forked from External/mage
Fixed that user expired sceduled job died without reporting causing error. Handling changed so that if an exception raises it does not prevent the server to check expired user next time. (Hope this will workaround the existing nasty problem in user handling and show the error causing code sequence).
This commit is contained in:
parent
ec692902c7
commit
628cf2e018
3 changed files with 44 additions and 51 deletions
|
|
@ -28,20 +28,17 @@
|
|||
|
||||
package mage.server.game;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.game.Game;
|
||||
import mage.game.match.Match;
|
||||
import mage.interfaces.callback.ClientCallback;
|
||||
import mage.server.User;
|
||||
import mage.server.UserManager;
|
||||
import mage.view.GameClientMessage;
|
||||
import mage.view.GameEndView;
|
||||
import mage.view.GameView;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.rmi.RemoteException;
|
||||
import java.util.UUID;
|
||||
import mage.game.GameState;
|
||||
import mage.game.match.Match;
|
||||
import mage.view.GameEndView;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
@ -74,10 +71,10 @@ public class GameWatcher {
|
|||
|
||||
public void update() {
|
||||
if (!killed) {
|
||||
User user = UserManager.getInstance().getUser(userId);
|
||||
if (user != null) {
|
||||
user.fireCallback(new ClientCallback("gameUpdate", game.getId(), getGameView()));
|
||||
}
|
||||
User user = UserManager.getInstance().getUser(userId);
|
||||
if (user != null) {
|
||||
user.fireCallback(new ClientCallback("gameUpdate", game.getId(), getGameView()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -117,11 +114,6 @@ public class GameWatcher {
|
|||
}
|
||||
}
|
||||
|
||||
protected void handleRemoteException(RemoteException ex) {
|
||||
logger.fatal("GameWatcher error", ex);
|
||||
GameManager.getInstance().kill(game.getId(), userId);
|
||||
}
|
||||
|
||||
public void setKilled() {
|
||||
killed = true;
|
||||
}
|
||||
|
|
@ -137,5 +129,5 @@ public class GameWatcher {
|
|||
public boolean isPlayer() {
|
||||
return isPlayer;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue