From bb3725046e6cb47a4d403c18ba5144e40e93931b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97=E5=90=9B?= Date: Fri, 22 Jul 2022 23:44:28 +0800 Subject: [PATCH] Fix run command failed --- .../main/java/com/mojo/consoleplus/socket/SocketClient.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gc-plugin/src/main/java/com/mojo/consoleplus/socket/SocketClient.java b/gc-plugin/src/main/java/com/mojo/consoleplus/socket/SocketClient.java index 01972a3..e88fea9 100644 --- a/gc-plugin/src/main/java/com/mojo/consoleplus/socket/SocketClient.java +++ b/gc-plugin/src/main/java/com/mojo/consoleplus/socket/SocketClient.java @@ -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);