mirror of
https://github.com/mingjun97/gc-mojoconsole-plus.git
synced 2024-11-27 12:16:26 +00:00
Fix run command failed
This commit is contained in:
parent
b51006edd0
commit
bb3725046e
@ -130,7 +130,7 @@ public class SocketClient {
|
||||
var command = player.data;
|
||||
var playerData = ConsolePlus.getInstance().getServer().getPlayerByUid(player.uid);
|
||||
if (playerData == null) {
|
||||
sendPacket(new HttpPacket(404, "Player not found."), packet.packetID);
|
||||
sendPacket(new HttpPacket(404, "[Mojo Console] Player not found."), packet.packetID);
|
||||
return;
|
||||
}
|
||||
// Player MessageHandler do not support concurrency
|
||||
@ -140,9 +140,9 @@ public class SocketClient {
|
||||
var resultCollector = new MessageHandler();
|
||||
playerData.setMessageHandler(resultCollector);
|
||||
CommandMap.getInstance().invoke(playerData, playerData, command);
|
||||
sendPacket(new HttpPacket(200, resultCollector.getMessage()), packet.packetID);
|
||||
sendPacket(new HttpPacket(200, "success", resultCollector.getMessage()), packet.packetID);
|
||||
} catch (Exception e) {
|
||||
mLogger.warn("Run command failed.", e);
|
||||
mLogger.warn("[Mojo Console] Run command failed.", e);
|
||||
sendPacket(new HttpPacket(500, "error", e.getLocalizedMessage()), packet.packetID);
|
||||
} finally {
|
||||
playerData.setMessageHandler(null);
|
||||
|
Loading…
Reference in New Issue
Block a user