Author Topic: Permissions - 1.4 out now, with S+S support  (Read 18200 times)

Version 1.1.1 released. Same download, but should also be delivered through the updater. Changelog:

  • Fixed all permissions being deleted on map reload
  • Added getPermissionManager().getPermissionByID(%id) (useful for looping)
  • Added friendly names to the permission objects
  • Fixed compatibility with mods that register permissions without a friendly name

Version 1.1.2. Changelog:

  • Removed a debug statement (whoops)

Version 1.1.3. Changelog:

  • Added a join permission
« Last Edit: May 06, 2012, 07:04:28 AM by DontCare4Free »

Bump for feedback for 1.2.

Known issues (striked through are fixed):
  • Incorrect grammar in the announcement after a failed join
  • Incorrect colour in the announcement after a failed join

Can i make so i(host) can use eval?

Can i make so i(host) can use eval?
While it's not supported out of the box it's fairly easy to make one that uses it. I actually made a quick edit for it from Kalphiter's eval mod, but I'm not completely sure about whether such add-ons are allowed to be posted on here.

  • Added a join permission
So this can function as a whitelist? Does it prevent the connection message from appearing if they are blocked?

So this can function as a whitelist?
Yes.

Does it prevent the connection message from appearing if they are blocked?
Well, yes, but I'm not sure about how to prevent the disconnection message (currently it's a custom "Permission denied" message + "left the game"). The problem is that I need to know the BL_ID before being able to deny it and OnConnectRequest only has the name.

Can you make an eval thing, Or tell me how to add my own things. Thanks

Get the BLID like this and store it in a global variable.
Code: [Select]
function servAuthTCPobj::onLine(%this, %line)
{
%parent = parent::onLine(%this, %line);
if(getWord(%line, 0) $= "YES")
{
$connectingClientBLID = getWord(%line, 1);
}
return %parent;
}

Nevermind, removed.

Get the BLID like this and store it in a global variable.
Code: [Select]
function servAuthTCPobj::onLine(%this, %line)
{
%parent = parent::onLine(%this, %line);
if(getWord(%line, 0) $= "YES")
{
$connectingClientBLID = getWord(%line, 1);
}
return %parent;
}
And how would the client then be kicked...?

Nevermind, removed.
What?

And how would the client then be kicked...?

Like this:
Code: [Select]
package myNewWhiteList
{
function servAuthTCPobj::onLine(%this,%line)
{
%parent = parent::onLine(%this,%line);
if(getWord(%line,0) $= "YES")
{
$connectingClientBLID = getWord(%line,1);
}
return %parent;
}

function GameConnection::onConnectRequest(%this,%netAddress,%lanName,%netName,%prefix,%suffix,%int,%a,%b,%c)
{
%parent = parent::onConnectRequest(%this,%netAddress,%lanName,%netName,%prefix,%suffix,%int,%a,%b,%c);

if(!isOnWhiteList($connectingClientBLID))
return "You are not on the WhiteList.";

return %parent;
}
};
activatePackage(myNewWhiteList);

I used the current whitelist mod as a reference.

What?

Probably decided that he didn't want to post that after he did.

What?

Like this:
Code: [Select]
package myNewWhiteList
{
function servAuthTCPobj::onLine(%this,%line)
{
%parent = parent::onLine(%this,%line);
if(getWord(%line,0) $= "YES")
{
$connectingClientBLID = getWord(%line,1);
}
return %parent;
}

function GameConnection::onConnectRequest(%this,%netAddress,%lanName,%netName,%prefix,%suffix,%int,%a,%b,%c)
{
%parent = parent::onConnectRequest(%this,%netAddress,%lanName,%netName,%prefix,%suffix,%int,%a,%b,%c);

if(!isOnWhiteList($connectingClientBLID))
return "You are not on the WhiteList.";

return %parent;
}
};
activatePackage(myNewWhiteList);

I used the current whitelist mod as a reference.
IIRC onConnectRequest is called before auth, but I'll check again.

EDIT: https://gist.github.com/2794851
« Last Edit: May 26, 2012, 01:15:52 PM by DontCare4Free »