mirror of
https://github.com/mingjun97/gc-mojoconsole-plus.git
synced 2024-11-30 13:18:43 +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 command = player.data;
|
||||||
var playerData = ConsolePlus.getInstance().getServer().getPlayerByUid(player.uid);
|
var playerData = ConsolePlus.getInstance().getServer().getPlayerByUid(player.uid);
|
||||||
if (playerData == null) {
|
if (playerData == null) {
|
||||||
sendPacket(new HttpPacket(404, "Player not found."), packet.packetID);
|
sendPacket(new HttpPacket(404, "[Mojo Console] Player not found."), packet.packetID);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Player MessageHandler do not support concurrency
|
// Player MessageHandler do not support concurrency
|
||||||
@ -140,9 +140,9 @@ public class SocketClient {
|
|||||||
var resultCollector = new MessageHandler();
|
var resultCollector = new MessageHandler();
|
||||||
playerData.setMessageHandler(resultCollector);
|
playerData.setMessageHandler(resultCollector);
|
||||||
CommandMap.getInstance().invoke(playerData, playerData, command);
|
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) {
|
} 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);
|
sendPacket(new HttpPacket(500, "error", e.getLocalizedMessage()), packet.packetID);
|
||||||
} finally {
|
} finally {
|
||||||
playerData.setMessageHandler(null);
|
playerData.setMessageHandler(null);
|
||||||
|
Loading…
Reference in New Issue
Block a user