forked from External/mage
Added Mage.Tests project. Update server for test operations. Implemented bdd classes.
This commit is contained in:
parent
ddf1866d6e
commit
1b6722f9b2
20 changed files with 546 additions and 2 deletions
|
|
@ -57,6 +57,7 @@ import mage.server.game.TableManager;
|
|||
import mage.server.util.ThreadExecutor;
|
||||
import mage.util.Logging;
|
||||
import mage.view.ChatMessage.MessageColor;
|
||||
import mage.view.GameView;
|
||||
import mage.view.TableView;
|
||||
|
||||
/**
|
||||
|
|
@ -615,9 +616,31 @@ public class ServerImpl extends RemoteServer implements Server {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cheat(final UUID gameId, final UUID sessionId, final UUID playerId, final String cardName) throws MageException {
|
||||
try {
|
||||
rmiExecutor.execute(
|
||||
new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (testMode)
|
||||
GameManager.getInstance().cheat(gameId, sessionId, playerId, cardName);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
public void handleException(Exception ex) throws MageException {
|
||||
logger.log(Level.SEVERE, "", ex);
|
||||
throw new MageException("Server error");
|
||||
}
|
||||
|
||||
public GameView getGameView(final UUID gameId, final UUID sessionId, final UUID playerId) {
|
||||
return GameManager.getInstance().getGameView(gameId, sessionId, playerId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue