forked from External/mage
integrated jboss remoting
This commit is contained in:
parent
34cd3bbcdc
commit
05be0a14ed
36 changed files with 1356 additions and 2061 deletions
|
|
@ -34,11 +34,8 @@ import java.util.Set;
|
|||
import java.util.UUID;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import mage.game.Game;
|
||||
import mage.MageException;
|
||||
import mage.interfaces.callback.CallbackException;
|
||||
import mage.interfaces.callback.ClientCallback;
|
||||
import mage.server.Session;
|
||||
import mage.server.SessionManager;
|
||||
|
|
@ -61,7 +58,7 @@ public class GameSession extends GameWatcher {
|
|||
private ScheduledFuture<?> futureTimeout;
|
||||
protected static ScheduledExecutorService timeoutExecutor = ThreadExecutor.getInstance().getTimeoutExecutor();
|
||||
|
||||
public GameSession(Game game, UUID sessionId, UUID playerId) {
|
||||
public GameSession(Game game, String sessionId, UUID playerId) {
|
||||
super(sessionId, game.getId());
|
||||
this.game = game;
|
||||
this.playerId = playerId;
|
||||
|
|
@ -173,8 +170,6 @@ public class GameSession extends GameWatcher {
|
|||
private synchronized void cancelTimeout() {
|
||||
if (futureTimeout != null) {
|
||||
futureTimeout.cancel(false);
|
||||
((ThreadPoolExecutor)timeoutExecutor).getQueue().remove(futureTimeout);
|
||||
//System.out.println("tasks:"+ ((ThreadPoolExecutor)timeoutExecutor).getTaskCount());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -197,9 +192,4 @@ public class GameSession extends GameWatcher {
|
|||
cancelTimeout();
|
||||
game.getPlayer(playerId).setResponseInteger(data);
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
cancelTimeout();
|
||||
setKilled();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue