From 4d68e58da295f7cf413f8a580e46313e7d9a750b Mon Sep 17 00:00:00 2001 From: lotodore Date: Tue, 2 Oct 2007 20:50:28 +0000 Subject: [PATCH] Fixed a few nasty networking-related bugs. --- src/engine/network_engine/clienthand.cpp | 2 +- src/game.cpp | 2 +- src/gui/qt/mainwindow/mainwindowimpl.cpp | 18 +++++++++--------- src/net/common/clientstate.cpp | 2 ++ 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/engine/network_engine/clienthand.cpp b/src/engine/network_engine/clienthand.cpp index 02579fc7..6f5bbd20 100644 --- a/src/engine/network_engine/clienthand.cpp +++ b/src/engine/network_engine/clienthand.cpp @@ -76,7 +76,7 @@ ClientHand::getPlayerArray() const PlayerList ClientHand::getSeatsList() const { - return activePlayerList; + return seatsList; } PlayerList diff --git a/src/game.cpp b/src/game.cpp index 996d83a0..688009c3 100755 --- a/src/game.cpp +++ b/src/game.cpp @@ -161,7 +161,7 @@ void Game::initHand() // } //Spieler Action auf 0 setzen - for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); it_c++) { + for(it_c=seatsList->begin(); it_c!=seatsList->end(); it_c++) { (*it_c)->setMyAction(PLAYER_ACTION_NONE); } diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index fb386592..9c008f28 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -1029,8 +1029,8 @@ void mainWindowImpl::callSettingsDialog() { - HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand(); - PlayerListIterator it = currentHand->getSeatsList()->begin(); + Game *currentGame = mySession->getCurrentGame(); + PlayerListIterator it = currentGame->getSeatsList()->begin(); (*it)->setMyName(mySettingsDialog->lineEdit_HumanPlayerName->text().toUtf8().constData()); (*(++it))->setMyName(mySettingsDialog->lineEdit_Opponent1Name->text().toUtf8().constData()); (*(++it))->setMyName(mySettingsDialog->lineEdit_Opponent2Name->text().toUtf8().constData()); @@ -1066,8 +1066,8 @@ void mainWindowImpl::callSettingsDialog() { - HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand(); - PlayerListIterator it = currentHand->getSeatsList()->begin(); + Game *currentGame = mySession->getCurrentGame(); + PlayerListIterator it = currentGame->getSeatsList()->begin(); (*it)->setMyAvatar(mySettingsDialog->pushButton_HumanPlayerAvatar->getMyLink().toUtf8().constData()); (*(++it))->setMyAvatar(mySettingsDialog->pushButton_Opponent1Avatar->getMyLink().toUtf8().constData()); (*(++it))->setMyAvatar(mySettingsDialog->pushButton_Opponent2Avatar->getMyLink().toUtf8().constData()); @@ -1176,10 +1176,10 @@ void mainWindowImpl::refreshSet() { // else setLabelArray[i]->setText("Set: "+QString::number(mySession->getCurrentGame()->getCurrentHand()->getPlayerArray()[i]->getMySet(),10)+" $"); // } - HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand(); + Game *currentGame = mySession->getCurrentGame(); PlayerListConstIterator it_c; - for (it_c=currentHand->getSeatsList()->begin(); it_c!=currentHand->getSeatsList()->end(); it_c++) { + for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) { if( (*it_c)->getMySet() == 0 ) setLabelArray[ (*it_c)->getMyID() ]->setText(""); else setLabelArray[(*it_c)->getMyID()]->setText("Set: "+QString::number( (*it_c)->getMySet(),10)+" $"); } @@ -1202,7 +1202,7 @@ void mainWindowImpl::refreshButton() { // if (mySession->getCurrentGame()->getCurrentHand()->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++; // } - HandInterface *currentHand = mySession->getCurrentGame()->getCurrentHand(); + Game *currentGame = mySession->getCurrentGame(); PlayerListConstIterator it_c; @@ -1247,9 +1247,9 @@ void mainWindowImpl::refreshButton() { - for (it_c=currentHand->getSeatsList()->begin(); it_c!=currentHand->getSeatsList()->end(); it_c++) { + for (it_c=currentGame->getSeatsList()->begin(); it_c!=currentGame->getSeatsList()->end(); it_c++) { if( (*it_c)->getMyActiveStatus() ) { - if( currentHand->getActivePlayerList()->size() > 2 ) { + if( currentGame->getActivePlayerList()->size() > 2 ) { switch ( (*it_c)->getMyButton() ) { case 1 : buttonLabelArray[(*it_c)->getMyID()]->setPixmap(dealerButton); diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index 97e83c23..343e511d 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -700,6 +700,8 @@ ClientStateWaitHand::InternalProcess(ClientThread &client, boost::shared_ptr