Added NumberFormatException check
parent
d054d84339
commit
7a18172b0a
|
@ -23,6 +23,7 @@ public class SendTestMessageCommand extends Command {
|
|||
// /sendTestMessage <status> <cmdID> <dest> <cmdNumber> <msg>
|
||||
|
||||
if (args.length == 5) {
|
||||
try {
|
||||
int cmdID;
|
||||
|
||||
byte status = Byte.parseByte(args[0]);
|
||||
|
@ -49,18 +50,16 @@ public class SendTestMessageCommand extends Command {
|
|||
|
||||
KraSocketClientProtocolMessage kraSocketClientProtocolMessage = null;
|
||||
|
||||
try {
|
||||
kraSocketClientProtocolMessage = new KraSocketClientProtocolMessage(
|
||||
status, (byte) cmdID, Integer.parseInt(args[2]),
|
||||
proxiedPlayer.getUniqueId().toString(), Integer.parseInt(args[3]), args[4],
|
||||
consumer);
|
||||
} catch (NumberFormatException exception) {
|
||||
proxiedPlayer.sendMessage(new TextComponent("§7Error: §cNumberFormatException"));
|
||||
return;
|
||||
}
|
||||
|
||||
ProxySystem.getInstance().getKraSocketClient().getSocketClient()
|
||||
.SendMessage(kraSocketClientProtocolMessage);
|
||||
} catch (NumberFormatException exception) {
|
||||
proxiedPlayer.sendMessage(new TextComponent("§7Error: §cNumberFormatException"));
|
||||
}
|
||||
} else {
|
||||
proxiedPlayer.sendMessage(new TextComponent(
|
||||
"§cVerwendung: §7/sendTestMessage <status> <cmdID> <dest> <cmdNumber> <msg>"));
|
||||
|
|
Loading…
Reference in New Issue