Skip to content

Commit

Permalink
Update App.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Antenehden authored Aug 12, 2024
1 parent 5d2d4ca commit 8a86f78
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main/java/uta/cse3310/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ public void onClose(WebSocket conn, int code, String reason, boolean remote) {
activeGames.remove(game);
}
}

// Reset the connectionId if no active games are left
if (activeGames.isEmpty()) {
connectionId = 0;
System.out.println("No active games left. Resetting connectionId to 0.");
}
}

@Override
Expand Down

0 comments on commit 8a86f78

Please sign in to comment.