reorgranize debug_mode

This commit is contained in:
floty
2014-03-23 23:11:16 +01:00
parent b93525607e
commit 1f0e256fe6
7 changed files with 166 additions and 140 deletions
+6 -6
View File
@@ -56,11 +56,9 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
dealerPosition = startData.startDealerPlayerId; dealerPosition = startData.startDealerPlayerId;
if(DEBUG_MODE) { // debug mode
startSmallBlind = myLog->debugMode_getStartSmallBlind(); myLog->debugMode_getStartSmallBlind(&startSmallBlind,&currentSmallBlind);
currentSmallBlind = startSmallBlind; myLog->debugMode_getStartDealerPosition(&dealerPosition);
dealerPosition = myLog->debugMode_getStartDealerPosition();
}
int i; int i;
@@ -109,8 +107,10 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> factory,
++player_i; ++player_i;
} }
// debug mode
myLog->debugMode_getPlayerStartCash(&myStartCash, i);
// create player objects // create player objects
if(DEBUG_MODE) myStartCash = myLog->debugMode_getPlayerStartCash(i);
boost::shared_ptr<PlayerInterface> tmpPlayer = myFactory->createPlayer(i, uniqueId, type, myName, myAvatarFile, myStartCash, startQuantityPlayers > i, myStayOnTableStatus, 0); boost::shared_ptr<PlayerInterface> tmpPlayer = myFactory->createPlayer(i, uniqueId, type, myName, myAvatarFile, myStartCash, startQuantityPlayers > i, myStayOnTableStatus, 0);
tmpPlayer->setIsSessionActive(true); tmpPlayer->setIsSessionActive(true);
tmpPlayer->setMyGuid(myGuid); tmpPlayer->setMyGuid(myGuid);
+12 -2
View File
@@ -73,8 +73,13 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost:
int bestHandPos[5]; int bestHandPos[5];
int sBluff; int sBluff;
// board cards
for(i=0; i<5; i++) tempBoardArray[i] = cardsArray[i]; for(i=0; i<5; i++) tempBoardArray[i] = cardsArray[i];
if(DEBUG_MODE) myLog->debugMode_getBoardCards(tempBoardArray,myID);
// debug mode
myLog->debugMode_getBoardCards(tempBoardArray,myID);
// prepare whole player hand
for(i=0; i<5; i++) tempPlayerAndBoardArray[i+2] = tempBoardArray[i]; for(i=0; i<5; i++) tempPlayerAndBoardArray[i+2] = tempBoardArray[i];
k = 0; k = 0;
@@ -83,8 +88,13 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost:
(*it)->getMyBestHandPosition(bestHandPos); (*it)->getMyBestHandPosition(bestHandPos);
// hole cards
for(j=0; j<2; j++) tempPlayerArray[j] = cardsArray[2*k+j+5]; for(j=0; j<2; j++) tempPlayerArray[j] = cardsArray[2*k+j+5];
if(DEBUG_MODE) myLog->debugMode_getPlayerCards(tempPlayerArray,myID,k);
// debug mode
myLog->debugMode_getPlayerCards(tempPlayerArray,myID,k);
// complete whole player hand
for(j=0; j<2; j++) tempPlayerAndBoardArray[j] = tempPlayerArray[j]; for(j=0; j<2; j++) tempPlayerAndBoardArray[j] = tempPlayerArray[j];
(*it)->setMyCards(tempPlayerArray); (*it)->setMyCards(tempPlayerArray);
+8 -4
View File
@@ -1263,7 +1263,8 @@ void LocalPlayer::preflopEngine()
// cout << myID << ": " << myOdds << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << "Bluff: " << sBluffStatus << endl; // cout << myID << ": " << myOdds << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << "Bluff: " << sBluffStatus << endl;
if(DEBUG_MODE) currentHand->getLog()->debugMode_getPlayerAction(GAME_STATE_PREFLOP, currentHand->getMyID(), myUniqueID, &myAction, &bet, &raise, mySet); // debug mode
currentHand->getLog()->debugMode_getPlayerAction(&myAction, &bet, &raise, GAME_STATE_PREFLOP, currentHand->getMyID(), myUniqueID, mySet);
evaluation(bet, raise); evaluation(bet, raise);
} }
@@ -1524,7 +1525,8 @@ void LocalPlayer::flopEngine()
} }
if(DEBUG_MODE) currentHand->getLog()->debugMode_getPlayerAction(GAME_STATE_FLOP, currentHand->getMyID(), myUniqueID, &myAction, &bet, &raise, mySet); // debug mode
currentHand->getLog()->debugMode_getPlayerAction(&myAction, &bet, &raise, GAME_STATE_FLOP, currentHand->getMyID(), myUniqueID, mySet);
evaluation(bet, raise); evaluation(bet, raise);
@@ -1798,7 +1800,8 @@ void LocalPlayer::turnEngine()
} }
if(DEBUG_MODE) currentHand->getLog()->debugMode_getPlayerAction(GAME_STATE_TURN, currentHand->getMyID(), myUniqueID, &myAction, &bet, &raise, mySet); // debug mode
currentHand->getLog()->debugMode_getPlayerAction(&myAction, &bet, &raise, GAME_STATE_TURN, currentHand->getMyID(), myUniqueID, mySet);
evaluation(bet, raise); evaluation(bet, raise);
@@ -2058,7 +2061,8 @@ void LocalPlayer::riverEngine()
} }
if(DEBUG_MODE) currentHand->getLog()->debugMode_getPlayerAction(GAME_STATE_RIVER, currentHand->getMyID(), myUniqueID, &myAction, &bet, &raise, mySet); // debug mode
currentHand->getLog()->debugMode_getPlayerAction(&myAction, &bet, &raise, GAME_STATE_RIVER, currentHand->getMyID(), myUniqueID, mySet);
evaluation(bet, raise); evaluation(bet, raise);
+102 -88
View File
@@ -39,17 +39,87 @@
#include <dirent.h> #include <dirent.h>
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <fstream>
using namespace std; using namespace std;
Log::Log(ConfigFile *c) : mySqliteLogDb(0), mySqliteLogFileName(""), myConfig(c), uniqueGameID(0), currentHandID(0), currentRound(GAME_STATE_PREFLOP), sql("") unsigned debug_mode_startSmallBlind = 10;
unsigned debug_mode_dealerPosition = 4;
unsigned debug_mode_startCash[MAX_NUMBER_OF_PLAYERS] = { 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000};
unsigned debug_mode_boardCards[][5] = {
{ 4, 19, 20, 43, 49 },
{ 4, 19, 20, 43, 49 }
};
int debug_mode_playerCards[][MAX_NUMBER_OF_PLAYERS][2] = {
{ {18,17}, {-1,-1}, {26,27}, {31,30}, {50,51}, {25,24}, {38,37}, {32,33}, {19,20}, {18,17} },
{ {18,17}, {31, 8}, {26,27}, {31,30}, {50,51}, {25,24}, {38,37}, {32,33}, {19,20}, {18,17} }
};
const unsigned debug_mode_cntBeRo = 4;
const unsigned debug_mode_cntActions = 4;
const unsigned debug_mode_cntValues = 3;
int playerActionMatrix[][debug_mode_cntBeRo][MAX_NUMBER_OF_PLAYERS][debug_mode_cntActions][debug_mode_cntValues] = {
{ /* handID==0 */
{ /* preflop */
{ {-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player0 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player1 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player2 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player3 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player4 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player5 */
{ {-1,PLAYER_ACTION_RAISE,100},{50,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player6 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player7 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player8 */
{ {-1,PLAYER_ACTION_CALL ,-1},{10,PLAYER_ACTION_RAISE ,100},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} } /* player9 */
},
{ /* flop */
{ {-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }
},
{ /* turn */
{ {-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }
},
{ /* river */
{ {-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }
}
}
};
Log::Log(ConfigFile *c) : mySqliteLogDb(0), mySqliteLogFileName(""), myConfig(c), uniqueGameID(0), currentHandID(0), currentRound(GAME_STATE_PREFLOP), sql(""), debug_mode(false)
{ {
// check for debug_mode
ifstream debug_mode_test_file("enable_debug_mode");
if(debug_mode_test_file) debug_mode = true;
} }
Log::~Log() Log::~Log()
{ {
if(SQLITE_LOG) { if(SQLITE_LOG) sqlite3_close(mySqliteLogDb);
sqlite3_close(mySqliteLogDb);
}
} }
void void
@@ -689,118 +759,61 @@ Log::exec_transaction()
// } // }
//} //}
unsigned void
Log::debugMode_getStartSmallBlind() Log::debugMode_getStartSmallBlind(int* startSmallBlind, int* currentSmallBlind)
{ {
return 10; if(debug_mode) {
*startSmallBlind = debug_mode_startSmallBlind;
*currentSmallBlind = *startSmallBlind;
}
} }
unsigned void
Log::debugMode_getStartDealerPosition() Log::debugMode_getStartDealerPosition(unsigned* dealerPosition)
{ {
return 4; if(debug_mode) {
*dealerPosition = debug_mode_dealerPosition;
}
} }
void void
Log::debugMode_getBoardCards(int *tempBoardArray, int handID) Log::debugMode_getBoardCards(int *tempBoardArray, int handID)
{ {
unsigned boardCards[][5] = { if(debug_mode) {
{ 4, 19, 20, 43, 49 }, if((unsigned)handID <= sizeof(debug_mode_boardCards)/sizeof(unsigned)/5) {
{ 4, 19, 20, 43, 49 } for(int i=0; i<5; i++) tempBoardArray[i] = debug_mode_boardCards[handID-1][i];
}; }
if((unsigned)handID <= sizeof(boardCards)/sizeof(int)/5) {
for(int i=0; i<5; i++) tempBoardArray[i] = boardCards[handID-1][i];
} }
} }
void void
Log::debugMode_getPlayerCards(int *tempPlayerArray, int handID, int seatID) Log::debugMode_getPlayerCards(int *tempPlayerArray, int handID, int seatID)
{ {
int playerCards[][10][2] = { if(debug_mode) {
{ {18,17}, {-1,-1}, {26,27}, {31,30}, {50,51}, {25,24}, {38,37}, {32,33}, {19,20}, {18,17} }, if((unsigned)handID <= sizeof(debug_mode_playerCards)/sizeof(int)/MAX_NUMBER_OF_PLAYERS/2) {
{ {18,17}, {31, 8}, {26,27}, {31,30}, {50,51}, {25,24}, {38,37}, {32,33}, {19,20}, {18,17} }
};
if((unsigned)handID <= sizeof(playerCards)/sizeof(int)/10/2) {
for(int i=0; i<2; i++) { for(int i=0; i<2; i++) {
if(playerCards[handID-1][seatID][i]>=0) tempPlayerArray[i] = playerCards[handID-1][seatID][i]; if(debug_mode_playerCards[handID-1][seatID][i]>=0) tempPlayerArray[i] = debug_mode_playerCards[handID-1][seatID][i];
} }
} }
} }
unsigned
Log::debugMode_getPlayerStartCash(int seatID)
{
unsigned startCashVector[] = { 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000, 5000 };
return startCashVector[seatID];
} }
void void
Log::debugMode_getPlayerAction(GameState gameState, int handID, int seatID, PlayerAction *playerAction, int *bet, int *raise, int mySet) Log::debugMode_getPlayerStartCash(int* startCash, int seatID)
{ {
const unsigned cntBeRo = 4; if(debug_mode) {
const unsigned cntPlayer = 10; *startCash = debug_mode_startCash[seatID];
const unsigned cntActions = 4;
const unsigned cntValues = 3;
int playerActionMatrix[][cntBeRo][cntPlayer][cntActions][cntValues] = {
{ /* handID==0 */
{ /* preflop */
{ {-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player0 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player1 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player2 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player3 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player4 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player5 */
{ {-1,PLAYER_ACTION_RAISE,100},{50,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player6 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player7 */
{ {-1,PLAYER_ACTION_CALL ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }, /* player8 */
{ {-1,PLAYER_ACTION_CALL ,-1},{10,PLAYER_ACTION_RAISE ,100},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} } /* player9 */
},
{ /* flop */
{ {-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }
},
{ /* turn */
{ {-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }
},
{ /* river */
{ {-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} },
{ {-1,PLAYER_ACTION_CHECK,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1},{-1,PLAYER_ACTION_NONE ,-1} }
} }
} }
};
if((unsigned)handID <= sizeof(playerActionMatrix)/sizeof(int)/cntBeRo/cntPlayer/cntActions/cntValues) { void
Log::debugMode_getPlayerAction(PlayerAction *playerAction, int *bet, int *raise, GameState gameState, int handID, int seatID, int mySet)
{
if(debug_mode) {
if((unsigned)handID <= sizeof(playerActionMatrix)/sizeof(int)/debug_mode_cntBeRo/MAX_NUMBER_OF_PLAYERS/debug_mode_cntActions/debug_mode_cntValues) {
int max_thd = 0; int max_thd = 0;
unsigned next_action_idx = 0; unsigned next_action_idx = 0;
for(unsigned action_idx=0; action_idx<cntActions; action_idx++) { for(unsigned action_idx=0; action_idx<debug_mode_cntActions; action_idx++) {
if(mySet > playerActionMatrix[handID-1][gameState][seatID][action_idx][0] && playerActionMatrix[handID-1][gameState][seatID][action_idx][0] > max_thd) { if(mySet > playerActionMatrix[handID-1][gameState][seatID][action_idx][0] && playerActionMatrix[handID-1][gameState][seatID][action_idx][0] > max_thd) {
max_thd = playerActionMatrix[handID-1][gameState][seatID][action_idx][0]; max_thd = playerActionMatrix[handID-1][gameState][seatID][action_idx][0];
next_action_idx = action_idx; next_action_idx = action_idx;
@@ -814,3 +827,4 @@ Log::debugMode_getPlayerAction(GameState gameState, int handID, int seatID, Play
} }
} }
} }
}
+9 -4
View File
@@ -66,12 +66,15 @@ public:
void logAfterGame(); void logAfterGame();
// void closeLogDbAtExit(); // void closeLogDbAtExit();
unsigned debugMode_getStartSmallBlind(); void debugMode_getStartSmallBlind(int* startSmallBlind, int* currentSmallBlind);
unsigned debugMode_getStartDealerPosition(); void debugMode_getStartDealerPosition(unsigned* dealerPosition);
void debugMode_getBoardCards(int* tempBoardArray, int handID); void debugMode_getBoardCards(int* tempBoardArray, int handID);
void debugMode_getPlayerCards(int* tempPlayerArray, int handID, int seatID); void debugMode_getPlayerCards(int* tempPlayerArray, int handID, int seatID);
unsigned debugMode_getPlayerStartCash(int seatID); void debugMode_getPlayerStartCash(int* startCash, int seatID);
void debugMode_getPlayerAction(GameState gameState, int handID, int seatID, PlayerAction* playerAction, int* bet, int* raise, int mySet); void debugMode_getPlayerAction(PlayerAction* playerAction, int* bet, int* raise, GameState gameState, int handID, int seatID, int mySet);
bool getDebugMode() {
return debug_mode;
}
void setCurrentRound(GameState theValue) { void setCurrentRound(GameState theValue) {
currentRound = theValue; currentRound = theValue;
@@ -92,6 +95,8 @@ private:
int currentHandID; int currentHandID;
GameState currentRound; GameState currentRound;
std::string sql; std::string sql;
bool debug_mode;
}; };
#endif // LOG_H #endif // LOG_H
-1
View File
@@ -37,7 +37,6 @@
#define MIN_GUI_SPEED 1 #define MIN_GUI_SPEED 1
#define MAX_GUI_SPEED 11 #define MAX_GUI_SPEED 11
#define DEBUG_MODE 0
#define SQLITE_LOG 1 #define SQLITE_LOG 1
#define HTML_LOG 0 #define HTML_LOG 0
+1 -7
View File
@@ -1443,7 +1443,7 @@ void gameTableImpl::dealHoleCards()
(*it_c)->getMyCards(tempCardsIntArray); (*it_c)->getMyCards(tempCardsIntArray);
for(j=0; j<2; j++) { for(j=0; j<2; j++) {
if((*it_c)->getMyActiveStatus()) { if((*it_c)->getMyActiveStatus()) {
if (( (*it_c)->getMyID() == 0) || DEBUG_MODE) { if (( (*it_c)->getMyID() == 0) || (currentGame->getCurrentHand()->getLog() && currentGame->getCurrentHand()->getLog()->getDebugMode()) ) {
tempCardsPixmapArray[j].load(myCardDeckStyle->getCurrentDir()+QString::number(tempCardsIntArray[j], 10)+".png"); tempCardsPixmapArray[j].load(myCardDeckStyle->getCurrentDir()+QString::number(tempCardsIntArray[j], 10)+".png");
if(myConfig->readConfigInt("AntiPeekMode")) { if(myConfig->readConfigInt("AntiPeekMode")) {
holeCardsArray[(*it_c)->getMyID()][j]->setPixmap(flipside, true); holeCardsArray[(*it_c)->getMyID()][j]->setPixmap(flipside, true);
@@ -2805,8 +2805,6 @@ void gameTableImpl::postRiverRunAnimation6()
} }
} }
if( !DEBUG_MODE ) {
if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_LOCAL) { if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_LOCAL) {
currentGameOver = true; currentGameOver = true;
#ifdef GUI_800x480 #ifdef GUI_800x480
@@ -2825,10 +2823,6 @@ void gameTableImpl::postRiverRunAnimation6()
#endif #endif
blinkingStartButtonAnimationTimer->start(500); blinkingStartButtonAnimationTimer->start(500);
} }
} else {
myStartWindow->callNewGameDialog();
//Bei Cancel nichts machen!!!
}
return; return;
} }