Fixed: Temporary fix Concurrent access disconnected player game (nextPlayerSetup)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user