Multiplayer capable (STABLE PRESENTATION VERSION)
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Main-Class: networking.TicTacToe_Server
|
||||
Main-Class: TicTacToe_Server
|
||||
|
||||
|
||||
@@ -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) {
|
||||
Reference in New Issue
Block a user