Added logging to game

This commit is contained in:
lieght
2025-09-17 13:03:26 +02:00
parent e1f2fe38e5
commit 5be2be56ad
5 changed files with 19 additions and 21 deletions

View File

@@ -19,24 +19,10 @@ import java.util.concurrent.ExecutionException;
public class Main {
private static final Logger logger = LogManager.getLogger(Main.class);
public static void main(String[] args) throws ExecutionException, InterruptedException, IOException {
public static void main(String[] args) throws ExecutionException, InterruptedException {
initSystems();
CompletableFuture<String> serverIdFuture = new CompletableFuture<>();
GlobalEventBus.post(new Events.ServerEvents.StartServerRequest("5001", "tictactoe", serverIdFuture));
String serverId = serverIdFuture.get();
CompletableFuture<String> connectionIdFuture = new CompletableFuture<>();
GlobalEventBus.post(new Events.ServerEvents.StartConnectionRequest("127.0.0.1", "5001", connectionIdFuture));
String connectionId = connectionIdFuture.get();
CompletableFuture<String> ticTacToeGame = new CompletableFuture<>();
GlobalEventBus.post(new Events.ServerEvents.CreateTicTacToeGameRequest(serverId, "John", "Pim", ticTacToeGame));
String ticTacToeGameId = ticTacToeGame.get();
GlobalEventBus.post(new Events.ServerEvents.RunTicTacToeGame(serverId, ticTacToeGameId));
ConsoleGui console = new ConsoleGui();
GameBase.State state = GameBase.State.INVALID;