diff --git a/docs/net_protocol.txt b/docs/net_protocol.txt index 02446c86..24c7b371 100644 --- a/docs/net_protocol.txt +++ b/docs/net_protocol.txt @@ -636,8 +636,8 @@ Player Action: 0x05 - Raise 0x06 - All in Player Bet: - 0 (ignored) - actions fold, check, - > 0 - atcions call, bet, raise, all in + 0 (ignored) - actions fold, check, all in (optionally call) + > 0 - actions call, bet, raise Server Notification: Player's Action Done diff --git a/src/net/common/servergamestate.cpp b/src/net/common/servergamestate.cpp index f722f765..c6b1ccd5 100644 --- a/src/net/common/servergamestate.cpp +++ b/src/net/common/servergamestate.cpp @@ -982,6 +982,17 @@ ServerGameStateWaitPlayerAction::InternalProcess(ServerGameThread &server, Sessi code = ACTION_CODE_NOT_YOUR_TURN; } + // If the client omitted some values, fill them in. + if (actionData.playerAction == PLAYER_ACTION_CALL && actionData.playerBet == 0) + { + if (curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() >= tmpPlayer->getMySet() + tmpPlayer->getMyCash()) + actionData.playerAction = PLAYER_ACTION_ALLIN; + else + actionData.playerBet = curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() - tmpPlayer->getMySet(); + } + if (actionData.playerAction == PLAYER_ACTION_ALLIN && actionData.playerBet == 0) + actionData.playerBet = tmpPlayer->getMyCash(); + // Check whether the action is valid. if (code == ACTION_CODE_VALID && (tmpPlayer->checkMyAction(