diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/torui/coflsky/network/WSClientWrapper.java | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/main/java/de/torui/coflsky/network/WSClientWrapper.java b/src/main/java/de/torui/coflsky/network/WSClientWrapper.java index e6592bb..044a3e2 100644 --- a/src/main/java/de/torui/coflsky/network/WSClientWrapper.java +++ b/src/main/java/de/torui/coflsky/network/WSClientWrapper.java @@ -41,16 +41,18 @@ public class WSClientWrapper { System.out.println("Sleeping..."); Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("Lost connection to Coflnet, trying to reestablish the connection in 2 Seconds...")); - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - socket = new WSClient(socket.uri); - isRunning = false; - start(); + isRunning = false; + while(isRunning == false) { + start(); + try { + Thread.sleep(2000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + socket.shouldRun = true; } |