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

@@ -74,9 +74,12 @@ public final class RequestBypassToServer extends GameClientPacket
{
if (_command.startsWith("admin_"))
{
// DaDummy: this way we LOGGER _every_ admincommand with all related info
String command;
if (!player.isGM())
{
return;
}
String command;
if (_command.contains(" "))
{
command = _command.substring(0, _command.indexOf(" "));
@@ -87,14 +90,9 @@ public final class RequestBypassToServer extends GameClientPacket
}
final IAdminCommandHandler ach = AdminCommandHandler.getInstance().getAdminCommandHandler(command);
if (ach == null)
{
if (player.isGM())
{
player.sendMessage("The command " + command + " does not exists!");
}
player.sendMessage("The command " + command + " does not exists!");
LOGGER.warning("No handler registered for admin command '" + command + "'");
return;
}

View File

@@ -46,7 +46,7 @@ public final class SendBypassBuildCmd extends GameClientPacket
protected void runImpl()
{
final PlayerInstance player = getClient().getPlayer();
if (player == null)
if ((player == null) || !player.isGM())
{
return;
}