Fixed: FullScreen Login after Standing displays

This commit is contained in:
rubenpirreram
2026-05-27 18:33:59 +02:00
parent a124feb639
commit d14126f198
3 changed files with 19 additions and 17 deletions
@@ -123,9 +123,8 @@ public class ServerLauncher {
disconnectionTimer.cancel(false); disconnectionTimer.cancel(false);
disconnectionTimer = null; disconnectionTimer = null;
} }
int roundPrev=gameController.getModel().getCurrentState().getRound();
synchronized(gameController){ synchronized(gameController){
int roundPrev=gameController.getModel().getCurrentState().getRound();
//applies the event and set if is an error //applies the event and set if is an error
event.setIsError(!event.apply(gameController)); event.setIsError(!event.apply(gameController));
Game game=gameController.getModel(); Game game=gameController.getModel();
@@ -153,18 +152,21 @@ public class ServerLauncher {
} }
//schedule endgame for forfeit //schedule endgame for forfeit
disconnectionTimer = timerExecutor.schedule(() -> { disconnectionTimer = timerExecutor.schedule(() -> {
game.EndGameForFeit(); synchronized (gameController)
serverRMI.notifyAll(new EndedGame(game.getSlotMap(), game.orderLogicCard, game.getCurrentState(),game.getPlayerStanding())); {
serverTCP.notifyAll(new EndedGame(game.getSlotMap(), game.orderLogicCard, game.getCurrentState(),game.getPlayerStanding())); game.EndGameForFeit();
System.out.println("Timer expired: no player reconnected in 60s."); serverRMI.notifyAll(new EndedGame(game.getSlotMap(), game.orderLogicCard, game.getCurrentState(),game.getPlayerStanding()));
for(Map.Entry<String,Boolean> entry:playerList.entrySet()){ serverTCP.notifyAll(new EndedGame(game.getSlotMap(), game.orderLogicCard, game.getCurrentState(),game.getPlayerStanding()));
if(!entry.getValue()) System.out.println("Timer expired: no player reconnected in 60s.");
playerList.remove(entry.getKey()); for(Map.Entry<String,Boolean> entry:playerList.entrySet()){
if(!entry.getValue())
playerList.remove(entry.getKey());
}
if(!this.deleteSave()){
System.out.println("\n!!! Couldn't delete save !!!\n");
}
disconnectionTimer = null;
} }
if(!this.deleteSave()){
System.out.println("\n!!! Couldn't delete save !!!\n");
}
disconnectionTimer = null;
}, 1, TimeUnit.MINUTES); }, 1, TimeUnit.MINUTES);
} }
//if the round is changed send a new next round event , the previous event is ignored and directly sent the next round(also upper and lower lists updated) //if the round is changed send a new next round event , the previous event is ignored and directly sent the next round(also upper and lower lists updated)
@@ -65,6 +65,7 @@ public class GUI extends Application implements IView {
controllerLeaderboard.setController(controller,()->{ controllerLeaderboard.setController(controller,()->{
primaryStage.setScene(loginScene); primaryStage.setScene(loginScene);
controllerLogin.showError(""); controllerLogin.showError("");
primaryStage.setFullScreen(true);
},loginScene); },loginScene);
@@ -143,10 +144,12 @@ public class GUI extends Application implements IView {
if(error==ErrorType.SERVER_CRASHED){ if(error==ErrorType.SERVER_CRASHED){
primaryStage.setScene(loginScene); primaryStage.setScene(loginScene);
controllerLogin.showError(error); controllerLogin.showError(error);
primaryStage.setFullScreen(true);
}else { }else {
synchronized (miniModel) { synchronized (miniModel) {
controllerMain.isError = true; controllerMain.isError = true;
controllerMain.render(); controllerMain.render();
} }
} }
}); });
@@ -112,8 +112,7 @@ public class MainFXMLController {
renderMyHand(); renderMyHand();
} }
renderSidePanel(); renderSidePanel();
isError=false;
} }
@@ -323,8 +322,6 @@ public class MainFXMLController {
tt.setCycleCount(6); tt.setCycleCount(6);
tt.setAutoReverse(true); tt.setAutoReverse(true);
tt.play(); tt.play();
isError=false;
} }
} }
headerRow.getChildren().addAll(totem, usernameLabel); headerRow.getChildren().addAll(totem, usernameLabel);