This commit is contained in:
ljacqu 2015-12-05 21:17:44 +01:00
commit 8cde4a1896
4 changed files with 114 additions and 95 deletions

View File

@ -5,6 +5,8 @@
<value> <value>
<option name="AUTODETECT_INDENTS" value="false" /> <option name="AUTODETECT_INDENTS" value="false" />
<option name="LINE_SEPARATOR" value="&#10;" /> <option name="LINE_SEPARATOR" value="&#10;" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="99" />
<option name="JD_ADD_BLANK_AFTER_PARM_COMMENTS" value="true" /> <option name="JD_ADD_BLANK_AFTER_PARM_COMMENTS" value="true" />
<option name="JD_ADD_BLANK_AFTER_RETURN" value="true" /> <option name="JD_ADD_BLANK_AFTER_RETURN" value="true" />
<XML> <XML>

View File

@ -162,7 +162,7 @@ public final class CommandInitializer {
.build(); .build();
// Register the setemail command // Register the setemail command
CommandDescription setEmailCommand = CommandDescription.builder() CommandDescription.builder()
.executableCommand(new SetEmailCommand()) .executableCommand(new SetEmailCommand())
.parent(AUTHME_BASE) .parent(AUTHME_BASE)
.labels("chgemail", "chgmail", "setemail", "setmail") .labels("chgemail", "chgmail", "setemail", "setmail")
@ -174,74 +174,80 @@ public final class CommandInitializer {
.build(); .build();
// Register the getip command // Register the getip command
CommandDescription getIpCommand = new CommandDescription(new GetIpCommand(), new ArrayList<String>() { CommandDescription.builder()
{ .executableCommand(new GetIpCommand())
add("getip"); .parent(AUTHME_BASE)
add("ip"); .labels("getip", "ip")
} .description("Get player's IP")
}, "Get player's IP", "Get the IP address of the specified online player.", AUTHME_BASE); .detailedDescription("Get the IP address of the specified online player.")
getIpCommand.setCommandPermissions(AdminPermission.GET_IP, OP_ONLY); .permissions(OP_ONLY, AdminPermission.GET_IP)
getIpCommand.addArgument(new CommandArgumentDescription("player", "Online player name", true)); .withArgument("player", "Player Name", false)
.build();
// Register the spawn command // Register the spawn command
CommandDescription spawnCommand = new CommandDescription(new SpawnCommand(), new ArrayList<String>() { CommandDescription.builder()
{ .executableCommand(new SpawnCommand())
add("spawn"); .parent(AUTHME_BASE)
add("home"); .labels("spawn", "home")
} .description("Teleport to spawn")
}, "Teleport to spawn", "Teleport to the spawn.", AUTHME_BASE); .detailedDescription("Teleport to the spawn.")
spawnCommand.setCommandPermissions(AdminPermission.SPAWN, OP_ONLY); .permissions(OP_ONLY, AdminPermission.SPAWN)
.withArgument("player", "Player Name", false)
.build();
// Register the setspawn command // Register the setspawn command
CommandDescription setSpawnCommand = new CommandDescription(new SetSpawnCommand(), new ArrayList<String>() { CommandDescription.builder()
{ .executableCommand(new SetSpawnCommand())
add("setspawn"); .parent(AUTHME_BASE)
add("chgspawn"); .labels("setspawn", "chgspawn")
} .description("Change the spawn")
}, "Change the spawn", "Change the player's spawn to your current position.", AUTHME_BASE); .detailedDescription("Change the player's spawn to your current position.")
setSpawnCommand.setCommandPermissions(AdminPermission.SET_SPAWN, OP_ONLY); .permissions(OP_ONLY, AdminPermission.SET_SPAWN)
.build();
// Register the firstspawn command // Register the firstspawn command
CommandDescription firstSpawnCommand = new CommandDescription(new FirstSpawnCommand(), new ArrayList<String>() { CommandDescription.builder()
{ .executableCommand(new FirstSpawnCommand())
add("firstspawn"); .parent(AUTHME_BASE)
add("firsthome"); .labels("firstspawn", "firsthome")
} .description("Teleport to first spawn")
}, "Teleport to first spawn", "Teleport to the first spawn.", AUTHME_BASE); .detailedDescription("Teleport to the first spawn.")
firstSpawnCommand.setCommandPermissions(AdminPermission.FIRST_SPAWN, OP_ONLY); .permissions(OP_ONLY, AdminPermission.FIRST_SPAWN)
.build();
// Register the setfirstspawn command // Register the setfirstspawn command
CommandDescription setFirstSpawnCommand = new CommandDescription(new SetFirstSpawnCommand(), new ArrayList<String>() { CommandDescription.builder()
{ .executableCommand(new SetFirstSpawnCommand())
add("setfirstspawn"); .parent(AUTHME_BASE)
add("chgfirstspawn"); .labels("setfirstspawn", "chgfirstspawn")
} .description("Change the first spawn")
}, "Change the first spawn", "Change the first player's spawn to your current position.", AUTHME_BASE); .detailedDescription("Change the first player's spawn to your current position.")
setFirstSpawnCommand.setCommandPermissions(AdminPermission.SET_FIRST_SPAWN, OP_ONLY); .permissions(OP_ONLY, AdminPermission.SET_FIRST_SPAWN)
.build();
// Register the purge command // Register the purge command
CommandDescription purgeCommand = new CommandDescription(new PurgeCommand(), new ArrayList<String>() { CommandDescription.builder()
{ .executableCommand(new PurgeCommand())
add("purge"); .parent(AUTHME_BASE)
add("delete"); .labels("purge", "delete")
} .description("Purge old data")
}, "Purge old data", "Purge old AuthMeReloaded data longer than the specified amount of days ago.", AUTHME_BASE); .detailedDescription("Purge old AuthMeReloaded data longer than the specified amount of days ago.")
purgeCommand.setCommandPermissions(AdminPermission.PURGE, OP_ONLY); .permissions(OP_ONLY, AdminPermission.PURGE)
purgeCommand.addArgument(new CommandArgumentDescription("days", "Number of days", false)); .withArgument("days", "Number of days", false)
.build();
// Register the purgelastposition command // Register the purgelastposition command
CommandDescription purgeLastPositionCommand = new CommandDescription(new PurgeLastPositionCommand(), new ArrayList<String>() { CommandDescription.builder()
{ .executableCommand(new PurgeLastPositionCommand())
add("resetpos"); .parent(AUTHME_BASE)
add("purgelastposition"); .labels("resetpos", "purgelastposition", "purgelastpos", "resetposition", "resetlastposition", "resetlastpos")
add("purgelastpos"); .description("Purge player's last position")
add("resetposition"); .detailedDescription("Purge the last know position of the specified player.")
add("resetlastposition"); .permissions(OP_ONLY, AdminPermission.PURGE_LAST_POSITION)
add("resetlastpos"); .withArgument("player", "Player name", false)
} .build();
}, "Purge player's last position", "Purge the last know position of the specified player.", AUTHME_BASE);
purgeLastPositionCommand.setCommandPermissions(AdminPermission.PURGE_LAST_POSITION, OP_ONLY);
purgeLastPositionCommand.addArgument(new CommandArgumentDescription("player", "Player name", true));
// Register the purgebannedplayers command // Register the purgebannedplayers command
CommandDescription purgeBannedPlayersCommand = new CommandDescription(new PurgeBannedPlayersCommand(), new ArrayList<String>() { CommandDescription purgeBannedPlayersCommand = new CommandDescription(new PurgeBannedPlayersCommand(), new ArrayList<String>() {

View File

@ -8,97 +8,102 @@ public enum AdminPermission implements PermissionNode {
/** /**
* Administrator command to register a new user. * Administrator command to register a new user.
*/ */
REGISTER("authme.command.admin.register"), REGISTER("authme.admin.register"),
/** /**
* Administrator command to unregister an existing user. * Administrator command to unregister an existing user.
*/ */
UNREGISTER("authme.command.admin.unregister"), UNREGISTER("authme.admin.unregister"),
/** /**
* Administrator command to force-login an existing user. * Administrator command to force-login an existing user.
*/ */
FORCE_LOGIN("authme.command.admin.forcelogin"), FORCE_LOGIN("authme.admin.forcelogin"),
/** /**
* Administrator command to change the password of a user. * Administrator command to change the password of a user.
*/ */
CHANGE_PASSWORD("authme.command.admin.changepassword"), CHANGE_PASSWORD("authme.admin.changepassword"),
/** /**
* Administrator command to see the last login date and time of an user. * Administrator command to see the last login date and time of a user.
*/ */
LAST_LOGIN("authme.command.admin.lastlogin"), LAST_LOGIN("authme.admin.lastlogin"),
/** /**
* Administrator command to see all accounts associated with an user. * Administrator command to see all accounts associated with a user.
*/ */
ACCOUNTS("authme.command.admin.accounts"), ACCOUNTS("authme.admin.accounts"),
/** /**
* Administrator command to get the email address of an user, if set. * Administrator command to get the email address of a user, if set.
*/ */
GET_EMAIL("authme.command.admin.getemail"), GET_EMAIL("authme.admin.getemail"),
/** /**
* Administrator command to set or change the email adress of an user. * Administrator command to set or change the email address of a user.
*/ */
CHANGE_EMAIL("authme.command.admin.changemail"), CHANGE_EMAIL("authme.admin.changemail"),
/** /**
* Administrator command to get the last known IP of an user. * Administrator command to get the last known IP of a user.
*/ */
GET_IP("authme.command.admin.getip"), GET_IP("authme.admin.getip"),
/** /**
* Administrator command to teleport to the AuthMe spawn. * Administrator command to teleport to the AuthMe spawn.
*/ */
SPAWN("authme.command.admin.spawn"), SPAWN("authme.admin.spawn"),
/** /**
* Administrator command to set the AuthMe spawn. * Administrator command to set the AuthMe spawn.
*/ */
SET_SPAWN("authme.command.admin.setspawn"), SET_SPAWN("authme.admin.setspawn"),
/** /**
* Administrator command to teleport to the first AuthMe spawn. * Administrator command to teleport to the first AuthMe spawn.
*/ */
FIRST_SPAWN("authme.command.admin.firstspawn"), FIRST_SPAWN("authme.admin.firstspawn"),
/** /**
* Administrator command to set the first AuthMe spawn. * Administrator command to set the first AuthMe spawn.
*/ */
SET_FIRST_SPAWN("authme.command.admin.setfirstspawn"), SET_FIRST_SPAWN("authme.admin.setfirstspawn"),
/** /**
* Administrator command to purge old user data. * Administrator command to purge old user data.
*/ */
PURGE("authme.command.admin.purge"), PURGE("authme.admin.purge"),
/** /**
* Administrator command to purge the last position of an user. * Administrator command to purge the last position of a user.
*/ */
PURGE_LAST_POSITION("authme.command.admin.purgelastpos"), PURGE_LAST_POSITION("authme.admin.purgelastpos"),
/** /**
* Administrator command to purge all data associated with banned players. * Administrator command to purge all data associated with banned players.
*/ */
PURGE_BANNED_PLAYERS("authme.command.admin.purgebannedplayers"), PURGE_BANNED_PLAYERS("authme.admin.purgebannedplayers"),
/** /**
* Administrator command to toggle the AntiBot protection status. * Administrator command to toggle the AntiBot protection status.
*/ */
SWITCH_ANTIBOT("authme.command.admin.switchantibot"), SWITCH_ANTIBOT("authme.admin.switchantibot"),
/** /**
* Administrator command to convert old or other data to AuthMe data. * Administrator command to convert old or other data to AuthMe data.
*/ */
CONVERTER("authme.command.admin.converter"), CONVERTER("authme.admin.converter"),
/** /**
* Administrator command to reload the plugin configuration. * Administrator command to reload the plugin configuration.
*/ */
RELOAD("authme.command.admin.reload"); RELOAD("authme.admin.reload"),
/**
* Give access to all admin commands.
*/
ALL("authme.admin.*");
/** /**
* Permission node. * Permission node.
@ -107,7 +112,8 @@ public enum AdminPermission implements PermissionNode {
/** /**
* Get the permission node. * Get the permission node.
* @return *
* @return Permission node.
*/ */
@Override @Override
public String getNode() { public String getNode() {

View File

@ -18,47 +18,47 @@ public enum PlayerPermission implements PermissionNode {
/** /**
* Command permission to login. * Command permission to login.
*/ */
LOGIN("authme.command.player.login"), LOGIN("authme.player.login"),
/** /**
* Command permission to logout. * Command permission to logout.
*/ */
LOGOUT("authme.command.player.logout"), LOGOUT("authme.player.logout"),
/** /**
* Command permission to register. * Command permission to register.
*/ */
REGISTER("authme.command.player.register"), REGISTER("authme.player.register"),
/** /**
* Command permission to unregister. * Command permission to unregister.
*/ */
UNREGISTER("authme.command.player.unregister"), UNREGISTER("authme.player.unregister"),
/** /**
* Command permission to change the password. * Command permission to change the password.
*/ */
CHANGE_PASSWORD("authme.command.player.changepassword"), CHANGE_PASSWORD("authme.player.changepassword"),
/** /**
* Command permission to add an email address. * Command permission to add an email address.
*/ */
ADD_EMAIL("authme.command.player.email.add"), ADD_EMAIL("authme.player.email.add"),
/** /**
* Command permission to change the email address. * Command permission to change the email address.
*/ */
CHANGE_EMAIL("authme.command.player.email.change"), CHANGE_EMAIL("authme.player.email.change"),
/** /**
* Command permission to recover an account using it's email address. * Command permission to recover an account using it's email address.
*/ */
RECOVER_EMAIL("authme.command.player.email.recover"), RECOVER_EMAIL("authme.player.email.recover"),
/** /**
* Command permission to use captcha. * Command permission to use captcha.
*/ */
CAPTCHA("authme.command.player.captcha"), CAPTCHA("authme.player.captcha"),
/** /**
* Permission for users a login can be forced to. * Permission for users a login can be forced to.
@ -68,17 +68,22 @@ public enum PlayerPermission implements PermissionNode {
/** /**
* Permission for users to bypass force-survival mode. * Permission for users to bypass force-survival mode.
*/ */
BYPASS_FORCE_SURVIVAL("authme.command.player.bypassforcesurvival"), BYPASS_FORCE_SURVIVAL("authme.player.bypassforcesurvival"),
/** /**
* Permission for users to allow two accounts. * Permission for users to allow two accounts.
*/ */
ALLOW_MULTIPLE_ACCOUNTS("authme.command.player.allow2accounts"), ALLOW_MULTIPLE_ACCOUNTS("authme.player.allow2accounts"),
/** /**
* Permission for user to see other accounts. * Permission for user to see other accounts.
*/ */
SEE_OTHER_ACCOUNTS("authme.command.player.seeotheraccounts"); SEE_OTHER_ACCOUNTS("authme.player.seeotheraccounts"),
/**
*
*/
ALL_COMMANDS("authme.player.*");
/** /**
* Permission node. * Permission node.