mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
Handled null pointer exception for "info about player not joined yet"
This commit is contained in:
parent
f4108f4e72
commit
368858cc95
1 changed files with 75 additions and 71 deletions
|
|
@ -157,7 +157,7 @@ public class GameController implements GameCallback {
|
|||
|
||||
private void init() {
|
||||
game.addTableEventListener(
|
||||
new Listener<TableEvent> () {
|
||||
new Listener<TableEvent>() {
|
||||
@Override
|
||||
public void event(TableEvent event) {
|
||||
try {
|
||||
|
|
@ -375,7 +375,11 @@ public class GameController implements GameCallback {
|
|||
logger.debug("Player " + player.getName() + " (disconnected) has joined gameId: " + game.getId());
|
||||
}
|
||||
Session session = SessionManager.getInstance().getSession(user.getSessionId());
|
||||
if (session != null) {
|
||||
ChatManager.getInstance().broadcast(chatId, user, session.getPingInfo() + " is pending to join the game", MessageColor.BLUE, true, ChatMessage.MessageType.STATUS);
|
||||
} else {
|
||||
logger.debug("Player " + player.getName() + " - not possible to get session gameId: " + game.getId());
|
||||
}
|
||||
if (user.getSecondsDisconnected() > 240) {
|
||||
// Cancel player join possibility lately after 4 minutes
|
||||
logger.debug("Player " + player.getName() + " - canceled game (after 240 seconds) gameId: " + game.getId());
|
||||
|
|
@ -1077,7 +1081,7 @@ public class GameController implements GameCallback {
|
|||
idleTimeout(playerId);
|
||||
}
|
||||
},
|
||||
ServerMain.getInstance().isTestMode() ? 3600 :ConfigSettings.getInstance().getMaxSecondsIdle(),
|
||||
ServerMain.getInstance().isTestMode() ? 3600 : ConfigSettings.getInstance().getMaxSecondsIdle(),
|
||||
TimeUnit.SECONDS
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue