1
0
mirror of https://github.com/moparisthebest/xAuth synced 2024-12-21 22:58:51 -05:00

Added version command (/xauth version)

This commit is contained in:
Zach Iverson 2011-07-04 01:46:14 -04:00
parent 500a9ac0dd
commit a18a4cb336
2 changed files with 13 additions and 1 deletions

View File

@ -47,6 +47,8 @@ public class xAuthCommand implements CommandExecutor {
return configCommand(sender, args);
else if (subCommand.equals("reload"))
return reloadCommand(sender);
else if (subCommand.equals("version"))
return versionCommand(sender);
else {
if (sender instanceof Player)
xAuthMessages.send("admnUnknown", (Player)sender);
@ -57,6 +59,15 @@ public class xAuthCommand implements CommandExecutor {
return true;
}
private boolean versionCommand(CommandSender sender) {
if (sender instanceof Player)
((Player)sender).sendMessage("[" + xAuth.desc.getName() + "] This server is running version " + xAuth.desc.getVersion());
else if (sender instanceof ConsoleCommandSender)
xAuthLog.info("This server is running version " + xAuth.desc.getVersion());
return true;
}
private boolean registerCommand(CommandSender sender, String[] args) {
if (sender instanceof Player) {
Player player = (Player)sender;

View File

@ -28,4 +28,5 @@ commands:
/<command> unregister <player>
/<command> location set|remove
/<command> config <setting> [value]
/<command> reload
/<command> reload
/<command> version