comment the sqlite-log
This commit is contained in:
+219
-219
@@ -63,7 +63,7 @@ Log::Log(gameTableImpl* w, ConfigFile *c) : myW(w), myConfig(c), myLogDir(0), my
|
|||||||
myLogDir = new QDir(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str()));
|
myLogDir = new QDir(QString::fromUtf8(myConfig->readConfigString("LogDir").c_str()));
|
||||||
QDateTime currentTime = QDateTime::currentDateTime();
|
QDateTime currentTime = QDateTime::currentDateTime();
|
||||||
myHtmlLogFile = new QFile(myLogDir->absolutePath()+"/pokerth-log-"+currentTime.toString("yyyy-MM-dd_hh.mm.ss")+".html");
|
myHtmlLogFile = new QFile(myLogDir->absolutePath()+"/pokerth-log-"+currentTime.toString("yyyy-MM-dd_hh.mm.ss")+".html");
|
||||||
mySqliteLogDb = new QSqlDatabase;
|
// mySqliteLogDb = new QSqlDatabase;
|
||||||
|
|
||||||
//Logo-Pixmap extrahieren
|
//Logo-Pixmap extrahieren
|
||||||
QPixmap logoChipPixmapFile(":/gfx/logoChip3D.png");
|
QPixmap logoChipPixmapFile(":/gfx/logoChip3D.png");
|
||||||
@@ -84,84 +84,84 @@ Log::Log(gameTableImpl* w, ConfigFile *c) : myW(w), myConfig(c), myLogDir(0), my
|
|||||||
myHtmlLogFile->close();
|
myHtmlLogFile->close();
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
// lege sqlite-Datenbank
|
// // lege sqlite-Datenbank
|
||||||
*mySqliteLogDb = QSqlDatabase::addDatabase("QSQLITE");
|
// *mySqliteLogDb = QSqlDatabase::addDatabase("QSQLITE");
|
||||||
mySqliteLogDb->setDatabaseName(myLogDir->absolutePath()+"/pokerth-log-"+currentTime.toString("yyyy-MM-dd_hh.mm.ss")+".pdb");
|
// mySqliteLogDb->setDatabaseName(myLogDir->absolutePath()+"/pokerth-log-"+currentTime.toString("yyyy-MM-dd_hh.mm.ss")+".pdb");
|
||||||
if(mySqliteLogDb->open()) {
|
// if(mySqliteLogDb->open()) {
|
||||||
|
//
|
||||||
QSqlQuery query(*mySqliteLogDb);
|
// QSqlQuery query(*mySqliteLogDb);
|
||||||
QString sql;
|
// QString sql;
|
||||||
|
//
|
||||||
// Session-Tabelle
|
// // Session-Tabelle
|
||||||
sql = "CREATE TABLE Session (";
|
// sql = "CREATE TABLE Session (";
|
||||||
sql += "PokerTH_Version TEXT,";
|
// sql += "PokerTH_Version TEXT,";
|
||||||
sql += "Date TEXT,";
|
// sql += "Date TEXT,";
|
||||||
sql += "Time TEXT,";
|
// sql += "Time TEXT,";
|
||||||
sql += "PRIMARY KEY(Date,Time))";
|
// sql += "PRIMARY KEY(Date,Time))";
|
||||||
if(!query.exec(sql)) {
|
// if(!query.exec(sql)) {
|
||||||
QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
// QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
||||||
}
|
// }
|
||||||
sql = "INSERT INTO Session (PokerTH_Version,Date,Time) VALUES (";
|
// sql = "INSERT INTO Session (PokerTH_Version,Date,Time) VALUES (";
|
||||||
sql += "'"+QString("%1").arg(POKERTH_BETA_RELEASE_STRING)+"',";
|
// sql += "'"+QString("%1").arg(POKERTH_BETA_RELEASE_STRING)+"',";
|
||||||
sql += "'"+currentTime.toString("yyyy-MM-dd")+"',";
|
// sql += "'"+currentTime.toString("yyyy-MM-dd")+"',";
|
||||||
sql += "'"+currentTime.toString("hh:mm:ss")+"')";
|
// sql += "'"+currentTime.toString("hh:mm:ss")+"')";
|
||||||
if(!query.exec(sql)) {
|
// if(!query.exec(sql)) {
|
||||||
QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
// QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// Game-Tabelle
|
// // Game-Tabelle
|
||||||
sql = "CREATE TABLE Game (";
|
// sql = "CREATE TABLE Game (";
|
||||||
sql += "GameID INTEGER NOT NULL PRIMARY KEY,";
|
// sql += "GameID INTEGER NOT NULL PRIMARY KEY,";
|
||||||
sql += "Startmoney INTEGER NOT NULL,";
|
// sql += "Startmoney INTEGER NOT NULL,";
|
||||||
sql += "StartSb INTEGER NOT NULL,";
|
// sql += "StartSb INTEGER NOT NULL,";
|
||||||
sql += "DealerPos INTEGER NOT NULL";
|
// sql += "DealerPos INTEGER NOT NULL";
|
||||||
for(i=1; i<=MAX_NUMBER_OF_PLAYERS; i++) {
|
// for(i=1; i<=MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
sql += ",Seat_" + QString("%1").arg(i);
|
// sql += ",Seat_" + QString("%1").arg(i);
|
||||||
}
|
// }
|
||||||
sql += ",Winner_Seat INTEGER)";
|
// sql += ",Winner_Seat INTEGER)";
|
||||||
if(!query.exec(sql)) {
|
// if(!query.exec(sql)) {
|
||||||
QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
// QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// Hand-Tabelle
|
// // Hand-Tabelle
|
||||||
sql = "CREATE TABLE Hand (";
|
// sql = "CREATE TABLE Hand (";
|
||||||
sql += "HandID INTEGER NOT NULL,";
|
// sql += "HandID INTEGER NOT NULL,";
|
||||||
sql += "GameID INTEGER NOT NULL,";
|
// sql += "GameID INTEGER NOT NULL,";
|
||||||
sql += "Sb_Amount INTEGER,";
|
// sql += "Sb_Amount INTEGER,";
|
||||||
sql += "Sb_Seat INTEGER,";
|
// sql += "Sb_Seat INTEGER,";
|
||||||
sql += "Bb_Amount INTEGER,";
|
// sql += "Bb_Amount INTEGER,";
|
||||||
sql += "Bb_Seat INTEGER,";
|
// sql += "Bb_Seat INTEGER,";
|
||||||
sql += "Dealer_Seat INTEGER,";
|
// sql += "Dealer_Seat INTEGER,";
|
||||||
for(i=1; i<=MAX_NUMBER_OF_PLAYERS; i++) {
|
// for(i=1; i<=MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
sql += "Seat_" + QString("%1").arg(i) + "_Cash INTEGER,";
|
// sql += "Seat_" + QString("%1").arg(i) + "_Cash INTEGER,";
|
||||||
sql += "Seat_" + QString("%1").arg(i) + "_Card_1 INTEGER,";
|
// sql += "Seat_" + QString("%1").arg(i) + "_Card_1 INTEGER,";
|
||||||
sql += "Seat_" + QString("%1").arg(i) + "_Card_2 INTEGER,";
|
// sql += "Seat_" + QString("%1").arg(i) + "_Card_2 INTEGER,";
|
||||||
sql += "Seat_" + QString("%1").arg(i) + "_Hand TEXT,";
|
// sql += "Seat_" + QString("%1").arg(i) + "_Hand TEXT,";
|
||||||
}
|
// }
|
||||||
for(i=1; i<=5; i++) {
|
// for(i=1; i<=5; i++) {
|
||||||
sql += "BoardCard_" + QString("%1").arg(i) + " INTEGER,";
|
// sql += "BoardCard_" + QString("%1").arg(i) + " INTEGER,";
|
||||||
}
|
// }
|
||||||
sql += "PRIMARY KEY(HandID,GameID))";
|
// sql += "PRIMARY KEY(HandID,GameID))";
|
||||||
if(!query.exec(sql)) {
|
// if(!query.exec(sql)) {
|
||||||
QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
// QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
// Action-Tabelle
|
// // Action-Tabelle
|
||||||
sql = "CREATE TABLE Action (";
|
// sql = "CREATE TABLE Action (";
|
||||||
sql += "ActionID INTEGER PRIMARY KEY AUTOINCREMENT,";
|
// sql += "ActionID INTEGER PRIMARY KEY AUTOINCREMENT,";
|
||||||
sql += "HandID INTEGER NOT NULL,";
|
// sql += "HandID INTEGER NOT NULL,";
|
||||||
sql += "GameID INTEGER NOT NULL,";
|
// sql += "GameID INTEGER NOT NULL,";
|
||||||
sql += "BeRo INTEGER NOT NULL,";
|
// sql += "BeRo INTEGER NOT NULL,";
|
||||||
sql += "Player INTEGER NOT NULL,";
|
// sql += "Player INTEGER NOT NULL,";
|
||||||
sql += "Action INTEGER NOT NULL,";
|
// sql += "Action INTEGER NOT NULL,";
|
||||||
sql += "Amount INTEGER)";
|
// sql += "Amount INTEGER)";
|
||||||
if(!query.exec(sql)) {
|
// if(!query.exec(sql)) {
|
||||||
QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
// QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
} else {
|
// } else {
|
||||||
QMessageBox::critical(0, tr("ERROR"),mySqliteLogDb->lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
// QMessageBox::critical(0, tr("ERROR"),mySqliteLogDb->lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
||||||
}
|
// }
|
||||||
|
|
||||||
//Zu alte Dateien löschen!!!
|
//Zu alte Dateien löschen!!!
|
||||||
int daysUntilWaste = myConfig->readConfigInt("LogStoreDuration");
|
int daysUntilWaste = myConfig->readConfigInt("LogStoreDuration");
|
||||||
@@ -201,16 +201,16 @@ Log::~Log()
|
|||||||
{
|
{
|
||||||
delete myLogDir;
|
delete myLogDir;
|
||||||
delete myHtmlLogFile;
|
delete myHtmlLogFile;
|
||||||
delete mySqliteLogDb;
|
// delete mySqliteLogDb;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Log::closeLogDbAtExit()
|
void Log::closeLogDbAtExit()
|
||||||
{
|
{
|
||||||
// Datenbank schließen
|
// Datenbank schließen
|
||||||
mySqliteLogDb->close();
|
// mySqliteLogDb->close();
|
||||||
delete mySqliteLogDb;
|
// delete mySqliteLogDb;
|
||||||
mySqliteLogDb = NULL;
|
// mySqliteLogDb = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Log::logPlayerActionMsg(QString msg, int playerID, int action, int setValue) {
|
void Log::logPlayerActionMsg(QString msg, int playerID, int action, int setValue) {
|
||||||
@@ -245,25 +245,25 @@ void Log::logPlayerActionMsg(QString msg, int playerID, int action, int setValue
|
|||||||
logFileStreamString = "";
|
logFileStreamString = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mySqliteLogDb->isOpen()) {
|
// if(mySqliteLogDb->isOpen()) {
|
||||||
|
//
|
||||||
QSqlQuery query(*mySqliteLogDb);
|
// QSqlQuery query(*mySqliteLogDb);
|
||||||
QString sql;
|
// QString sql;
|
||||||
|
//
|
||||||
sql = "INSERT INTO Action (HandID,GameID,BeRo,Player,Action,Amount) VALUES (";
|
// sql = "INSERT INTO Action (HandID,GameID,BeRo,Player,Action,Amount) VALUES (";
|
||||||
sql += QString::number(myW->getSession()->getCurrentGame()->getCurrentHandID(),10);
|
// sql += QString::number(myW->getSession()->getCurrentGame()->getCurrentHandID(),10);
|
||||||
sql += "," + QString::number(myW->getSession()->getCurrentGame()->getMyGameID(),10);
|
// sql += "," + QString::number(myW->getSession()->getCurrentGame()->getMyGameID(),10);
|
||||||
sql += "," + QString::number(myW->getSession()->getCurrentGame()->getCurrentHand()->getCurrentBeRo()->getMyBeRoID(),10);
|
// sql += "," + QString::number(myW->getSession()->getCurrentGame()->getCurrentHand()->getCurrentBeRo()->getMyBeRoID(),10);
|
||||||
sql += "," + QString::number(playerID,10);
|
// sql += "," + QString::number(playerID,10);
|
||||||
sql += "," + QString::number(action,10);
|
// sql += "," + QString::number(action,10);
|
||||||
sql += "," + QString::number(setValue,10);
|
// sql += "," + QString::number(setValue,10);
|
||||||
sql += ")";
|
// sql += ")";
|
||||||
|
//
|
||||||
if(!query.exec(sql)) {
|
// if(!query.exec(sql)) {
|
||||||
QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
// QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -283,76 +283,76 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
|||||||
logFileStreamString += "<table><tr><td width=\"600\" align=\"center\"><hr noshade size=\"3\"><b>Game: "+QString::number(gameID,10)+" | Hand: "+QString::number(handID,10)+"</b></td><td></td></tr></table>";
|
logFileStreamString += "<table><tr><td width=\"600\" align=\"center\"><hr noshade size=\"3\"><b>Game: "+QString::number(gameID,10)+" | Hand: "+QString::number(handID,10)+"</b></td><td></td></tr></table>";
|
||||||
logFileStreamString += "BLIND LEVEL: $"+QString::number(currentHand->getSmallBlind())+" / $"+QString::number(currentHand->getSmallBlind()*2)+"</br>";
|
logFileStreamString += "BLIND LEVEL: $"+QString::number(currentHand->getSmallBlind())+" / $"+QString::number(currentHand->getSmallBlind()*2)+"</br>";
|
||||||
|
|
||||||
if(!mySqliteLogDb->open()) {
|
// if(!mySqliteLogDb->open()) {
|
||||||
QMessageBox::critical(0, tr("ERROR"),mySqliteLogDb->lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
// QMessageBox::critical(0, tr("ERROR"),mySqliteLogDb->lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
//
|
||||||
if(mySqliteLogDb->isOpen()) {
|
// if(mySqliteLogDb->isOpen()) {
|
||||||
|
//
|
||||||
QSqlQuery query(*mySqliteLogDb);
|
// QSqlQuery query(*mySqliteLogDb);
|
||||||
QString sql;
|
// QString sql;
|
||||||
|
//
|
||||||
// bei Beginn eines Games
|
// // bei Beginn eines Games
|
||||||
if(handID == 1) {
|
// if(handID == 1) {
|
||||||
sql = "INSERT INTO Game (GameID,Startmoney,StartSb,DealerPos";
|
// sql = "INSERT INTO Game (GameID,Startmoney,StartSb,DealerPos";
|
||||||
for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
// for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
||||||
sql += ",Seat_" + QString::number((*it_c)->getMyID()+1,10);
|
// sql += ",Seat_" + QString::number((*it_c)->getMyID()+1,10);
|
||||||
}
|
|
||||||
// for(i=1;i<=MAX_NUMBER_OF_PLAYERS; i++) {
|
|
||||||
// sql += ",Seat_" + QString::number(i,10);
|
|
||||||
// }
|
// }
|
||||||
sql += ") VALUES (";
|
//// for(i=1;i<=MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
sql += QString::number(gameID,10) + ",";
|
//// sql += ",Seat_" + QString::number(i,10);
|
||||||
sql += QString::number(myW->getSession()->getCurrentGame()->getStartCash(),10) + ",";
|
//// }
|
||||||
sql += QString::number(myW->getSession()->getCurrentGame()->getStartSmallBlind(),10) + ",";
|
// sql += ") VALUES (";
|
||||||
sql += QString::number(myW->getSession()->getCurrentGame()->getDealerPosition(),10);
|
// sql += QString::number(gameID,10) + ",";
|
||||||
for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
// sql += QString::number(myW->getSession()->getCurrentGame()->getStartCash(),10) + ",";
|
||||||
sql += ",'" + QString::fromUtf8((*it_c)->getMyName().c_str()) +"'";
|
// sql += QString::number(myW->getSession()->getCurrentGame()->getStartSmallBlind(),10) + ",";
|
||||||
}
|
// sql += QString::number(myW->getSession()->getCurrentGame()->getDealerPosition(),10);
|
||||||
// for(it_c = currentHand->getSeatsList()->begin();it_c!=currentHand->getSeatsList()->end();it_c++) {
|
// for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
||||||
// if((*it_c)->getMyActiveStatus()) {
|
// sql += ",'" + QString::fromUtf8((*it_c)->getMyName().c_str()) +"'";
|
||||||
// sql += ",'" + QString::fromUtf8((*it_c)->getMyName().c_str()) +"'";
|
|
||||||
// } else {
|
|
||||||
// sql += ",NULL";
|
|
||||||
// }
|
|
||||||
// }
|
// }
|
||||||
sql += ")";
|
//// for(it_c = currentHand->getSeatsList()->begin();it_c!=currentHand->getSeatsList()->end();it_c++) {
|
||||||
if(!query.exec(sql)) {
|
//// if((*it_c)->getMyActiveStatus()) {
|
||||||
QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
//// sql += ",'" + QString::fromUtf8((*it_c)->getMyName().c_str()) +"'";
|
||||||
}
|
//// } else {
|
||||||
}
|
//// sql += ",NULL";
|
||||||
|
//// }
|
||||||
sql = "INSERT INTO Hand (HandID,GameID,Sb_Amount,Bb_Amount";
|
//// }
|
||||||
for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
// sql += ")";
|
||||||
sql += ",Seat_" + QString::number((*it_c)->getMyID()+1,10) + "_Cash";
|
// if(!query.exec(sql)) {
|
||||||
}
|
// QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
||||||
// for(i=1;i<=MAX_NUMBER_OF_PLAYERS; i++) {
|
|
||||||
// sql += ",Seat_" + QString("%1").arg(i) + "_Cash";
|
|
||||||
// }
|
|
||||||
sql += ") VALUES (";
|
|
||||||
sql += QString::number(handID,10);
|
|
||||||
sql += "," + QString::number(gameID,10);
|
|
||||||
sql += "," + QString::number(currentHand->getSmallBlind(),10);
|
|
||||||
sql += "," + QString::number(currentHand->getSmallBlind()*2,10);
|
|
||||||
for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
|
||||||
sql += "," + QString::number((*it_c)->getMyCash()+(*it_c)->getMySet(),10);
|
|
||||||
}
|
|
||||||
// for(it_c = currentHand->getSeatsList()->begin();it_c!=currentHand->getSeatsList()->end();it_c++) {
|
|
||||||
// if((*it_c)->getMyActiveStatus()) {
|
|
||||||
// sql += "," + QString::number((*it_c)->getMyCash()+(*it_c)->getMySet(),10);
|
|
||||||
// } else {
|
|
||||||
// sql += ",NULL";
|
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
sql += ")";
|
//
|
||||||
|
// sql = "INSERT INTO Hand (HandID,GameID,Sb_Amount,Bb_Amount";
|
||||||
if(!query.exec(sql)) {
|
// for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
||||||
QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
// sql += ",Seat_" + QString::number((*it_c)->getMyID()+1,10) + "_Cash";
|
||||||
}
|
// }
|
||||||
|
//// for(i=1;i<=MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
}
|
//// sql += ",Seat_" + QString("%1").arg(i) + "_Cash";
|
||||||
|
//// }
|
||||||
|
// sql += ") VALUES (";
|
||||||
|
// sql += QString::number(handID,10);
|
||||||
|
// sql += "," + QString::number(gameID,10);
|
||||||
|
// sql += "," + QString::number(currentHand->getSmallBlind(),10);
|
||||||
|
// sql += "," + QString::number(currentHand->getSmallBlind()*2,10);
|
||||||
|
// for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
||||||
|
// sql += "," + QString::number((*it_c)->getMyCash()+(*it_c)->getMySet(),10);
|
||||||
|
// }
|
||||||
|
//// for(it_c = currentHand->getSeatsList()->begin();it_c!=currentHand->getSeatsList()->end();it_c++) {
|
||||||
|
//// if((*it_c)->getMyActiveStatus()) {
|
||||||
|
//// sql += "," + QString::number((*it_c)->getMyCash()+(*it_c)->getMySet(),10);
|
||||||
|
//// } else {
|
||||||
|
//// sql += ",NULL";
|
||||||
|
//// }
|
||||||
|
//// }
|
||||||
|
// sql += ")";
|
||||||
|
//
|
||||||
|
// if(!query.exec(sql)) {
|
||||||
|
// QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
|
||||||
//print cash only for active players
|
//print cash only for active players
|
||||||
for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
||||||
@@ -461,47 +461,47 @@ void Log::logDealBoardCardsMsg(int roundID, int card1, int card2, int card3, int
|
|||||||
if(myConfig->readConfigInt("LogOnOff")) {
|
if(myConfig->readConfigInt("LogOnOff")) {
|
||||||
//if write logfiles is enabled
|
//if write logfiles is enabled
|
||||||
|
|
||||||
QString sql;
|
// QString sql;
|
||||||
sql = "UPDATE Hand SET ";
|
// sql = "UPDATE Hand SET ";
|
||||||
|
//
|
||||||
|
switch (roundID) {
|
||||||
|
|
||||||
switch (roundID) {
|
case 1: round = "Flop";
|
||||||
|
logFileStreamString += "</br><b>"+round.toUpper()+"</b> [board cards <b>"+translateCardCode(card1).at(0)+"</b>"+translateCardCode(card1).at(1)+",<b>"+translateCardCode(card2).at(0)+"</b>"+translateCardCode(card2).at(1)+",<b>"+translateCardCode(card3).at(0)+"</b>"+translateCardCode(card3).at(1)+"]"+"</br>\n";
|
||||||
case 1: round = "Flop";
|
// sql += "BoardCard_1 = " + QString::number(card1,10) + ",";
|
||||||
logFileStreamString += "</br><b>"+round.toUpper()+"</b> [board cards <b>"+translateCardCode(card1).at(0)+"</b>"+translateCardCode(card1).at(1)+",<b>"+translateCardCode(card2).at(0)+"</b>"+translateCardCode(card2).at(1)+",<b>"+translateCardCode(card3).at(0)+"</b>"+translateCardCode(card3).at(1)+"]"+"</br>\n";
|
// sql += "BoardCard_2 = " + QString::number(card2,10) + ",";
|
||||||
sql += "BoardCard_1 = " + QString::number(card1,10) + ",";
|
// sql += "BoardCard_3 = " + QString::number(card3,10);
|
||||||
sql += "BoardCard_2 = " + QString::number(card2,10) + ",";
|
break;
|
||||||
sql += "BoardCard_3 = " + QString::number(card3,10);
|
case 2: round = "Turn";
|
||||||
break;
|
logFileStreamString += "</br><b>"+round.toUpper()+"</b> [board cards <b>"+translateCardCode(card1).at(0)+"</b>"+translateCardCode(card1).at(1)+",<b>"+translateCardCode(card2).at(0)+"</b>"+translateCardCode(card2).at(1)+",<b>"+translateCardCode(card3).at(0)+"</b>"+translateCardCode(card3).at(1)+",<b>"+translateCardCode(card4).at(0)+"</b>"+translateCardCode(card4).at(1)+"]"+"</br>\n";
|
||||||
case 2: round = "Turn";
|
// sql += "BoardCard_4 = " + QString::number(card4,10);
|
||||||
logFileStreamString += "</br><b>"+round.toUpper()+"</b> [board cards <b>"+translateCardCode(card1).at(0)+"</b>"+translateCardCode(card1).at(1)+",<b>"+translateCardCode(card2).at(0)+"</b>"+translateCardCode(card2).at(1)+",<b>"+translateCardCode(card3).at(0)+"</b>"+translateCardCode(card3).at(1)+",<b>"+translateCardCode(card4).at(0)+"</b>"+translateCardCode(card4).at(1)+"]"+"</br>\n";
|
break;
|
||||||
sql += "BoardCard_4 = " + QString::number(card4,10);
|
case 3: round = "River";
|
||||||
break;
|
logFileStreamString += "</br><b>"+round.toUpper()+"</b> [board cards <b>"+translateCardCode(card1).at(0)+"</b>"+translateCardCode(card1).at(1)+",<b>"+translateCardCode(card2).at(0)+"</b>"+translateCardCode(card2).at(1)+",<b>"+translateCardCode(card3).at(0)+"</b>"+translateCardCode(card3).at(1)+",<b>"+translateCardCode(card4).at(0)+"</b>"+translateCardCode(card4).at(1)+",<b>"+translateCardCode(card5).at(0)+"</b>"+translateCardCode(card5).at(1)+"]"+"</br>\n";
|
||||||
case 3: round = "River";
|
// sql += "BoardCard_5 = " + QString::number(card5,10);
|
||||||
logFileStreamString += "</br><b>"+round.toUpper()+"</b> [board cards <b>"+translateCardCode(card1).at(0)+"</b>"+translateCardCode(card1).at(1)+",<b>"+translateCardCode(card2).at(0)+"</b>"+translateCardCode(card2).at(1)+",<b>"+translateCardCode(card3).at(0)+"</b>"+translateCardCode(card3).at(1)+",<b>"+translateCardCode(card4).at(0)+"</b>"+translateCardCode(card4).at(1)+",<b>"+translateCardCode(card5).at(0)+"</b>"+translateCardCode(card5).at(1)+"]"+"</br>\n";
|
break;
|
||||||
sql += "BoardCard_5 = " + QString::number(card5,10);
|
default: round = "ERROR";
|
||||||
break;
|
}
|
||||||
default: round = "ERROR";
|
|
||||||
}
|
|
||||||
if(myConfig->readConfigInt("LogInterval") == 0) {
|
if(myConfig->readConfigInt("LogInterval") == 0) {
|
||||||
writeLogFileStream(logFileStreamString);
|
writeLogFileStream(logFileStreamString);
|
||||||
logFileStreamString = "";
|
logFileStreamString = "";
|
||||||
}
|
}
|
||||||
|
//
|
||||||
sql += " WHERE ";
|
// sql += " WHERE ";
|
||||||
sql += "HandID = " + QString::number(myW->getSession()->getCurrentGame()->getCurrentHandID(),10) + " AND ";
|
// sql += "HandID = " + QString::number(myW->getSession()->getCurrentGame()->getCurrentHandID(),10) + " AND ";
|
||||||
sql += "GameID = " + QString::number(myW->getSession()->getCurrentGame()->getMyGameID(),10);
|
// sql += "GameID = " + QString::number(myW->getSession()->getCurrentGame()->getMyGameID(),10);
|
||||||
|
//
|
||||||
if(roundID <= 3) {
|
// if(roundID <= 3) {
|
||||||
if(mySqliteLogDb->isOpen()) {
|
// if(mySqliteLogDb->isOpen()) {
|
||||||
|
//
|
||||||
QSqlQuery query(*mySqliteLogDb);
|
// QSqlQuery query(*mySqliteLogDb);
|
||||||
if(!query.exec(sql)) {
|
// if(!query.exec(sql)) {
|
||||||
QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
// QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -539,22 +539,22 @@ void Log::logFlipHoleCardsMsg(QString playerName, int playerID, int card1, int c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//
|
||||||
QString sql = "UPDATE Hand SET ";
|
// QString sql = "UPDATE Hand SET ";
|
||||||
sql += "Seat_" + QString::number(playerID+1,10) + "_Card_1 = " + QString::number(card1,10) + ",";
|
// sql += "Seat_" + QString::number(playerID+1,10) + "_Card_1 = " + QString::number(card1,10) + ",";
|
||||||
sql += "Seat_" + QString::number(playerID+1,10) + "_Card_2 = " + QString::number(card2,10);
|
// sql += "Seat_" + QString::number(playerID+1,10) + "_Card_2 = " + QString::number(card2,10);
|
||||||
sql += " WHERE ";
|
// sql += " WHERE ";
|
||||||
sql += "HandID = " + QString::number(myW->getSession()->getCurrentGame()->getCurrentHandID(),10) + " AND ";
|
// sql += "HandID = " + QString::number(myW->getSession()->getCurrentGame()->getCurrentHandID(),10) + " AND ";
|
||||||
sql += "GameID = " + QString::number(myW->getSession()->getCurrentGame()->getMyGameID(),10);
|
// sql += "GameID = " + QString::number(myW->getSession()->getCurrentGame()->getMyGameID(),10);
|
||||||
|
//
|
||||||
if(mySqliteLogDb->isOpen()) {
|
// if(mySqliteLogDb->isOpen()) {
|
||||||
|
//
|
||||||
QSqlQuery query(*mySqliteLogDb);
|
// QSqlQuery query(*mySqliteLogDb);
|
||||||
if(!query.exec(sql)) {
|
// if(!query.exec(sql)) {
|
||||||
QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
// QMessageBox::critical(0, tr("ERROR"),query.lastError().text().toUtf8().data(), QMessageBox::Cancel);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user