Trying to bring life to the server.
This commit is contained in:
+18
-18
@@ -59,36 +59,36 @@ void GuiWrapper::refreshPot() const { myW->refreshPot(); }
|
||||
void GuiWrapper::refreshGroupbox(int playerID, int status) const { myW->refreshGroupbox(playerID, status); }
|
||||
void GuiWrapper::refreshPlayerName() const { myW->refreshPlayerName(); }
|
||||
|
||||
void GuiWrapper::dealHoleCards() const { myW->dealHoleCards(); }
|
||||
void GuiWrapper::dealFlopCards() const { myW->dealFlopCards0(); }
|
||||
void GuiWrapper::dealTurnCard() const { myW->dealTurnCards0(); }
|
||||
void GuiWrapper::dealRiverCard() const { myW->dealRiverCards0(); }
|
||||
void GuiWrapper::dealHoleCards() { myW->dealHoleCards(); }
|
||||
void GuiWrapper::dealFlopCards() { myW->dealFlopCards0(); }
|
||||
void GuiWrapper::dealTurnCard() { myW->dealTurnCards0(); }
|
||||
void GuiWrapper::dealRiverCard() { myW->dealRiverCards0(); }
|
||||
|
||||
void GuiWrapper::highlightRoundLabel(string round) const { myW->highlightRoundLabel(round); }
|
||||
|
||||
|
||||
void GuiWrapper::nextPlayerAnimation() const { myW->nextPlayerAnimation(); }
|
||||
void GuiWrapper::nextPlayerAnimation() { myW->nextPlayerAnimation(); }
|
||||
|
||||
void GuiWrapper::preflopAnimation1() const { myW->preflopAnimation1(); }
|
||||
void GuiWrapper::preflopAnimation2() const { myW->preflopAnimation2(); }
|
||||
void GuiWrapper::preflopAnimation1() { myW->preflopAnimation1(); }
|
||||
void GuiWrapper::preflopAnimation2() { myW->preflopAnimation2(); }
|
||||
|
||||
void GuiWrapper::flopAnimation1() const { myW->flopAnimation1(); }
|
||||
void GuiWrapper::flopAnimation2() const { myW->flopAnimation2(); }
|
||||
void GuiWrapper::flopAnimation1() { myW->flopAnimation1(); }
|
||||
void GuiWrapper::flopAnimation2() { myW->flopAnimation2(); }
|
||||
|
||||
void GuiWrapper::turnAnimation1() const { myW->turnAnimation1(); }
|
||||
void GuiWrapper::turnAnimation2() const { myW->turnAnimation2(); }
|
||||
void GuiWrapper::turnAnimation1() { myW->turnAnimation1(); }
|
||||
void GuiWrapper::turnAnimation2() { myW->turnAnimation2(); }
|
||||
|
||||
void GuiWrapper::riverAnimation1() const { myW->riverAnimation1(); }
|
||||
void GuiWrapper::riverAnimation2() const { myW->riverAnimation2(); }
|
||||
void GuiWrapper::riverAnimation1() { myW->riverAnimation1(); }
|
||||
void GuiWrapper::riverAnimation2() { myW->riverAnimation2(); }
|
||||
|
||||
void GuiWrapper::postRiverAnimation1() const { myW->postRiverAnimation1(); }
|
||||
void GuiWrapper::postRiverRunAnimation1() const { myW->postRiverRunAnimation1(); }
|
||||
void GuiWrapper::postRiverAnimation1() { myW->postRiverAnimation1(); }
|
||||
void GuiWrapper::postRiverRunAnimation1() { myW->postRiverRunAnimation1(); }
|
||||
|
||||
void GuiWrapper::flipHolecardsAllIn() const { myW->flipHolecardsAllIn(); }
|
||||
void GuiWrapper::flipHolecardsAllIn() { myW->flipHolecardsAllIn(); }
|
||||
|
||||
void GuiWrapper::nextRoundCleanGui() const { myW->nextRoundCleanGui(); }
|
||||
void GuiWrapper::nextRoundCleanGui() { myW->nextRoundCleanGui(); }
|
||||
|
||||
void GuiWrapper::meInAction() const { myW->meInAction(); }
|
||||
void GuiWrapper::meInAction() { myW->meInAction(); }
|
||||
|
||||
void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) { myLog->logPlayerActionMsg(playerName, action, setValue); }
|
||||
void GuiWrapper::logNewGameHandMsg(int gameID, int handID) { myLog->logNewGameHandMsg(gameID, handID); }
|
||||
|
||||
+18
-18
@@ -54,35 +54,35 @@ public:
|
||||
void refreshAll() const;
|
||||
void refreshPlayerName() const;
|
||||
|
||||
void dealHoleCards() const;
|
||||
void dealFlopCards() const;
|
||||
void dealTurnCard() const;
|
||||
void dealRiverCard() const;
|
||||
void dealHoleCards();
|
||||
void dealFlopCards();
|
||||
void dealTurnCard();
|
||||
void dealRiverCard();
|
||||
|
||||
void highlightRoundLabel(std::string round) const;
|
||||
|
||||
void nextPlayerAnimation() const;
|
||||
void nextPlayerAnimation();
|
||||
|
||||
void preflopAnimation1() const;
|
||||
void preflopAnimation2() const;
|
||||
void preflopAnimation1();
|
||||
void preflopAnimation2();
|
||||
|
||||
void flopAnimation1() const;
|
||||
void flopAnimation2() const;
|
||||
void flopAnimation1();
|
||||
void flopAnimation2();
|
||||
|
||||
void turnAnimation1() const;
|
||||
void turnAnimation2() const;
|
||||
void turnAnimation1();
|
||||
void turnAnimation2();
|
||||
|
||||
void riverAnimation1() const;
|
||||
void riverAnimation2() const;
|
||||
void riverAnimation1();
|
||||
void riverAnimation2();
|
||||
|
||||
void postRiverAnimation1() const;
|
||||
void postRiverRunAnimation1() const;
|
||||
void postRiverAnimation1();
|
||||
void postRiverRunAnimation1();
|
||||
|
||||
void flipHolecardsAllIn() const;
|
||||
void flipHolecardsAllIn();
|
||||
|
||||
void nextRoundCleanGui() const;
|
||||
void nextRoundCleanGui();
|
||||
|
||||
void meInAction() const;
|
||||
void meInAction();
|
||||
|
||||
void logPlayerActionMsg(std::string playerName, int action, int setValue) ;
|
||||
void logNewGameHandMsg(int gameID, int handID) ;
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#include "log.h"
|
||||
#include "configfile.h"
|
||||
#include <generic/serverguiwrapper.h>
|
||||
|
||||
#include <net/socket_msg.h>
|
||||
|
||||
@@ -594,7 +595,8 @@ void mainWindowImpl::startNewLocalGame(newGameDialogImpl *v) {
|
||||
|
||||
// Start new local game - terminate existing network game.
|
||||
mySession->terminateNetworkClient();
|
||||
mySession->terminateNetworkServer();
|
||||
if (myServerGuiInterface.get())
|
||||
myServerGuiInterface->getSession().terminateNetworkServer();
|
||||
|
||||
//get values from local game dialog
|
||||
GameData gameData;
|
||||
@@ -630,8 +632,19 @@ void mainWindowImpl::callCreateNetworkGameDialog() {
|
||||
//
|
||||
if (myCreateNetworkGameDialog->result() == QDialog::Accepted ) {
|
||||
|
||||
if (!myServerGuiInterface.get())
|
||||
{
|
||||
// Create pseudo Gui Wrapper for the server.
|
||||
myServerGuiInterface.reset(new ServerGuiWrapper(myConfig, mySession->getGui(), mySession->getGui()));
|
||||
{
|
||||
boost::shared_ptr<Session> session(new Session(myServerGuiInterface.get(), myConfig));
|
||||
myServerGuiInterface->setSession(session);
|
||||
}
|
||||
}
|
||||
|
||||
// Terminate existing network games.
|
||||
mySession->terminateNetworkClient();
|
||||
mySession->terminateNetworkServer();
|
||||
myServerGuiInterface->getSession().terminateNetworkServer();
|
||||
|
||||
GameData gameData;
|
||||
gameData.numberOfPlayers = myCreateNetworkGameDialog->spinBox_quantityPlayers->value();
|
||||
@@ -641,8 +654,8 @@ void mainWindowImpl::callCreateNetworkGameDialog() {
|
||||
gameData.guiSpeed = myCreateNetworkGameDialog->spinBox_gameSpeed->value();
|
||||
|
||||
myStartNetworkGameDialog->treeWidget->clear();
|
||||
|
||||
mySession->startNetworkServer(gameData);
|
||||
|
||||
myServerGuiInterface->getSession().startNetworkServer(gameData);
|
||||
mySession->startNetworkClientForLocalServer();
|
||||
|
||||
myStartNetworkGameDialog->exec();
|
||||
@@ -650,11 +663,11 @@ void mainWindowImpl::callCreateNetworkGameDialog() {
|
||||
|
||||
|
||||
if (myStartNetworkGameDialog->result() == QDialog::Accepted ) {
|
||||
mySession->initiateNetworkServerGame();
|
||||
myServerGuiInterface->getSession().initiateNetworkServerGame();
|
||||
}
|
||||
else {
|
||||
mySession->terminateNetworkClient();
|
||||
mySession->terminateNetworkServer();
|
||||
myServerGuiInterface->getSession().terminateNetworkServer();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -667,7 +680,8 @@ void mainWindowImpl::callJoinNetworkGameDialog() {
|
||||
if (myJoinNetworkGameDialog->result() == QDialog::Accepted ) {
|
||||
|
||||
mySession->terminateNetworkClient();
|
||||
mySession->terminateNetworkServer();
|
||||
if (myServerGuiInterface.get())
|
||||
myServerGuiInterface->getSession().terminateNetworkServer();
|
||||
|
||||
myWaitingForServerGameDialog->treeWidget->clear();
|
||||
// Maybe use QUrl::toPunycode.
|
||||
|
||||
@@ -35,6 +35,7 @@ class Log;
|
||||
class ConfigFile;
|
||||
class Session;
|
||||
|
||||
class GuiInterface;
|
||||
class BoardInterface;
|
||||
// class HandInterface;
|
||||
class PlayerInterface;
|
||||
@@ -199,7 +200,8 @@ public slots:
|
||||
void networkStart(int, int, int, int);
|
||||
|
||||
private:
|
||||
|
||||
|
||||
boost::shared_ptr<GuiInterface> myServerGuiInterface;
|
||||
boost::shared_ptr<Session> mySession;
|
||||
Log *myLog;
|
||||
ConfigFile *myConfig;
|
||||
|
||||
Reference in New Issue
Block a user