Multiplayer capable (STABLE PRESENTATION VERSION)

This commit is contained in:
2021-03-24 20:33:03 +01:00
parent 52ce1f070f
commit abcfc8d0d6
9 changed files with 45 additions and 16 deletions

View File

@@ -1,3 +1,3 @@
Manifest-Version: 1.0
Main-Class: networking.TicTacToe_Server
Main-Class: TicTacToe_Server

View File

@@ -1,5 +1,3 @@
package networking;
import logging.LogType;
import logging.ServerLogger;
import res.TicTacToe_GameRules;
@@ -157,9 +155,16 @@ public class TicTacToe_Server {
}
while (clients.size() == requiredConnections) {
for (Socket client : clients.values()) {
gameFlow(handleInput(client), client);
try {
if (instreams.get(client).available() > 0){
gameFlow(handleInput(client), client);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
System.out.println("Ended");
}
public void gameFlow(String input, Socket client) {