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
+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(