Server Coments

This commit is contained in:
MickWerf
2020-06-07 16:36:13 +02:00
parent fd6d91b7ed
commit c5411217b8
2 changed files with 1 additions and 17 deletions

View File

@@ -404,6 +404,7 @@ public class MainGame extends Game implements ClientCallback {
}
} else if (data instanceof MoveData) {
MoveData moveData = (MoveData) data;
System.out.println(moveData);
if (moveData.getUsername().equals(this.username)) {
moveData.getTile().visit(team.get(moveData.getCharacterName()));
} else {

View File

@@ -1,32 +1,15 @@
package netwerkprog.game.server;
import java.util.HashMap;
public class Server {
private Thread sessionThread;
private HashMap<String, Thread> gameThreads;
public void start() {
SessionController sessionController = new SessionController();
this.gameThreads = new HashMap<>();
this.sessionThread = new Thread(sessionController);
run();
}
private void run() {
setTestGames();
this.sessionThread.start();
}
private void setTestGames() {
// for (int i = 0; i < 10; i++) {
// gameThreads.put("game " + i, new Thread(new GameController(i)));
// }
//
// for (String game : gameThreads.keySet()) {
// gameThreads.get(game).start();
// }
}
}