diff options
| author | Äkwav <16632490+Ekwav@users.noreply.github.com> | 2021-11-05 21:34:33 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-05 21:34:33 +0100 |
| commit | 39a061b57e38667987a4e38df71b5d8030222c1b (patch) | |
| tree | d87a007269aa6696b38fe37ad3e3a2e536f4f5f5 /src/main/java/de/torui/coflsky/network | |
| parent | 5cc73b705cf4c6d6887e650daf8222b63dedc011 (diff) | |
| parent | e533c7f6f9860479f5f472280d6fce8b87d8d0b8 (diff) | |
| download | COFL-39a061b57e38667987a4e38df71b5d8030222c1b.tar.gz COFL-39a061b57e38667987a4e38df71b5d8030222c1b.tar.bz2 COFL-39a061b57e38667987a4e38df71b5d8030222c1b.zip | |
Merge pull request #30 from Coflnet/feature/command-rewrite-plus-ci
Rewrite Commands to be Generic
Diffstat (limited to 'src/main/java/de/torui/coflsky/network')
| -rw-r--r-- | src/main/java/de/torui/coflsky/network/WSClient.java | 12 | ||||
| -rw-r--r-- | src/main/java/de/torui/coflsky/network/WSClientWrapper.java | 7 |
2 files changed, 5 insertions, 14 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..cd23b30 100644 --- a/src/main/java/de/torui/coflsky/network/WSClient.java +++ b/src/main/java/de/torui/coflsky/network/WSClient.java @@ -16,8 +16,8 @@ import com.neovisionaries.ws.client.WebSocketState; 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.commands.Command; +import de.torui.coflsky.commands.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..6542542 100644 --- a/src/main/java/de/torui/coflsky/network/WSClientWrapper.java +++ b/src/main/java/de/torui/coflsky/network/WSClientWrapper.java @@ -9,8 +9,8 @@ import java.util.UUID; 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.commands.Command; +import de.torui.coflsky.commands.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 + " " + |
