Fixed init gui in networking (is now thread safe). Fixed displaying of game/hand number for network games.

This commit is contained in:
lotodore
2007-06-03 13:36:24 +00:00
parent baad95427f
commit 1fcb0c80fd
13 changed files with 58 additions and 34 deletions
+1 -3
View File
@@ -60,15 +60,13 @@ void ServerGuiWrapper::refreshPot() const {}
void ServerGuiWrapper::refreshGroupbox(int playerID, int status) const {}
void ServerGuiWrapper::refreshPlayerName() const {}
void ServerGuiWrapper::refreshButton() const {}
void ServerGuiWrapper::refreshGameLabels() const {}
void ServerGuiWrapper::dealHoleCards() {}
void ServerGuiWrapper::dealFlopCards() {}
void ServerGuiWrapper::dealTurnCard() {}
void ServerGuiWrapper::dealRiverCard() {}
void ServerGuiWrapper::refreshGameLabels(int round) const {}
void ServerGuiWrapper::nextPlayerAnimation() {}
void ServerGuiWrapper::preflopAnimation1() {}
+1 -1
View File
@@ -44,7 +44,7 @@ public:
void refreshAll() const;
void refreshPlayerName() const;
void refreshButton() const;
void refreshGameLabels(int round) const;
void refreshGameLabels() const;
void dealHoleCards();
void dealFlopCards();
+1 -2
View File
@@ -49,6 +49,7 @@ public:
virtual void refreshAll() const=0;
virtual void refreshPlayerName() const=0;
virtual void refreshButton() const =0;
virtual void refreshGameLabels() const=0;
// // Karten-Funktionen
virtual void dealHoleCards()=0;
@@ -56,8 +57,6 @@ public:
virtual void dealTurnCard()=0;
virtual void dealRiverCard()=0;
virtual void refreshGameLabels(int) const=0;
virtual void nextPlayerAnimation()=0;
virtual void preflopAnimation1()=0;
+2 -2
View File
@@ -44,7 +44,7 @@ GuiWrapper::~GuiWrapper()
{
}
void GuiWrapper::initGui(int speed) { myW->initGui(speed); }
void GuiWrapper::initGui(int speed) { myW->signalInitGui(speed); }
Session &GuiWrapper::getSession() { return myW->getSession(); }
void GuiWrapper::setSession(boost::shared_ptr<Session> session) { myW->setSession(session); }
@@ -58,7 +58,7 @@ void GuiWrapper::refreshPot() const { myW->signalRefreshPot(); }
void GuiWrapper::refreshGroupbox(int playerID, int status) const { myW->signalRefreshGroupbox(playerID, status); }
void GuiWrapper::refreshPlayerName() const { myW->signalRefreshPlayerName(); }
void GuiWrapper::refreshButton() const { myW->signalRefreshButton(); }
void GuiWrapper::refreshGameLabels(int round) const { myW->signalRefreshGameLabels(round); }
void GuiWrapper::refreshGameLabels() const { myW->signalRefreshGameLabels(); }
void GuiWrapper::dealHoleCards() { myW->signalDealHoleCards(); }
void GuiWrapper::dealFlopCards() { myW->signalDealFlopCards0(); }
+1 -2
View File
@@ -52,14 +52,13 @@ public:
void refreshAll() const;
void refreshPlayerName() const;
void refreshButton() const;
void refreshGameLabels() const;
void dealHoleCards();
void dealFlopCards();
void dealTurnCard();
void dealRiverCard();
void refreshGameLabels(int round) const;
void nextPlayerAnimation();
void preflopAnimation1();
+10 -3
View File
@@ -572,6 +572,8 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
connect( lineEdit_ChatInput, SIGNAL( textChanged (QString) ), this, SLOT( checkChatInputLength(QString) ) );
//Nachrichten Thread-Save
connect(this, SIGNAL(signalInitGui(int)), this, SLOT(initGui(int)));
connect(this, SIGNAL(signalRefreshSet()), this, SLOT(refreshSet()));
connect(this, SIGNAL(signalRefreshCash()), this, SLOT(refreshCash()));
connect(this, SIGNAL(signalRefreshAction(int, int)), this, SLOT(refreshAction(int, int)));
@@ -581,6 +583,7 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
connect(this, SIGNAL(signalRefreshAll()), this, SLOT(refreshAll()));
connect(this, SIGNAL(signalRefreshPlayerName()), this, SLOT(refreshPlayerName()));
connect(this, SIGNAL(signalRefreshButton()), this, SLOT(refreshButton()));
connect(this, SIGNAL(signalRefreshGameLabels()), this, SLOT(refreshGameLabels()));
connect(this, SIGNAL(signalMeInAction()), this, SLOT(meInAction()));
@@ -589,7 +592,6 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
connect(this, SIGNAL(signalDealTurnCards0()), this, SLOT(dealTurnCards0()));
connect(this, SIGNAL(signalDealRiverCards0()), this, SLOT(dealRiverCards0()));
connect(this, SIGNAL(signalRefreshGameLabels(int)), this, SLOT(refreshGameLabels(int)));
connect(this, SIGNAL(signalNextPlayerAnimation()), this, SLOT(nextPlayerAnimation()));
connect(this, SIGNAL(signalPreflopAnimation1()), this, SLOT(preflopAnimation1()));
@@ -1181,9 +1183,9 @@ void mainWindowImpl::refreshGroupbox(int playerID, int status) {
}
}
void mainWindowImpl::refreshGameLabels(int round) {
void mainWindowImpl::refreshGameLabels() {
switch(round) {
switch(mySession->getCurrentGame()->getCurrentHand()->getActualRound()) {
case 0: {
textLabel_handLabel->setText("Preflop");
} break;
@@ -2472,6 +2474,11 @@ void mainWindowImpl::networkError(int errorID, int osErrorID) {
{ myChangeHumanPlayerNameDialog->label_Message->setText(tr("The player name is either too short or too long. Please choose another one."));
myChangeHumanPlayerNameDialog->exec(); }
break;
case ERR_NET_UNKNOWN_PLAYER_ID:
{ QMessageBox::warning(this, tr("Network Error"),
tr("The server referred to an unknown player. Aborting."),
QMessageBox::Close); }
break;
default: { QMessageBox::warning(this, tr("Network Error"),
tr("An internal error occured."),
QMessageBox::Close); }
+6 -4
View File
@@ -64,8 +64,6 @@ public:
~mainWindowImpl();
void initGui(int speed);
Session &getSession();
void setSession(boost::shared_ptr<Session> session);
@@ -75,6 +73,8 @@ public:
void setSpeeds();
signals:
void signalInitGui(int speed);
void signalRefreshSet();
void signalRefreshCash();
void signalRefreshAction(int =-1, int=-1);
@@ -92,7 +92,7 @@ signals:
void signalDealTurnCards0();
void signalDealRiverCards0();
void signalRefreshGameLabels(int);
void signalRefreshGameLabels();
void signalNextPlayerAnimation();
void signalPreflopAnimation1();
@@ -122,6 +122,8 @@ signals:
public slots:
void initGui(int speed);
//refresh-Funktionen
void refreshSet();
void refreshCash();
@@ -131,7 +133,7 @@ public slots:
void refreshGroupbox(int =-1, int =-1);
void refreshAll();
void refreshPlayerName();
void refreshGameLabels(int);
void refreshGameLabels();
void refreshButton();
void refreshPlayerAvatar();