diff --git a/src/engine/boardinterface.h b/src/engine/boardinterface.h index ef88be09..5d06b4b9 100644 --- a/src/engine/boardinterface.h +++ b/src/engine/boardinterface.h @@ -41,7 +41,7 @@ public: virtual void setSets(int theValue) =0; virtual void setAllInCondition(bool theValue) =0; - virtual void setLastActionPlayer(unsigned theValue) =0; + virtual void setLastActionPlayerID(unsigned theValue) =0; // virtual void collectSets() =0; virtual void collectPot() =0; diff --git a/src/engine/handinterface.h b/src/engine/handinterface.h index bb20e010..fc616013 100644 --- a/src/engine/handinterface.h +++ b/src/engine/handinterface.h @@ -70,11 +70,11 @@ public: virtual void setBettingRoundsPlayed(int theValue) =0; virtual int getBettingRoundsPlayed() const =0; - virtual void setLastPlayersTurn(int theValue) =0; - virtual int getLastPlayersTurn() const =0; + virtual void setPreviousPlayerID(int theValue) =0; + virtual int getPreviousPlayerID() const =0; - virtual void setLastActionPlayer( unsigned theValue ) =0; - virtual unsigned getLastActionPlayer() const =0; + virtual void setLastActionPlayerID( unsigned theValue ) =0; + virtual unsigned getLastActionPlayerID() const =0; virtual void setCardsShown(bool theValue) =0; virtual bool getCardsShown() const =0; diff --git a/src/engine/local_engine/localbero.cpp b/src/engine/local_engine/localbero.cpp index 770f25e4..5d37c7bb 100644 --- a/src/engine/local_engine/localbero.cpp +++ b/src/engine/local_engine/localbero.cpp @@ -84,7 +84,7 @@ void LocalBeRo::run() if(firstRunGui) { firstRunGui = false; - myHand->setLastPlayersTurn(-1); + myHand->setPreviousPlayerID(-1); myHand->getGuiInterface()->dealBeRoCards(myBeRoID); } else { @@ -243,32 +243,6 @@ void LocalBeRo::run() myHand->getGuiInterface()->beRoAnimation2(myBeRoID); } - // logging action - PlayerActionLog myActionLog = LOG_ACTION_NONE; - switch((*currentPlayersTurnIt)->getMyAction()) { - case PLAYER_ACTION_FOLD: { - myActionLog = LOG_ACTION_FOLD; - } break; - case PLAYER_ACTION_CHECK: { - myActionLog = LOG_ACTION_CHECK; - } break; - case PLAYER_ACTION_CALL: { - myActionLog = LOG_ACTION_CALL; - } break; - case PLAYER_ACTION_BET: - case PLAYER_ACTION_RAISE: { - myActionLog = LOG_ACTION_BET; - } break; - case PLAYER_ACTION_ALLIN: { - myActionLog = LOG_ACTION_ALL_IN; - } break; - default: { - } - } - if(myActionLog) { -// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,myActionLog); - } - } } } diff --git a/src/engine/local_engine/localboard.cpp b/src/engine/local_engine/localboard.cpp index 42390546..ca590f95 100755 --- a/src/engine/local_engine/localboard.cpp +++ b/src/engine/local_engine/localboard.cpp @@ -24,7 +24,7 @@ #include "localexception.h" #include "engine_msg.h" -LocalBoard::LocalBoard(unsigned dp) : BoardInterface(), pot(0), sets(0), dealerPosition(dp), allInCondition(false), lastActionPlayer(0) +LocalBoard::LocalBoard(unsigned dp) : BoardInterface(), pot(0), sets(0), dealerPosition(dp), allInCondition(false), lastActionPlayerID(0) { myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0; } @@ -299,7 +299,7 @@ void LocalBoard::determinePlayerNeedToShowCards() // cout << "lAP-Ende: " << currentHand->getLastActionPlayer() << endl; // search lastActionPlayer for(it_c = activePlayerList->begin(); it_c != activePlayerList->end(); ++it_c) { - if((*it_c)->getMyUniqueID() == lastActionPlayer && (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) { + if((*it_c)->getMyUniqueID() == lastActionPlayerID && (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) { lastActionPlayerIt = it_c; // cout << (*it_c)->getMyUniqueID() << endl; break; diff --git a/src/engine/local_engine/localboard.h b/src/engine/local_engine/localboard.h index e9191245..9af7e101 100755 --- a/src/engine/local_engine/localboard.h +++ b/src/engine/local_engine/localboard.h @@ -49,8 +49,8 @@ public: void setAllInCondition(bool theValue) { allInCondition = theValue; } - void setLastActionPlayer(unsigned theValue) { - lastActionPlayer = theValue; + void setLastActionPlayerID(unsigned theValue) { + lastActionPlayerID = theValue; } int getPot() const { @@ -100,7 +100,7 @@ private: int sets; unsigned dealerPosition; bool allInCondition; - unsigned lastActionPlayer; + unsigned lastActionPlayerID; }; diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index fe11ce49..fceba75f 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -30,7 +30,7 @@ using namespace std; LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, boost::shared_ptr b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC) - : myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), smallBlindPosition(dP), bigBlindPosition(dP), currentRound(GAME_STATE_PREFLOP), smallBlind(sB), startCash(sC), lastPlayersTurn(-1), lastActionPlayer(0), allInCondition(false), + : myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), smallBlindPosition(dP), bigBlindPosition(dP), currentRound(GAME_STATE_PREFLOP), smallBlind(sB), startCash(sC), previousPlayerID(-1), lastActionPlayerID(0), allInCondition(false), cardsShown(false), bettingRoundsPlayed(0) { @@ -448,8 +448,8 @@ void LocalHand::assignButtons() } // first player after dealer have to show his cards first (in showdown) - lastActionPlayer = (*it)->getMyUniqueID(); - myBoard->setLastActionPlayer(lastActionPlayer); + lastActionPlayerID = (*it)->getMyUniqueID(); + myBoard->setLastActionPlayerID(lastActionPlayerID); ++it; if(it == activePlayerList->end()) it = activePlayerList->begin(); @@ -528,6 +528,35 @@ void LocalHand::setBlinds() void LocalHand::switchRounds() { + // logging last player action +// currentPlayersTurnIt = myHand->getRunningPlayerIt( currentPlayersTurnId ); +// if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) { +// throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND); +// } + + +// switch((*currentPlayersTurnIt)->getMyAction()) { +// case PLAYER_ACTION_FOLD: { +// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_FOLD); +// } break; +// case PLAYER_ACTION_CHECK: { +// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_CHECK); +// } break; +// case PLAYER_ACTION_CALL: { +// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_CALL); +// } break; +// case PLAYER_ACTION_BET: +// case PLAYER_ACTION_RAISE: { +// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_BET,(*currentPlayersTurnIt)->getMySet()); +// } break; +// case PLAYER_ACTION_ALLIN: { +// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_ALL_IN,(*currentPlayersTurnIt)->getMySet()); +// } break; +// default: { +// } +// } + + PlayerListIterator it, it_1; PlayerListConstIterator it_c; @@ -646,10 +675,10 @@ void LocalHand::switchRounds() } //unhighlight current players groupbox - it_c = getActivePlayerIt(lastPlayersTurn); + it_c = getActivePlayerIt(previousPlayerID); if( it_c != activePlayerList->end() ) { // lastPlayersTurn is active - myGui->refreshGroupbox(lastPlayersTurn,1); + myGui->refreshGroupbox(previousPlayerID,1); } myGui->refreshGameLabels((GameState)getCurrentRound()); @@ -738,8 +767,8 @@ PlayerListIterator LocalHand::getRunningPlayerIt(unsigned uniqueId) const } -void LocalHand::setLastActionPlayer(unsigned theValue) +void LocalHand::setLastActionPlayerID(unsigned theValue) { - lastActionPlayer = theValue; - myBoard->setLastActionPlayer(theValue); + lastActionPlayerID = theValue; + myBoard->setLastActionPlayerID(theValue); } diff --git a/src/engine/local_engine/localhand.h b/src/engine/local_engine/localhand.h index f39649ee..0b21e99d 100755 --- a/src/engine/local_engine/localhand.h +++ b/src/engine/local_engine/localhand.h @@ -130,16 +130,16 @@ public: return bettingRoundsPlayed; } - void setLastPlayersTurn(int theValue) { - lastPlayersTurn = theValue; + void setPreviousPlayerID(int theValue) { + previousPlayerID = theValue; } - int getLastPlayersTurn() const { - return lastPlayersTurn; + int getPreviousPlayerID() const { + return previousPlayerID; } - void setLastActionPlayer ( unsigned theValue ); - unsigned getLastActionPlayer() const { - return lastActionPlayer; + void setLastActionPlayerID ( unsigned theValue ); + unsigned getLastActionPlayerID() const { + return lastActionPlayerID; } void setCardsShown(bool theValue) { @@ -181,8 +181,8 @@ private: int smallBlind; int startCash; - int lastPlayersTurn; - unsigned lastActionPlayer; + int previousPlayerID; + unsigned lastActionPlayerID; bool allInCondition; bool cardsShown; diff --git a/src/engine/local_engine/localplayer.cpp b/src/engine/local_engine/localplayer.cpp index 59007ad6..f25918a6 100755 --- a/src/engine/local_engine/localplayer.cpp +++ b/src/engine/local_engine/localplayer.cpp @@ -1066,7 +1066,7 @@ void LocalPlayer::action() // cout << "jetzt" << endl; //set that i was the last active player. need this for unhighlighting groupbox - currentHand->setLastPlayersTurn(myID); + currentHand->setPreviousPlayerID(myID); currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet); currentHand->getGuiInterface()->nextPlayerAnimation(); @@ -3222,12 +3222,12 @@ void LocalPlayer::evaluation(int bet, int raise) break; // fold case 1: { - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_FOLD); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_FOLD); } break; // check case 2: { - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CHECK); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CHECK); } break; // call @@ -3238,14 +3238,14 @@ void LocalPlayer::evaluation(int bet, int raise) mySet += myCash; myCash = 0; myAction = PLAYER_ACTION_ALLIN; - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); // cout << "evaluation(call) - mySet: " << mySet << endl; } // sonst else { myCash = myCash - highestSet + mySet; mySet = highestSet; - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CALL,mySet); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CALL,mySet); } } break; @@ -3262,7 +3262,7 @@ void LocalPlayer::evaluation(int bet, int raise) myCash = 0; myAction = PLAYER_ACTION_ALLIN; highestSet = mySet; - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); } // sonst else { @@ -3270,11 +3270,11 @@ void LocalPlayer::evaluation(int bet, int raise) myCash = myCash - bet; mySet = bet; highestSet = mySet; - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_BET,mySet); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_BET,mySet); } // lastPlayerAction für Karten umblättern reihenfolge setzrn - currentHand->setLastActionPlayer(myUniqueID); + currentHand->setLastActionPlayerID(myUniqueID); } break; // raise @@ -3285,14 +3285,14 @@ void LocalPlayer::evaluation(int bet, int raise) mySet += myCash; myCash = 0; myAction = PLAYER_ACTION_ALLIN; - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); } // sonst else { myCash = myCash - highestSet + mySet; mySet = highestSet; myAction = PLAYER_ACTION_CALL; - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CALL,mySet); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CALL,mySet); } } else { if(raise < currentHand->getCurrentBeRo()->getMinimumRaise()) { @@ -3311,7 +3311,7 @@ void LocalPlayer::evaluation(int bet, int raise) // raise, but not enough --> full bet rule currentHand->getCurrentBeRo()->setFullBetRule(true); // lastPlayerAction für Karten umblättern reihenfolge setzrn - currentHand->setLastActionPlayer(myUniqueID); + currentHand->setLastActionPlayerID(myUniqueID); mySet += myCash; currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet); @@ -3321,7 +3321,7 @@ void LocalPlayer::evaluation(int bet, int raise) } } else { // lastPlayerAction für Karten umblättern reihenfolge setzrn - currentHand->setLastActionPlayer(myUniqueID); + currentHand->setLastActionPlayerID(myUniqueID); mySet += myCash; currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet); @@ -3329,7 +3329,7 @@ void LocalPlayer::evaluation(int bet, int raise) myAction = PLAYER_ACTION_ALLIN; highestSet = mySet; } - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); } // sonst else { @@ -3338,15 +3338,15 @@ void LocalPlayer::evaluation(int bet, int raise) mySet = highestSet + raise; highestSet = mySet; // lastPlayerAction für Karten umblättern reihenfolge setzrn - currentHand->setLastActionPlayer(myUniqueID); - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_BET,mySet); + currentHand->setLastActionPlayerID(myUniqueID); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_BET,mySet); } } } break; // all in case 6: { - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); } break; default: diff --git a/src/engine/network_engine/clientboard.cpp b/src/engine/network_engine/clientboard.cpp index 4b3963c9..f66c1e69 100644 --- a/src/engine/network_engine/clientboard.cpp +++ b/src/engine/network_engine/clientboard.cpp @@ -24,7 +24,7 @@ using namespace std; ClientBoard::ClientBoard(unsigned dp) - : pot(0), sets(0), dealerPosition(dp), allInCondition(false), lastActionPlayer(0) + : pot(0), sets(0), dealerPosition(dp), allInCondition(false), lastActionPlayerID(0) { myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0; } @@ -95,10 +95,10 @@ ClientBoard::setAllInCondition(bool theValue) } void -ClientBoard::setLastActionPlayer(unsigned theValue) +ClientBoard::setLastActionPlayerID(unsigned theValue) { boost::recursive_mutex::scoped_lock lock(m_syncMutex); - lastActionPlayer = theValue; + lastActionPlayerID = theValue; } void diff --git a/src/engine/network_engine/clientboard.h b/src/engine/network_engine/clientboard.h index 2cd6e2c6..497c6d25 100644 --- a/src/engine/network_engine/clientboard.h +++ b/src/engine/network_engine/clientboard.h @@ -45,7 +45,7 @@ public: void setSets(int theValue); void setAllInCondition(bool theValue); - void setLastActionPlayer(unsigned theValue); + void setLastActionPlayerID(unsigned theValue); void collectSets(); void collectPot(); @@ -74,7 +74,7 @@ private: int sets; unsigned dealerPosition; bool allInCondition; - unsigned lastActionPlayer; + unsigned lastActionPlayerID; }; #endif diff --git a/src/engine/network_engine/clienthand.cpp b/src/engine/network_engine/clienthand.cpp index d16f2f6a..d076807e 100644 --- a/src/engine/network_engine/clienthand.cpp +++ b/src/engine/network_engine/clienthand.cpp @@ -23,7 +23,7 @@ using namespace std; ClientHand::ClientHand(boost::shared_ptr f, GuiInterface *g, boost::shared_ptr b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) : myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(GAME_STATE_PREFLOP), - smallBlind(sB), startCash(sC), lastPlayersTurn(-1), allInCondition(0), + smallBlind(sB), startCash(sC), previousPlayerID(-1), allInCondition(0), cardsShown(false), bettingRoundsPlayed(0) { PlayerListIterator it; @@ -287,31 +287,31 @@ ClientHand::getBettingRoundsPlayed() const } void -ClientHand::setLastPlayersTurn(int theValue) +ClientHand::setPreviousPlayerID(int theValue) { boost::recursive_mutex::scoped_lock lock(m_syncMutex); - lastPlayersTurn = theValue; + previousPlayerID = theValue; } int -ClientHand::getLastPlayersTurn() const +ClientHand::getPreviousPlayerID() const { boost::recursive_mutex::scoped_lock lock(m_syncMutex); - return lastPlayersTurn; + return previousPlayerID; } void -ClientHand::setLastActionPlayer (unsigned theValue) +ClientHand::setLastActionPlayerID (unsigned theValue) { boost::recursive_mutex::scoped_lock lock(m_syncMutex); - lastActionPlayer = theValue; + lastActionPlayerID = theValue; } unsigned -ClientHand::getLastActionPlayer() const +ClientHand::getLastActionPlayerID() const { boost::recursive_mutex::scoped_lock lock(m_syncMutex); - return lastActionPlayer; + return lastActionPlayerID; } void diff --git a/src/engine/network_engine/clienthand.h b/src/engine/network_engine/clienthand.h index 30820dd4..ace6945b 100644 --- a/src/engine/network_engine/clienthand.h +++ b/src/engine/network_engine/clienthand.h @@ -81,11 +81,11 @@ public: void setBettingRoundsPlayed ( int theValue ); int getBettingRoundsPlayed() const; - void setLastPlayersTurn ( int theValue ); - int getLastPlayersTurn() const; + void setPreviousPlayerID ( int theValue ); + int getPreviousPlayerID() const; - void setLastActionPlayer ( unsigned theValue ); - unsigned getLastActionPlayer() const; + void setLastActionPlayerID ( unsigned theValue ); + unsigned getLastActionPlayerID() const; void setCardsShown ( bool theValue ); bool getCardsShown() const; @@ -119,8 +119,8 @@ private: int smallBlind; int startCash; - int lastPlayersTurn; - unsigned lastActionPlayer; + int previousPlayerID; + unsigned lastActionPlayerID; bool allInCondition; bool cardsShown; diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index aee962bc..457569a2 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -1824,11 +1824,11 @@ void gameTableImpl::myFold() boost::shared_ptr currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr humanPlayer = currentHand->getSeatsList()->front(); humanPlayer->setMyAction(PLAYER_ACTION_FOLD); - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_FOLD); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_FOLD); humanPlayer->setMyTurn(0); //set that i was the last active player. need this for unhighlighting groupbox - currentHand->setLastPlayersTurn(0); + currentHand->setPreviousPlayerID(0); // statusBar()->clearMessage(); @@ -1843,11 +1843,11 @@ void gameTableImpl::myCheck() boost::shared_ptr currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr humanPlayer = currentHand->getSeatsList()->front(); humanPlayer->setMyTurn(0); - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CHECK); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CHECK); humanPlayer->setMyAction(PLAYER_ACTION_CHECK); //set that i was the last active player. need this for unhighlighting groupbox - currentHand->setLastPlayersTurn(0); + currentHand->setPreviousPlayerID(0); // statusBar()->clearMessage(); @@ -1910,11 +1910,11 @@ void gameTableImpl::myCall() humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMyCash(0); - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); } else { humanPlayer->setMySet(tempHighestSet - humanPlayer->getMySet()); - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CALL,humanPlayer->getMySet()); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CALL,humanPlayer->getMySet()); humanPlayer->setMyAction(PLAYER_ACTION_CALL); } humanPlayer->setMyTurn(0); @@ -1923,7 +1923,7 @@ void gameTableImpl::myCall() refreshPot(); //set that i was the last active player. need this for unhighlighting groupbox - currentHand->setLastPlayersTurn(0); + currentHand->setPreviousPlayerID(0); // statusBar()->clearMessage(); @@ -1949,7 +1949,7 @@ void gameTableImpl::mySet() humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMyCash(0); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); // full bet rule if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) { @@ -1961,7 +1961,7 @@ void gameTableImpl::mySet() //do not if allIn if(humanPlayer->getMyAction() != 6) { humanPlayer->setMyAction(PLAYER_ACTION_RAISE); - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet()); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet()); } myActionIsRaise = 0; @@ -1972,7 +1972,7 @@ void gameTableImpl::mySet() //do not if allIn if(humanPlayer->getMyAction() != 6) { humanPlayer->setMyAction(PLAYER_ACTION_BET); - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet()); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet()); } myActionIsBet = 0; @@ -1989,10 +1989,10 @@ void gameTableImpl::mySet() // statusBar()->clearMessage(); //set that i was the last active player. need this for unhighlighting groupbox - currentHand->setLastPlayersTurn(0); + currentHand->setPreviousPlayerID(0); // lastPlayerAction für Karten umblättern reihenfolge setzrn - currentHand->setLastActionPlayer(humanPlayer->getMyUniqueID()); + currentHand->setLastActionPlayerID(humanPlayer->getMyUniqueID()); //Spiel läuft weiter myActionDone(); @@ -2010,7 +2010,7 @@ void gameTableImpl::myAllIn() humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMyCash(0); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); - currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); +// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); // full bet rule if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) { @@ -2023,7 +2023,7 @@ void gameTableImpl::myAllIn() currentHand->getCurrentBeRo()->setHighestSet(humanPlayer->getMySet()); // lastPlayerAction für Karten umblättern reihenfolge setzrn - currentHand->setLastActionPlayer(humanPlayer->getMyUniqueID()); + currentHand->setLastActionPlayerID(humanPlayer->getMyUniqueID()); } @@ -2033,7 +2033,7 @@ void gameTableImpl::myAllIn() refreshPot(); //set that i was the last active player. need this for unhighlighting groupbox - currentHand->setLastPlayersTurn(0); + currentHand->setPreviousPlayerID(0); //Spiel läuft weiter myActionDone(); @@ -2174,11 +2174,11 @@ void gameTableImpl::nextPlayerAnimation() PlayerListConstIterator it_c; PlayerList seatsList = currentHand->getSeatsList(); for (it_c=seatsList->begin(); it_c!=seatsList->end(); ++it_c) { - if((*it_c)->getMyID() == currentHand->getLastPlayersTurn()) break; + if((*it_c)->getMyID() == currentHand->getPreviousPlayerID()) break; } - if(currentHand->getLastPlayersTurn() != -1) { - refreshAction(currentHand->getLastPlayersTurn(), (*it_c)->getMyAction()); + if(currentHand->getPreviousPlayerID() != -1) { + refreshAction(currentHand->getPreviousPlayerID(), (*it_c)->getMyAction()); } refreshCash(); @@ -3229,7 +3229,7 @@ void gameTableImpl::updateMyButtonsState(int mode) boost::shared_ptr currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); - if(currentHand->getLastPlayersTurn() == 0) { + if(currentHand->getPreviousPlayerID() == 0) { myButtonsCheckable(FALSE); clearMyButtons(); } else { diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index 7ba0a0ac..add72327 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -1753,7 +1753,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr client, netActionDone->totalPlayerBet - tmpPlayer->getMySet()); } // Update last players turn only after the blinds. - curGame->getCurrentHand()->setLastPlayersTurn(tmpPlayer->getMyID()); + curGame->getCurrentHand()->setPreviousPlayerID(tmpPlayer->getMyID()); } tmpPlayer->setMyAction(PlayerAction(netActionDone->playerAction)); @@ -1832,7 +1832,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr client, tmpCards[3] = tmpCards[4] = 0; curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards); curGame->getCurrentHand()->getBoard()->collectPot(); - curGame->getCurrentHand()->setLastPlayersTurn(-1); + curGame->getCurrentHand()->setPreviousPlayerID(-1); client->GetGui().logDealBoardCardsMsg(GAME_STATE_FLOP, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]); client->GetGui().refreshGameLabels(GAME_STATE_FLOP); @@ -1847,7 +1847,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr client, tmpCards[3] = static_cast(netDealTurn->turnCard); curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards); curGame->getCurrentHand()->getBoard()->collectPot(); - curGame->getCurrentHand()->setLastPlayersTurn(-1); + curGame->getCurrentHand()->setPreviousPlayerID(-1); client->GetGui().logDealBoardCardsMsg(GAME_STATE_TURN, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]); client->GetGui().refreshGameLabels(GAME_STATE_TURN); @@ -1862,7 +1862,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr client, tmpCards[4] = static_cast(netDealRiver->riverCard); curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards); curGame->getCurrentHand()->getBoard()->collectPot(); - curGame->getCurrentHand()->setLastPlayersTurn(-1); + curGame->getCurrentHand()->setPreviousPlayerID(-1); client->GetGui().logDealBoardCardsMsg(GAME_STATE_RIVER, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]); client->GetGui().refreshGameLabels(GAME_STATE_RIVER); diff --git a/src/net/common/servergamestate.cpp b/src/net/common/servergamestate.cpp index a68e2afc..1e7411f2 100644 --- a/src/net/common/servergamestate.cpp +++ b/src/net/common/servergamestate.cpp @@ -154,12 +154,12 @@ static void PerformPlayerAction(ServerGame &server, boost::shared_ptrgetCurrentBeRo()->setMinimumRaise(bet); - curGame.getCurrentHand()->setLastActionPlayer(player->getMyUniqueID()); + curGame.getCurrentHand()->setLastActionPlayerID(player->getMyUniqueID()); } break; case PLAYER_ACTION_RAISE: { curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet()); - curGame.getCurrentHand()->setLastActionPlayer(player->getMyUniqueID()); + curGame.getCurrentHand()->setLastActionPlayerID(player->getMyUniqueID()); } break; case PLAYER_ACTION_ALLIN: { @@ -167,7 +167,7 @@ static void PerformPlayerAction(ServerGame &server, boost::shared_ptrgetCurrentBeRo()->setMinimumRaise(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet()); } if(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() > 0) { - curGame.getCurrentHand()->setLastActionPlayer(player->getMyUniqueID()); + curGame.getCurrentHand()->setLastActionPlayerID(player->getMyUniqueID()); } } break;