mirror of
https://github.com/correl/mage.git
synced 2024-12-01 11:09:56 +00:00
Send message to client instead of forcing rejoin if player is still connected.
This commit is contained in:
parent
66651bc500
commit
1c9cd592bd
1 changed files with 8 additions and 3 deletions
|
@ -333,9 +333,14 @@ public class GameController implements GameCallback {
|
||||||
// TODO: workaround to fix not started games in tourneys, need to find out real reason
|
// TODO: workaround to fix not started games in tourneys, need to find out real reason
|
||||||
if (gameSessions.get(player.getId()) == null) {
|
if (gameSessions.get(player.getId()) == null) {
|
||||||
// join the game because player has not joined are was removed because of disconnect
|
// join the game because player has not joined are was removed because of disconnect
|
||||||
|
if (user.isConnected()) {
|
||||||
|
user.ccGameStarted(game.getId(), player.getId());
|
||||||
|
logger.warn("Player " + player.getName() + " (missed message) has joined gameId: " + game.getId());
|
||||||
|
} else {
|
||||||
user.removeConstructing(player.getId());
|
user.removeConstructing(player.getId());
|
||||||
GameManager.instance.joinGame(game.getId(), user.getId());
|
GameManager.instance.joinGame(game.getId(), user.getId());
|
||||||
logger.warn("Forced join of player " + player.getName() + " (" + user.getUserState() + ") to gameId: " + game.getId());
|
logger.warn("Forced join of player " + player.getName() + " (" + user.getUserState() + ") to gameId: " + game.getId());
|
||||||
|
}
|
||||||
ChatManager.instance.broadcast(chatId, player.getName(), user.getPingInfo()
|
ChatManager.instance.broadcast(chatId, player.getName(), user.getPingInfo()
|
||||||
+ " is forced to join the game (waiting ends after "
|
+ " is forced to join the game (waiting ends after "
|
||||||
+ GAME_TIMEOUTS_CANCEL_PLAYER_GAME_JOINING_AFTER_INACTIVE_SECS + " secs)",
|
+ GAME_TIMEOUTS_CANCEL_PLAYER_GAME_JOINING_AFTER_INACTIVE_SECS + " secs)",
|
||||||
|
|
Loading…
Reference in a new issue