Restructured network server.
This commit is contained in:
@@ -1,121 +0,0 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007 by Lothar May *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "genericservergui.h"
|
||||
#include <session.h>
|
||||
#include <game.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
GenericServerGui::GenericServerGui(ConfigFile *config)
|
||||
: myConfig(config)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
GenericServerGui::~GenericServerGui()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::initGui(int speed)
|
||||
{
|
||||
}
|
||||
|
||||
Session &GenericServerGui::getSession()
|
||||
{
|
||||
assert(mySession.get());
|
||||
return *mySession;
|
||||
}
|
||||
|
||||
void GenericServerGui::setSession(boost::shared_ptr<Session> session)
|
||||
{
|
||||
mySession = session;
|
||||
}
|
||||
|
||||
void GenericServerGui::waitForNetworkAction(GameState state, unsigned uniquePlayerId)
|
||||
{
|
||||
getSession().waitForNetworkServerAction(state, uniquePlayerId);
|
||||
}
|
||||
|
||||
|
||||
void GenericServerGui::dealHoleCards()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::dealFlopCards()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::dealTurnCard()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::dealRiverCard()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::nextPlayerAnimation()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::preflopAnimation1()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::preflopAnimation2()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::flopAnimation1()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::flopAnimation2()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::turnAnimation1()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::turnAnimation2()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::riverAnimation1()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::riverAnimation2()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::postRiverAnimation1()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::postRiverRunAnimation1()
|
||||
{
|
||||
}
|
||||
|
||||
void GenericServerGui::flipHolecardsAllIn()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007 by Lothar May *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
#ifndef GENERICSERVERGUI_H
|
||||
#define GENERICSERVERGUI_H
|
||||
|
||||
#include <game_defs.h>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
class Session;
|
||||
class ConfigFile;
|
||||
|
||||
class GenericServerGui
|
||||
{
|
||||
public:
|
||||
GenericServerGui(ConfigFile *config);
|
||||
|
||||
~GenericServerGui();
|
||||
|
||||
void initGui(int speed);
|
||||
|
||||
Session &getSession();
|
||||
void setSession(boost::shared_ptr<Session> session);
|
||||
|
||||
void waitForNetworkAction(GameState state, unsigned uniquePlayerId);
|
||||
|
||||
void dealHoleCards();
|
||||
void dealFlopCards();
|
||||
void dealTurnCard();
|
||||
void dealRiverCard();
|
||||
|
||||
void nextPlayerAnimation();
|
||||
|
||||
void preflopAnimation1();
|
||||
void preflopAnimation2();
|
||||
|
||||
void flopAnimation1();
|
||||
void flopAnimation2();
|
||||
|
||||
void turnAnimation1();
|
||||
void turnAnimation2();
|
||||
|
||||
void riverAnimation1();
|
||||
void riverAnimation2();
|
||||
|
||||
void postRiverAnimation1();
|
||||
void postRiverRunAnimation1();
|
||||
|
||||
void flipHolecardsAllIn();
|
||||
|
||||
private:
|
||||
|
||||
boost::shared_ptr<Session> mySession;
|
||||
ConfigFile *myConfig;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -18,16 +18,15 @@
|
||||
***************************************************************************/
|
||||
|
||||
#include "serverguiwrapper.h"
|
||||
#include "genericservergui.h"
|
||||
#include <session.h>
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
ServerGuiWrapper::ServerGuiWrapper(ConfigFile *config, ClientCallback *clientcb, ServerCallback *servercb)
|
||||
: myClientcb(clientcb), myServercb(servercb)
|
||||
: myConfig(config), myClientcb(clientcb), myServercb(servercb)
|
||||
{
|
||||
myGui.reset(new GenericServerGui(config));
|
||||
}
|
||||
|
||||
ServerGuiWrapper::~ServerGuiWrapper()
|
||||
@@ -38,26 +37,13 @@ void ServerGuiWrapper::initGui(int speed) {}
|
||||
|
||||
Session &ServerGuiWrapper::getSession()
|
||||
{
|
||||
return myGui->getSession();
|
||||
assert(mySession.get());
|
||||
return *mySession;
|
||||
}
|
||||
|
||||
void ServerGuiWrapper::setSession(boost::shared_ptr<Session> session)
|
||||
{
|
||||
myGui->setSession(session);
|
||||
}
|
||||
|
||||
bool
|
||||
ServerGuiWrapper::isNetworkServer() const
|
||||
{
|
||||
/* TODO hack */
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
ServerGuiWrapper::waitForNetworkAction(GameState state, unsigned uniquePlayerId)
|
||||
{
|
||||
/* TODO hack */
|
||||
myGui->waitForNetworkAction(state, uniquePlayerId);
|
||||
mySession = session;
|
||||
}
|
||||
|
||||
void ServerGuiWrapper::refreshSet() const {}
|
||||
@@ -74,32 +60,32 @@ void ServerGuiWrapper::refreshPot() const {}
|
||||
void ServerGuiWrapper::refreshGroupbox(int playerID, int status) const {}
|
||||
void ServerGuiWrapper::refreshPlayerName() const {}
|
||||
|
||||
void ServerGuiWrapper::dealHoleCards() { myGui->dealHoleCards(); }
|
||||
void ServerGuiWrapper::dealFlopCards() { myGui->dealFlopCards(); }
|
||||
void ServerGuiWrapper::dealTurnCard() { myGui->dealTurnCard(); }
|
||||
void ServerGuiWrapper::dealRiverCard() { myGui->dealRiverCard(); }
|
||||
void ServerGuiWrapper::dealHoleCards() {}
|
||||
void ServerGuiWrapper::dealFlopCards() {}
|
||||
void ServerGuiWrapper::dealTurnCard() {}
|
||||
void ServerGuiWrapper::dealRiverCard() {}
|
||||
|
||||
void ServerGuiWrapper::highlightRoundLabel(string round) const {}
|
||||
|
||||
|
||||
void ServerGuiWrapper::nextPlayerAnimation() { myGui->nextPlayerAnimation(); }
|
||||
void ServerGuiWrapper::nextPlayerAnimation() {}
|
||||
|
||||
void ServerGuiWrapper::preflopAnimation1() { myGui->preflopAnimation1(); }
|
||||
void ServerGuiWrapper::preflopAnimation2() { myGui->preflopAnimation2(); }
|
||||
void ServerGuiWrapper::preflopAnimation1() {}
|
||||
void ServerGuiWrapper::preflopAnimation2() {}
|
||||
|
||||
void ServerGuiWrapper::flopAnimation1() { myGui->flopAnimation1(); }
|
||||
void ServerGuiWrapper::flopAnimation2() { myGui->flopAnimation2(); }
|
||||
void ServerGuiWrapper::flopAnimation1() {}
|
||||
void ServerGuiWrapper::flopAnimation2() {}
|
||||
|
||||
void ServerGuiWrapper::turnAnimation1() { myGui->turnAnimation1(); }
|
||||
void ServerGuiWrapper::turnAnimation2() { myGui->turnAnimation2(); }
|
||||
void ServerGuiWrapper::turnAnimation1() {}
|
||||
void ServerGuiWrapper::turnAnimation2() {}
|
||||
|
||||
void ServerGuiWrapper::riverAnimation1() { myGui->riverAnimation1(); }
|
||||
void ServerGuiWrapper::riverAnimation2() { myGui->riverAnimation2(); }
|
||||
void ServerGuiWrapper::riverAnimation1() {}
|
||||
void ServerGuiWrapper::riverAnimation2() {}
|
||||
|
||||
void ServerGuiWrapper::postRiverAnimation1() { myGui->postRiverAnimation1(); }
|
||||
void ServerGuiWrapper::postRiverRunAnimation1() { myGui->postRiverRunAnimation1(); }
|
||||
void ServerGuiWrapper::postRiverAnimation1() {}
|
||||
void ServerGuiWrapper::postRiverRunAnimation1() {}
|
||||
|
||||
void ServerGuiWrapper::flipHolecardsAllIn() { myGui->flipHolecardsAllIn(); }
|
||||
void ServerGuiWrapper::flipHolecardsAllIn() {}
|
||||
|
||||
void ServerGuiWrapper::nextRoundCleanGui() {}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include <guiinterface.h>
|
||||
|
||||
class ConfigFile;
|
||||
class GenericServerGui;
|
||||
class Session;
|
||||
|
||||
class ServerGuiWrapper : public GuiInterface
|
||||
{
|
||||
@@ -35,9 +35,6 @@ public:
|
||||
Session &getSession();
|
||||
void setSession(boost::shared_ptr<Session> session);
|
||||
|
||||
bool isNetworkServer() const;
|
||||
void waitForNetworkAction(GameState state, unsigned uniquePlayerId);
|
||||
|
||||
void refreshSet() const;
|
||||
void refreshCash() const;
|
||||
void refreshAction(int =-1, int =-1) const;
|
||||
@@ -95,7 +92,9 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
boost::shared_ptr<GenericServerGui> myGui;
|
||||
boost::shared_ptr<Session> mySession;
|
||||
ConfigFile *myConfig;
|
||||
|
||||
ClientCallback *myClientcb;
|
||||
ServerCallback *myServercb;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user