changing parameter in some log-functions; run astyle

This commit is contained in:
floty
2012-01-07 18:42:24 +00:00
parent 476ee936f0
commit 800199f6f0
12 changed files with 182 additions and 121 deletions
+1 -1
View File
@@ -152,7 +152,7 @@ void LocalBeRo::run()
LOG_ERROR(__FILE__ << " (" << __LINE__ << "): ERROR - wrong myBeRoID"); LOG_ERROR(__FILE__ << " (" << __LINE__ << "): ERROR - wrong myBeRoID");
} }
} }
if(myHand->getLog()) myHand->getLog()->logBoardCards(myBeRoID, tempBoardCardsArray); if(myHand->getLog()) myHand->getLog()->logBoardCards(tempBoardCardsArray);
logBoardCardsDone = true; logBoardCardsDone = true;
} }
@@ -89,7 +89,7 @@ void LocalBeRoPostRiver::postRiverRun()
if ((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) nonfoldPlayersCounter++; if ((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) nonfoldPlayersCounter++;
} }
if(nonfoldPlayersCounter>1) { if(nonfoldPlayersCounter>1) {
if(getMyHand()->getLog()) getMyHand()->getLog()->logHoleCardsHandName(GAME_STATE_POST_RIVER,getMyHand()->getActivePlayerList()); if(getMyHand()->getLog()) getMyHand()->getLog()->logHoleCardsHandName(getMyHand()->getActivePlayerList());
} }
if(getMyHand()->getLog()) { if(getMyHand()->getLog()) {
getMyHand()->getLog()->logHandWinner(getMyHand()->getActivePlayerList(), highestCardsValue, getMyHand()->getBoard()->getWinners()); getMyHand()->getLog()->logHandWinner(getMyHand()->getActivePlayerList(), highestCardsValue, getMyHand()->getBoard()->getWinners());
+7 -4
View File
@@ -527,7 +527,7 @@ void LocalHand::switchRounds()
// logging last player action // logging last player action
PlayerListConstIterator previousPlayerIt = getRunningPlayerIt(previousPlayerID); PlayerListConstIterator previousPlayerIt = getRunningPlayerIt(previousPlayerID);
if(previousPlayerIt != runningPlayerList->end()) { if(previousPlayerIt != runningPlayerList->end()) {
if(myLog) myLog->logPlayerAction(currentRound,(*previousPlayerIt)->getMyID()+1,myLog->transformPlayerActionLog((*previousPlayerIt)->getMyAction()),(*previousPlayerIt)->getMySet()); if(myLog) myLog->logPlayerAction((*previousPlayerIt)->getMyName(),myLog->transformPlayerActionLog((*previousPlayerIt)->getMyAction()),(*previousPlayerIt)->getMySet());
} }
PlayerListIterator it, it_1; PlayerListIterator it, it_1;
@@ -569,6 +569,7 @@ void LocalHand::switchRounds()
myGui->refreshPot(); myGui->refreshPot();
myGui->refreshSet(); myGui->refreshSet();
currentRound = GAME_STATE_POST_RIVER; currentRound = GAME_STATE_POST_RIVER;
myLog->setCurrentRound(currentRound);
} }
// check for all in condition // check for all in condition
@@ -630,11 +631,13 @@ void LocalHand::switchRounds()
myGui->flipHolecardsAllIn(); myGui->flipHolecardsAllIn();
// Logging HoleCards // Logging HoleCards
if(currentRound<GAME_STATE_RIVER) { if(currentRound<GAME_STATE_RIVER) {
if(myLog) myLog->logHoleCardsHandName(currentRound,activePlayerList); if(myLog) myLog->logHoleCardsHandName(activePlayerList);
} }
if (currentRound < GAME_STATE_POST_RIVER) // do not increment past 4 if (currentRound < GAME_STATE_POST_RIVER) { // do not increment past 4
currentRound = GameState(currentRound + 1); currentRound = GameState(currentRound + 1);
myLog->setCurrentRound(currentRound);
}
//log board cards for allin //log board cards for allin
if(currentRound >= GAME_STATE_FLOP) { if(currentRound >= GAME_STATE_FLOP) {
@@ -642,7 +645,7 @@ void LocalHand::switchRounds()
myBoard->getMyCards(tempBoardCardsArray); myBoard->getMyCards(tempBoardCardsArray);
myGui->logDealBoardCardsMsg(currentRound, tempBoardCardsArray[0], tempBoardCardsArray[1], tempBoardCardsArray[2], tempBoardCardsArray[3], tempBoardCardsArray[4]); myGui->logDealBoardCardsMsg(currentRound, tempBoardCardsArray[0], tempBoardCardsArray[1], tempBoardCardsArray[2], tempBoardCardsArray[3], tempBoardCardsArray[4]);
if(myLog) myLog->logBoardCards(currentRound, tempBoardCardsArray); if(myLog) myLog->logBoardCards(tempBoardCardsArray);
} }
} }
+1
View File
@@ -90,6 +90,7 @@ public:
void setCurrentRound(GameState theValue) { void setCurrentRound(GameState theValue) {
currentRound = theValue; currentRound = theValue;
myLog->setCurrentRound(currentRound);
} }
GameState getCurrentRound() const { GameState getCurrentRound() const {
return currentRound; return currentRound;
+87 -42
View File
@@ -28,11 +28,8 @@
using namespace std; using namespace std;
Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), uniqueGameID(0), curHandID(0), sql("") Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), uniqueGameID(0), currentHandID(0), currentRound(GAME_STATE_PREFLOP), sql("")
{ {
logVersion = 1;
} }
Log::~Log() Log::~Log()
@@ -94,7 +91,7 @@ Log::init()
sql += "\"" + boost::lexical_cast<string>(POKERTH_BETA_RELEASE_STRING) + "\","; sql += "\"" + boost::lexical_cast<string>(POKERTH_BETA_RELEASE_STRING) + "\",";
sql += "\"" + boost::lexical_cast<string>(curDate) + "\","; sql += "\"" + boost::lexical_cast<string>(curDate) + "\",";
sql += "\"" + boost::lexical_cast<string>(curTime) + "\","; sql += "\"" + boost::lexical_cast<string>(curTime) + "\",";
sql += boost::lexical_cast<string>(logVersion) + ");"; sql += boost::lexical_cast<string>(SQLITE_LOG_VERSION) + ");";
// create game table // create game table
sql += "CREATE TABLE Game ("; sql += "CREATE TABLE Game (";
@@ -103,12 +100,16 @@ Log::init()
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++) {
sql += ",Seat_" + boost::lexical_cast<std::string>(i) + " TEXT";
}
sql += ",Winner_Seat INTEGER"; sql += ",Winner_Seat INTEGER";
sql += ");"; sql += ");";
// create player table
sql += "CREATE TABLE Player (";
sql += "UniqueGameID INTEGER NOT NULL";
sql += ",Seat INTEGER NOT NULL";
sql += ",Player TEXT NOT NULL";
sql += ",PRIMARY KEY(UniqueGameID,Seat));";
// create hand table // create hand table
sql += "CREATE TABLE Hand ("; sql += "CREATE TABLE Hand (";
sql += "HandID INTEGER NOT NULL"; sql += "HandID INTEGER NOT NULL";
@@ -170,26 +171,31 @@ Log::logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned deal
sql += ",Startmoney"; sql += ",Startmoney";
sql += ",StartSb"; sql += ",StartSb";
sql += ",DealerPos"; sql += ",DealerPos";
for(i=1; i<=MAX_NUMBER_OF_PLAYERS; i++) {
sql += ",Seat_" + boost::lexical_cast<std::string>(i);
}
sql += ") VALUES ("; sql += ") VALUES (";
sql += boost::lexical_cast<string>(uniqueGameID); sql += boost::lexical_cast<string>(uniqueGameID);
sql += "," + boost::lexical_cast<string>(gameID); sql += "," + boost::lexical_cast<string>(gameID);
sql += "," + boost::lexical_cast<string>(startCash); sql += "," + boost::lexical_cast<string>(startCash);
sql += "," + boost::lexical_cast<string>(startSmallBlind); sql += "," + boost::lexical_cast<string>(startSmallBlind);
sql += "," + boost::lexical_cast<string>(dealerPosition); sql += "," + boost::lexical_cast<string>(dealerPosition);
sql += ");";
i = 1;
for(it_c = seatsList->begin(); it_c!=seatsList->end(); ++it_c) { for(it_c = seatsList->begin(); it_c!=seatsList->end(); ++it_c) {
if((*it_c)->getMyActiveStatus()) { if((*it_c)->getMyActiveStatus()) {
sql += "INSERT INTO Player (";
sql += "UniqueGameID";
sql += ",Seat";
sql += ",Player";
sql += ") VALUES (";
sql += boost::lexical_cast<string>(uniqueGameID);
sql += "," + boost::lexical_cast<string>(i);
sql += ",\"" + (*it_c)->getMyName() +"\""; sql += ",\"" + (*it_c)->getMyName() +"\"";
} else { sql += ");";
sql += ",NULL";
} }
i++;
} }
sql += ");";
if(myConfig->readConfigInt("LogInterval") == 0) { exec_transaction();
exec_transaction();
}
} }
} }
} }
@@ -199,7 +205,8 @@ void
Log::logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, unsigned smallBlindPosition, int bigBlind, unsigned bigBlindPosition, PlayerList seatsList) Log::logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, unsigned smallBlindPosition, int bigBlind, unsigned bigBlindPosition, PlayerList seatsList)
{ {
curHandID = handID; currentRound = GAME_STATE_PREFLOP;
currentHandID = handID;
PlayerListConstIterator it_c; PlayerListConstIterator it_c;
for(it_c = seatsList->begin(); it_c!=seatsList->end(); ++it_c) { for(it_c = seatsList->begin(); it_c!=seatsList->end(); ++it_c) {
(*it_c)->setLogHoleCardsDone(false); (*it_c)->setLogHoleCardsDone(false);
@@ -226,7 +233,7 @@ Log::logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, unsigned
sql += ",Seat_" + boost::lexical_cast<std::string>(i) + "_Cash"; sql += ",Seat_" + boost::lexical_cast<std::string>(i) + "_Cash";
} }
sql += ") VALUES ("; sql += ") VALUES (";
sql += boost::lexical_cast<string>(curHandID); sql += boost::lexical_cast<string>(currentHandID);
sql += "," + boost::lexical_cast<string>(uniqueGameID); sql += "," + boost::lexical_cast<string>(uniqueGameID);
sql += "," + boost::lexical_cast<string>(dealerPosition); sql += "," + boost::lexical_cast<string>(dealerPosition);
sql += "," + boost::lexical_cast<string>(smallBlind); sql += "," + boost::lexical_cast<string>(smallBlind);
@@ -257,22 +264,22 @@ Log::logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, unsigned
} }
} }
if(countActivePlayer==2) { if(countActivePlayer==2) {
logPlayerAction(GAME_STATE_PREFLOP,smallBlindPosition,LOG_ACTION_DEALER); logPlayerAction(smallBlindPosition,LOG_ACTION_DEALER);
} else { } else {
if(dealerButtonOnTable) { if(dealerButtonOnTable) {
logPlayerAction(GAME_STATE_PREFLOP,dealerPosition,LOG_ACTION_DEALER); logPlayerAction(dealerPosition,LOG_ACTION_DEALER);
} }
} }
// log blinds // log blinds
for(it_c = seatsList->begin(); it_c!=seatsList->end(); ++it_c) { for(it_c = seatsList->begin(); it_c!=seatsList->end(); ++it_c) {
if((*it_c)->getMyButton() == BUTTON_SMALL_BLIND && (*it_c)->getMySet()>0) { if((*it_c)->getMyButton() == BUTTON_SMALL_BLIND && (*it_c)->getMySet()>0) {
logPlayerAction(GAME_STATE_PREFLOP,smallBlindPosition,LOG_ACTION_SMALL_BLIND,(*it_c)->getMySet()); logPlayerAction(smallBlindPosition,LOG_ACTION_SMALL_BLIND,(*it_c)->getMySet());
} }
} }
for(it_c = seatsList->begin(); it_c!=seatsList->end(); ++it_c) { for(it_c = seatsList->begin(); it_c!=seatsList->end(); ++it_c) {
if((*it_c)->getMyButton() == BUTTON_BIG_BLIND && (*it_c)->getMySet()>0) { if((*it_c)->getMyButton() == BUTTON_BIG_BLIND && (*it_c)->getMySet()>0) {
logPlayerAction(GAME_STATE_PREFLOP,bigBlindPosition,LOG_ACTION_BIG_BLIND,(*it_c)->getMySet()); logPlayerAction(bigBlindPosition,LOG_ACTION_BIG_BLIND,(*it_c)->getMySet());
} }
} }
@@ -286,7 +293,45 @@ Log::logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, unsigned
} }
void void
Log::logPlayerAction(GameState bero, int seat, PlayerActionLog action, int amount) Log::logPlayerAction(string playerName, PlayerActionLog action, int amount)
{
if(SQLITE_LOG) {
if(myConfig->readConfigInt("LogOnOff")) {
//if write logfiles is enabled
if( mySqliteLogDb != 0 ) {
// sqlite-db is open
char **result_Player=0;
int nRow_Player=0;
int nCol_Player=0;
char *errmsg = 0;
// read seat
string sql_select = "SELECT Seat FROM Player WHERE UniqueGameID=" + boost::lexical_cast<std::string>(uniqueGameID);
sql_select += " AND ";
sql_select += "Player=\"" + playerName +"\"";
if(sqlite3_get_table(mySqliteLogDb,sql_select.data(),&result_Player,&nRow_Player,&nCol_Player,&errmsg) != SQLITE_OK) {
cout << "Error in statement: " << sql_select.data() << "[" << errmsg << "]." << endl;
} else {
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;
}
}
sqlite3_free_table(result_Player);
}
}
}
}
void
Log::logPlayerAction(int seat, PlayerActionLog action, int amount)
{ {
if(SQLITE_LOG) { if(SQLITE_LOG) {
@@ -306,9 +351,9 @@ Log::logPlayerAction(GameState bero, int seat, PlayerActionLog action, int amoun
sql += ",Action"; sql += ",Action";
sql += ",Amount"; sql += ",Amount";
sql += ") VALUES ("; sql += ") VALUES (";
sql += boost::lexical_cast<string>(curHandID); sql += boost::lexical_cast<string>(currentHandID);
sql += "," + boost::lexical_cast<string>(uniqueGameID); sql += "," + boost::lexical_cast<string>(uniqueGameID);
sql += "," + boost::lexical_cast<string>(bero);; sql += "," + boost::lexical_cast<string>(currentRound);;
sql += "," + boost::lexical_cast<string>(seat); sql += "," + boost::lexical_cast<string>(seat);
switch(action) { switch(action) {
case LOG_ACTION_DEALER: case LOG_ACTION_DEALER:
@@ -422,7 +467,7 @@ Log::transformPlayerActionLog(PlayerAction action)
} }
void void
Log::logBoardCards(GameState bero, int boardCards[5]) Log::logBoardCards(int boardCards[5])
{ {
if(SQLITE_LOG) { if(SQLITE_LOG) {
@@ -432,7 +477,7 @@ Log::logBoardCards(GameState bero, int boardCards[5])
if( mySqliteLogDb != 0 ) { if( mySqliteLogDb != 0 ) {
// sqlite-db is open // sqlite-db is open
switch(bero) { switch(currentRound) {
case GAME_STATE_FLOP: { case GAME_STATE_FLOP: {
sql += "UPDATE Hand SET "; sql += "UPDATE Hand SET ";
sql += "BoardCard_1=" + boost::lexical_cast<string>(boardCards[0]) + ","; sql += "BoardCard_1=" + boost::lexical_cast<string>(boardCards[0]) + ",";
@@ -455,7 +500,7 @@ Log::logBoardCards(GameState bero, int boardCards[5])
} }
sql += " WHERE "; sql += " WHERE ";
sql += "UniqueGameID=" + boost::lexical_cast<string>(uniqueGameID) + " AND "; sql += "UniqueGameID=" + boost::lexical_cast<string>(uniqueGameID) + " AND ";
sql += "HandID=" + boost::lexical_cast<string>(curHandID); sql += "HandID=" + boost::lexical_cast<string>(currentHandID);
sql += ";"; sql += ";";
if(myConfig->readConfigInt("LogInterval") == 0) { if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(); exec_transaction();
@@ -466,22 +511,22 @@ Log::logBoardCards(GameState bero, int boardCards[5])
} }
void void
Log::logHoleCardsHandName(GameState bero, PlayerList activePlayerList) Log::logHoleCardsHandName(PlayerList activePlayerList)
{ {
PlayerListConstIterator it_c; PlayerListConstIterator it_c;
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) { for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) {
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD && ( ((*it_c)->checkIfINeedToShowCards() && bero==GAME_STATE_POST_RIVER ) || ( bero!=GAME_STATE_POST_RIVER && !(*it_c)->getLogHoleCardsDone()) ) ) { if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD && ( ((*it_c)->checkIfINeedToShowCards() && currentRound==GAME_STATE_POST_RIVER ) || ( currentRound!=GAME_STATE_POST_RIVER && !(*it_c)->getLogHoleCardsDone()) ) ) {
logHoleCardsHandName(bero, activePlayerList, *it_c); logHoleCardsHandName(activePlayerList, *it_c);
} }
} }
} }
void void
Log::logHoleCardsHandName(GameState bero, PlayerList activePlayerList, boost::shared_ptr<PlayerInterface> player, bool forceExecLog) Log::logHoleCardsHandName(PlayerList activePlayerList, boost::shared_ptr<PlayerInterface> player, bool forceExecLog)
{ {
if(SQLITE_LOG) { if(SQLITE_LOG) {
@@ -494,11 +539,11 @@ Log::logHoleCardsHandName(GameState bero, PlayerList activePlayerList, boost::sh
int myCards[2]; int myCards[2];
player->getMyCards(myCards); player->getMyCards(myCards);
sql += "UPDATE Hand SET "; sql += "UPDATE Hand SET ";
if(bero==GAME_STATE_POST_RIVER && player->getMyCardsValueInt()>0) { if(currentRound==GAME_STATE_POST_RIVER && player->getMyCardsValueInt()>0) {
sql += "Seat_" + boost::lexical_cast<string>(player->getMyID()+1) + "_Hand_text=\"" + CardsValue::determineHandName(player->getMyCardsValueInt(),activePlayerList) + "\""; sql += "Seat_" + boost::lexical_cast<string>(player->getMyID()+1) + "_Hand_text=\"" + CardsValue::determineHandName(player->getMyCardsValueInt(),activePlayerList) + "\"";
sql += ",Seat_" + boost::lexical_cast<string>(player->getMyID()+1) + "_Hand_int=" + boost::lexical_cast<string>(player->getMyCardsValueInt()); sql += ",Seat_" + boost::lexical_cast<string>(player->getMyID()+1) + "_Hand_int=" + boost::lexical_cast<string>(player->getMyCardsValueInt());
} }
if(bero==GAME_STATE_POST_RIVER && player->getMyCardsValueInt()>0 && !player->getLogHoleCardsDone()) { if(currentRound==GAME_STATE_POST_RIVER && player->getMyCardsValueInt()>0 && !player->getLogHoleCardsDone()) {
sql+= ","; sql+= ",";
} }
if(!player->getLogHoleCardsDone()) { if(!player->getLogHoleCardsDone()) {
@@ -507,16 +552,16 @@ Log::logHoleCardsHandName(GameState bero, PlayerList activePlayerList, boost::sh
} }
sql += " WHERE "; sql += " WHERE ";
sql += "UniqueGameID=" + boost::lexical_cast<string>(uniqueGameID) + " AND "; sql += "UniqueGameID=" + boost::lexical_cast<string>(uniqueGameID) + " AND ";
sql += "HandID=" + boost::lexical_cast<string>(curHandID); sql += "HandID=" + boost::lexical_cast<string>(currentHandID);
sql += ";"; sql += ";";
if(myConfig->readConfigInt("LogInterval") == 0 || forceExecLog) { if(myConfig->readConfigInt("LogInterval") == 0 || forceExecLog) {
exec_transaction(); exec_transaction();
} }
if(!player->getLogHoleCardsDone()) { if(!player->getLogHoleCardsDone()) {
logPlayerAction(bero,player->getMyID()+1,LOG_ACTION_SHOW); logPlayerAction(player->getMyName(),LOG_ACTION_SHOW);
} else { } else {
logPlayerAction(bero,player->getMyID()+1,LOG_ACTION_HAS); logPlayerAction(player->getMyName(),LOG_ACTION_HAS);
} }
player->setLogHoleCardsDone(true); player->setLogHoleCardsDone(true);
@@ -537,7 +582,7 @@ Log::logHandWinner(PlayerList activePlayerList, int highestCardsValue, std::list
// log winner // log winner
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) { for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) {
if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD && (*it_c)->getMyCardsValueInt() == highestCardsValue) { if((*it_c)->getMyAction() != PLAYER_ACTION_FOLD && (*it_c)->getMyCardsValueInt() == highestCardsValue) {
logPlayerAction(GAME_STATE_POST_RIVER,(*it_c)->getMyID()+1,LOG_ACTION_WIN,(*it_c)->getLastMoneyWon()); logPlayerAction((*it_c)->getMyName(),LOG_ACTION_WIN,(*it_c)->getLastMoneyWon());
} }
} }
@@ -547,7 +592,7 @@ Log::logHandWinner(PlayerList activePlayerList, int highestCardsValue, std::list
for(it_int = winners.begin(); it_int != winners.end(); ++it_int) { for(it_int = winners.begin(); it_int != winners.end(); ++it_int) {
if((*it_int) == (*it_c)->getMyUniqueID()) { if((*it_int) == (*it_c)->getMyUniqueID()) {
logPlayerAction(GAME_STATE_POST_RIVER,(*it_c)->getMyID()+1,LOG_ACTION_WIN_SIDE_POT,(*it_c)->getLastMoneyWon()); logPlayerAction((*it_c)->getMyName(),LOG_ACTION_WIN_SIDE_POT,(*it_c)->getLastMoneyWon());
} }
} }
} }
@@ -567,7 +612,7 @@ Log::logGameWinner(PlayerList activePlayerList)
if (playersPositiveCashCounter==1) { if (playersPositiveCashCounter==1) {
for (it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) { for (it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) {
if ((*it_c)->getMyCash() > 0) { if ((*it_c)->getMyCash() > 0) {
logPlayerAction(GAME_STATE_POST_RIVER,(*it_c)->getMyID()+1,LOG_ACTION_WIN_GAME); logPlayerAction((*it_c)->getMyName(),LOG_ACTION_WIN_GAME);
} }
} }
// for log after every game // for log after every game
@@ -584,7 +629,7 @@ Log::logPlayerSitsOut(PlayerList activePlayerList)
for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) { for(it_c=activePlayerList->begin(); it_c!=activePlayerList->end(); ++it_c) {
if((*it_c)->getMyCash() == 0) { if((*it_c)->getMyCash() == 0) {
logPlayerAction(GAME_STATE_POST_RIVER, (*it_c)->getMyID()+1, LOG_ACTION_SIT_OUT); logPlayerAction((*it_c)->getMyName(), LOG_ACTION_SIT_OUT);
} }
} }
+11 -5
View File
@@ -37,11 +37,12 @@ public:
void init(); void init();
void logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned dealerPosition, PlayerList seatsList); void logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned dealerPosition, PlayerList seatsList);
void logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, unsigned smallBlindPosition, int bigBlind, unsigned bigBlindPosition, PlayerList seatsList); void logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, unsigned smallBlindPosition, int bigBlind, unsigned bigBlindPosition, PlayerList seatsList);
void logPlayerAction(GameState bero, int seat, PlayerActionLog action, int amount = 0); void logPlayerAction(std::string playerName, PlayerActionLog action, int amount = 0);
void logPlayerAction(int seat, PlayerActionLog action, int amount = 0);
PlayerActionLog transformPlayerActionLog(PlayerAction action); PlayerActionLog transformPlayerActionLog(PlayerAction action);
void logBoardCards(GameState bero, int boardCards[5]); void logBoardCards(int boardCards[5]);
void logHoleCardsHandName(GameState bero, PlayerList activePlayerList); void logHoleCardsHandName(PlayerList activePlayerList);
void logHoleCardsHandName(GameState bero, PlayerList activePlayerList, boost::shared_ptr<PlayerInterface> player, bool forceExecLog = 0); void logHoleCardsHandName(PlayerList activePlayerList, boost::shared_ptr<PlayerInterface> player, bool forceExecLog = 0);
void logHandWinner(PlayerList activePlayerList, int highestCardsValue, std::list<unsigned> winners); void logHandWinner(PlayerList activePlayerList, int highestCardsValue, std::list<unsigned> winners);
void logGameWinner(PlayerList activePlayerList); void logGameWinner(PlayerList activePlayerList);
void logPlayerSitsOut(PlayerList activePlayerList); void logPlayerSitsOut(PlayerList activePlayerList);
@@ -49,6 +50,10 @@ public:
void logAfterGame(); void logAfterGame();
// void closeLogDbAtExit(); // void closeLogDbAtExit();
void setCurrentRound(GameState theValue) {
currentRound = theValue;
}
private: private:
@@ -58,7 +63,8 @@ private:
sqlite3 *mySqliteLogDb; sqlite3 *mySqliteLogDb;
ConfigFile *myConfig; ConfigFile *myConfig;
int uniqueGameID; int uniqueGameID;
int curHandID; int currentHandID;
GameState currentRound;
std::string sql; std::string sql;
}; };
+58 -46
View File
@@ -687,6 +687,7 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
result_struct results; result_struct results;
results.result_Session = 0; results.result_Session = 0;
results.result_Game = 0; results.result_Game = 0;
results.result_Player = 0;
results.result_Hand = 0; results.result_Hand = 0;
results.result_Hand_ID = 0; results.result_Hand_ID = 0;
results.result_Action = 0; results.result_Action = 0;
@@ -696,8 +697,8 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
string round_string = ""; string round_string = "";
string action_string = ""; string action_string = "";
bool data_found = false; bool data_found = false;
int nRow_Session=0, nRow_Game=0, nRow_Hand=0, nRow_Hand_ID=0, nRow_Action=0; int nRow_Session=0, nRow_Game=0, nRow_Player=0, nRow_Hand=0, nRow_Hand_ID=0, nRow_Action=0;
int nCol_Session=0, nCol_Game=0, nCol_Hand=0, nCol_Action=0; int nCol_Session=0, nCol_Game=0, nCol_Player=0, nCol_Hand=0, nCol_Action=0;
char *errmsg = 0; char *errmsg = 0;
int game_ctr = 0, hand_ctr = 0, round_ctr = 0, action_ctr = 0; int game_ctr = 0, hand_ctr = 0, round_ctr = 0, action_ctr = 0;
int i = 0, j = 0; int i = 0, j = 0;
@@ -721,7 +722,7 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
cleanUp(results, mySqliteLogDb); cleanUp(results, mySqliteLogDb);
return 1; return 1;
} }
if(nRow_Session<1 || nRow_Session>1) { if(nRow_Session != 1) {
cout << "Number of Sessions implausible!" << endl; cout << "Number of Sessions implausible!" << endl;
cleanUp(results, mySqliteLogDb); cleanUp(results, mySqliteLogDb);
return 1; return 1;
@@ -775,8 +776,6 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
return 1; return 1;
} }
// sqlite3_free_table(results.result_Session);
switch(modus) { switch(modus) {
case 1: case 1:
log_string = "<h3><b>" + log_string + "</b></h3>\n"; log_string = "<h3><b>" + log_string + "</b></h3>\n";
@@ -834,28 +833,42 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
} }
// read player // read player
for(i=1; i<=MAX_NUMBER_OF_PLAYERS; i++) { sql = "SELECT Player,Seat FROM Player WHERE UniqueGameID=";
data_found = false; sql += boost::lexical_cast<std::string>(uniqueGameID);
for(j=0; j<nCol_Game; j++) { sql += " ORDER BY Seat;";
cmpString = "Seat_"; if(sqlite3_get_table(mySqliteLogDb,sql.data(),&results.result_Player,&nRow_Player,&nCol_Player,&errmsg) != SQLITE_OK) {
cmpString+= boost::lexical_cast<std::string>(i); cout << "Error in statement: " << sql.data() << "[" << errmsg << "]." << endl;
if(boost::lexical_cast<std::string>(results.result_Game[j]) == cmpString) { cleanUp(results, mySqliteLogDb);
// Seat found return 1;
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;
}
} }
for(i=1; i<=nRow_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=";
@@ -1050,8 +1063,6 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
} }
} }
// sqlite3_free_table(results.result_Action);
} else { } else {
log_string += "BLINDS: "; log_string += "BLINDS: ";
@@ -1080,8 +1091,6 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
log_string += boost::lexical_cast<std::string>(results.result_Action[3]); log_string += boost::lexical_cast<std::string>(results.result_Action[3]);
log_string += "), "; log_string += "), ";
// sqlite3_free_table(results.result_Action);
// read big blind // read big blind
sql = "SELECT Player,Amount FROM Action WHERE UniqueGameID="; sql = "SELECT Player,Amount FROM Action WHERE UniqueGameID=";
sql += boost::lexical_cast<std::string>(uniqueGameID); sql += boost::lexical_cast<std::string>(uniqueGameID);
@@ -1106,8 +1115,6 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
log_string += boost::lexical_cast<std::string>(results.result_Action[3]); log_string += boost::lexical_cast<std::string>(results.result_Action[3]);
log_string += ")"; log_string += ")";
// sqlite3_free_table(results.result_Action);
// read dealer // read dealer
sql = "SELECT Player,Amount FROM Action WHERE UniqueGameID="; sql = "SELECT Player,Amount FROM Action WHERE UniqueGameID=";
sql += boost::lexical_cast<std::string>(uniqueGameID); sql += boost::lexical_cast<std::string>(uniqueGameID);
@@ -1145,8 +1152,6 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
log_string += " starts as dealer."; log_string += " starts as dealer.";
} }
// sqlite3_free_table(results.result_Action);
} }
if(!neu && modus==1) log_string += "</br>"; if(!neu && modus==1) log_string += "</br>";
@@ -1300,7 +1305,7 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
} }
// wins // wins
if(boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "wins" || boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "wins (side pot)" || boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "has left the game" || boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "was kicked from the game" || boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "is game admin now" || boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "has joined the game") { if(boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "wins" || boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "wins (side pot)") {
switch(modus) { switch(modus) {
case 1: case 1:
if(!neu) action_string = "</br><i>" + action_string + "</i>"; if(!neu) action_string = "</br><i>" + action_string + "</i>";
@@ -1314,6 +1319,21 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
} }
} }
// network actions
if(boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "has left the game" || boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "was kicked from the game" || boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "is game admin now" || boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "has joined the game") {
switch(modus) {
case 1:
if(!neu) action_string = "<i>" + action_string + "!</i>";
else action_string = "<i>" + action_string + "</i>";
break;
case 3:
action_string = "<i>" + action_string + "</i>";
break;
default:
;
}
}
// sits out // sits out
if(boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "sits out") { if(boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) == "sits out") {
switch(modus) { switch(modus) {
@@ -1394,34 +1414,26 @@ int guiLog::exportLog(QString fileStringPdb,int modus)
if(round_ctr == GAME_STATE_POST_RIVER) { if(round_ctr == GAME_STATE_POST_RIVER) {
// find hand name // find hand name
// data_found = false;
for(i=0; i<nCol_Hand; i++) { for(i=0; i<nCol_Hand; i++) {
cmpString = "Seat_"; cmpString = "Seat_";
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 += "_Hand_text"; cmpString += "_Hand_text";
if(boost::lexical_cast<std::string>(results.result_Hand[i]) == cmpString && results.result_Hand[i+nCol_Hand]) { if(boost::lexical_cast<std::string>(results.result_Hand[i]) == cmpString && results.result_Hand[i+nCol_Hand]) {
log_string += " - " + boost::lexical_cast<std::string>(results.result_Hand[i+nCol_Hand]); log_string += " - " + boost::lexical_cast<std::string>(results.result_Hand[i+nCol_Hand]);
// data_found = true;
} }
} }
// if(!data_found) {
// cout << "Missing hand name information in uniqueGame " << uniqueGameID << " hand " << results.result_Hand_ID[hand_ctr] << "!" << endl;
// sqlite3_close(mySqliteLogDb);
// return 1;
// }
} }
} }
if(!neu && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "wins" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "shows" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "has" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "sits out" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "wins (side pot)" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "wins game") { if(!neu && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "wins" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "shows" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "has" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "sits out" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "wins (side pot)" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "wins game" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "has left the game" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "was kicked from the game" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "is game admin now" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "has joined the game") {
log_string += "."; log_string += ".";
} }
if(neu && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "wins game") log_string += "."; if(neu && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "wins game" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "has left the game" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "was kicked from the game" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "is game admin now" && boost::lexical_cast<std::string>(results.result_Action[3*action_ctr+1]) != "has joined the game")
log_string += ".";
} }
// sqlite3_free_table(results.result_Action);
} }
if(modus == 1) log_string += "\n"; if(modus == 1) log_string += "\n";
+1
View File
@@ -32,6 +32,7 @@
struct result_struct { struct result_struct {
char **result_Session; char **result_Session;
char **result_Game; char **result_Game;
char **result_Player;
char **result_Hand; char **result_Hand;
char **result_Hand_ID; char **result_Hand_ID;
char **result_Action; char **result_Action;
+1 -1
View File
@@ -177,7 +177,7 @@ void MyAvatarLabel::refreshStars()
#ifdef __APPLE__ #ifdef __APPLE__
fontSize = "7"; fontSize = "7";
#else #else
fontSize = "12"; fontSize = "12";
#endif #endif
#endif #endif
@@ -491,8 +491,7 @@ void settingsDialogImpl::prepareDialog()
if(calledIngame) { if(calledIngame) {
pushButton_resetSettings->setDisabled(true); pushButton_resetSettings->setDisabled(true);
label_resetNote->show(); label_resetNote->show();
} } else {
else {
pushButton_resetSettings->setEnabled(true); pushButton_resetSettings->setEnabled(true);
label_resetNote->hide(); label_resetNote->hide();
} }
@@ -1382,11 +1381,10 @@ void settingsDialogImpl::showLogFilePreview()
void settingsDialogImpl::resetSettings() void settingsDialogImpl::resetSettings()
{ {
int ret = QMessageBox::warning(this, tr("PokerTH - Settings"), int ret = QMessageBox::warning(this, tr("PokerTH - Settings"),
tr("Attention: this will delete all your personal settings and close PokerTH!\n" tr("Attention: this will delete all your personal settings and close PokerTH!\n"
"Do you really want to reset factory settings?"), "Do you really want to reset factory settings?"),
QMessageBox::Yes | QMessageBox::No); QMessageBox::Yes | QMessageBox::No);
if(ret == QMessageBox::Yes) if(ret == QMessageBox::Yes) {
{
myConfig->deleteConfigFile(); myConfig->deleteConfigFile();
exit(0); exit(0);
} }
+6 -8
View File
@@ -1710,7 +1710,7 @@ ClientStateWaitHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client
tmpPlayer->setLastMoneyWon(r->moneyWon); tmpPlayer->setLastMoneyWon(r->moneyWon);
client->GetCallback().SignalNetClientPostRiverShowCards(r->playerId); client->GetCallback().SignalNetClientPostRiverShowCards(r->playerId);
client->GetClientLog()->logHoleCardsHandName(GAME_STATE_POST_RIVER, client->GetGame()->getActivePlayerList(), tmpPlayer, true); client->GetClientLog()->logHoleCardsHandName(client->GetGame()->getActivePlayerList(), tmpPlayer, true);
} else if (tmpPacket->GetMsg()->present == PokerTHMessage_PR_playerIdChangedMessage) { } else if (tmpPacket->GetMsg()->present == PokerTHMessage_PR_playerIdChangedMessage) {
boost::shared_ptr<Game> curGame = client->GetGame(); boost::shared_ptr<Game> curGame = client->GetGame();
if (curGame) { if (curGame) {
@@ -1788,8 +1788,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
netActionDone->playerAction, netActionDone->playerAction,
netActionDone->totalPlayerBet - tmpPlayer->getMySet()); netActionDone->totalPlayerBet - tmpPlayer->getMySet());
client->GetClientLog()->logPlayerAction( client->GetClientLog()->logPlayerAction(
curGame->getCurrentHand()->getCurrentBeRo()->getMyBeRoID(), tmpPlayer->getMyName(),
tmpPlayer->getMyID()+1,
client->GetClientLog()->transformPlayerActionLog(PlayerAction(netActionDone->playerAction)), client->GetClientLog()->transformPlayerActionLog(PlayerAction(netActionDone->playerAction)),
netActionDone->totalPlayerBet - tmpPlayer->getMySet() netActionDone->totalPlayerBet - tmpPlayer->getMySet()
); );
@@ -1886,7 +1885,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
curGame->getCurrentHand()->setPreviousPlayerID(-1); curGame->getCurrentHand()->setPreviousPlayerID(-1);
client->GetGui().logDealBoardCardsMsg(GAME_STATE_FLOP, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]); client->GetGui().logDealBoardCardsMsg(GAME_STATE_FLOP, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]);
client->GetClientLog()->logBoardCards(GAME_STATE_FLOP,tmpCards); client->GetClientLog()->logBoardCards(tmpCards);
client->GetGui().refreshGameLabels(GAME_STATE_FLOP); client->GetGui().refreshGameLabels(GAME_STATE_FLOP);
client->GetGui().refreshPot(); client->GetGui().refreshPot();
client->GetGui().refreshSet(); client->GetGui().refreshSet();
@@ -1902,7 +1901,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
curGame->getCurrentHand()->setPreviousPlayerID(-1); curGame->getCurrentHand()->setPreviousPlayerID(-1);
client->GetGui().logDealBoardCardsMsg(GAME_STATE_TURN, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]); client->GetGui().logDealBoardCardsMsg(GAME_STATE_TURN, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]);
client->GetClientLog()->logBoardCards(GAME_STATE_TURN,tmpCards); client->GetClientLog()->logBoardCards(tmpCards);
client->GetGui().refreshGameLabels(GAME_STATE_TURN); client->GetGui().refreshGameLabels(GAME_STATE_TURN);
client->GetGui().refreshPot(); client->GetGui().refreshPot();
client->GetGui().refreshSet(); client->GetGui().refreshSet();
@@ -1918,7 +1917,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
curGame->getCurrentHand()->setPreviousPlayerID(-1); curGame->getCurrentHand()->setPreviousPlayerID(-1);
client->GetGui().logDealBoardCardsMsg(GAME_STATE_RIVER, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]); client->GetGui().logDealBoardCardsMsg(GAME_STATE_RIVER, tmpCards[0], tmpCards[1], tmpCards[2], tmpCards[3], tmpCards[4]);
client->GetClientLog()->logBoardCards(GAME_STATE_RIVER,tmpCards); client->GetClientLog()->logBoardCards(tmpCards);
client->GetGui().refreshGameLabels(GAME_STATE_RIVER); client->GetGui().refreshGameLabels(GAME_STATE_RIVER);
client->GetGui().refreshPot(); client->GetGui().refreshPot();
client->GetGui().refreshSet(); client->GetGui().refreshSet();
@@ -1947,7 +1946,6 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
client->GetGui().flipHolecardsAllIn(); client->GetGui().flipHolecardsAllIn();
if(curGame->getCurrentHand()->getCurrentRound()<GAME_STATE_RIVER) { if(curGame->getCurrentHand()->getCurrentRound()<GAME_STATE_RIVER) {
client->GetClientLog()->logHoleCardsHandName( client->GetClientLog()->logHoleCardsHandName(
curGame->getCurrentHand()->getCurrentRound(),
curGame->getActivePlayerList() curGame->getActivePlayerList()
); );
} }
@@ -2037,7 +2035,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
curGame->getCurrentHand()->getBoard()->setPlayerNeedToShowCards(showList); curGame->getCurrentHand()->getBoard()->setPlayerNeedToShowCards(showList);
// logging // logging
client->GetClientLog()->logHoleCardsHandName(GAME_STATE_POST_RIVER,curGame->getActivePlayerList()); client->GetClientLog()->logHoleCardsHandName(curGame->getActivePlayerList());
client->GetClientLog()->logHandWinner(curGame->getActivePlayerList(), highestValueOfCards, winnerList); client->GetClientLog()->logHandWinner(curGame->getActivePlayerList(), highestValueOfCards, winnerList);
client->GetGui().postRiverRunAnimation1(); client->GetGui().postRiverRunAnimation1();
+3 -6
View File
@@ -753,8 +753,7 @@ ClientThread::SetNewGameAdmin(unsigned id)
playerData->SetGameAdmin(true); playerData->SetGameAdmin(true);
GetCallback().SignalNetClientNewGameAdmin(id, playerData->GetName()); GetCallback().SignalNetClientNewGameAdmin(id, playerData->GetName());
m_clientLog->logPlayerAction( m_clientLog->logPlayerAction(
m_game->getCurrentHand()->getCurrentRound(), playerData->GetName(),
m_game->getPlayerByUniqueId(id)->getMyID()+1,
LOG_ACTION_ADMIN LOG_ACTION_ADMIN
); );
} }
@@ -1126,14 +1125,12 @@ ClientThread::RemovePlayerData(unsigned playerId, int removeReason)
if(removeReason == NTF_NET_REMOVED_KICKED) { if(removeReason == NTF_NET_REMOVED_KICKED) {
m_clientLog->logPlayerAction( m_clientLog->logPlayerAction(
m_game->getCurrentHand()->getCurrentRound(), tmpData->GetName(),
m_game->getPlayerByUniqueId(tmpData->GetUniqueId())->getMyID()+1,
LOG_ACTION_KICKED LOG_ACTION_KICKED
); );
} else { } else {
m_clientLog->logPlayerAction( m_clientLog->logPlayerAction(
m_game->getCurrentHand()->getCurrentRound(), tmpData->GetName(),
m_game->getPlayerByUniqueId(tmpData->GetUniqueId())->getMyID()+1,
LOG_ACTION_LEFT LOG_ACTION_LEFT
); );
} }