forked from External/mage
Improved reconnect and tournament handling. Reconnect time is now shown for disconneted players on player list and tournament panel. You can now reconnect (during 3 minutes) to a tournament also if meanwhile new game (after sideboarding ended) or round was started. Conceding the complete match in a tournament can no longer result in a draw, if you won games before. Quitting a tournament does now always end all active games of that quitting player.
This commit is contained in:
parent
c76529bf91
commit
9ff5bcbd92
29 changed files with 282 additions and 109 deletions
|
|
@ -37,6 +37,7 @@ import mage.interfaces.callback.ClientCallback;
|
|||
import mage.players.net.UserData;
|
||||
import mage.players.net.UserGroup;
|
||||
import mage.server.util.ConfigSettings;
|
||||
import mage.view.ChatMessage;
|
||||
import mage.view.UserDataView;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.jboss.remoting.callback.AsynchInvokerCallbackHandler;
|
||||
|
|
@ -88,6 +89,8 @@ public class Session {
|
|||
user = UserManager.getInstance().findUser(userName);
|
||||
if (user.getHost().equals(host)) {
|
||||
if (user.getSessionId().isEmpty()) {
|
||||
// TODO Send Chat message to tables (user is not registered yet)
|
||||
// ChatManager.getInstance().broadcast([CHAT ID TABLES], "has reconnected", ChatMessage.MessageColor.GREEN);
|
||||
logger.info("Reconnecting session for " + userName);
|
||||
} else {
|
||||
//throw new MageException("This machine is already connected");
|
||||
|
|
@ -124,7 +127,10 @@ public class Session {
|
|||
userData = new UserData(UserGroup.PLAYER, userDataView.getAvatarId(), userDataView.isShowAbilityPickerForced());
|
||||
user.setUserData(userData);
|
||||
} else {
|
||||
userData.setAvatarId(userDataView.getAvatarId());
|
||||
if (userDataView.getAvatarId() == 51) { // Update special avatar if first avatar is selected
|
||||
updateAvatar(userName, userData);
|
||||
}
|
||||
userData.setAvatarId(userDataView.getAvatarId());
|
||||
userData.setShowAbilityPickerForced(userDataView.isShowAbilityPickerForced());
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue