mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
changed "already connected" state handling
This commit is contained in:
parent
b43492ba19
commit
d10385fad2
2 changed files with 7 additions and 2 deletions
|
@ -267,6 +267,7 @@ public class Session {
|
|||
class CallbackHandler implements InvokerCallbackHandler {
|
||||
@Override
|
||||
public void handleCallback(Callback callback) throws HandleCallbackException {
|
||||
logger.info("callback handler");
|
||||
client.processCallback((ClientCallback)callback.getCallbackObject());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,8 +75,12 @@ public class Session {
|
|||
if (user.getHost().equals(host)) {
|
||||
if (user.getSessionId().isEmpty())
|
||||
logger.info("Reconnecting session for " + userName);
|
||||
else
|
||||
throw new MageException("This machine is already connected");
|
||||
else {
|
||||
//throw new MageException("This machine is already connected");
|
||||
//disconnect previous one
|
||||
logger.info("Disconnecting another user instance: " + userName);
|
||||
UserManager.getInstance().disconnect(user.getId());
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw new MageException("User name already in use");
|
||||
|
|
Loading…
Reference in a new issue