Add: TUI for server (debug)

This commit is contained in:
2026-05-02 16:11:32 +02:00
parent b5889d86e0
commit fe621d3a3c
@@ -7,6 +7,7 @@ import it.polimi.ingsw.gc14.Network.NetworkEvent;
import it.polimi.ingsw.gc14.Network.NetworkEvents.AddPlayer; import it.polimi.ingsw.gc14.Network.NetworkEvents.AddPlayer;
import it.polimi.ingsw.gc14.Network.RMI.Server.RMIServer; import it.polimi.ingsw.gc14.Network.RMI.Server.RMIServer;
import it.polimi.ingsw.gc14.Network.TCP.Server.TCPServer; import it.polimi.ingsw.gc14.Network.TCP.Server.TCPServer;
import it.polimi.ingsw.gc14.View.TUI.TUI;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.util.concurrent.BlockingQueue; import java.util.concurrent.BlockingQueue;
@@ -56,6 +57,8 @@ public class ServerLauncher {
*/ */
static LimitedList<String> playerList; static LimitedList<String> playerList;
TUI view;
/** /**
* Class constructor that initializes the attributes. * Class constructor that initializes the attributes.
@@ -137,11 +140,14 @@ public class ServerLauncher {
System.out.println("\n\nNotifying model"); System.out.println("\n\nNotifying model");
serverRMI.notifyAll(gameController.getModel()); serverRMI.notifyAll(gameController.getModel());
serverTCP.notifyAll(gameController.getModel()); serverTCP.notifyAll(gameController.getModel());
this.view = new TUI(gameController.getModel());
this.view.fullRender();
// Game execution // Game execution
while (true) { while (true) {
try { try {
this.doFirstEvent(); this.doFirstEvent();
this.view.fullRender();
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
break; break;