2011-07-02 23:03:18 +00:00
|
|
|
/*****************************************************************************
|
|
|
|
|
* PokerTH - The open source texas holdem engine *
|
|
|
|
|
* Copyright (C) 2006-2011 Felix Hammer, Florian Thauer, Lothar May *
|
|
|
|
|
* *
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
|
* it under the terms of the GNU Affero General Public License as *
|
|
|
|
|
* published by the Free Software Foundation, either version 3 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 Affero General Public License for more details. *
|
|
|
|
|
* *
|
|
|
|
|
* You should have received a copy of the GNU Affero General Public License *
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
2011-07-03 19:45:08 +00:00
|
|
|
*****************************************************************************/
|
|
|
|
|
#ifndef GUILOG_H
|
2010-12-13 22:09:48 +00:00
|
|
|
#define GUILOG_H
|
|
|
|
|
|
|
|
|
|
#include <fstream>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <sstream>
|
|
|
|
|
|
|
|
|
|
#include "configfile.h"
|
|
|
|
|
#include <sqlite3.h>
|
|
|
|
|
|
|
|
|
|
#include <QtCore>
|
|
|
|
|
#include <QtSql>
|
|
|
|
|
|
|
|
|
|
class gameTableImpl;
|
|
|
|
|
class GameTableStyleReader;
|
|
|
|
|
|
|
|
|
|
class guiLog : public QObject
|
|
|
|
|
{
|
2011-02-11 20:02:08 +00:00
|
|
|
Q_OBJECT
|
2010-12-13 22:09:48 +00:00
|
|
|
|
|
|
|
|
public:
|
2011-02-11 20:02:08 +00:00
|
|
|
guiLog(gameTableImpl*, ConfigFile *c);
|
2010-12-13 22:09:48 +00:00
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
~guiLog();
|
2010-12-13 22:09:48 +00:00
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
2011-02-27 16:34:39 +00:00
|
|
|
void logPlayerActionMsg(QString playerName, int action, int setValue);
|
2010-12-13 22:09:48 +00:00
|
|
|
void logNewGameHandMsg(int gameID, int handID);
|
|
|
|
|
void logNewBlindsSetsMsg(int sbSet, int bbSet, QString sbName, QString bbName);
|
|
|
|
|
void logPlayerWinsMsg(QString playerName, int pot, bool main);
|
|
|
|
|
void logPlayerSitsOut(QString playerName);
|
|
|
|
|
void logDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int card4 = -1, int card5 = -1);
|
2011-02-27 16:34:39 +00:00
|
|
|
void logFlipHoleCardsMsg(QString playerName, int card1, int card2, int cardsValueInt = -1, QString showHas = "shows");
|
2010-12-13 22:09:48 +00:00
|
|
|
void logPlayerLeftMsg(QString playerName, int wasKicked);
|
2011-11-01 00:02:12 +00:00
|
|
|
void logPlayerJoinedMsg(QString playerName);
|
2010-12-13 22:09:48 +00:00
|
|
|
void logNewGameAdminMsg(QString playerName);
|
|
|
|
|
void logPlayerWinGame(QString playerName, int gameID);
|
|
|
|
|
void flushLogAtGame(int gameID);
|
|
|
|
|
void flushLogAtHand();
|
2011-11-25 21:51:27 +00:00
|
|
|
void exportLogPdbToHtml(std::string fileString);
|
|
|
|
|
void exportLogPdbToTxt(std::string fileString);
|
|
|
|
|
void showLog(std::string fileString);
|
2010-12-13 22:09:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
QStringList translateCardCode(int cardCode);
|
|
|
|
|
|
|
|
|
|
void writeLogFileStream(QString string);
|
|
|
|
|
|
|
|
|
|
signals:
|
2011-02-27 16:34:39 +00:00
|
|
|
void signalLogPlayerActionMsg(QString playerName, int action, int setValue);
|
2010-12-13 22:09:48 +00:00
|
|
|
void signalLogNewGameHandMsg(int gameID, int handID);
|
|
|
|
|
void signalLogNewBlindsSetsMsg(int sbSet, int bbSet, QString sbName, QString bbName);
|
|
|
|
|
void signalLogPlayerWinsMsg(QString playerName, int pot, bool main);
|
|
|
|
|
void signalLogPlayerSitsOut(QString playerName);
|
|
|
|
|
void signalLogDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int card4 = -1, int card5 = -1);
|
2011-02-27 16:34:39 +00:00
|
|
|
void signalLogFlipHoleCardsMsg(QString playerName, int card1, int card2, int cardsValueInt = -1, QString showHas = "shows");
|
2010-12-13 22:09:48 +00:00
|
|
|
void signalLogPlayerLeftMsg(QString playerName, int wasKicked);
|
2011-11-01 00:02:12 +00:00
|
|
|
void signalLogPlayerJoinedMsg(QString playerName);
|
2010-12-13 22:09:48 +00:00
|
|
|
void signalLogNewGameAdminMsg(QString playerName);
|
|
|
|
|
void signalLogPlayerWinGame(QString playerName, int gameID);
|
|
|
|
|
void signalFlushLogAtGame(int gameID);
|
|
|
|
|
void signalFlushLogAtHand();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int lastGameID;
|
|
|
|
|
|
|
|
|
|
gameTableImpl *myW;
|
|
|
|
|
ConfigFile *myConfig;
|
|
|
|
|
QTextStream stream;
|
|
|
|
|
QDir *myLogDir;
|
2011-02-11 20:02:08 +00:00
|
|
|
QFile *myHtmlLogFile;
|
2010-12-13 22:09:48 +00:00
|
|
|
QString logFileStreamString;
|
|
|
|
|
QString myAppDataPath;
|
|
|
|
|
|
|
|
|
|
GameTableStyleReader *myStyle;
|
|
|
|
|
|
2011-02-11 20:02:08 +00:00
|
|
|
friend class GuiWrapper;
|
2010-12-13 22:09:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|