sqlite-logging: include log in pokerth_lib; new function for game-logging
This commit is contained in:
+3
-1
@@ -125,7 +125,8 @@ HEADERS += \
|
|||||||
src/engine/local_engine/tools.h \
|
src/engine/local_engine/tools.h \
|
||||||
src/engine/local_engine/localbero.h \
|
src/engine/local_engine/localbero.h \
|
||||||
src/engine/local_engine/localexception.h \
|
src/engine/local_engine/localexception.h \
|
||||||
src/engine/local_engine/arraydata.h \
|
src/engine/local_engine/arraydata.h \
|
||||||
|
src/engine/local_engine/log.h \
|
||||||
src/engine/network_engine/clientboard.h \
|
src/engine/network_engine/clientboard.h \
|
||||||
src/engine/network_engine/clientenginefactory.h \
|
src/engine/network_engine/clientenginefactory.h \
|
||||||
src/engine/network_engine/clienthand.h \
|
src/engine/network_engine/clienthand.h \
|
||||||
@@ -173,6 +174,7 @@ SOURCES += \
|
|||||||
src/engine/local_engine/localbero.cpp \
|
src/engine/local_engine/localbero.cpp \
|
||||||
src/engine/local_engine/localexception.cpp \
|
src/engine/local_engine/localexception.cpp \
|
||||||
src/engine/local_engine/arraydata.cpp \
|
src/engine/local_engine/arraydata.cpp \
|
||||||
|
src/engine/local_engine/log.cpp \
|
||||||
src/engine/network_engine/clientboard.cpp \
|
src/engine/network_engine/clientboard.cpp \
|
||||||
src/engine/network_engine/clientenginefactory.cpp \
|
src/engine/network_engine/clientenginefactory.cpp \
|
||||||
src/engine/network_engine/clienthand.cpp \
|
src/engine/network_engine/clienthand.cpp \
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "configfile.h"
|
#include "configfile.h"
|
||||||
#include "game_defs.h"
|
#include "game_defs.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "playerinterface.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
|||||||
@@ -20,10 +20,16 @@
|
|||||||
#ifndef LOG_H
|
#ifndef LOG_H
|
||||||
#define LOG_H
|
#define LOG_H
|
||||||
|
|
||||||
#include "playerinterface.h"
|
#include <boost/shared_ptr.hpp>
|
||||||
|
#include <list>
|
||||||
|
|
||||||
struct sqlite3;
|
struct sqlite3;
|
||||||
class ConfigFile;
|
class ConfigFile;
|
||||||
|
class PlayerInterface;
|
||||||
|
|
||||||
|
typedef boost::shared_ptr<std::list<boost::shared_ptr<PlayerInterface> > > PlayerList;
|
||||||
|
typedef std::list<boost::shared_ptr<PlayerInterface> >::iterator PlayerListIterator;
|
||||||
|
typedef std::list<boost::shared_ptr<PlayerInterface> >::const_iterator PlayerListConstIterator;
|
||||||
|
|
||||||
class Log
|
class Log
|
||||||
{
|
{
|
||||||
@@ -33,7 +39,7 @@ public:
|
|||||||
|
|
||||||
~Log();
|
~Log();
|
||||||
|
|
||||||
void logNewGameMsg(int, int, int, unsigned, PlayerList);
|
void logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned dealerPosition, PlayerList seatsList);
|
||||||
// void closeLogDbAtExit();
|
// void closeLogDbAtExit();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+2
-1
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include <enginefactory.h>
|
#include <enginefactory.h>
|
||||||
#include <guiinterface.h>
|
#include <guiinterface.h>
|
||||||
|
#include "log.h"
|
||||||
|
|
||||||
#include "localexception.h"
|
#include "localexception.h"
|
||||||
#include "engine_msg.h"
|
#include "engine_msg.h"
|
||||||
@@ -109,7 +110,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
|
|||||||
currentBoard->setPlayerLists(seatsList, activePlayerList, runningPlayerList);
|
currentBoard->setPlayerLists(seatsList, activePlayerList, runningPlayerList);
|
||||||
|
|
||||||
// log game data
|
// log game data
|
||||||
// myLog->logNewGameMsg(myGameID, startCash, startSmallBlind, dealerPosition, seatsList);
|
myLog->logNewGameMsg(myGameID, startCash, startSmallBlind, dealerPosition, seatsList);
|
||||||
|
|
||||||
//start timer
|
//start timer
|
||||||
blindsTimer.reset();
|
blindsTimer.reset();
|
||||||
|
|||||||
@@ -23,7 +23,6 @@
|
|||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include "gamedata.h"
|
#include "gamedata.h"
|
||||||
#include "playerdata.h"
|
#include "playerdata.h"
|
||||||
#include "log.h"
|
|
||||||
|
|
||||||
#include <third_party/boost/timers.hpp>
|
#include <third_party/boost/timers.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ Session::Session(GuiInterface *g, ConfigFile *c)
|
|||||||
: currentGameNum(0), myGui(g), myConfig(c), myLog(0), myGameType(GAME_TYPE_NONE)
|
: currentGameNum(0), myGui(g), myConfig(c), myLog(0), myGameType(GAME_TYPE_NONE)
|
||||||
{
|
{
|
||||||
myQtToolsInterface = CreateQtToolsWrapper();
|
myQtToolsInterface = CreateQtToolsWrapper();
|
||||||
|
myLog = new Log(myConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user