Admin commands should be available only to GM characters.

This commit is contained in:
MobiusDevelopment
2019-04-01 14:57:25 +00:00
parent dfad468db9
commit c905853551
14 changed files with 79 additions and 57 deletions

View File

@@ -79,16 +79,18 @@ public class AdminCommandHandler implements IHandler<IAdminCommandHandler, Strin
public void useAdminCommand(PlayerInstance player, String fullCommand, boolean useConfirm)
{
if (!player.isGM())
{
return;
}
final String command = fullCommand.split(" ")[0];
final String commandNoPrefix = command.substring(6);
final IAdminCommandHandler handler = getHandler(command);
if (handler == null)
{
if (player.isGM())
{
player.sendMessage("The command '" + commandNoPrefix + "' does not exist!");
}
player.sendMessage("The command '" + commandNoPrefix + "' does not exist!");
LOGGER.warning("No handler registered for admin command '" + command + "'");
return;
}