Even better server resource management

This commit is contained in:
brausjonas
2023-03-31 14:45:40 +02:00
parent 38b4f06bb1
commit cc3d4a398a
8 changed files with 8 additions and 17 deletions
-15
View File
@@ -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)
{
}
}
}