Pot and total sets are now displayed correctly.
This commit is contained in:
@@ -613,7 +613,6 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
tmpPlayer->setMyAction(actionDoneData.playerAction);
|
||||
tmpPlayer->setMySetAbsolute(actionDoneData.totalPlayerBet);
|
||||
tmpPlayer->setMyCash(actionDoneData.playerMoney);
|
||||
curGame->getCurrentHand()->getBoard()->setPot(actionDoneData.potSize);
|
||||
curGame->getCurrentHand()->getBoard()->setSets(actionDoneData.curHandBets);
|
||||
|
||||
// Update highest set
|
||||
@@ -670,8 +669,11 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
tmpCards[num] = static_cast<int>(cardsData.flopCards[num]);
|
||||
tmpCards[3] = tmpCards[4] = 0;
|
||||
curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards);
|
||||
curGame->getCurrentHand()->getBoard()->collectPot();
|
||||
|
||||
client.GetGui().refreshGameLabels(GAME_STATE_FLOP);
|
||||
client.GetGui().refreshPot();
|
||||
client.GetGui().refreshSet();
|
||||
client.GetGui().dealFlopCards();
|
||||
}
|
||||
else if (packet->ToNetPacketDealTurnCard())
|
||||
@@ -682,8 +684,11 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
curGame->getCurrentHand()->getBoard()->getMyCards(tmpCards);
|
||||
tmpCards[3] = static_cast<int>(cardsData.turnCard);
|
||||
curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards);
|
||||
curGame->getCurrentHand()->getBoard()->collectPot();
|
||||
|
||||
client.GetGui().refreshGameLabels(GAME_STATE_TURN);
|
||||
client.GetGui().refreshPot();
|
||||
client.GetGui().refreshSet();
|
||||
client.GetGui().dealTurnCard();
|
||||
}
|
||||
else if (packet->ToNetPacketDealRiverCard())
|
||||
@@ -694,8 +699,11 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
|
||||
curGame->getCurrentHand()->getBoard()->getMyCards(tmpCards);
|
||||
tmpCards[4] = static_cast<int>(cardsData.riverCard);
|
||||
curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards);
|
||||
curGame->getCurrentHand()->getBoard()->collectPot();
|
||||
|
||||
client.GetGui().refreshGameLabels(GAME_STATE_RIVER);
|
||||
client.GetGui().refreshPot();
|
||||
client.GetGui().refreshSet();
|
||||
client.GetGui().dealRiverCard();
|
||||
}
|
||||
else if (packet->ToNetPacketAllInShowCards())
|
||||
|
||||
@@ -160,7 +160,6 @@ struct GCC_PACKED NetPacketPlayersActionDoneData
|
||||
u_int16_t reserved;
|
||||
u_int32_t totalPlayerBet;
|
||||
u_int32_t playerMoney;
|
||||
u_int32_t potSize;
|
||||
u_int32_t curHandBets;
|
||||
};
|
||||
|
||||
@@ -1234,7 +1233,6 @@ NetPacketPlayersActionDone::SetData(const NetPacketPlayersActionDone::Data &inDa
|
||||
tmpData->playerAction = htons(inData.playerAction);
|
||||
tmpData->totalPlayerBet = htonl(inData.totalPlayerBet);
|
||||
tmpData->playerMoney = htonl(inData.playerMoney);
|
||||
tmpData->potSize = htonl(inData.potSize);
|
||||
tmpData->curHandBets = htonl(inData.curHandBets);
|
||||
}
|
||||
|
||||
@@ -1249,7 +1247,6 @@ NetPacketPlayersActionDone::GetData(NetPacketPlayersActionDone::Data &outData) c
|
||||
outData.playerAction = static_cast<PlayerAction>(ntohs(tmpData->playerAction));
|
||||
outData.totalPlayerBet = ntohl(tmpData->totalPlayerBet);
|
||||
outData.playerMoney = ntohl(tmpData->playerMoney);
|
||||
outData.potSize = ntohl(tmpData->potSize);
|
||||
outData.curHandBets = ntohl(tmpData->curHandBets);
|
||||
}
|
||||
|
||||
|
||||
@@ -436,7 +436,6 @@ ServerRecvStateStartHand::Process(ServerRecvThread &server)
|
||||
actionDoneData.playerAction = (PlayerAction)playerArray[i]->getMyAction();
|
||||
actionDoneData.totalPlayerBet = playerArray[i]->getMySet();
|
||||
actionDoneData.playerMoney = playerArray[i]->getMyCash();
|
||||
actionDoneData.potSize = curGame.getCurrentHand()->getBoard()->getPot();
|
||||
actionDoneData.curHandBets = playerArray[i]->getMySet(); // first bet only
|
||||
static_cast<NetPacketPlayersActionDone *>(notifySmallBlind.get())->SetData(actionDoneData);
|
||||
server.SendToAllPlayers(notifySmallBlind);
|
||||
@@ -454,7 +453,6 @@ ServerRecvStateStartHand::Process(ServerRecvThread &server)
|
||||
actionDoneData.playerAction = (PlayerAction)playerArray[i]->getMyAction();
|
||||
actionDoneData.totalPlayerBet = playerArray[i]->getMySet();
|
||||
actionDoneData.playerMoney = playerArray[i]->getMyCash();
|
||||
actionDoneData.potSize = curGame.getCurrentHand()->getBoard()->getPot();
|
||||
actionDoneData.curHandBets = curGame.getCurrentHand()->getBoard()->getSets();
|
||||
static_cast<NetPacketPlayersActionDone *>(notifyBigBlind.get())->SetData(actionDoneData);
|
||||
server.SendToAllPlayers(notifyBigBlind);
|
||||
@@ -579,7 +577,7 @@ ServerRecvStateStartRound::Process(ServerRecvThread &server)
|
||||
|
||||
// Retrieve active players. If only one player is left, no cards are shown.
|
||||
std::list<PlayerInterface *> activePlayers = GetActivePlayers(curGame);
|
||||
assert(!activePlayers.empty());
|
||||
// if (activePlayers.empty()) TODO throw exception
|
||||
|
||||
if (activePlayers.size() == 1)
|
||||
{
|
||||
@@ -768,6 +766,8 @@ ServerRecvStateWaitPlayerAction::PerformPlayerAction(ServerRecvThread &server, P
|
||||
|
||||
if (player->getMySet() > GetHighestSet(curGame))
|
||||
SetHighestSet(curGame, player->getMySet());
|
||||
// Update total sets.
|
||||
curGame.getCurrentHand()->getBoard()->collectSets();
|
||||
}
|
||||
|
||||
boost::shared_ptr<NetPacket> notifyActionDone(new NetPacketPlayersActionDone);
|
||||
@@ -777,7 +777,6 @@ ServerRecvStateWaitPlayerAction::PerformPlayerAction(ServerRecvThread &server, P
|
||||
actionDoneData.playerAction = static_cast<PlayerAction>(player->getMyAction());
|
||||
actionDoneData.totalPlayerBet = player->getMySet();
|
||||
actionDoneData.playerMoney = player->getMyCash();
|
||||
actionDoneData.potSize = curGame.getCurrentHand()->getBoard()->getPot();
|
||||
actionDoneData.curHandBets = curGame.getCurrentHand()->getBoard()->getSets();
|
||||
static_cast<NetPacketPlayersActionDone *>(notifyActionDone.get())->SetData(actionDoneData);
|
||||
server.SendToAllPlayers(notifyActionDone);
|
||||
|
||||
Reference in New Issue
Block a user