prepare implementing new cards value function for calculating odds: rename myCards to myHoleCards

This commit is contained in:
floty
2014-05-26 12:41:21 +02:00
parent 6dffbaeea5
commit 590f9f7a33
13 changed files with 107 additions and 104 deletions
+5 -6
View File
@@ -535,8 +535,7 @@ ClientStateStartConnect::TimerTimeout(const boost::system::error_code& ec, boost
client->GetContext().GetSessionData()->GetAsioSocket()->close(ec);
if (client->GetContext().GetAddrFamily() == AF_INET6) {
throw ClientException(__FILE__, __LINE__, ERR_SOCK_CONNECT_IPV6_TIMEOUT, 0);
}
else {
} else {
throw ClientException(__FILE__, __LINE__, ERR_SOCK_CONNECT_TIMEOUT, 0);
}
}
@@ -1652,7 +1651,7 @@ ClientStateWaitHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client
// Basic synchronisation before a new hand is started.
client->GetGui().waitForGuiUpdateDone();
// Start new hand.
client->GetGame()->getSeatsList()->front()->setMyCards(myCards);
client->GetGame()->getSeatsList()->front()->setMyHoleCards(myCards);
client->GetGame()->initHand();
client->GetGame()->getCurrentHand()->setSmallBlind(netHandStart.smallblind());
client->GetGame()->getCurrentHand()->getCurrentBeRo()->setMinimumRaise(2 * netHandStart.smallblind());
@@ -1692,7 +1691,7 @@ ClientStateWaitHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client
int bestHandPos[5];
tmpCards[0] = static_cast<int>(r.resultcard1());
tmpCards[1] = static_cast<int>(r.resultcard2());
tmpPlayer->setMyCards(tmpCards);
tmpPlayer->setMyHoleCards(tmpCards);
for (int num = 0; num < 5; num++) {
bestHandPos[num] = r.besthandposition(num);
}
@@ -1940,7 +1939,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
int tmpCards[2];
tmpCards[0] = static_cast<int>(p.allincard1());
tmpCards[1] = static_cast<int>(p.allincard2());
tmpPlayer->setMyCards(tmpCards);
tmpPlayer->setMyHoleCards(tmpCards);
}
client->GetGui().flipHolecardsAllIn();
if(curGame->getCurrentHand()->getCurrentRound()<GAME_STATE_RIVER) {
@@ -2012,7 +2011,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
int bestHandPos[5];
tmpCards[0] = static_cast<int>(r.resultcard1());
tmpCards[1] = static_cast<int>(r.resultcard2());
tmpPlayer->setMyCards(tmpCards);
tmpPlayer->setMyHoleCards(tmpCards);
for (int num = 0; num < 5; num++) {
bestHandPos[num] = r.besthandposition(num);
}
+3 -3
View File
@@ -210,7 +210,7 @@ SetPlayerResult(PlayerResult &playerResult, boost::shared_ptr<PlayerInterface> t
playerResult.set_playerid(tmpPlayer->getMyUniqueID());
int tmpCards[2];
int bestHandPos[5];
tmpPlayer->getMyCards(tmpCards);
tmpPlayer->getMyHoleCards(tmpCards);
playerResult.set_resultcard1(tmpCards[0]);
playerResult.set_resultcard2(tmpCards[1]);
tmpPlayer->getMyBestHandPosition(bestHandPos);
@@ -999,7 +999,7 @@ ServerGameStateHand::EngineLoop(boost::shared_ptr<ServerGame> server)
AllInShowCardsMessage::PlayerAllIn *playerAllIn = netAllInShow->add_playersallin();
playerAllIn->set_playerid((*i)->getMyUniqueID());
int tmpCards[2];
(*i)->getMyCards(tmpCards);
(*i)->getMyHoleCards(tmpCards);
playerAllIn->set_allincard1(tmpCards[0]);
playerAllIn->set_allincard2(tmpCards[1]);
++i;
@@ -1257,7 +1257,7 @@ ServerGameStateHand::StartNewHand(boost::shared_ptr<ServerGame> server)
if (tmpSession) {
int cards[2];
bool errorFlag = false;
tmpPlayer->getMyCards(cards);
tmpPlayer->getMyHoleCards(cards);
boost::shared_ptr<NetPacket> notifyCards = CreateNetPacketHandStart(*server);
HandStartMessage *netHandStart = notifyCards->GetMsg()->mutable_handstartmessage();