diff options
author | Florian Rinke <develop@torui.de> | 2021-10-11 17:52:17 +0200 |
---|---|---|
committer | Florian Rinke <develop@torui.de> | 2021-10-11 17:52:17 +0200 |
commit | 16b9821f55eec8f4a77ee1743cbc3f9b4ba3e303 (patch) | |
tree | c7ede24fb2a7c0871c92c66fe4b4f7806344d326 /src/main/java/de/torui/coflsky/CoflSky.java | |
parent | 9e923dbdf82b2a1fbebcb9c4559400f921104229 (diff) | |
download | COFL-16b9821f55eec8f4a77ee1743cbc3f9b4ba3e303.tar.gz COFL-16b9821f55eec8f4a77ee1743cbc3f9b4ba3e303.tar.bz2 COFL-16b9821f55eec8f4a77ee1743cbc3f9b4ba3e303.zip |
implements #11, #8
Diffstat (limited to 'src/main/java/de/torui/coflsky/CoflSky.java')
-rw-r--r-- | src/main/java/de/torui/coflsky/CoflSky.java | 59 |
1 files changed, 15 insertions, 44 deletions
diff --git a/src/main/java/de/torui/coflsky/CoflSky.java b/src/main/java/de/torui/coflsky/CoflSky.java index cc762ca..85d05b6 100644 --- a/src/main/java/de/torui/coflsky/CoflSky.java +++ b/src/main/java/de/torui/coflsky/CoflSky.java @@ -1,13 +1,12 @@ package de.torui.coflsky; -import java.io.IOException; + import java.net.URISyntaxException; -import java.util.UUID; + import org.lwjgl.input.Keyboard; -import de.torui.coflsky.minecraft_integration.PlayerDataProvider; -import de.torui.coflsky.minecraft_integration.TemporarySession; + import de.torui.coflsky.websocket.WSClientWrapper; import net.minecraft.client.settings.KeyBinding; import net.minecraftforge.client.ClientCommandHandler; @@ -27,46 +26,26 @@ public class CoflSky public static WSClientWrapper Wrapper; public static KeyBinding[] keyBindings; - + + public static final String[] webSocketURIPrefix = new String [] { + "wss://sky-commands.coflnet.com/modsocket", + "wss://sky-mod.coflnet.com/modsocket", + "ws://sky-commands.coflnet.com/modsocket", + "ws://sky-mod.coflnet.com/modsocket", + }; + + public static String CommandUri = "https://sky-commands.coflnet.com/api/mod/commands"; @EventHandler public void init(FMLInitializationEvent event) throws URISyntaxException { - System.out.println(">>>> "+ TemporarySession.GetTempFileFolder().toString()); - //Minecraft.getSessionInfo().forEach((a,b) -> System.out.println("Key=" + a + " value=" + b)); - - //System.out.println("Loggerfactory: " + LoggerFactory.getILoggerFactory()); - // Logger log = LoggerFactory.getLogger(CoflSky.class); - // log.debug("Testing"); - - - - // some example code - System.out.println("Initializing"); - - //new Thread(new WSClient(new URI("ws://localhost:8080"))).start(); - System.out.println(">>>Started"); - - String username = PlayerDataProvider.getUsername(); - String uuid = PlayerDataProvider.getActivePlayerUUID(); - System.out.println(">>> Username= " + username + " with UUID=" + uuid ); - - String tempUUID = UUID.randomUUID().toString(); - try { - TemporarySession.UpdateSessions(); - tempUUID = TemporarySession.GetSession(username).SessionUUID; - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } + System.out.println(">>>Started"); - - //CoflSky.Wrapper = new WSClientWrapper("wss://sky-commands.coflnet.com/modsocket?version=" + CoflSky.VERSION + "&uuid="); - CoflSky.Wrapper = new WSClientWrapper("ws://sky-mod.coflnet.com/modsocket?version=" + CoflSky.VERSION + "&SId=" + tempUUID + "&uuid=" + uuid); + CoflSky.Wrapper = new WSClientWrapper(webSocketURIPrefix); keyBindings = new KeyBinding[] { - new KeyBinding("key.replay_last.onclick", Keyboard.KEY_R, "SkyCofl") + new KeyBinding("key.replay_last.onclick", Keyboard.KEY_R, "SkyCofl"), }; if(event.getSide() == Side.CLIENT) { @@ -82,14 +61,6 @@ public class CoflSky MinecraftForge.EVENT_BUS.register(new EventRegistry()); } - - /* @EventHandler - public void init(FMLServerStartingEvent event) - { - - if(event.getSide() == Side.CLIENT) return; - //event.registerServerCommand(new CoflSkyCommand()); - }*/ }
\ No newline at end of file |