Basic admin system. This should automatically prevent most admin commands from being called by players that shouldn't be calling them, and even supports multiple levels of admins.

There are some outlier commands that don't follow the assumed convention of "admin" ability + godLevel, for example /setGodMode does not require the "admin" ability, but neither does it have a godLevel. So without manually checking in that instance, any player could  grant themselves god mode and have access to low level admin commands.

In order for admins to gain access to most of their commands, they must call the /setGodMode command. This command gives them the "admin" ability, and this ability works in tandem with their godLevel (which is determined by their access level).

Adds a minor implementation for abilities to enable the admin system to work. This implementation should come in handy in GU3 when we start on combat, since it will automatically prevent players from calling combat commands that they do not have the ability to call.
This commit is contained in:
wallaceg09
2015-08-15 18:23:13 -05:00
parent 6ede7e784c
commit 086e6535b0
7 changed files with 109 additions and 21 deletions
@@ -250,10 +250,11 @@ public class PlayerObject extends IntangibleObject {
public void setAdminTag(AccessLevel access) {
switch(access) {
case PLAYER: break;
case ADMIN: adminTag = 1; break;
case DEV: adminTag = 2; break;
case QA: adminTag = 4; break;
case PLAYER: break;
case CSR: adminTag = 1; break;
case DEV: adminTag = 2; break;
case WARDEN: adminTag = 3; break;
case QA: adminTag = 4; break;
}
sendDelta(6, 2, adminTag);
}