diff --git a/src/engine/local_engine/localberopostriver.cpp b/src/engine/local_engine/localberopostriver.cpp index d624c742..c568ff9b 100644 --- a/src/engine/local_engine/localberopostriver.cpp +++ b/src/engine/local_engine/localberopostriver.cpp @@ -73,15 +73,15 @@ void LocalBeRoPostRiver::postRiverRun() { // } // } - // Spieler ermitteln, welche die Karten auf jeden Fall umdrehen müssen - getMyHand()->getBoard()->determinePlayerNeedToShowCards(); + // Spieler ermitteln, welche die Karten auf jeden Fall umdrehen müssen + getMyHand()->getBoard()->determinePlayerNeedToShowCards(); // Pot-Verteilung getMyHand()->getBoard()->distributePot(); //Pot auf 0 setzen getMyHand()->getBoard()->setPot(0); - + //starte die Animaionsreihe getMyHand()->getGuiInterface()->postRiverRunAnimation1(); } diff --git a/src/engine/network_engine/clientboard.cpp b/src/engine/network_engine/clientboard.cpp index 2e5a951e..a1ec1d58 100644 --- a/src/engine/network_engine/clientboard.cpp +++ b/src/engine/network_engine/clientboard.cpp @@ -142,9 +142,7 @@ std::list ClientBoard::getPlayerNeedToShowCards() const { boost::recursive_mutex::scoped_lock lock(m_syncMutex); - // TODO returns winners for now. - //return playerNeedToShowCards; - return winners; + return playerNeedToShowCards; } void diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index 88727035..5c1bb8af 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -2007,6 +2007,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr client, // End of Hand, show cards. list winnerList; + list showList; int highestValueOfCards = 0; PlayerResult_t **playerResults = showCards->playerResults.list.array; unsigned numResults = showCards->playerResults.list.count; @@ -2034,11 +2035,13 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr client, tmpPlayer->setLastMoneyWon(r->moneyWon); if (r->moneyWon) winnerList.push_back(r->playerId); + showList.push_back(r->playerId); } curGame->getCurrentHand()->getCurrentBeRo()->setHighestCardsValue(highestValueOfCards); curGame->getCurrentHand()->getBoard()->setPot(0); curGame->getCurrentHand()->getBoard()->setWinners(winnerList); + curGame->getCurrentHand()->getBoard()->setPlayerNeedToShowCards(showList); client->GetGui().postRiverRunAnimation1(); diff --git a/src/net/common/servergamestate.cpp b/src/net/common/servergamestate.cpp index e1d6a4d0..8ecbb8f5 100644 --- a/src/net/common/servergamestate.cpp +++ b/src/net/common/servergamestate.cpp @@ -883,8 +883,8 @@ ServerGameStateHand::EngineLoop(boost::shared_ptr server) } else { - // End of Hand - show cards of active players. - boost::shared_ptr player = nonFoldPlayers.front(); + // End of Hand - show cards. + const PlayerIdList showList(curGame.getCurrentHand()->getBoard()->getPlayerNeedToShowCards()); boost::shared_ptr endHand(new NetPacket(NetPacket::Alloc)); endHand->GetMsg()->present = PokerTHMessage_PR_endOfHandMessage; EndOfHandMessage_t *netEndHand = &endHand->GetMsg()->choice.endOfHandMessage; @@ -893,15 +893,19 @@ ServerGameStateHand::EngineLoop(boost::shared_ptr server) netEndHand->endOfHandType.present = endOfHandType_PR_endOfHandShowCards; EndOfHandShowCards_t *endHandShow = &netEndHand->endOfHandType.choice.endOfHandShowCards; - PlayerListConstIterator i = nonFoldPlayers.begin(); - PlayerListConstIterator end = nonFoldPlayers.end(); + PlayerIdList::const_iterator i = showList.begin(); + PlayerIdList::const_iterator end = showList.end(); while (i != end) { - PlayerResult_t *playerResult = (PlayerResult_t *)calloc(1, sizeof(PlayerResult_t)); - SetPlayerResult(*playerResult, (*i)); + boost::shared_ptr tmpPlayer(curGame.getPlayerByUniqueId(*i)); + if (tmpPlayer) + { + PlayerResult_t *playerResult = (PlayerResult_t *)calloc(1, sizeof(PlayerResult_t)); + SetPlayerResult(*playerResult, tmpPlayer); - ASN_SEQUENCE_ADD(&endHandShow->playerResults.list, playerResult); + ASN_SEQUENCE_ADD(&endHandShow->playerResults.list, playerResult); + } ++i; } server->SendToAllPlayers(endHand, SessionData::Game); diff --git a/src/pokerth.cpp b/src/pokerth.cpp index c9ec75c3..9dbfeb2c 100755 --- a/src/pokerth.cpp +++ b/src/pokerth.cpp @@ -85,11 +85,11 @@ int main( int argc, char **argv ) curl_global_init(CURL_GLOBAL_NOTHING); /////// can be removed for non-qt-guis //////////// - QtSingleApplication a( argc, argv ); + QApplication a( argc, argv ); - if (a.sendMessage("Wake up!")) { + /*if (a.sendMessage("Wake up!")) { return 0; - } + }*/ #ifdef __APPLE__ // The following needs to be done directly after the application is created. @@ -147,7 +147,7 @@ int main( int argc, char **argv ) /////////////////////////////////////////////////// startWindowImpl mainWin(myConfig); - a.setActivationWindow(&mainWin, true); + //a.setActivationWindow(&mainWin, true); int retVal = a.exec();