Let the server automatically perform call/all in without the client having to provide values.

This commit is contained in:
lotodore
2008-12-25 21:11:05 +00:00
parent 4e6b9d9357
commit 77bb02113a
2 changed files with 13 additions and 2 deletions
+2 -2
View File
@@ -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
+11
View File
@@ -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(