diff --git a/Server/.idea/workspace.xml b/Server/.idea/workspace.xml index a256311..a2f2ce1 100644 --- a/Server/.idea/workspace.xml +++ b/Server/.idea/workspace.xml @@ -92,7 +92,7 @@ - + diff --git a/Server/out/artifacts/Server_jar/Server.jar b/Server/out/artifacts/Server_jar/Server.jar index 1c7cd0a..9efffe7 100644 Binary files a/Server/out/artifacts/Server_jar/Server.jar and b/Server/out/artifacts/Server_jar/Server.jar differ diff --git a/Server/out/production/Server/Room$1.class b/Server/out/production/Server/Room$1.class index 1f962e5..18ebc82 100644 Binary files a/Server/out/production/Server/Room$1.class and b/Server/out/production/Server/Room$1.class differ diff --git a/Server/out/production/Server/Room.class b/Server/out/production/Server/Room.class index 8c66bcf..2bdbdbf 100644 Binary files a/Server/out/production/Server/Room.class and b/Server/out/production/Server/Room.class differ diff --git a/Server/out/production/Server/Server$1.class b/Server/out/production/Server/Server$1.class index 19bc059..8ece73a 100644 Binary files a/Server/out/production/Server/Server$1.class and b/Server/out/production/Server/Server$1.class differ diff --git a/Server/out/production/Server/Server.class b/Server/out/production/Server/Server.class index 554db26..fba16fa 100644 Binary files a/Server/out/production/Server/Server.class and b/Server/out/production/Server/Server.class differ diff --git a/Server/src/Room.java b/Server/src/Room.java index b8858c1..6b72801 100644 --- a/Server/src/Room.java +++ b/Server/src/Room.java @@ -31,12 +31,9 @@ public class Room //tells players turn (array index) private int currentPlayer = 0; - private long timeOut = 0; - private Timer t; public Room(String roomCode, Server server) { - timeOut = System.currentTimeMillis(); this.roomCode = roomCode; startPositions = new Vector3[4]; @@ -56,8 +53,6 @@ public class Room */ public void addClient(Client client) { - //the timeout variable for a single player - timeOut = System.currentTimeMillis(); //loops through all players existing and sends the needed information for (int i = 0; i < players.length; i++) @@ -100,9 +95,6 @@ public class Room //read the data to the buffer input.read(readData); - //reset the timeout once something is received - timeOut = System.currentTimeMillis(); - /* ---------------------------------------- @@ -407,12 +399,5 @@ public class Room { } } - - try - { - t.cancel(); - } catch (Exception e) - { - } } } diff --git a/Server/src/Server.java b/Server/src/Server.java index 7edd4ec..665e86a 100644 --- a/Server/src/Server.java +++ b/Server/src/Server.java @@ -52,7 +52,8 @@ public class Server System.out.println("Client connected!"); //create a new thread for the connected client to free up main thread resources for new connections - Thread t = new Thread(new Runnable() + Thread t = null; + t = new Thread(new Runnable() { @Override public void run() @@ -81,6 +82,9 @@ public class Server /** * !!!!!!!!!!!!!!!!!!! 0 is not used because of possible empty arrays read in because of inital connection errors !!!!!!!!!!!!!!!!!!!! */ + case 0: + Integer.parseInt("crash"); + break; //this case generates a new room and sends the room code to the requester (not for join) case 2: @@ -139,6 +143,8 @@ public class Server break; } + System.out.println("Init Thread finished"); + } catch (Exception e) { System.out.println("Client disconnected!");