2018-07-06 15:30:00 +02:00
|
|
|
package com.eu.habbo.habbohotel.commands;
|
|
|
|
|
|
|
|
import com.eu.habbo.Emulator;
|
|
|
|
import com.eu.habbo.habbohotel.gameclients.GameClient;
|
|
|
|
import com.eu.habbo.habbohotel.users.Habbo;
|
|
|
|
import com.eu.habbo.messages.ServerMessage;
|
|
|
|
|
2019-05-26 20:14:53 +02:00
|
|
|
public class TestCommand extends Command {
|
|
|
|
public TestCommand() {
|
|
|
|
super("acc_debug", new String[]{"test"});
|
2018-07-06 15:30:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-05-26 20:14:53 +02:00
|
|
|
public boolean handle(GameClient gameClient, String[] params) throws Exception {
|
2019-06-23 22:08:29 +02:00
|
|
|
if (gameClient.getHabbo() != null || !gameClient.getHabbo().hasPermission("acc_supporttool") || !Emulator.debugging)
|
|
|
|
return false;
|
2018-07-06 15:30:00 +02:00
|
|
|
|
2019-06-23 22:08:29 +02:00
|
|
|
int header = Integer.valueOf(params[1]);
|
2018-07-06 15:30:00 +02:00
|
|
|
|
2019-06-23 22:08:29 +02:00
|
|
|
ServerMessage message = new ServerMessage(header);
|
2018-07-06 15:30:00 +02:00
|
|
|
|
2019-06-23 22:08:29 +02:00
|
|
|
for (int i = 1; i < params.length; i++) {
|
|
|
|
String[] data = params[i].split(":");
|
2018-07-06 15:30:00 +02:00
|
|
|
|
2019-06-23 22:08:29 +02:00
|
|
|
if (data[0].equalsIgnoreCase("b")) {
|
|
|
|
message.appendBoolean(data[1].equalsIgnoreCase("1"));
|
|
|
|
} else if (data[0].equalsIgnoreCase("s")) {
|
|
|
|
if (data.length > 1) {
|
|
|
|
message.appendString(data[1]);
|
|
|
|
} else {
|
|
|
|
message.appendString("");
|
2018-07-06 15:30:00 +02:00
|
|
|
}
|
2019-06-23 22:08:29 +02:00
|
|
|
} else if (data[0].equals("i")) {
|
|
|
|
message.appendInt(Integer.valueOf(data[1]));
|
|
|
|
} else if (data[0].equalsIgnoreCase("by")) {
|
|
|
|
message.appendByte(Integer.valueOf(data[1]));
|
|
|
|
} else if (data[0].equalsIgnoreCase("sh")) {
|
|
|
|
message.appendShort(Integer.valueOf(data[1]));
|
2018-07-06 15:30:00 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-23 22:08:29 +02:00
|
|
|
gameClient.sendResponse(message);
|
2018-07-08 23:32:00 +02:00
|
|
|
|
2018-07-06 15:30:00 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|