forked from External/mage
Network upgrade and new reconnection mode: * users can disconnect or close app without game progress loose now; * disconnect dialog will show active tables stats and additional options; * all active tables will be restored on reconnect (tables, tourneys, games, drafts, sideboarding, constructing); * user must use same server and username on next connection; * there are few minutes for reconnect until server kick off a disconnected player from all player's tables (concede/loose); * now you can safety reconnect after IP change (after proxy/vpn/wifi/router restart); Other improvements and fixes: * gui: main menu - improved switch panel button, added stats about current tables/panels; * gui: improved data sync and updates (fixes many use cases with empty battlefield, not started games/drafts/tourneys, not updatable drafts, etc); * gui: improved stability on game updates (fixes some random errors related to wrong threads); * server: fixed miss messages about player's disconnection problems for other players in the chat; * refactor: simplified and improved connection and network related code, deleted outdated code, added docs; * tests: improved load test to support lands only set for more stable performance/network testing (set TEST_AI_RANDOM_DECK_SETS = PELP and run test_TwoAIPlayGame_Multiple);
24 lines
No EOL
841 B
Java
24 lines
No EOL
841 B
Java
package mage.server;
|
|
|
|
/**
|
|
* Server: possible reasons for disconnection
|
|
*
|
|
* @author LevelX2, JayDi85
|
|
*/
|
|
public enum DisconnectReason {
|
|
LostConnection(false, " has lost connection"),
|
|
DisconnectedByUser(true, " has left XMage"),
|
|
DisconnectedByUserButKeepTables(false, " has left XMage for app restart/reconnect"),
|
|
DisconnectedByAdmin(true, " was disconnected by admin"),
|
|
AnotherUserInstance(false, " disconnected by another user intance"),
|
|
AnotherUserInstanceSilent(false, ""), // same user, no need inform in chats
|
|
SessionExpired(true, " session expired");
|
|
|
|
final boolean isRemoveUserTables;
|
|
final String messageForUser;
|
|
|
|
DisconnectReason(boolean isRemoveUserTables, String messageForUser) {
|
|
this.isRemoveUserTables = isRemoveUserTables;
|
|
this.messageForUser = messageForUser;
|
|
}
|
|
} |