Fixed: Temporary fix Concurrent access disconnected player game (nextPlayerSetup)

This commit is contained in:
rubenpirreram
2026-05-27 19:16:15 +02:00
parent d14126f198
commit 29de0a9ed8
3 changed files with 29 additions and 19 deletions
@@ -154,7 +154,7 @@ public class ServerLauncher {
disconnectionTimer = timerExecutor.schedule(() -> {
synchronized (gameController)
{
game.EndGameForFeit();
gameController.EndGameForFeit();
serverRMI.notifyAll(new EndedGame(game.getSlotMap(), game.orderLogicCard, game.getCurrentState(),game.getPlayerStanding()));
serverTCP.notifyAll(new EndedGame(game.getSlotMap(), game.orderLogicCard, game.getCurrentState(),game.getPlayerStanding()));
System.out.println("Timer expired: no player reconnected in 60s.");
@@ -283,7 +283,8 @@ public class ServerLauncher {
new Thread(()-> {
try {
launcher.run();
} catch (Exception e)
}
catch (Exception e)
{
System.out.println("Generic exception occurred");
e.printStackTrace();
@@ -310,6 +311,10 @@ public class ServerLauncher {
try{
this.doFirstEvent();
}
catch (ConcurrentModificationException e)
{
System.err.println("Concurrent Exception");
}
catch(InterruptedException e){
Thread.currentThread().interrupt();
break;