diff options
author | Florian Rinke <develop@torui.de> | 2021-11-05 17:07:39 +0100 |
---|---|---|
committer | Florian Rinke <develop@torui.de> | 2021-11-05 20:05:05 +0100 |
commit | bf5bdf3ca643c6a28def732e9085a6c9766a8830 (patch) | |
tree | c5a7e828279c497924b3fe1fa39a8ef54dc5a94d /src/main/java/de/torui/coflsky/network | |
parent | 161c01a2be916670c5bb4730760966f78e35afd0 (diff) | |
download | COFL-bf5bdf3ca643c6a28def732e9085a6c9766a8830.tar.gz COFL-bf5bdf3ca643c6a28def732e9085a6c9766a8830.tar.bz2 COFL-bf5bdf3ca643c6a28def732e9085a6c9766a8830.zip |
Modularized Command Infrastructure
Diffstat (limited to 'src/main/java/de/torui/coflsky/network')
-rw-r--r-- | src/main/java/de/torui/coflsky/network/WSClient.java | 10 | ||||
-rw-r--r-- | src/main/java/de/torui/coflsky/network/WSClientWrapper.java | 5 |
2 files changed, 3 insertions, 12 deletions
diff --git a/src/main/java/de/torui/coflsky/network/WSClient.java b/src/main/java/de/torui/coflsky/network/WSClient.java index 529056b..b3f28ca 100644 --- a/src/main/java/de/torui/coflsky/network/WSClient.java +++ b/src/main/java/de/torui/coflsky/network/WSClient.java @@ -17,7 +17,7 @@ import net.minecraft.client.Minecraft; import de.torui.coflsky.CoflSky; import de.torui.coflsky.WSCommandHandler; import de.torui.coflsky.core.Command; -import de.torui.coflsky.core.StringCommand; +import de.torui.coflsky.core.JsonStringCommand; public class WSClient extends WebSocketAdapter { @@ -112,7 +112,7 @@ public class WSClient extends WebSocketAdapter { //super.onTextMessage(websocket, text); System.out.println("Received: "+ text); - Command cmd = gson.fromJson(text, Command.class); + JsonStringCommand cmd = gson.fromJson(text, JsonStringCommand.class); //System.out.println(cmd); WSCommandHandler.HandleCommand(cmd, Minecraft.getMinecraft().thePlayer); @@ -122,12 +122,6 @@ public class WSClient extends WebSocketAdapter { String json = gson.toJson(cmd); this.socket.sendText(json); } - - public void SendCommand(StringCommand sc) { - String json = gson.toJson(sc); - this.socket.sendText(json); - } - diff --git a/src/main/java/de/torui/coflsky/network/WSClientWrapper.java b/src/main/java/de/torui/coflsky/network/WSClientWrapper.java index f30d0f9..dd9d13b 100644 --- a/src/main/java/de/torui/coflsky/network/WSClientWrapper.java +++ b/src/main/java/de/torui/coflsky/network/WSClientWrapper.java @@ -10,7 +10,7 @@ import com.neovisionaries.ws.client.WebSocketException; import de.torui.coflsky.CoflSky; import de.torui.coflsky.core.Command; -import de.torui.coflsky.core.StringCommand; +import de.torui.coflsky.core.JsonStringCommand; import de.torui.coflsky.minecraft_integration.PlayerDataProvider; import net.minecraft.client.Minecraft; import net.minecraft.util.ChatComponentText; @@ -141,9 +141,6 @@ public class WSClientWrapper { } - public void SendMessage(StringCommand sc) { - this.socket.SendCommand(sc); - } public String GetStatus() { return "" + isRunning + " " + |