mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 20:32:06 -08:00
improved disconnect handling
This commit is contained in:
parent
8bff961caf
commit
9be04769f9
7 changed files with 80 additions and 40 deletions
|
|
@ -112,10 +112,12 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable {
|
|||
}
|
||||
}
|
||||
List<UsersView> users = new ArrayList<>();
|
||||
String pingInfo;
|
||||
for (User user : UserManager.getInstance().getUsers()) {
|
||||
Session session = SessionManager.getInstance().getSession(user.getSessionId());
|
||||
pingInfo = session == null ? "<no ping>" : session.getPingInfo();
|
||||
try {
|
||||
users.add(new UsersView(user.getUserData().getFlagName(), user.getName(), user.getInfo(), user.getGameInfo(), session.getPingInfo()));
|
||||
users.add(new UsersView(user.getUserData().getFlagName(), user.getName(), user.getInfo(), user.getGameInfo(), pingInfo));
|
||||
} catch (Exception ex) {
|
||||
logger.fatal("User update exception: " + user.getName() + " - " + ex.toString(), ex);
|
||||
users.add(new UsersView(
|
||||
|
|
@ -123,7 +125,7 @@ public class GamesRoomImpl extends RoomImpl implements GamesRoom, Serializable {
|
|||
user.getName() != null ? user.getName() : "<no name>",
|
||||
user.getInfo() != null ? user.getInfo() : "<no info>",
|
||||
"[exception]",
|
||||
session.getPingInfo() != null ? session.getPingInfo() : "<no ping>"));
|
||||
pingInfo));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue