- Model.Player p = player.model;
-
- try {
- int stones = player.getAction();
- if (stones == 0 && p.getStones() > 0) {
+ player.receiveGameTurn();
+ switch (player.type) {
+ case Timeout:
+ gameManager.addToGameSummary(player.getNicknameToken() + " timed out!");
+ player.deactivate(player.getNicknameToken() + " T/O");
+ player.setScore(-1);
+ disqual = true;
+ break;
+ case Invalid:
+ player.deactivate(player.getNicknameToken() + " INVALID");
+ gameManager.addToGameSummary(GameManager.formatErrorMessage(player.getNicknameToken() + " provided an ill-formed action"));
+ player.setScore(-1);
+ disqual = true;
+ break;
+ case Throw:
+ try { player.model.consumeStones(player.stoneThrow); }
+ catch (Model.Player.ThrewMoreStonesThanHad e) {
+ if (model.random.nextInt(10) > 0) {
+ gameManager.addToGameSummary(GameManager.formatErrorMessage(player.getNicknameToken() + " tried to throw more stones than they had. I'll let it slide for this time. (But not let them throw that much!)"));
+ player.stoneThrow = player.model.consumeMaxStones();
+ }
+ else {
+ gameManager.addToGameSummary(GameManager.formatErrorMessage(player.getNicknameToken() + " tried to throw more stones than they had. They went into debt trying to provide. The economy tanked, recession and famine ensued; even the troll wouldn't have wanted to bash them anymore. But that's no victory."));
+ player.deactivate(player.getNicknameToken() + " ILLEGAL");
+ player.setScore(-1);
+ disqual = true;
+ }
+ }
+ catch (Model.Player.FailedToThrowStonesAndShouldHave e) {