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) {
logPlayerAction(boost::lexical_cast<int>(result_Player[1]), action, amount);
} else {
cout << sql_select << 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 DEBUG_MODE 0
#define SQLITE_LOG 0
#define HTML_LOG 1
#define SQLITE_LOG 1
#define HTML_LOG 0
#define POKERTH_VERSION_MAJOR 0
#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]);
}
// 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
sql = "SELECT HandID FROM Hand WHERE UniqueGameID=";
sql+= boost::lexical_cast<std::string>(uniqueGameID);
@@ -529,13 +529,12 @@ void settingsDialogImpl::isAccepted()
checkSetPlayerNicks.insert(lineEdit_Opponent9Name->text().trimmed());
if(checkSetPlayerNicks.count() != 10) {
QMessageBox::warning(this, tr("Settings Error"),
tr("The opponent names are not unique.\n"
"Please choose different names for each Opponent!"),
QMessageBox::Ok);
settingsCorrect = FALSE;
}
else {
QMessageBox::warning(this, tr("Settings Error"),
tr("The opponent names are not unique.\n"
"Please choose different names for each Opponent!"),
QMessageBox::Ok);
settingsCorrect = FALSE;
} else {
//save nicks and avatars
myConfig->writeConfigString("MyName", lineEdit_HumanPlayerName->text().trimmed().toUtf8().constData());
myConfig->writeConfigString("MyAvatar", pushButton_HumanPlayerAvatar->getMyLink().toUtf8().constData());
@@ -1352,7 +1351,7 @@ void settingsDialogImpl::exportLogToHtml()
if(selectedItem) {
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)"));
if(!fileName.isEmpty()) {
@@ -1367,7 +1366,7 @@ void settingsDialogImpl::exportLogToTxt()
if(selectedItem) {
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)"));
if(!fileName.isEmpty()) {
+14 -15
View File
@@ -752,10 +752,9 @@ ClientThread::SetNewGameAdmin(unsigned id)
if (playerData.get()) {
playerData->SetGameAdmin(true);
GetCallback().SignalNetClientNewGameAdmin(id, playerData->GetName());
m_clientLog->logPlayerAction(
playerData->GetName(),
LOG_ACTION_ADMIN
);
if(m_game) {
m_clientLog->logPlayerAction(playerData->GetName(),LOG_ACTION_ADMIN);
}
}
}
@@ -1092,8 +1091,12 @@ ClientThread::AddPlayerData(boost::shared_ptr<PlayerData> playerData)
m_playerDataList.push_back(playerData);
if (playerData->GetUniqueId() == GetGuiPlayerId())
GetCallback().SignalNetClientSelfJoined(playerData->GetUniqueId(), playerData->GetName(), playerData->IsGameAdmin());
else
else {
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);
if(removeReason == NTF_NET_REMOVED_KICKED) {
m_clientLog->logPlayerAction(
tmpData->GetName(),
LOG_ACTION_KICKED
);
} else {
m_clientLog->logPlayerAction(
tmpData->GetName(),
LOG_ACTION_LEFT
);
if(m_game) {
if(removeReason == NTF_NET_REMOVED_KICKED) {
m_clientLog->logPlayerAction(tmpData->GetName(),LOG_ACTION_KICKED);
} else {
m_clientLog->logPlayerAction(tmpData->GetName(),LOG_ACTION_LEFT);
}
}
}
+1 -1
View File
@@ -891,7 +891,7 @@ ServerLobbyThread::HandlePacket(boost::shared_ptr<SessionData> session, boost::s
else if (packet->GetMsg()->present == PokerTHMessage_PR_avatarRequestMessage)
HandleNetPacketRetrieveAvatar(session, packet->GetMsg()->choice.avatarRequestMessage);
else if (packet->GetMsg()->present == PokerTHMessage_PR_resetTimeoutMessage)
{}
{}
else if (packet->GetMsg()->present == PokerTHMessage_PR_subscriptionRequestMessage) {
SubscriptionRequestMessage_t *subscriptionRequest = &packet->GetMsg()->choice.subscriptionRequestMessage;
if (subscriptionRequest->subscriptionAction == subscriptionAction_resubscribeGameList)