show logos in the log preview (#101)

This commit is contained in:
floty
2012-01-28 12:51:42 +00:00
parent 0f39ca7820
commit 3b96fb2196
3 changed files with 51 additions and 28 deletions
+49 -26
View File
@@ -542,16 +542,16 @@ QStringList guiLog::translateCardCode(int cardCode)
switch (color) { switch (color) {
case 0: case 0:
cardString << "d"; cardString << "&diams;";
break; break;
case 1: case 1:
cardString << "h"; cardString << "&hearts;";
break; break;
case 2: case 2:
cardString << "s"; cardString << "&spades;";
break; break;
case 3: case 3:
cardString << "c"; cardString << "&clubs;";
break; break;
default: default:
cardString << "ERROR"; cardString << "ERROR";
@@ -1184,7 +1184,7 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
if(boost::lexical_cast<std::string>(results.result_Hand[j]) == "BoardCard_"+boost::lexical_cast<std::string>(i)) { if(boost::lexical_cast<std::string>(results.result_Hand[j]) == "BoardCard_"+boost::lexical_cast<std::string>(i)) {
if(results.result_Hand[j+nCol_Hand]) { if(results.result_Hand[j+nCol_Hand]) {
if(modus == 1 || modus == 3) round_string += "<b>"; if(modus == 1 || modus == 3) round_string += "<b>";
string_tmp = convertCardIntToString(boost::lexical_cast<int>(results.result_Hand[j+nCol_Hand])); string_tmp = convertCardIntToString(boost::lexical_cast<int>(results.result_Hand[j+nCol_Hand]),modus);
if(string_tmp == "") { if(string_tmp == "") {
cout << "Implausible board card in uniqueGame " << uniqueGameID << " hand " << results.result_Hand_ID[hand_ctr] << "!" << endl; cout << "Implausible board card in uniqueGame " << uniqueGameID << " hand " << results.result_Hand_ID[hand_ctr] << "!" << endl;
cleanUp(results, mySqliteLogDb); cleanUp(results, mySqliteLogDb);
@@ -1192,7 +1192,7 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
} }
round_string += boost::lexical_cast<std::string>(string_tmp.at(0)); round_string += boost::lexical_cast<std::string>(string_tmp.at(0));
if(modus==1 || modus == 3) round_string += "</b>"; if(modus==1 || modus == 3) round_string += "</b>";
round_string += boost::lexical_cast<std::string>(string_tmp.at(1)); round_string += boost::lexical_cast<std::string>(string_tmp.erase(0,1));
if(round_ctr+2-i > 0) round_string += ","; if(round_ctr+2-i > 0) round_string += ",";
data_found = true; data_found = true;
@@ -1341,7 +1341,7 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
cmpString += boost::lexical_cast<std::string>(results.result_Action[3*action_ctr]); cmpString += boost::lexical_cast<std::string>(results.result_Action[3*action_ctr]);
cmpString += "_Card_1"; cmpString += "_Card_1";
if(boost::lexical_cast<std::string>(results.result_Hand[i]) == cmpString) { if(boost::lexical_cast<std::string>(results.result_Hand[i]) == cmpString) {
string_tmp = convertCardIntToString(boost::lexical_cast<int>(results.result_Hand[i+nCol_Hand])); string_tmp = convertCardIntToString(boost::lexical_cast<int>(results.result_Hand[i+nCol_Hand]),modus);
if(string_tmp == "") { if(string_tmp == "") {
cout << "Hole card information implausible in uniqueGame " << uniqueGameID << " hand " << results.result_Hand_ID[hand_ctr] << "!" << endl; cout << "Hole card information implausible in uniqueGame " << uniqueGameID << " hand " << results.result_Hand_ID[hand_ctr] << "!" << endl;
cleanUp(results, mySqliteLogDb); cleanUp(results, mySqliteLogDb);
@@ -1349,7 +1349,7 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
} }
log_string += boost::lexical_cast<std::string>(string_tmp.at(0)); log_string += boost::lexical_cast<std::string>(string_tmp.at(0));
if(modus == 1 || modus == 3) log_string += "</b>"; if(modus == 1 || modus == 3) log_string += "</b>";
log_string += boost::lexical_cast<std::string>(string_tmp.at(1)); log_string += boost::lexical_cast<std::string>(string_tmp.erase(0,1));
log_string += ","; log_string += ",";
if(modus == 1 || modus == 3) log_string += "<b>"; if(modus == 1 || modus == 3) log_string += "<b>";
data_found = true; data_found = true;
@@ -1368,7 +1368,7 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
cmpString += boost::lexical_cast<std::string>(results.result_Action[3*action_ctr]); cmpString += boost::lexical_cast<std::string>(results.result_Action[3*action_ctr]);
cmpString += "_Card_2"; cmpString += "_Card_2";
if(boost::lexical_cast<std::string>(results.result_Hand[i]) == cmpString) { if(boost::lexical_cast<std::string>(results.result_Hand[i]) == cmpString) {
string_tmp = convertCardIntToString(boost::lexical_cast<int>(results.result_Hand[i+nCol_Hand])); string_tmp = convertCardIntToString(boost::lexical_cast<int>(results.result_Hand[i+nCol_Hand]),modus);
if(string_tmp == "") { if(string_tmp == "") {
cout << "Hole card information implausible in uniqueGame " << uniqueGameID << " hand " << results.result_Hand_ID[hand_ctr] << "!" << endl; cout << "Hole card information implausible in uniqueGame " << uniqueGameID << " hand " << results.result_Hand_ID[hand_ctr] << "!" << endl;
cleanUp(results, mySqliteLogDb); cleanUp(results, mySqliteLogDb);
@@ -1376,7 +1376,7 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
} }
log_string += boost::lexical_cast<std::string>(string_tmp.at(0)); log_string += boost::lexical_cast<std::string>(string_tmp.at(0));
if(modus == 1 || modus == 3) log_string += "</b>"; if(modus == 1 || modus == 3) log_string += "</b>";
log_string += boost::lexical_cast<std::string>(string_tmp.at(1)); log_string += boost::lexical_cast<std::string>(string_tmp.erase(0,1));
log_string += "]"; log_string += "]";
data_found = true; data_found = true;
} }
@@ -1510,7 +1510,7 @@ int guiLog::convertCardStringToInt(string val, string col)
} }
string guiLog::convertCardIntToString(int code) string guiLog::convertCardIntToString(int code, int modus)
{ {
string tmp; string tmp;
@@ -1559,21 +1559,44 @@ string guiLog::convertCardIntToString(int code)
return ""; return "";
} }
switch(code/13) { if(modus==2) {
case 0:
tmp+= "d"; switch(code/13) {
break; case 0:
case 1: tmp+= "d";
tmp+= "h"; break;
break; case 1:
case 2: tmp+= "h";
tmp+= "s"; break;
break; case 2:
case 3: tmp+= "s";
tmp+= "c"; break;
break; case 3:
default: tmp+= "c";
return ""; break;
default:
return "";
}
} else {
switch(code/13) {
case 0:
tmp+= "&diams;";
break;
case 1:
tmp+= "&hearts;";
break;
case 2:
tmp+= "&spades;";
break;
case 3:
tmp+= "&clubs;";
break;
default:
return "";
}
} }
return tmp; return tmp;
+1 -1
View File
@@ -98,7 +98,7 @@ private:
void writeLog(std::string log_string, int modus); void writeLog(std::string log_string, int modus);
void cleanUp(result_struct &results, sqlite3 *mySqliteLogDb); void cleanUp(result_struct &results, sqlite3 *mySqliteLogDb);
int convertCardStringToInt(std::string val, std::string col); int convertCardStringToInt(std::string val, std::string col);
std::string convertCardIntToString(int code); std::string convertCardIntToString(int code, int modus);
int lastGameID; int lastGameID;
+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) else if (packet->GetMsg()->present == PokerTHMessage_PR_avatarRequestMessage)
HandleNetPacketRetrieveAvatar(session, packet->GetMsg()->choice.avatarRequestMessage); HandleNetPacketRetrieveAvatar(session, packet->GetMsg()->choice.avatarRequestMessage);
else if (packet->GetMsg()->present == PokerTHMessage_PR_resetTimeoutMessage) else if (packet->GetMsg()->present == PokerTHMessage_PR_resetTimeoutMessage)
{} {}
else if (packet->GetMsg()->present == PokerTHMessage_PR_subscriptionRequestMessage) { else if (packet->GetMsg()->present == PokerTHMessage_PR_subscriptionRequestMessage) {
SubscriptionRequestMessage_t *subscriptionRequest = &packet->GetMsg()->choice.subscriptionRequestMessage; SubscriptionRequestMessage_t *subscriptionRequest = &packet->GetMsg()->choice.subscriptionRequestMessage;
if (subscriptionRequest->subscriptionAction == subscriptionAction_resubscribeGameList) if (subscriptionRequest->subscriptionAction == subscriptionAction_resubscribeGameList)