You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -41,28 +44,74 @@ public static void setConnection(WebSocket socket) {
41
44
}
42
45
43
46
publicstaticStringonMessage(Stringmessage) {
44
-
if(!authorised) return"{\"status\":\"error\",\"error\":\"auth\",\"message\":\"This app isn't authorized, check you have run /auth in the game.\"}";
45
-
if(action == Action.CLEAR) return"{\"status\":\"error\",\"error\":\"clearing\",\"message\":\"The client is already clearing a plot. If it is stuck, run /abort and /auth.\"}";
46
-
if(action == Action.SPAWN) return"{\"status\":\"error\",\"error\":\"spawn\",\"message\":\"The client is trying to go to the plot spawn. If it is stuck, run /abort and /auth.\"}";
47
+
JsonObjectresponse = newJsonObject();
48
+
if(!authorised) {
49
+
response.addProperty("status","error");
50
+
response.addProperty("error","auth");
51
+
response.addProperty("message","This app isn't authorized, check you have run /auth in the game.");
52
+
returnresponse.toString();
53
+
}
54
+
if(action == Action.CLEAR) {
55
+
response.addProperty("status","error");
56
+
response.addProperty("error","clear");
57
+
response.addProperty("message","The client is already clearing a plot. If it is stuck, run /abort.");
58
+
returnresponse.toString();
59
+
}
60
+
if(action == Action.SPAWN) {
61
+
response.addProperty("status","error");
62
+
response.addProperty("error","spawn");
63
+
response.addProperty("message","The client is trying to go to the plot spawn. If it is stuck, run /abort.");
0 commit comments