improved replays - can now skip forward 10 moves or let the client play through the moves

This commit is contained in:
BetaSteward 2011-09-05 22:12:36 -04:00
parent 6d4c3aa8d9
commit f5c3494723
12 changed files with 142 additions and 20 deletions

View file

@ -858,6 +858,26 @@ public class MageServerImpl implements MageServer {
}
@Override
public void skipForward(final UUID gameId, final String sessionId, final int moves) throws MageException {
if (SessionManager.getInstance().isValidSession(sessionId)) {
try {
callExecutor.execute(
new Runnable() {
@Override
public void run() {
UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
ReplayManager.getInstance().skipForward(gameId, userId, moves);
}
}
);
}
catch (Exception ex) {
handleException(ex);
}
}
}
@Override
public ServerState getServerState() throws MageException {
try {
return new ServerState(