Client engine should now be completely thread safe. const int& -> int. Player CardsValue is now returned as copy, not the array itself.

This commit is contained in:
lotodore
2007-06-11 17:48:22 +00:00
parent dfffa16565
commit 07dc39d107
30 changed files with 1128 additions and 225 deletions
+3 -1
View File
@@ -818,12 +818,14 @@ ClientStateRunHand::InternalProcess(ClientThread &client, boost::shared_ptr<NetP
throw ClientException(ERR_NET_UNKNOWN_PLAYER_ID, 0);
int tmpCards[2];
int bestHandPos[5];
tmpCards[0] = static_cast<int>((*i).cards[0]);
tmpCards[1] = static_cast<int>((*i).cards[1]);
tmpPlayer->setMyCards(tmpCards);
for (int num = 0; num < 5; num++)
tmpPlayer->getMyBestHandPosition()[num] = (*i).bestHandPos[num];
bestHandPos[num] = (*i).bestHandPos[num];
tmpPlayer->setMyCardsValueInt((*i).valueOfCards);
tmpPlayer->setMyBestHandPosition(bestHandPos);
if (tmpPlayer->getMyCardsValueInt() > highestValueOfCards)
highestValueOfCards = tmpPlayer->getMyCardsValueInt();
tmpPlayer->setMyCash((*i).playerMoney);
+3 -1
View File
@@ -618,12 +618,14 @@ ServerRecvStateStartRound::Process(ServerRecvThread &server)
tmpPlayerResult.playerId = (*i)->getMyUniqueID();
int tmpCards[2];
int bestHandPos[5];
(*i)->getMyCards(tmpCards);
tmpPlayerResult.cards[0] = static_cast<u_int16_t>(tmpCards[0]);
tmpPlayerResult.cards[1] = static_cast<u_int16_t>(tmpCards[1]);
(*i)->getMyBestHandPosition(bestHandPos);
for (int num = 0; num < 5; num++)
tmpPlayerResult.bestHandPos[num] = (*i)->getMyBestHandPosition()[num];
tmpPlayerResult.bestHandPos[num] = bestHandPos[num];
tmpPlayerResult.valueOfCards = (*i)->getMyCardsValueInt();
tmpPlayerResult.moneyWon = 0; // TODO