last bugfixes for sqlite-log; activating sqlite-log for release version 0.9.1

This commit is contained in:
floty
2012-01-09 12:42:04 +00:00
parent ac3cd7b0c2
commit 5769423595
6 changed files with 25 additions and 53 deletions
-1
View File
@@ -319,7 +319,6 @@ Log::logPlayerAction(string playerName, PlayerActionLog action, int amount)
if(nRow_Player == 1) { if(nRow_Player == 1) {
logPlayerAction(boost::lexical_cast<int>(result_Player[1]), action, amount); logPlayerAction(boost::lexical_cast<int>(result_Player[1]), action, amount);
} else { } else {
cout << sql_select << endl;
cout << "Implausible information about player " << playerName << " in log-db!" << endl; cout << "Implausible information about player " << playerName << " in log-db!" << endl;
} }
} }
+2 -2
View File
@@ -25,8 +25,8 @@
#define MAX_GUI_SPEED 11 #define MAX_GUI_SPEED 11
#define DEBUG_MODE 0 #define DEBUG_MODE 0
#define SQLITE_LOG 0 #define SQLITE_LOG 1
#define HTML_LOG 1 #define HTML_LOG 0
#define POKERTH_VERSION_MAJOR 0 #define POKERTH_VERSION_MAJOR 0
#define POKERTH_VERSION_MINOR 90 #define POKERTH_VERSION_MINOR 90
-25
View File
@@ -845,31 +845,6 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
player[i-1] = boost::lexical_cast<std::string>(results.result_Player[nCol_Player*i]); player[i-1] = boost::lexical_cast<std::string>(results.result_Player[nCol_Player*i]);
} }
// for(i=1; i<=MAX_NUMBER_OF_PLAYERS; i++) {
// data_found = false;
// for(j=0; j<nCol_Game; j++) {
// cmpString = "Seat_";
// cmpString+= boost::lexical_cast<std::string>(i);
// if(boost::lexical_cast<std::string>(results.result_Game[j]) == cmpString) {
// // Seat found
// if(results.result_Game[j+nCol_Game*game_ctr]) {
// // the Seat is not empty
// player[i-1] = boost::lexical_cast<std::string>(results.result_Game[j+nCol_Game*game_ctr]);
// } else {
// player[i-1] = "";
// }
// data_found = true;
// }
// }
// if(!data_found) {
// cout << "Missing some seats!" << endl;
// cleanUp(results, mySqliteLogDb);
// return 1;
// }
// }
// read all hand id // read all hand id
sql = "SELECT HandID FROM Hand WHERE UniqueGameID="; sql = "SELECT HandID FROM Hand WHERE UniqueGameID=";
sql+= boost::lexical_cast<std::string>(uniqueGameID); sql+= boost::lexical_cast<std::string>(uniqueGameID);
@@ -534,8 +534,7 @@ void settingsDialogImpl::isAccepted()
"Please choose different names for each Opponent!"), "Please choose different names for each Opponent!"),
QMessageBox::Ok); QMessageBox::Ok);
settingsCorrect = FALSE; settingsCorrect = FALSE;
} } else {
else {
//save nicks and avatars //save nicks and avatars
myConfig->writeConfigString("MyName", lineEdit_HumanPlayerName->text().trimmed().toUtf8().constData()); myConfig->writeConfigString("MyName", lineEdit_HumanPlayerName->text().trimmed().toUtf8().constData());
myConfig->writeConfigString("MyAvatar", pushButton_HumanPlayerAvatar->getMyLink().toUtf8().constData()); myConfig->writeConfigString("MyAvatar", pushButton_HumanPlayerAvatar->getMyLink().toUtf8().constData());
@@ -1352,7 +1351,7 @@ void settingsDialogImpl::exportLogToHtml()
if(selectedItem) { if(selectedItem) {
QString fileName = QFileDialog::getSaveFileName(this, tr("Export PokerTH log file to HTML"), QString fileName = QFileDialog::getSaveFileName(this, tr("Export PokerTH log file to HTML"),
QString::fromUtf8(myConfig->readConfigString("LogDir").c_str())+"/"+selectedItem->text(0), QDir::homePath()+"/"+selectedItem->text(0),
tr("PokerTH HTML log (*.html)")); tr("PokerTH HTML log (*.html)"));
if(!fileName.isEmpty()) { if(!fileName.isEmpty()) {
@@ -1367,7 +1366,7 @@ void settingsDialogImpl::exportLogToTxt()
if(selectedItem) { if(selectedItem) {
QString fileName = QFileDialog::getSaveFileName(this, tr("Export PokerTH log file to plain text"), QString fileName = QFileDialog::getSaveFileName(this, tr("Export PokerTH log file to plain text"),
QString::fromUtf8(myConfig->readConfigString("LogDir").c_str())+"/"+selectedItem->text(0), QDir::homePath()+"/"+selectedItem->text(0),
tr("PokerTH plain text log (*.txt)")); tr("PokerTH plain text log (*.txt)"));
if(!fileName.isEmpty()) { if(!fileName.isEmpty()) {
+12 -13
View File
@@ -752,10 +752,9 @@ ClientThread::SetNewGameAdmin(unsigned id)
if (playerData.get()) { if (playerData.get()) {
playerData->SetGameAdmin(true); playerData->SetGameAdmin(true);
GetCallback().SignalNetClientNewGameAdmin(id, playerData->GetName()); GetCallback().SignalNetClientNewGameAdmin(id, playerData->GetName());
m_clientLog->logPlayerAction( if(m_game) {
playerData->GetName(), m_clientLog->logPlayerAction(playerData->GetName(),LOG_ACTION_ADMIN);
LOG_ACTION_ADMIN }
);
} }
} }
@@ -1092,8 +1091,12 @@ ClientThread::AddPlayerData(boost::shared_ptr<PlayerData> playerData)
m_playerDataList.push_back(playerData); m_playerDataList.push_back(playerData);
if (playerData->GetUniqueId() == GetGuiPlayerId()) if (playerData->GetUniqueId() == GetGuiPlayerId())
GetCallback().SignalNetClientSelfJoined(playerData->GetUniqueId(), playerData->GetName(), playerData->IsGameAdmin()); GetCallback().SignalNetClientSelfJoined(playerData->GetUniqueId(), playerData->GetName(), playerData->IsGameAdmin());
else else {
GetCallback().SignalNetClientPlayerJoined(playerData->GetUniqueId(), playerData->GetName(), playerData->IsGameAdmin()); GetCallback().SignalNetClientPlayerJoined(playerData->GetUniqueId(), playerData->GetName(), playerData->IsGameAdmin());
// if(m_game) {
// m_clientLog->logPlayerAction(playerData->GetName(),LOG_ACTION_JOIN);
// }
}
} }
} }
@@ -1123,16 +1126,12 @@ ClientThread::RemovePlayerData(unsigned playerId, int removeReason)
} }
GetCallback().SignalNetClientPlayerLeft(tmpData->GetUniqueId(), tmpData->GetName(), removeReason); GetCallback().SignalNetClientPlayerLeft(tmpData->GetUniqueId(), tmpData->GetName(), removeReason);
if(m_game) {
if(removeReason == NTF_NET_REMOVED_KICKED) { if(removeReason == NTF_NET_REMOVED_KICKED) {
m_clientLog->logPlayerAction( m_clientLog->logPlayerAction(tmpData->GetName(),LOG_ACTION_KICKED);
tmpData->GetName(),
LOG_ACTION_KICKED
);
} else { } else {
m_clientLog->logPlayerAction( m_clientLog->logPlayerAction(tmpData->GetName(),LOG_ACTION_LEFT);
tmpData->GetName(), }
LOG_ACTION_LEFT
);
} }
} }