Add: ClientLauncherTUI. Connection and model sending works.
Note: ClientController.view is commented out since class TUI is still missing
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user