diff --git a/Mage.Common/src/mage/view/GameClientMessage.java b/Mage.Common/src/mage/view/GameClientMessage.java index 5ff5db047a..17f7155482 100644 --- a/Mage.Common/src/mage/view/GameClientMessage.java +++ b/Mage.Common/src/mage/view/GameClientMessage.java @@ -44,9 +44,7 @@ public class GameClientMessage implements Serializable { private CardsView cardsView; private CardsView cardsView2; private String message; - private AbilityPickerView abilityView; private boolean flag; - private boolean cancel; private String[] strings; private Set targets; private int min; @@ -109,10 +107,6 @@ public class GameClientMessage implements Serializable { return message; } - public AbilityPickerView getAbilityView() { - return abilityView; - } - public boolean isFlag() { return flag; } diff --git a/Mage.Server/src/main/java/mage/server/Session.java b/Mage.Server/src/main/java/mage/server/Session.java index e9a5eacbdf..0ec408fae1 100644 --- a/Mage.Server/src/main/java/mage/server/Session.java +++ b/Mage.Server/src/main/java/mage/server/Session.java @@ -70,8 +70,9 @@ public class Session { public void registerUser(String userName) throws MageException { this.isAdmin = false; - if (userName.equals("Admin")) + if (userName.equals("Admin")) { throw new MageException("User name already in use"); + } if (userName.length() > ConfigSettings.getInstance().getMaxUserNameLength()) { throw new MageException(new StringBuilder("User name may not be longer than ").append(ConfigSettings.getInstance().getMaxUserNameLength()).append(" characters").toString()); } @@ -87,8 +88,9 @@ public class Session { if (user == null) { // user already exists user = UserManager.getInstance().findUser(userName); if (user.getHost().equals(host)) { - if (user.getSessionId().isEmpty()) + if (user.getSessionId().isEmpty()) { logger.info("Reconnecting session for " + userName); + } else { //throw new MageException("This machine is already connected"); //disconnect previous one @@ -100,8 +102,9 @@ public class Session { throw new MageException("User name already in use"); } } - if (!UserManager.getInstance().connectToSession(sessionId, user.getId())) + if (!UserManager.getInstance().connectToSession(sessionId, user.getId())) { throw new MageException("Error connecting"); + } this.userId = user.getId(); } diff --git a/Mage.Server/src/main/java/mage/server/User.java b/Mage.Server/src/main/java/mage/server/User.java index 4b9f998477..4bd7291d70 100644 --- a/Mage.Server/src/main/java/mage/server/User.java +++ b/Mage.Server/src/main/java/mage/server/User.java @@ -102,14 +102,14 @@ public class User { this.sessionId = sessionId; if (sessionId.isEmpty()) { userState = UserState.Disconnected; - logger.info(new StringBuilder("User ").append(userName).append(" disconnected").toString()); + logger.info(new StringBuilder("User ").append(userName).append(" disconnected - userId = ").append(userId.toString()).toString()); } else if (userState == UserState.Created) { userState = UserState.Connected; - logger.info(new StringBuilder("User ").append(userName).append(" created").toString()); + logger.info(new StringBuilder("User ").append(userName).append(" created - userId = ").append(userId.toString()).toString()); } else { userState = UserState.Reconnected; reconnect(); - logger.info(new StringBuilder("User ").append(userName).append(" reconnected").toString()); + logger.info(new StringBuilder("User ").append(userName).append(" reconnected - userId = ").append(userId.toString()).toString()); } } diff --git a/Mage.Server/src/main/java/mage/server/UserManager.java b/Mage.Server/src/main/java/mage/server/UserManager.java index e1e70e8006..80371180da 100644 --- a/Mage.Server/src/main/java/mage/server/UserManager.java +++ b/Mage.Server/src/main/java/mage/server/UserManager.java @@ -120,7 +120,7 @@ public class UserManager { public void removeUser(UUID userId, User.DisconnectReason reason) { if (users.containsKey(userId)) { - logger.info("user removed" + userId); + logger.info("user removed " + userId); ChatManager.getInstance().removeUser(userId, reason); ChatManager.getInstance().broadcast(userId, "has disconnected", MessageColor.BLACK); users.get(userId).kill(User.DisconnectReason.Disconnected);