Fixed: disconnection during lobby creation--> currentStateProblem
This commit is contained in:
@@ -120,7 +120,7 @@ public class ServerLauncher {
|
||||
Game game=gameController.getModel();
|
||||
if(!event.getIsError())
|
||||
{
|
||||
if(event.getEventType().equals(EventType.DISCONNECTED_PLAYER)&& game.getCurrentState().equals(GameStages.WAITING))
|
||||
if(event.getEventType().equals(EventType.DISCONNECTED_PLAYER)&& game.getCurrentState().getGameStage().equals(GameStages.WAITING))
|
||||
{
|
||||
playerList.remove(event.getUsername());
|
||||
}else {
|
||||
@@ -155,7 +155,6 @@ public class ServerLauncher {
|
||||
else if(!this.gameSave() ){
|
||||
System.out.println("\n!!! Save failed !!!\n");
|
||||
}
|
||||
|
||||
}
|
||||
if (event.getEventType().equals(EventType.DISCONNECTED_PLAYER) && playerList.values().stream().filter(x -> x).count() == 1) {
|
||||
if (disconnectionTimer != null && !disconnectionTimer.isDone()) {
|
||||
@@ -266,7 +265,12 @@ public class ServerLauncher {
|
||||
while (true) {
|
||||
try{
|
||||
this.doFirstEvent();
|
||||
this.view.fullRender();
|
||||
try{
|
||||
this.view.fullRender();
|
||||
}
|
||||
catch (NullPointerException e){
|
||||
|
||||
}
|
||||
}
|
||||
catch(InterruptedException e){
|
||||
Thread.currentThread().interrupt();
|
||||
|
||||
Reference in New Issue
Block a user