2018-07-06 15:30:00 +02:00
|
|
|
package com.eu.habbo.messages.rcon;
|
|
|
|
|
|
|
|
import com.eu.habbo.Emulator;
|
|
|
|
import com.eu.habbo.habbohotel.commands.CommandHandler;
|
|
|
|
import com.eu.habbo.habbohotel.users.Habbo;
|
|
|
|
import com.google.gson.Gson;
|
|
|
|
|
|
|
|
public class ExecuteCommand extends RCONMessage<ExecuteCommand.JSONExecuteCommand>
|
|
|
|
{
|
2018-07-08 23:32:00 +02:00
|
|
|
|
2018-07-06 15:30:00 +02:00
|
|
|
public ExecuteCommand()
|
|
|
|
{
|
|
|
|
super(JSONExecuteCommand.class);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void handle(Gson gson, JSONExecuteCommand json)
|
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
Habbo habbo = Emulator.getGameServer().getGameClientManager().getHabbo(json.user_id);
|
|
|
|
|
|
|
|
if (habbo == null)
|
|
|
|
{
|
2019-03-18 02:22:00 +01:00
|
|
|
this.status = HABBO_NOT_FOUND;
|
2018-07-06 15:30:00 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CommandHandler.handleCommand(habbo.getClient(), json.command);
|
|
|
|
}
|
|
|
|
catch (Exception e)
|
|
|
|
{
|
2019-03-18 02:22:00 +01:00
|
|
|
this.status = STATUS_ERROR;
|
2018-07-06 15:30:00 +02:00
|
|
|
Emulator.getLogging().logErrorLine(e);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-03-18 02:22:00 +01:00
|
|
|
static class JSONExecuteCommand
|
2018-07-06 15:30:00 +02:00
|
|
|
{
|
2018-10-07 00:28:00 +02:00
|
|
|
|
2018-07-06 15:30:00 +02:00
|
|
|
public int user_id;
|
2018-10-07 00:28:00 +02:00
|
|
|
|
|
|
|
|
2018-07-06 15:30:00 +02:00
|
|
|
public String command;
|
|
|
|
}
|
|
|
|
}
|