Add: ClientLauncherTUI. Connection and model sending works.

Note: ClientController.view is commented out since class TUI is still missing
This commit is contained in:
2026-04-29 17:14:45 +02:00
parent a699826137
commit 73b5b6eba5
10 changed files with 91 additions and 47 deletions
@@ -34,7 +34,7 @@ import java.util.concurrent.LinkedBlockingQueue;
public class ServerLauncher {
/**
* Queue containing the events to be applied to the game model.
* Queue containinetworkTypeng the events to be applied to the game model.
* Thread safe by design.
*/
BlockingQueue<NetworkEvent> actionQueue;
@@ -109,13 +109,15 @@ public class ServerLauncher {
ServerLauncher launcher = new ServerLauncher(actionQueue, gameController, serverRMI, serverTCP);
playerList.setAction(()->{
try {
launcher.run();
} catch (InterruptedException e) {
throw new RuntimeException(e);
} catch (RemoteException e) {
throw new RuntimeException(e);
}
new Thread(()->{
try {
launcher.run();
} catch (InterruptedException e) {
throw new RuntimeException(e);
} catch (RemoteException e) {
throw new RuntimeException(e);
}
}).start();
});
serverRMI.start();
@@ -132,6 +134,7 @@ public class ServerLauncher {
*/
public void run() throws InterruptedException, RemoteException {
// Game creation
System.out.println("NOTIFICO MODEL");
serverRMI.notifyAll(gameController.getModel());
serverTCP.notifyAll(gameController.getModel());