forked from External/mage
GUI: fixed empty battlefield/players after reconnection, if it still empties then press any skip button (closes #11201)
This commit is contained in:
parent
9322c13926
commit
491c9cbe04
1 changed files with 10 additions and 2 deletions
|
|
@ -632,7 +632,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
}
|
||||
|
||||
public synchronized void init(int messageId, GameView game) {
|
||||
public synchronized void init(int messageId, GameView game, boolean callGameUpdateAfterInit) {
|
||||
addPlayers(game);
|
||||
// default menu states
|
||||
setMenuStates(
|
||||
|
|
@ -642,8 +642,10 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
holdingPriority
|
||||
);
|
||||
|
||||
if (callGameUpdateAfterInit) {
|
||||
updateGame(messageId, game);
|
||||
}
|
||||
}
|
||||
|
||||
private void addPlayers(GameView game) {
|
||||
this.players.clear();
|
||||
|
|
@ -773,6 +775,12 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
|
||||
public synchronized void updateGame(int messageId, GameView game, boolean showPlayable, Map<String, Serializable> options, Set<UUID> targets) {
|
||||
keepLastGameData(messageId, game, showPlayable, options, targets);
|
||||
|
||||
if (this.players.isEmpty() && !game.getPlayers().isEmpty()) {
|
||||
logger.warn("Found empty players list, trying to init game again (possible reason: reconnection)");
|
||||
init(messageId, game, false);
|
||||
}
|
||||
|
||||
prepareSelectableView();
|
||||
updateGame();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue