applying astyle

This commit is contained in:
floty
2011-10-26 22:29:47 +00:00
parent fa01ab57d6
commit 7f13da91e5
38 changed files with 443 additions and 447 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ public:
virtual void setSets(int theValue) =0; virtual void setSets(int theValue) =0;
virtual void setAllInCondition(bool theValue) =0; virtual void setAllInCondition(bool theValue) =0;
virtual void setLastActionPlayerID(unsigned theValue) =0; virtual void setLastActionPlayerID(unsigned theValue) =0;
// //
virtual void collectSets() =0; virtual void collectSets() =0;
virtual void collectPot() =0; virtual void collectPot() =0;
+1 -1
View File
@@ -34,7 +34,7 @@ public:
virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) =0; virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) =0;
virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp) =0; virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp) =0;
virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) =0; virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) =0;
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB) =0; virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB) =0;
}; };
#endif #endif
+6 -6
View File
@@ -52,8 +52,8 @@ public:
virtual void setStartQuantityPlayers(int theValue) =0; virtual void setStartQuantityPlayers(int theValue) =0;
virtual int getStartQuantityPlayers() const =0; virtual int getStartQuantityPlayers() const =0;
virtual void setCurrentRound(GameState theValue) =0; virtual void setCurrentRound(GameState theValue) =0;
virtual GameState getCurrentRound() const =0; virtual GameState getCurrentRound() const =0;
virtual void setDealerPosition(int theValue) =0; virtual void setDealerPosition(int theValue) =0;
virtual int getDealerPosition() const =0; virtual int getDealerPosition() const =0;
@@ -70,11 +70,11 @@ public:
virtual void setBettingRoundsPlayed(int theValue) =0; virtual void setBettingRoundsPlayed(int theValue) =0;
virtual int getBettingRoundsPlayed() const =0; virtual int getBettingRoundsPlayed() const =0;
virtual void setPreviousPlayerID(int theValue) =0; virtual void setPreviousPlayerID(int theValue) =0;
virtual int getPreviousPlayerID() const =0; virtual int getPreviousPlayerID() const =0;
virtual void setLastActionPlayerID( unsigned theValue ) =0; virtual void setLastActionPlayerID( unsigned theValue ) =0;
virtual unsigned getLastActionPlayerID() const =0; virtual unsigned getLastActionPlayerID() const =0;
virtual void setCardsShown(bool theValue) =0; virtual void setCardsShown(bool theValue) =0;
virtual bool getCardsShown() const =0; virtual bool getCardsShown() const =0;
+3 -3
View File
@@ -25,7 +25,7 @@
using namespace std; using namespace std;
LocalBeRo::LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS) LocalBeRo::LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS)
: BeRoInterface(), myHand(hi), myBeRoID(gS), dealerPosition(dP), smallBlindPosition(0), dealerPositionId(dP), smallBlindPositionId(0), bigBlindPositionId(0), smallBlind(sB), highestSet(0), minimumRaise(2*sB), fullBetRule(false), firstRun(true), firstRunGui(true), firstRound(true), firstHeadsUpRound(true), currentPlayersTurnId(0), firstRoundLastPlayersTurnId(0), logBoardCardsDone(false) : BeRoInterface(), myHand(hi), myBeRoID(gS), dealerPosition(dP), smallBlindPosition(0), dealerPositionId(dP), smallBlindPositionId(0), bigBlindPositionId(0), smallBlind(sB), highestSet(0), minimumRaise(2*sB), fullBetRule(false), firstRun(true), firstRunGui(true), firstRound(true), firstHeadsUpRound(true), currentPlayersTurnId(0), firstRoundLastPlayersTurnId(0), logBoardCardsDone(false)
{ {
currentPlayersTurnIt = myHand->getRunningPlayerList()->begin(); currentPlayersTurnIt = myHand->getRunningPlayerList()->begin();
lastPlayersTurnIt = myHand->getRunningPlayerList()->begin(); lastPlayersTurnIt = myHand->getRunningPlayerList()->begin();
@@ -84,7 +84,7 @@ void LocalBeRo::run()
if(firstRunGui) { if(firstRunGui) {
firstRunGui = false; firstRunGui = false;
myHand->setPreviousPlayerID(-1); myHand->setPreviousPlayerID(-1);
myHand->getGuiInterface()->dealBeRoCards(myBeRoID); myHand->getGuiInterface()->dealBeRoCards(myBeRoID);
} else { } else {
@@ -176,7 +176,7 @@ void LocalBeRo::run()
// aktuelle bero nicht dran, weil alle Sets gleich sind // aktuelle bero nicht dran, weil alle Sets gleich sind
//also gehe in naechste bero //also gehe in naechste bero
myHand->setCurrentRound(GameState(myBeRoID+1)); myHand->setCurrentRound(GameState(myBeRoID+1));
//Action loeschen und ActionButtons refresh //Action loeschen und ActionButtons refresh
for(it_c=myHand->getRunningPlayerList()->begin(); it_c!=myHand->getRunningPlayerList()->end(); ++it_c) { for(it_c=myHand->getRunningPlayerList()->begin(); it_c!=myHand->getRunningPlayerList()->end(); ++it_c) {
+1 -1
View File
@@ -28,7 +28,7 @@
class LocalBeRo : public BeRoInterface class LocalBeRo : public BeRoInterface
{ {
public: public:
LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS); LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS);
~LocalBeRo(); ~LocalBeRo();
GameState getMyBeRoID() const { GameState getMyBeRoID() const {
+1 -1
View File
@@ -28,7 +28,7 @@ class LocalBeRoFlop : public LocalBeRo
{ {
public: public:
LocalBeRoFlop(HandInterface*, unsigned, int); LocalBeRoFlop(HandInterface*, unsigned, int);
~LocalBeRoFlop(); ~LocalBeRoFlop();
}; };
+21 -21
View File
@@ -83,28 +83,28 @@ void LocalBeRoPostRiver::postRiverRun()
//Pot auf 0 setzen //Pot auf 0 setzen
getMyHand()->getBoard()->setPot(0); getMyHand()->getBoard()->setPot(0);
// logging hole Cards / Hands // logging hole Cards / Hands
int nonfoldPlayersCounter = 0; int nonfoldPlayersCounter = 0;
for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) { for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if ((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) nonfoldPlayersCounter++; if ((*it_c)->getMyAction() != PLAYER_ACTION_FOLD) nonfoldPlayersCounter++;
} }
if(nonfoldPlayersCounter>1) { if(nonfoldPlayersCounter>1) {
getMyHand()->getLog()->logHoleCardsHandName(5,getMyHand()->getActivePlayerList()); getMyHand()->getLog()->logHoleCardsHandName(5,getMyHand()->getActivePlayerList());
} }
// logging winner if game is over // logging winner if game is over
// wenn nur noch ein Spieler aktive "neues Spiel"-Dialog anzeigen // wenn nur noch ein Spieler aktive "neues Spiel"-Dialog anzeigen
int playersPositiveCashCounter = 0; int playersPositiveCashCounter = 0;
for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) { for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if ((*it_c)->getMyCash() > 0) playersPositiveCashCounter++; if ((*it_c)->getMyCash() > 0) playersPositiveCashCounter++;
} }
if (playersPositiveCashCounter==1) { if (playersPositiveCashCounter==1) {
for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) { for (it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); ++it_c) {
if ((*it_c)->getMyCash() > 0) { if ((*it_c)->getMyCash() > 0) {
getMyHand()->getLog()->logPlayerAction(5,(*it_c)->getMyID()+1,LOG_ACTION_WIN_GAME); getMyHand()->getLog()->logPlayerAction(5,(*it_c)->getMyID()+1,LOG_ACTION_WIN_GAME);
} }
} }
} }
//starte die Animaionsreihe //starte die Animaionsreihe
getMyHand()->getGuiInterface()->postRiverRunAnimation1(); getMyHand()->getGuiInterface()->postRiverRunAnimation1();
+1 -1
View File
@@ -28,7 +28,7 @@ class HandInterface;
class LocalBeRoPostRiver : public LocalBeRo class LocalBeRoPostRiver : public LocalBeRo
{ {
public: public:
LocalBeRoPostRiver(HandInterface*, int, int); LocalBeRoPostRiver(HandInterface*, int, int);
~LocalBeRoPostRiver(); ~LocalBeRoPostRiver();
void setHighestCardsValue(int theValue) { void setHighestCardsValue(int theValue) {
+1 -1
View File
@@ -28,7 +28,7 @@ class LocalBeRoPreflop : public LocalBeRo
{ {
public: public:
LocalBeRoPreflop(HandInterface*, unsigned, int); LocalBeRoPreflop(HandInterface*, unsigned, int);
~LocalBeRoPreflop(); ~LocalBeRoPreflop();
void run(); void run();
+1 -1
View File
@@ -28,7 +28,7 @@ class HandInterface;
class LocalBeRoRiver : public LocalBeRo class LocalBeRoRiver : public LocalBeRo
{ {
public: public:
LocalBeRoRiver(HandInterface*, unsigned, int); LocalBeRoRiver(HandInterface*, unsigned, int);
~LocalBeRoRiver(); ~LocalBeRoRiver();
}; };
+1 -1
View File
@@ -27,7 +27,7 @@ class HandInterface;
class LocalBeRoTurn : public LocalBeRo class LocalBeRoTurn : public LocalBeRo
{ {
public: public:
LocalBeRoTurn(HandInterface*, unsigned, int); LocalBeRoTurn(HandInterface*, unsigned, int);
~LocalBeRoTurn(); ~LocalBeRoTurn();
}; };
+1 -1
View File
@@ -299,7 +299,7 @@ void LocalBoard::determinePlayerNeedToShowCards()
// cout << "lAP-Ende: " << currentHand->getLastActionPlayer() << endl; // cout << "lAP-Ende: " << currentHand->getLastActionPlayer() << endl;
// search lastActionPlayer // search lastActionPlayer
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)->getMyUniqueID() == lastActionPlayerID && (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) { if((*it_c)->getMyUniqueID() == lastActionPlayerID && (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
lastActionPlayerIt = it_c; lastActionPlayerIt = it_c;
// cout << (*it_c)->getMyUniqueID() << endl; // cout << (*it_c)->getMyUniqueID() << endl;
break; break;
+3 -3
View File
@@ -49,8 +49,8 @@ public:
void setAllInCondition(bool theValue) { void setAllInCondition(bool theValue) {
allInCondition = theValue; allInCondition = theValue;
} }
void setLastActionPlayerID(unsigned theValue) { void setLastActionPlayerID(unsigned theValue) {
lastActionPlayerID = theValue; lastActionPlayerID = theValue;
} }
int getPot() const { int getPot() const {
@@ -100,7 +100,7 @@ private:
int sets; int sets;
unsigned dealerPosition; unsigned dealerPosition;
bool allInCondition; bool allInCondition;
unsigned lastActionPlayerID; unsigned lastActionPlayerID;
}; };
@@ -64,15 +64,15 @@ LocalEngineFactory::createBeRo(HandInterface *hi, unsigned dP, int sB)
{ {
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo; std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPreflop(hi, dP, sB))); myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPreflop(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoFlop(hi, dP, sB))); myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoFlop(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoTurn(hi, dP, sB))); myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoTurn(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoRiver(hi, dP, sB))); myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoRiver(hi, dP, sB)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPostRiver(hi, dP, sB))); myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new LocalBeRoPostRiver(hi, dP, sB)));
return myBeRo; return myBeRo;
+1 -1
View File
@@ -39,7 +39,7 @@ public:
virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC); virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp); virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp);
virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB); virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB); virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB);
private: private:
ConfigFile *myConfig; ConfigFile *myConfig;
+28 -28
View File
@@ -30,7 +30,7 @@
using namespace std; using namespace std;
LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC) LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, unsigned dP, int sB,int sC)
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), smallBlindPosition(dP), bigBlindPosition(dP), currentRound(GAME_STATE_PREFLOP), smallBlind(sB), startCash(sC), previousPlayerID(-1), lastActionPlayerID(0), allInCondition(false), : myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myBeRo(0), myID(id), startQuantityPlayers(sP), dealerPosition(dP), smallBlindPosition(dP), bigBlindPosition(dP), currentRound(GAME_STATE_PREFLOP), smallBlind(sB), startCash(sC), previousPlayerID(-1), lastActionPlayerID(0), allInCondition(false),
cardsShown(false), bettingRoundsPlayed(0) cardsShown(false), bettingRoundsPlayed(0)
{ {
@@ -46,7 +46,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost:
// generate cards and assign to board and player // generate cards and assign to board and player
const int NumCards = 52; const int NumCards = 52;
int cardsArray[NumCards] = { int cardsArray[NumCards] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
@@ -367,7 +367,7 @@ LocalHand::LocalHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost:
setBlinds(); setBlinds();
myBeRo = myFactory->createBeRo(this, dealerPosition, smallBlind); myBeRo = myFactory->createBeRo(this, dealerPosition, smallBlind);
} }
@@ -448,8 +448,8 @@ void LocalHand::assignButtons()
} }
// first player after dealer have to show his cards first (in showdown) // first player after dealer have to show his cards first (in showdown)
lastActionPlayerID = (*it)->getMyUniqueID(); lastActionPlayerID = (*it)->getMyUniqueID();
myBoard->setLastActionPlayerID(lastActionPlayerID); myBoard->setLastActionPlayerID(lastActionPlayerID);
++it; ++it;
if(it == activePlayerList->end()) it = activePlayerList->begin(); if(it == activePlayerList->end()) it = activePlayerList->begin();
@@ -528,29 +528,29 @@ void LocalHand::setBlinds()
void LocalHand::switchRounds() void LocalHand::switchRounds()
{ {
// logging last player action // // logging last player action
// currentPlayersTurnIt = myHand->getRunningPlayerIt( currentPlayersTurnId ); // PlayerListConstIterator previousPlayerIt = getRunningPlayerIt(previousPlayerID);
// if(currentPlayersTurnIt == myHand->getRunningPlayerList()->end()) { // if(previousPlayerIt == runningPlayerList->end()) {
// throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND); // throw LocalException(__FILE__, __LINE__, ERR_RUNNING_PLAYER_NOT_FOUND);
// } // }
// switch((*currentPlayersTurnIt)->getMyAction()) { // switch((*previousPlayerIt)->getMyAction()) {
// case PLAYER_ACTION_FOLD: { // case PLAYER_ACTION_FOLD: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_FOLD); // myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_FOLD);
// } break; // } break;
// case PLAYER_ACTION_CHECK: { // case PLAYER_ACTION_CHECK: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_CHECK); // myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_CHECK);
// } break; // } break;
// case PLAYER_ACTION_CALL: { // case PLAYER_ACTION_CALL: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_CALL); // myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_CALL);
// } break; // } break;
// case PLAYER_ACTION_BET: // case PLAYER_ACTION_BET:
// case PLAYER_ACTION_RAISE: { // case PLAYER_ACTION_RAISE: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_BET,(*currentPlayersTurnIt)->getMySet()); // myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_BET,(*previousPlayerIt)->getMySet());
// } break; // } break;
// case PLAYER_ACTION_ALLIN: { // case PLAYER_ACTION_ALLIN: {
// myHand->getLog()->logPlayerAction(myBeRoID+1,(*currentPlayersTurnIt)->getMyID()+1,LOG_ACTION_ALL_IN,(*currentPlayersTurnIt)->getMySet()); // myLog->logPlayerAction(currentRound+1,(*previousPlayerIt)->getMyID()+1,LOG_ACTION_ALL_IN,(*previousPlayerIt)->getMySet());
// } break; // } break;
// default: { // default: {
// } // }
@@ -595,7 +595,7 @@ void LocalHand::switchRounds()
myBoard->collectPot(); myBoard->collectPot();
myGui->refreshPot(); myGui->refreshPot();
myGui->refreshSet(); myGui->refreshSet();
currentRound = GAME_STATE_POST_RIVER; currentRound = GAME_STATE_POST_RIVER;
} }
// check for all in condition // check for all in condition
@@ -655,16 +655,16 @@ void LocalHand::switchRounds()
myGui->refreshPot(); myGui->refreshPot();
myGui->refreshSet(); myGui->refreshSet();
myGui->flipHolecardsAllIn(); myGui->flipHolecardsAllIn();
// Logging HoleCards // Logging HoleCards
if(currentRound<GAME_STATE_RIVER) { if(currentRound<GAME_STATE_RIVER) {
myLog->logHoleCardsHandName(currentRound+1,activePlayerList); myLog->logHoleCardsHandName(currentRound+1,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);
//log board cards for allin //log board cards for allin
if(currentRound >= GAME_STATE_FLOP) { if(currentRound >= GAME_STATE_FLOP) {
int tempBoardCardsArray[5]; int tempBoardCardsArray[5];
myBoard->getMyCards(tempBoardCardsArray); myBoard->getMyCards(tempBoardCardsArray);
@@ -675,10 +675,10 @@ void LocalHand::switchRounds()
} }
//unhighlight current players groupbox //unhighlight current players groupbox
it_c = getActivePlayerIt(previousPlayerID); it_c = getActivePlayerIt(previousPlayerID);
if( it_c != activePlayerList->end() ) { if( it_c != activePlayerList->end() ) {
// lastPlayersTurn is active // lastPlayersTurn is active
myGui->refreshGroupbox(previousPlayerID,1); myGui->refreshGroupbox(previousPlayerID,1);
} }
myGui->refreshGameLabels((GameState)getCurrentRound()); myGui->refreshGameLabels((GameState)getCurrentRound());
@@ -769,6 +769,6 @@ PlayerListIterator LocalHand::getRunningPlayerIt(unsigned uniqueId) const
void LocalHand::setLastActionPlayerID(unsigned theValue) void LocalHand::setLastActionPlayerID(unsigned theValue)
{ {
lastActionPlayerID = theValue; lastActionPlayerID = theValue;
myBoard->setLastActionPlayerID(theValue); myBoard->setLastActionPlayerID(theValue);
} }
+12 -12
View File
@@ -88,10 +88,10 @@ public:
return startQuantityPlayers; return startQuantityPlayers;
} }
void setCurrentRound(GameState theValue) { void setCurrentRound(GameState theValue) {
currentRound = theValue; currentRound = theValue;
} }
GameState getCurrentRound() const { GameState getCurrentRound() const {
return currentRound; return currentRound;
} }
@@ -130,16 +130,16 @@ public:
return bettingRoundsPlayed; return bettingRoundsPlayed;
} }
void setPreviousPlayerID(int theValue) { void setPreviousPlayerID(int theValue) {
previousPlayerID = theValue; previousPlayerID = theValue;
} }
int getPreviousPlayerID() const { int getPreviousPlayerID() const {
return previousPlayerID; return previousPlayerID;
} }
void setLastActionPlayerID ( unsigned theValue ); void setLastActionPlayerID ( unsigned theValue );
unsigned getLastActionPlayerID() const { unsigned getLastActionPlayerID() const {
return lastActionPlayerID; return lastActionPlayerID;
} }
void setCardsShown(bool theValue) { void setCardsShown(bool theValue) {
@@ -177,12 +177,12 @@ private:
unsigned dealerPosition; unsigned dealerPosition;
unsigned smallBlindPosition; unsigned smallBlindPosition;
unsigned bigBlindPosition; unsigned bigBlindPosition;
GameState currentRound; GameState currentRound;
int smallBlind; int smallBlind;
int startCash; int startCash;
int previousPlayerID; int previousPlayerID;
unsigned lastActionPlayerID; unsigned lastActionPlayerID;
bool allInCondition; bool allInCondition;
bool cardsShown; bool cardsShown;
+157 -157
View File
@@ -847,7 +847,7 @@ static const RoundData FlopValues[] = {
LocalPlayer::LocalPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) LocalPlayer::LocalPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
: PlayerInterface(), myConfig(c), currentHand(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar), : PlayerInterface(), myConfig(c), currentHand(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar),
myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(PLAYER_ACTION_NONE), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(PLAYER_ACTION_NONE),
myButton(mB), myActiveStatus(aS), myStayOnTableStatus(1), myTurn(0), myCardsFlip(0), myRoundStartCash(0), lastMoneyWon(0), myButton(mB), myActiveStatus(aS), myStayOnTableStatus(1), myTurn(0), myCardsFlip(0), myRoundStartCash(0), lastMoneyWon(0),
sBluff(0), sBluffStatus(0), myWinnerState(false), m_actionTimeoutCounter(0), m_isConnected(false) sBluff(0), sBluffStatus(0), myWinnerState(false), m_actionTimeoutCounter(0), m_isConnected(false)
{ {
@@ -1066,7 +1066,7 @@ void LocalPlayer::action()
// cout << "jetzt" << endl; // cout << "jetzt" << endl;
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setPreviousPlayerID(myID); currentHand->setPreviousPlayerID(myID);
currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet); currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
currentHand->getGuiInterface()->nextPlayerAnimation(); currentHand->getGuiInterface()->nextPlayerAnimation();
@@ -1222,16 +1222,16 @@ void LocalPlayer::preflopEngine()
// all in // all in
if(myOdds >= myNiveau[2] + 8) { if(myOdds >= myNiveau[2] + 8) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
// nur call // nur call
else { else {
// all in bei knappem call // all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) { if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} else { } else {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} }
@@ -1247,51 +1247,51 @@ void LocalPlayer::preflopEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) { if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash; raise = myCash;
} }
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
// auf cBluff testen --> call (bzw check) statt raise // auf cBluff testen --> call (bzw check) statt raise
if(cBluff > 90) { if(cBluff > 90) {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
// bigBlind --> check // bigBlind --> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK; if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
} }
if(cBluff > 80 && myOdds >= myNiveau[2] + 4) { if(cBluff > 80 && myOdds >= myNiveau[2] + 4) {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
// bigBlind --> check // bigBlind --> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK; if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
} }
if(cBluff > 70 && myOdds >= myNiveau[2] + 8) { if(cBluff > 70 && myOdds >= myNiveau[2] + 8) {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
// bigBlind --> check // bigBlind --> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK; if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
} }
if(cBluff > 60 && myOdds >= myNiveau[2] + 12) { if(cBluff > 60 && myOdds >= myNiveau[2] + 12) {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
// bigBlind --> check // bigBlind --> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK; if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
} }
} else { } else {
// call // call
if(myOdds >= myNiveau[0] || (mySet >= currentHand->getCurrentBeRo()->getHighestSet()/2 && myOdds >= myNiveau[0]-8)) { if(myOdds >= myNiveau[0] || (mySet >= currentHand->getCurrentBeRo()->getHighestSet()/2 && myOdds >= myNiveau[0]-8)) {
// bigBlind --> check // bigBlind --> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK; if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
else { else {
// all in bei knappem call // all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) { if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} else { } else {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} }
} }
// fold // fold
else { else {
// bigBlind -> check // bigBlind -> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK; if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
else myAction = PLAYER_ACTION_FOLD; else myAction = PLAYER_ACTION_FOLD;
} }
} }
@@ -1308,11 +1308,11 @@ void LocalPlayer::preflopEngine()
// all in bei knappem call // all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/6) { if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/6) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} else { } else {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
// bigBlind --> check // bigBlind --> check
if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK; if(myButton == 3 && mySet == currentHand->getCurrentBeRo()->getHighestSet()) myAction = PLAYER_ACTION_CHECK;
} }
} }
// Standard-Raise-Routine // Standard-Raise-Routine
@@ -1327,12 +1327,12 @@ void LocalPlayer::preflopEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) { if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash; raise = myCash;
} }
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
// extrem hoher set der gegner -> bluff beenden // extrem hoher set der gegner -> bluff beenden
if((currentHand->getCurrentBeRo()->getHighestSet() >= 12*currentHand->getSmallBlind() && myOdds < myNiveau[0]) || (currentHand->getCurrentBeRo()->getHighestSet() >= 20*currentHand->getSmallBlind() && myOdds < myNiveau[2])) { if((currentHand->getCurrentBeRo()->getHighestSet() >= 12*currentHand->getSmallBlind() && myOdds < myNiveau[0]) || (currentHand->getCurrentBeRo()->getHighestSet() >= 20*currentHand->getSmallBlind() && myOdds < myNiveau[2])) {
myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_FOLD;
} }
@@ -1590,16 +1590,16 @@ void LocalPlayer::flopEngine()
// all in // all in
if(myOdds >= myNiveau[2] + 15) { if(myOdds >= myNiveau[2] + 15) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
// nur call // nur call
else { else {
// all in bei knappem call // all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) { if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} else { } else {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} }
@@ -1615,14 +1615,14 @@ void LocalPlayer::flopEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4.0)/5.0) { if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4.0)/5.0) {
raise = myCash; raise = myCash;
} }
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
// auf cBluff testen --> call statt raise // auf cBluff testen --> call statt raise
if(cBluff > 90) myAction = PLAYER_ACTION_CALL; if(cBluff > 90) myAction = PLAYER_ACTION_CALL;
if(cBluff > 80 && myOdds >= myNiveau[2] + 4) myAction = PLAYER_ACTION_CALL; if(cBluff > 80 && myOdds >= myNiveau[2] + 4) myAction = PLAYER_ACTION_CALL;
if(cBluff > 70 && myOdds >= myNiveau[2] + 8) myAction = PLAYER_ACTION_CALL; if(cBluff > 70 && myOdds >= myNiveau[2] + 8) myAction = PLAYER_ACTION_CALL;
if(cBluff > 60 && myOdds >= myNiveau[2] + 12) myAction = PLAYER_ACTION_CALL; if(cBluff > 60 && myOdds >= myNiveau[2] + 12) myAction = PLAYER_ACTION_CALL;
} else { } else {
// call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt // call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt
@@ -1630,12 +1630,12 @@ void LocalPlayer::flopEngine()
// all in bei knappem call // all in bei knappem call
if(currentHand->getCurrentBeRo()->getHighestSet() > (myCash*3.0)/4.0) { if(currentHand->getCurrentBeRo()->getHighestSet() > (myCash*3.0)/4.0) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} else myAction = PLAYER_ACTION_CALL; } else myAction = PLAYER_ACTION_CALL;
} }
// fold // fold
else { else {
myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_FOLD;
} }
} }
} else { } else {
@@ -1654,17 +1654,17 @@ void LocalPlayer::flopEngine()
if(bet > (myCash*4.0)/5.0) { if(bet > (myCash*4.0)/5.0) {
bet = myCash; bet = myCash;
} }
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
// auf cBluff testen --> check statt bet // auf cBluff testen --> check statt bet
if(cBluff > 80) myAction = PLAYER_ACTION_CHECK; if(cBluff > 80) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 70 && myOdds >= myNiveau[1] + 4) myAction = PLAYER_ACTION_CHECK; if(cBluff > 70 && myOdds >= myNiveau[1] + 4) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 60 && myOdds >= myNiveau[1] + 8) myAction = PLAYER_ACTION_CHECK; if(cBluff > 60 && myOdds >= myNiveau[1] + 8) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 50 && myOdds >= myNiveau[1] + 12) myAction = PLAYER_ACTION_CHECK; if(cBluff > 50 && myOdds >= myNiveau[1] + 12) myAction = PLAYER_ACTION_CHECK;
} }
// check // check
else { else {
myAction = PLAYER_ACTION_CHECK; myAction = PLAYER_ACTION_CHECK;
// Position // Position
if(myButton == 1) { if(myButton == 1) {
// Position-Bluff generieren // Position-Bluff generieren
@@ -1683,7 +1683,7 @@ void LocalPlayer::flopEngine()
if(bet > (myCash*4.0)/5.0) { if(bet > (myCash*4.0)/5.0) {
bet = myCash; bet = myCash;
} }
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
} }
} }
} }
@@ -1701,7 +1701,7 @@ void LocalPlayer::flopEngine()
// Gegner setzen -> call // Gegner setzen -> call
if(currentHand->getCurrentBeRo()->getHighestSet() >= 4*currentHand->getSmallBlind()) { if(currentHand->getCurrentBeRo()->getHighestSet() >= 4*currentHand->getSmallBlind()) {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
// Standard-Raise-Routine // Standard-Raise-Routine
else { else {
@@ -1716,12 +1716,12 @@ void LocalPlayer::flopEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) { if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash; raise = myCash;
} }
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
// extrem hoher set der gegner -> bluff beenden // extrem hoher set der gegner -> bluff beenden
if(currentHand->getCurrentBeRo()->getHighestSet() >= 10*currentHand->getSmallBlind()) { if(currentHand->getCurrentBeRo()->getHighestSet() >= 10*currentHand->getSmallBlind()) {
myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_FOLD;
} }
} }
} else { } else {
@@ -1743,7 +1743,7 @@ void LocalPlayer::flopEngine()
if(bet > (myCash*4.0)/5.0) { if(bet > (myCash*4.0)/5.0) {
bet = myCash; bet = myCash;
} }
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
} }
} }
@@ -1974,11 +1974,11 @@ void LocalPlayer::flopEngine()
// case 4: { // case 4: {
// Tools::getRandNumber(0,100,1,&cBluff,0); // Tools::getRandNumber(0,100,1,&cBluff,0);
// if(cBluff < 35) { // if(cBluff < 35) {
// myAction = PLAYER_ACTION_CHECK; // myAction = PLAYER_ACTION_CHECK;
// } // }
// else { // else {
// if(myCash/(2*currentHand->getSmallBlind()) <= 8) { // if(myCash/(2*currentHand->getSmallBlind()) <= 8) {
// myAction = PLAYER_ACTION_ALLIN; // myAction = PLAYER_ACTION_ALLIN;
// } else { // } else {
// if(cBluff < 60) { // if(cBluff < 60) {
// bet = (7-myDude4)*2*currentHand->getSmallBlind(); // bet = (7-myDude4)*2*currentHand->getSmallBlind();
@@ -1986,7 +1986,7 @@ void LocalPlayer::flopEngine()
// bet = (((100-cBluff)/20)+2)*currentHand->getSmallBlind(); // bet = (((100-cBluff)/20)+2)*currentHand->getSmallBlind();
// } // }
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
// } // }
// } // }
// } // }
@@ -1996,11 +1996,11 @@ void LocalPlayer::flopEngine()
// case 2: { // case 2: {
// Tools::getRandNumber(0,100,1,&cBluff,0); // Tools::getRandNumber(0,100,1,&cBluff,0);
// if(cBluff < 35) { // if(cBluff < 35) {
// myAction = PLAYER_ACTION_CHECK; // myAction = PLAYER_ACTION_CHECK;
// } // }
// else { // else {
// if(myCash/(2*currentHand->getSmallBlind()) <= 8) { // if(myCash/(2*currentHand->getSmallBlind()) <= 8) {
// myAction = PLAYER_ACTION_ALLIN; // myAction = PLAYER_ACTION_ALLIN;
// } else { // } else {
// if(cBluff < 60) { // if(cBluff < 60) {
// bet = (5-myDude4)*2*currentHand->getSmallBlind(); // bet = (5-myDude4)*2*currentHand->getSmallBlind();
@@ -2008,7 +2008,7 @@ void LocalPlayer::flopEngine()
// bet = (((100-cBluff)/20)+2)*currentHand->getSmallBlind(); // bet = (((100-cBluff)/20)+2)*currentHand->getSmallBlind();
// } // }
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
// } // }
// } // }
// } // }
@@ -2016,11 +2016,11 @@ void LocalPlayer::flopEngine()
// case 1: { // case 1: {
// Tools::getRandNumber(0,100,1,&cBluff,0); // Tools::getRandNumber(0,100,1,&cBluff,0);
// if(cBluff < 40) { // if(cBluff < 40) {
// myAction = PLAYER_ACTION_CHECK; // myAction = PLAYER_ACTION_CHECK;
// } // }
// else { // else {
// if(myCash/(2*currentHand->getSmallBlind()) <= 6) { // if(myCash/(2*currentHand->getSmallBlind()) <= 6) {
// myAction = PLAYER_ACTION_ALLIN; // myAction = PLAYER_ACTION_ALLIN;
// } else { // } else {
// if(cBluff < 60) { // if(cBluff < 60) {
// bet = (3-myDude4)*2*currentHand->getSmallBlind(); // bet = (3-myDude4)*2*currentHand->getSmallBlind();
@@ -2028,7 +2028,7 @@ void LocalPlayer::flopEngine()
// bet = (((100-cBluff)/20)+2)*currentHand->getSmallBlind(); // bet = (((100-cBluff)/20)+2)*currentHand->getSmallBlind();
// } // }
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
// } // }
// } // }
// } // }
@@ -2038,10 +2038,10 @@ void LocalPlayer::flopEngine()
// if(info[1] >= 10 && sBluff <= 40) { // if(info[1] >= 10 && sBluff <= 40) {
// bet = (sBluff/10)*2*currentHand->getSmallBlind(); // bet = (sBluff/10)*2*currentHand->getSmallBlind();
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
// } // }
// else { // else {
// myAction = PLAYER_ACTION_CHECK; // myAction = PLAYER_ACTION_CHECK;
// } // }
// } // }
// } // }
@@ -2052,15 +2052,15 @@ void LocalPlayer::flopEngine()
// case 2: { // case 2: {
// Tools::getRandNumber(0,100,1,&cBluff,0); // Tools::getRandNumber(0,100,1,&cBluff,0);
// if(cBluff > 80) { // if(cBluff > 80) {
// myAction = PLAYER_ACTION_CHECK; // myAction = PLAYER_ACTION_CHECK;
// } // }
// else { // else {
// if(myCash/(2*currentHand->getSmallBlind()) <= 6) { // if(myCash/(2*currentHand->getSmallBlind()) <= 6) {
// myAction = PLAYER_ACTION_ALLIN; // myAction = PLAYER_ACTION_ALLIN;
// } else { // } else {
// bet = (cBluff/20)*2*currentHand->getSmallBlind(); // bet = (cBluff/20)*2*currentHand->getSmallBlind();
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
// } // }
// } // }
// } // }
@@ -2068,15 +2068,15 @@ void LocalPlayer::flopEngine()
// default: { // default: {
// Tools::getRandNumber(0,100,1,&cBluff,0); // Tools::getRandNumber(0,100,1,&cBluff,0);
// if(cBluff > 90) { // if(cBluff > 90) {
// myAction = PLAYER_ACTION_CHECK; // myAction = PLAYER_ACTION_CHECK;
// } // }
// else { // else {
// if(myCash/(2*currentHand->getSmallBlind()) <= 5) { // if(myCash/(2*currentHand->getSmallBlind()) <= 5) {
// myAction = PLAYER_ACTION_ALLIN; // myAction = PLAYER_ACTION_ALLIN;
// } else { // } else {
// bet = (cBluff/30)*2*currentHand->getSmallBlind(); // bet = (cBluff/30)*2*currentHand->getSmallBlind();
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
// } // }
// } // }
// } // }
@@ -2092,7 +2092,7 @@ void LocalPlayer::flopEngine()
// if(currentHand->getActivePlayerList().size() == 2) { // if(currentHand->getActivePlayerList().size() == 2) {
// bet = (1-myDude4)*2*currentHand->getSmallBlind(); // bet = (1-myDude4)*2*currentHand->getSmallBlind();
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
// //
// } // }
// else { // else {
@@ -2100,40 +2100,40 @@ void LocalPlayer::flopEngine()
// case 3: { // case 3: {
// if(sBluff <= 10) { // if(sBluff <= 10) {
// bet = (sBluff/5 + 2)*currentHand->getSmallBlind(); // bet = (sBluff/5 + 2)*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
// } // }
// else { // else {
// myAction = PLAYER_ACTION_CHECK; // myAction = PLAYER_ACTION_CHECK;
// } // }
// } // }
// break; // break;
// case 2: { // case 2: {
// if(sBluff <= 15) { // if(sBluff <= 15) {
// bet = (sBluff/5 + 2)*currentHand->getSmallBlind(); // bet = (sBluff/5 + 2)*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
// } // }
// else { // else {
// myAction = PLAYER_ACTION_CHECK; // myAction = PLAYER_ACTION_CHECK;
// } // }
// } // }
// break; // break;
// case 1: { // case 1: {
// if(sBluff <= 50) { // if(sBluff <= 50) {
// bet = (sBluff/15 + 2)*currentHand->getSmallBlind(); // bet = (sBluff/15 + 2)*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
// } // }
// else { // else {
// myAction = PLAYER_ACTION_CHECK; // myAction = PLAYER_ACTION_CHECK;
// } // }
// } // }
// break; // break;
// default: { // default: {
// if(myCash/(2*currentHand->getSmallBlind()) <= 5) { // if(myCash/(2*currentHand->getSmallBlind()) <= 5) {
// myAction = PLAYER_ACTION_ALLIN; // myAction = PLAYER_ACTION_ALLIN;
// } else { // } else {
// bet = (sBluff/15)*2*currentHand->getSmallBlind(); // bet = (sBluff/15)*2*currentHand->getSmallBlind();
// if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind(); // if(bet < 2*currentHand->getSmallBlind()) bet = 2*currentHand->getSmallBlind();
// myAction = PLAYER_ACTION_BET; // myAction = PLAYER_ACTION_BET;
// } // }
// } // }
// break; // break;
@@ -2292,16 +2292,16 @@ void LocalPlayer::turnEngine()
// all in // all in
if(myOdds >= myNiveau[2] + 15) { if(myOdds >= myNiveau[2] + 15) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
// nur call // nur call
else { else {
// all in bei knappem call // all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) { if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} else { } else {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} }
@@ -2317,25 +2317,25 @@ void LocalPlayer::turnEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4.0)/5.0) { if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4.0)/5.0) {
raise = myCash; raise = myCash;
} }
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
// auf cBluff testen --> call statt raise // auf cBluff testen --> call statt raise
if(cBluff > 90) myAction = PLAYER_ACTION_CALL; if(cBluff > 90) myAction = PLAYER_ACTION_CALL;
if(cBluff > 80 && myOdds >= myNiveau[2] + 5) myAction = PLAYER_ACTION_CALL; if(cBluff > 80 && myOdds >= myNiveau[2] + 5) myAction = PLAYER_ACTION_CALL;
if(cBluff > 70 && myOdds >= myNiveau[2] + 10) myAction = PLAYER_ACTION_CALL; if(cBluff > 70 && myOdds >= myNiveau[2] + 10) myAction = PLAYER_ACTION_CALL;
if(cBluff > 60 && myOdds >= myNiveau[2] + 15) myAction = PLAYER_ACTION_CALL; if(cBluff > 60 && myOdds >= myNiveau[2] + 15) myAction = PLAYER_ACTION_CALL;
} else { } else {
// call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt // call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt
if(myOdds >= myNiveau[0] || (mySet >= currentHand->getCurrentBeRo()->getHighestSet()/2 && myOdds >= myNiveau[0]-5) || (myRoundStartCash-myCash > individualHighestSet && myNiveau[0]-3)) { if(myOdds >= myNiveau[0] || (mySet >= currentHand->getCurrentBeRo()->getHighestSet()/2 && myOdds >= myNiveau[0]-5) || (myRoundStartCash-myCash > individualHighestSet && myNiveau[0]-3)) {
// all in bei knappem call // all in bei knappem call
if(currentHand->getCurrentBeRo()->getHighestSet() > (myCash*3.0)/4.0) { if(currentHand->getCurrentBeRo()->getHighestSet() > (myCash*3.0)/4.0) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} else myAction = PLAYER_ACTION_CALL; } else myAction = PLAYER_ACTION_CALL;
} }
// fold // fold
else { else {
myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_FOLD;
} }
} }
} }
@@ -2355,17 +2355,17 @@ void LocalPlayer::turnEngine()
if(bet > (myCash*4.0)/5.0) { if(bet > (myCash*4.0)/5.0) {
bet = myCash; bet = myCash;
} }
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
// auf cBluff testen --> call statt raise // auf cBluff testen --> call statt raise
if(cBluff > 90) myAction = PLAYER_ACTION_CHECK; if(cBluff > 90) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 80 && myOdds >= myNiveau[2] + 5) myAction = PLAYER_ACTION_CHECK; if(cBluff > 80 && myOdds >= myNiveau[2] + 5) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 70 && myOdds >= myNiveau[2] + 10) myAction = PLAYER_ACTION_CHECK; if(cBluff > 70 && myOdds >= myNiveau[2] + 10) myAction = PLAYER_ACTION_CHECK;
if(cBluff > 60 && myOdds >= myNiveau[2] + 15) myAction = PLAYER_ACTION_CHECK; if(cBluff > 60 && myOdds >= myNiveau[2] + 15) myAction = PLAYER_ACTION_CHECK;
} }
// check // check
else { else {
myAction = PLAYER_ACTION_CHECK; myAction = PLAYER_ACTION_CHECK;
// Position // Position
if(myButton == 1) { if(myButton == 1) {
// Position-Bluff generieren // Position-Bluff generieren
@@ -2384,7 +2384,7 @@ void LocalPlayer::turnEngine()
if(bet > (myCash*4.0)/5.0) { if(bet > (myCash*4.0)/5.0) {
bet = myCash; bet = myCash;
} }
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
} }
} }
} }
@@ -2401,7 +2401,7 @@ void LocalPlayer::turnEngine()
// Gegner setzen -> call // Gegner setzen -> call
if(currentHand->getCurrentBeRo()->getHighestSet() >= 4*currentHand->getSmallBlind()) { if(currentHand->getCurrentBeRo()->getHighestSet() >= 4*currentHand->getSmallBlind()) {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
// Standard-Raise-Routine // Standard-Raise-Routine
else { else {
@@ -2416,12 +2416,12 @@ void LocalPlayer::turnEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) { if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash; raise = myCash;
} }
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
// extrem hoher set der gegner -> bluff beenden // extrem hoher set der gegner -> bluff beenden
if(currentHand->getCurrentBeRo()->getHighestSet() >= 10*currentHand->getSmallBlind()) { if(currentHand->getCurrentBeRo()->getHighestSet() >= 10*currentHand->getSmallBlind()) {
myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_FOLD;
} }
} }
} else { } else {
@@ -2443,7 +2443,7 @@ void LocalPlayer::turnEngine()
if(bet > (myCash*4.0)/5.0) { if(bet > (myCash*4.0)/5.0) {
bet = myCash; bet = myCash;
} }
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
} }
} }
@@ -2813,16 +2813,16 @@ void LocalPlayer::riverEngine()
// all in // all in
if(myOdds >= myNiveau[2] + 15) { if(myOdds >= myNiveau[2] + 15) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
// nur call // nur call
else { else {
// all in bei knappem call // all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) { if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/5) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} else { } else {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} }
} }
@@ -2838,7 +2838,7 @@ void LocalPlayer::riverEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 8) { if(myCash/(2*currentHand->getSmallBlind()) <= 8) {
raise = myCash; raise = myCash;
} }
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
} else { } else {
// call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt // call -> über niveau0, schon einiges gesetzt im flop, schon einiges insgesamt gesetzt
@@ -2846,12 +2846,12 @@ void LocalPlayer::riverEngine()
// all in bei knappem call // all in bei knappem call
if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/4) { if(myCash-currentHand->getCurrentBeRo()->getHighestSet() <= (myCash*1)/4) {
raise = myCash; raise = myCash;
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} else myAction = PLAYER_ACTION_CALL; } else myAction = PLAYER_ACTION_CALL;
} }
// fold // fold
else { else {
myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_FOLD;
} }
} }
} else { } else {
@@ -2869,11 +2869,11 @@ void LocalPlayer::riverEngine()
if(bet > (myCash*4.0)/5.0) { if(bet > (myCash*4.0)/5.0) {
bet = myCash; bet = myCash;
} }
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
} }
// check // check
else { else {
myAction = PLAYER_ACTION_CHECK; myAction = PLAYER_ACTION_CHECK;
// Position // Position
if(myButton == 1) { if(myButton == 1) {
// Position-Bluff generieren // Position-Bluff generieren
@@ -2892,7 +2892,7 @@ void LocalPlayer::riverEngine()
if(bet > (myCash*4.0)/5.0) { if(bet > (myCash*4.0)/5.0) {
bet = myCash; bet = myCash;
} }
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
} }
} }
} }
@@ -2913,7 +2913,7 @@ void LocalPlayer::riverEngine()
// Gegner setzen -> call // Gegner setzen -> call
if(currentHand->getCurrentBeRo()->getHighestSet() >= 4*currentHand->getSmallBlind()) { if(currentHand->getCurrentBeRo()->getHighestSet() >= 4*currentHand->getSmallBlind()) {
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
// Standard-Raise-Routine // Standard-Raise-Routine
else { else {
@@ -2928,12 +2928,12 @@ void LocalPlayer::riverEngine()
if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) { if(myCash/(2*currentHand->getSmallBlind()) <= 6 || raise >= (myCash*4)/5) {
raise = myCash; raise = myCash;
} }
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
// extrem hoher set der gegner -> bluff beenden // extrem hoher set der gegner -> bluff beenden
if(currentHand->getCurrentBeRo()->getHighestSet() >= 10*currentHand->getSmallBlind()) { if(currentHand->getCurrentBeRo()->getHighestSet() >= 10*currentHand->getSmallBlind()) {
myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_FOLD;
} }
} }
} else { } else {
@@ -2955,7 +2955,7 @@ void LocalPlayer::riverEngine()
if(bet > (myCash*4.0)/5.0) { if(bet > (myCash*4.0)/5.0) {
bet = myCash; bet = myCash;
} }
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
} }
} }
@@ -3237,7 +3237,7 @@ void LocalPlayer::evaluation(int bet, int raise)
if(highestSet >= myCash + mySet) { if(highestSet >= myCash + mySet) {
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
// cout << "evaluation(call) - mySet: " << mySet << endl; // cout << "evaluation(call) - mySet: " << mySet << endl;
} }
@@ -3260,7 +3260,7 @@ void LocalPlayer::evaluation(int bet, int raise)
currentHand->getCurrentBeRo()->setMinimumRaise(myCash); currentHand->getCurrentBeRo()->setMinimumRaise(myCash);
mySet = myCash; mySet = myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
highestSet = mySet; highestSet = mySet;
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
} }
@@ -3274,7 +3274,7 @@ void LocalPlayer::evaluation(int bet, int raise)
} }
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(myUniqueID); currentHand->setLastActionPlayerID(myUniqueID);
} }
break; break;
// raise // raise
@@ -3284,14 +3284,14 @@ void LocalPlayer::evaluation(int bet, int raise)
if(highestSet >= myCash + mySet) { if(highestSet >= myCash + mySet) {
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
} }
// sonst // sonst
else { else {
myCash = myCash - highestSet + mySet; myCash = myCash - highestSet + mySet;
mySet = highestSet; mySet = highestSet;
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CALL,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_CALL,mySet);
} }
} else { } else {
@@ -3306,27 +3306,27 @@ void LocalPlayer::evaluation(int bet, int raise)
// only call all-in // only call all-in
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} else { } else {
// raise, but not enough --> full bet rule // raise, but not enough --> full bet rule
currentHand->getCurrentBeRo()->setFullBetRule(true); currentHand->getCurrentBeRo()->setFullBetRule(true);
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(myUniqueID); currentHand->setLastActionPlayerID(myUniqueID);
mySet += myCash; mySet += myCash;
currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet); currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet);
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
highestSet = mySet; highestSet = mySet;
} }
} else { } else {
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(myUniqueID); currentHand->setLastActionPlayerID(myUniqueID);
mySet += myCash; mySet += myCash;
currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet); currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet);
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
highestSet = mySet; highestSet = mySet;
} }
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_ALL_IN,mySet);
@@ -3338,7 +3338,7 @@ void LocalPlayer::evaluation(int bet, int raise)
mySet = highestSet + raise; mySet = highestSet + raise;
highestSet = mySet; highestSet = mySet;
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(myUniqueID); currentHand->setLastActionPlayerID(myUniqueID);
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_BET,mySet); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,myID+1,LOG_ACTION_BET,mySet);
} }
} }
@@ -4470,7 +4470,7 @@ void LocalPlayer::preflopEngine3()
// FOLD --> wenn Potential negativ oder HighestSet zu hoch // FOLD --> wenn Potential negativ oder HighestSet zu hoch
if( (potential*setToHighest<0 || (setToHighest > tempFold * currentHand->getSmallBlind() && potential<1) || (setToHighest > 2 * tempFold * currentHand->getSmallBlind() && potential<2) || (setToHighest > 4 * tempFold * currentHand->getSmallBlind() && potential<3) || (setToHighest > 10 * tempFold * currentHand->getSmallBlind() && potential<4)) && CardsValue::holeCardsClass(myCards[0], myCards[1]) < 9 && bluff > 15) { if( (potential*setToHighest<0 || (setToHighest > tempFold * currentHand->getSmallBlind() && potential<1) || (setToHighest > 2 * tempFold * currentHand->getSmallBlind() && potential<2) || (setToHighest > 4 * tempFold * currentHand->getSmallBlind() && potential<3) || (setToHighest > 10 * tempFold * currentHand->getSmallBlind() && potential<4)) && CardsValue::holeCardsClass(myCards[0], myCards[1]) < 9 && bluff > 15) {
myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_FOLD;
} else { } else {
// RAISE --> wenn hohes Potential // RAISE --> wenn hohes Potential
if((potential >= 4 && 6 * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet()) || bluff <= 6) { if((potential >= 4 && 6 * currentHand->getSmallBlind() >= currentHand->getCurrentBeRo()->getHighestSet()) || bluff <= 6) {
@@ -4489,14 +4489,14 @@ void LocalPlayer::preflopEngine3()
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet; myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet(); mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} else { } else {
// doch nich raisen, sondern nur checken, weil highestSets bereits sehr hoch !!! // doch nich raisen, sondern nur checken, weil highestSets bereits sehr hoch !!!
@@ -4507,14 +4507,14 @@ void LocalPlayer::preflopEngine3()
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet; myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet(); mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} else raise = (potential - 4 ) * 2 * currentHand->getCurrentBeRo()->getHighestSet(); } else raise = (potential - 4 ) * 2 * currentHand->getCurrentBeRo()->getHighestSet();
@@ -4535,14 +4535,14 @@ void LocalPlayer::preflopEngine3()
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet; myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet(); mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} else { } else {
// doch nich raisen, sondern nur checken, weil highestSets bereits sehr hoch !!! // doch nich raisen, sondern nur checken, weil highestSets bereits sehr hoch !!!
@@ -4553,14 +4553,14 @@ void LocalPlayer::preflopEngine3()
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet; myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet(); mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} else raise = (potential - 3 ) * currentHand->getCurrentBeRo()->getHighestSet(); } else raise = (potential - 3 ) * currentHand->getCurrentBeRo()->getHighestSet();
} }
@@ -4573,7 +4573,7 @@ void LocalPlayer::preflopEngine3()
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
if(mySet > currentHand->getCurrentBeRo()->getHighestSet()) currentHand->getCurrentBeRo()->setHighestSet(mySet); if(mySet > currentHand->getCurrentBeRo()->getHighestSet()) currentHand->getCurrentBeRo()->setHighestSet(mySet);
} }
@@ -4583,7 +4583,7 @@ void LocalPlayer::preflopEngine3()
myCash = myCash + mySet - currentHand->getCurrentBeRo()->getHighestSet() - raise; myCash = myCash + mySet - currentHand->getCurrentBeRo()->getHighestSet() - raise;
mySet = currentHand->getCurrentBeRo()->getHighestSet() + raise; mySet = currentHand->getCurrentBeRo()->getHighestSet() + raise;
currentHand->getCurrentBeRo()->setHighestSet(mySet); currentHand->getCurrentBeRo()->setHighestSet(mySet);
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
} }
} }
@@ -4591,7 +4591,7 @@ void LocalPlayer::preflopEngine3()
else { else {
// CHECK --> wenn alle Sets glieich bei BigBlind und nich zu hohem Potential // CHECK --> wenn alle Sets glieich bei BigBlind und nich zu hohem Potential
if(mySet == currentHand->getCurrentBeRo()->getHighestSet()) { if(mySet == currentHand->getCurrentBeRo()->getHighestSet()) {
myAction = PLAYER_ACTION_CHECK; myAction = PLAYER_ACTION_CHECK;
} }
// CALL --> bei normalen Potential // CALL --> bei normalen Potential
else { else {
@@ -4600,14 +4600,14 @@ void LocalPlayer::preflopEngine3()
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet; myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet(); mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} }
} }
@@ -4697,14 +4697,14 @@ void LocalPlayer::flopEngine3()
// FOLD --> wenn potential negativ oder HighestSet zu hoch // FOLD --> wenn potential negativ oder HighestSet zu hoch
if(( potential*setToHighest<0 || (setToHighest > tempFold * currentHand->getSmallBlind() && potential<1) || (setToHighest > 3 * tempFold * currentHand->getSmallBlind() && potential<2) || (setToHighest > 9 * tempFold * currentHand->getSmallBlind() && potential<3) || (setToHighest > 20*tempFold * currentHand->getSmallBlind() && potential<4) || (setToHighest > 40 *tempFold * currentHand->getSmallBlind() && potential<5)) && percent < 0.90 && bluff > 18) { if(( potential*setToHighest<0 || (setToHighest > tempFold * currentHand->getSmallBlind() && potential<1) || (setToHighest > 3 * tempFold * currentHand->getSmallBlind() && potential<2) || (setToHighest > 9 * tempFold * currentHand->getSmallBlind() && potential<3) || (setToHighest > 20*tempFold * currentHand->getSmallBlind() && potential<4) || (setToHighest > 40 *tempFold * currentHand->getSmallBlind() && potential<5)) && percent < 0.90 && bluff > 18) {
myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_FOLD;
} else { } else {
// CHECK und BET --> wenn noch keiner was gesetzt hat // CHECK und BET --> wenn noch keiner was gesetzt hat
if(currentHand->getCurrentBeRo()->getHighestSet() == 0) { if(currentHand->getCurrentBeRo()->getHighestSet() == 0) {
// CHECK --> wenn Potential klein oder check-bluff sonst bet oder bet-bluff // CHECK --> wenn Potential klein oder check-bluff sonst bet oder bet-bluff
if((potential<3 || bluff >= 80) && bluff > 15) { if((potential<3 || bluff >= 80) && bluff > 15) {
// check // check
myAction = PLAYER_ACTION_CHECK; myAction = PLAYER_ACTION_CHECK;
} }
// BET --> wenn Potential hoch // BET --> wenn Potential hoch
else { else {
@@ -4719,13 +4719,13 @@ void LocalPlayer::flopEngine3()
if(mySet >= myCash) { if(mySet >= myCash) {
mySet = myCash; mySet = myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash -= mySet; myCash -= mySet;
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
} }
currentHand->getCurrentBeRo()->setHighestSet(mySet); currentHand->getCurrentBeRo()->setHighestSet(mySet);
} }
@@ -4748,7 +4748,7 @@ void LocalPlayer::flopEngine3()
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
if(mySet > currentHand->getCurrentBeRo()->getHighestSet()) currentHand->getCurrentBeRo()->setHighestSet(mySet); if(mySet > currentHand->getCurrentBeRo()->getHighestSet()) currentHand->getCurrentBeRo()->setHighestSet(mySet);
} }
@@ -4758,7 +4758,7 @@ void LocalPlayer::flopEngine3()
myCash = myCash + mySet - currentHand->getCurrentBeRo()->getHighestSet() - raise; myCash = myCash + mySet - currentHand->getCurrentBeRo()->getHighestSet() - raise;
mySet = currentHand->getCurrentBeRo()->getHighestSet() + raise; mySet = currentHand->getCurrentBeRo()->getHighestSet() + raise;
currentHand->getCurrentBeRo()->setHighestSet(mySet); currentHand->getCurrentBeRo()->setHighestSet(mySet);
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
} }
// CALL --> bei normalen Potential // CALL --> bei normalen Potential
@@ -4769,14 +4769,14 @@ void LocalPlayer::flopEngine3()
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet; myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet(); mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} }
} }
@@ -4864,14 +4864,14 @@ void LocalPlayer::turnEngine3()
// FOLD // FOLD
// --> wenn potential negativ oder HighestSet zu hoch // --> wenn potential negativ oder HighestSet zu hoch
if( (potential*setToHighest<0 || (setToHighest > tempFold * currentHand->getSmallBlind() && potential<1) || (setToHighest > 3 * tempFold * currentHand->getSmallBlind() && potential<2) || (setToHighest > 9 * tempFold * currentHand->getSmallBlind() && potential<3) || (setToHighest > 20*tempFold * currentHand->getSmallBlind() && potential<4) || (setToHighest > 40 *tempFold * currentHand->getSmallBlind() && potential<5)) && percent < 0.90 && bluff > 15) { if( (potential*setToHighest<0 || (setToHighest > tempFold * currentHand->getSmallBlind() && potential<1) || (setToHighest > 3 * tempFold * currentHand->getSmallBlind() && potential<2) || (setToHighest > 9 * tempFold * currentHand->getSmallBlind() && potential<3) || (setToHighest > 20*tempFold * currentHand->getSmallBlind() && potential<4) || (setToHighest > 40 *tempFold * currentHand->getSmallBlind() && potential<5)) && percent < 0.90 && bluff > 15) {
myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_FOLD;
} else { } else {
// CHECK und BET --> wenn noch keiner was gesetzt hat // CHECK und BET --> wenn noch keiner was gesetzt hat
if(currentHand->getCurrentBeRo()->getHighestSet() == 0) { if(currentHand->getCurrentBeRo()->getHighestSet() == 0) {
// CHECK --> wenn Potential klein // CHECK --> wenn Potential klein
if((potential<2 || bluff >= 80) && bluff > 10) { if((potential<2 || bluff >= 80) && bluff > 10) {
// check // check
myAction = PLAYER_ACTION_CHECK; myAction = PLAYER_ACTION_CHECK;
} }
// BET --> wenn Potential hoch // BET --> wenn Potential hoch
else { else {
@@ -4887,13 +4887,13 @@ void LocalPlayer::turnEngine3()
if(mySet >= myCash) { if(mySet >= myCash) {
mySet = myCash; mySet = myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash -= mySet; myCash -= mySet;
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
} }
currentHand->getCurrentBeRo()->setHighestSet(mySet); currentHand->getCurrentBeRo()->setHighestSet(mySet);
} }
@@ -4916,7 +4916,7 @@ void LocalPlayer::turnEngine3()
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
if(mySet > currentHand->getCurrentBeRo()->getHighestSet()) currentHand->getCurrentBeRo()->setHighestSet(mySet); if(mySet > currentHand->getCurrentBeRo()->getHighestSet()) currentHand->getCurrentBeRo()->setHighestSet(mySet);
} }
@@ -4926,7 +4926,7 @@ void LocalPlayer::turnEngine3()
myCash = myCash + mySet - currentHand->getCurrentBeRo()->getHighestSet() - raise; myCash = myCash + mySet - currentHand->getCurrentBeRo()->getHighestSet() - raise;
mySet = currentHand->getCurrentBeRo()->getHighestSet() + raise; mySet = currentHand->getCurrentBeRo()->getHighestSet() + raise;
currentHand->getCurrentBeRo()->setHighestSet(mySet); currentHand->getCurrentBeRo()->setHighestSet(mySet);
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
} }
// CALL --> bei normalen Potential // CALL --> bei normalen Potential
@@ -4936,14 +4936,14 @@ void LocalPlayer::turnEngine3()
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet; myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet(); mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} }
} }
@@ -5026,14 +5026,14 @@ void LocalPlayer::riverEngine3()
// FOLD // FOLD
// --> wenn potential negativ oder HighestSet zu hoch // --> wenn potential negativ oder HighestSet zu hoch
if( (potential*setToHighest<0 || (setToHighest > tempFold * currentHand->getSmallBlind() && potential<1) || (setToHighest > 3 * tempFold * currentHand->getSmallBlind() && potential<2) || (setToHighest > 9 * tempFold * currentHand->getSmallBlind() && potential<3) || (setToHighest > 20*tempFold * currentHand->getSmallBlind() && potential<4) || (setToHighest > 40 *tempFold * currentHand->getSmallBlind() && potential<5)) && percent < 0.90 && bluff > 15) { if( (potential*setToHighest<0 || (setToHighest > tempFold * currentHand->getSmallBlind() && potential<1) || (setToHighest > 3 * tempFold * currentHand->getSmallBlind() && potential<2) || (setToHighest > 9 * tempFold * currentHand->getSmallBlind() && potential<3) || (setToHighest > 20*tempFold * currentHand->getSmallBlind() && potential<4) || (setToHighest > 40 *tempFold * currentHand->getSmallBlind() && potential<5)) && percent < 0.90 && bluff > 15) {
myAction = PLAYER_ACTION_FOLD; myAction = PLAYER_ACTION_FOLD;
} else { } else {
// CHECK und BET --> wenn noch keiner was gesetzt hat // CHECK und BET --> wenn noch keiner was gesetzt hat
if(currentHand->getCurrentBeRo()->getHighestSet() == 0) { if(currentHand->getCurrentBeRo()->getHighestSet() == 0) {
// CHECK --> wenn Potential klein // CHECK --> wenn Potential klein
if((potential<2 || bluff >= 92) && bluff > 15) { if((potential<2 || bluff >= 92) && bluff > 15) {
// check // check
myAction = PLAYER_ACTION_CHECK; myAction = PLAYER_ACTION_CHECK;
} }
// BET --> wenn Potential hoch // BET --> wenn Potential hoch
else { else {
@@ -5049,13 +5049,13 @@ void LocalPlayer::riverEngine3()
if(mySet >= myCash) { if(mySet >= myCash) {
mySet = myCash; mySet = myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash -= mySet; myCash -= mySet;
myAction = PLAYER_ACTION_BET; myAction = PLAYER_ACTION_BET;
} }
currentHand->getCurrentBeRo()->setHighestSet(mySet); currentHand->getCurrentBeRo()->setHighestSet(mySet);
} }
@@ -5078,7 +5078,7 @@ void LocalPlayer::riverEngine3()
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
if(mySet > currentHand->getCurrentBeRo()->getHighestSet()) currentHand->getCurrentBeRo()->setHighestSet(mySet); if(mySet > currentHand->getCurrentBeRo()->getHighestSet()) currentHand->getCurrentBeRo()->setHighestSet(mySet);
} }
@@ -5088,7 +5088,7 @@ void LocalPlayer::riverEngine3()
myCash = myCash + mySet - currentHand->getCurrentBeRo()->getHighestSet() - raise; myCash = myCash + mySet - currentHand->getCurrentBeRo()->getHighestSet() - raise;
mySet = currentHand->getCurrentBeRo()->getHighestSet() + raise; mySet = currentHand->getCurrentBeRo()->getHighestSet() + raise;
currentHand->getCurrentBeRo()->setHighestSet(mySet); currentHand->getCurrentBeRo()->setHighestSet(mySet);
myAction = PLAYER_ACTION_RAISE; myAction = PLAYER_ACTION_RAISE;
} }
} }
// CALL --> bei normalen Potential // CALL --> bei normalen Potential
@@ -5098,14 +5098,14 @@ void LocalPlayer::riverEngine3()
mySet += myCash; mySet += myCash;
myCash = 0; myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet; myCash = myCash - currentHand->getCurrentBeRo()->getHighestSet() + mySet;
mySet = currentHand->getCurrentBeRo()->getHighestSet(); mySet = currentHand->getCurrentBeRo()->getHighestSet();
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} }
} }
+3 -3
View File
@@ -113,12 +113,12 @@ public:
return myLastRelativeSet; return myLastRelativeSet;
} }
void setMyAction(PlayerAction theValue, bool blind = 0) { void setMyAction(PlayerAction theValue, bool blind = 0) {
myAction = theValue; myAction = theValue;
// logging for human player // logging for human player
if(myAction && !blind) currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet); if(myAction && !blind) currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
} }
PlayerAction getMyAction() const { PlayerAction getMyAction() const {
return myAction; return myAction;
} }
@@ -317,7 +317,7 @@ private:
int myCash; int myCash;
int mySet; int mySet;
int myLastRelativeSet; int myLastRelativeSet;
PlayerAction myAction; PlayerAction myAction;
int myButton; // 0 = none, 1 = dealer, 2 =small, 3 = big int myButton; // 0 = none, 1 = dealer, 2 =small, 3 = big
bool myActiveStatus; // 0 = inactive, 1 = active bool myActiveStatus; // 0 = inactive, 1 = active
bool myStayOnTableStatus; // 0 = left, 1 = stay bool myStayOnTableStatus; // 0 = left, 1 = stay
+102 -103
View File
@@ -34,15 +34,15 @@ Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), curGameID(0), curHandID
if(SQLITE_LOG) { if(SQLITE_LOG) {
// logging activated // logging activated
if(myConfig->readConfigInt("LogOnOff")) { if(myConfig->readConfigInt("LogOnOff")) {
DIR *logDir; DIR *logDir;
logDir = opendir((myConfig->readConfigString("LogDir")).c_str()); logDir = opendir((myConfig->readConfigString("LogDir")).c_str());
bool dirExists = logDir != NULL; bool dirExists = logDir != NULL;
closedir(logDir); closedir(logDir);
// check if logging path exist // check if logging path exist
if(myConfig->readConfigString("LogDir") != "" && dirExists) { if(myConfig->readConfigString("LogDir") != "" && dirExists) {
// detect current time // detect current time
char curDateTime[20]; char curDateTime[20];
@@ -54,7 +54,7 @@ Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), curGameID(0), curHandID
strftime(curDate,11,"%Y-%m-%d",z); strftime(curDate,11,"%Y-%m-%d",z);
strftime(curTime,9,"%H:%M:%S",z); strftime(curTime,9,"%H:%M:%S",z);
string mySqliteLogFileName = boost::lexical_cast<string>((myConfig->readConfigString("LogDir")).c_str()); string mySqliteLogFileName = boost::lexical_cast<string>((myConfig->readConfigString("LogDir")).c_str());
mySqliteLogFileName += "pokerth-log-" + boost::lexical_cast<string>(curDateTime) + ".pdb"; mySqliteLogFileName += "pokerth-log-" + boost::lexical_cast<string>(curDateTime) + ".pdb";
// open sqlite-db // open sqlite-db
@@ -63,23 +63,23 @@ Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), curGameID(0), curHandID
int i; int i;
// create session table // create session table
sql += "CREATE TABLE Session ("; sql += "CREATE TABLE Session (";
sql += "PokerTH_Version TEXT NOT NULL"; sql += "PokerTH_Version TEXT NOT NULL";
sql += ",Date TEXT NOT NULL"; sql += ",Date TEXT NOT NULL";
sql += ",Time TEXT NOT NULL"; sql += ",Time TEXT NOT NULL";
sql += ", PRIMARY KEY(Date,Time));"; sql += ", PRIMARY KEY(Date,Time));";
sql += "INSERT INTO Session ("; sql += "INSERT INTO Session (";
sql += "PokerTH_Version"; sql += "PokerTH_Version";
sql += ",Date"; sql += ",Date";
sql += ",Time"; sql += ",Time";
sql += ") VALUES ("; sql += ") VALUES (";
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) + "\");";
// create game table // create game table
sql += "CREATE TABLE Game ("; sql += "CREATE TABLE Game (";
sql += "GameID INTEGER NOT NULL PRIMARY KEY"; sql += "GameID INTEGER NOT NULL PRIMARY KEY";
sql += ",Startmoney INTEGER NOT NULL"; sql += ",Startmoney INTEGER NOT NULL";
sql += ",StartSb INTEGER NOT NULL"; sql += ",StartSb INTEGER NOT NULL";
@@ -88,10 +88,10 @@ Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), curGameID(0), curHandID
sql += ",Seat_" + boost::lexical_cast<std::string>(i) + " TEXT"; sql += ",Seat_" + boost::lexical_cast<std::string>(i) + " TEXT";
} }
sql += ",Winner_Seat INTEGER"; sql += ",Winner_Seat INTEGER";
sql += ");"; sql += ");";
// create hand table // create hand table
sql += "CREATE TABLE Hand ("; sql += "CREATE TABLE Hand (";
sql += "HandID INTEGER NOT NULL"; sql += "HandID INTEGER NOT NULL";
sql += ",GameID INTEGER NOT NULL"; sql += ",GameID INTEGER NOT NULL";
sql += ",Dealer_Seat INTEGER"; sql += ",Dealer_Seat INTEGER";
@@ -109,10 +109,10 @@ Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), curGameID(0), curHandID
for(i=1; i<=5; i++) { for(i=1; i<=5; i++) {
sql += ",BoardCard_" + boost::lexical_cast<std::string>(i) + " INTEGER"; sql += ",BoardCard_" + boost::lexical_cast<std::string>(i) + " INTEGER";
} }
sql += ",PRIMARY KEY(HandID,GameID));"; sql += ",PRIMARY KEY(HandID,GameID));";
// create action table // create action table
sql += "CREATE TABLE Action ("; sql += "CREATE TABLE Action (";
sql += "ActionID INTEGER PRIMARY KEY AUTOINCREMENT"; sql += "ActionID INTEGER PRIMARY KEY AUTOINCREMENT";
sql += ",HandID INTEGER NOT NULL"; sql += ",HandID INTEGER NOT NULL";
sql += ",GameID INTEGER NOT NULL"; sql += ",GameID INTEGER NOT NULL";
@@ -120,9 +120,9 @@ Log::Log(ConfigFile *c) : mySqliteLogDb(0), myConfig(c), curGameID(0), curHandID
sql += ",Player INTEGER NOT NULL"; sql += ",Player INTEGER NOT NULL";
sql += ",Action TEXT NOT NULL"; sql += ",Action TEXT NOT NULL";
sql += ",Amount INTEGER"; sql += ",Amount INTEGER";
sql += ");"; sql += ");";
exec_transaction(&sql); exec_transaction(&sql);
} }
} }
} }
@@ -143,7 +143,7 @@ void Log::logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned
if(SQLITE_LOG) { if(SQLITE_LOG) {
if(myConfig->readConfigInt("LogOnOff")) { if(myConfig->readConfigInt("LogOnOff")) {
//if write logfiles is enabled //if write logfiles is enabled
PlayerListConstIterator it_c; PlayerListConstIterator it_c;
@@ -152,7 +152,7 @@ void Log::logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned
// sqlite-db is open // sqlite-db is open
int i; int i;
sql += "INSERT INTO Game ("; sql += "INSERT INTO Game (";
sql += "GameID"; sql += "GameID";
sql += ",Startmoney"; sql += ",Startmoney";
sql += ",StartSb"; sql += ",StartSb";
@@ -172,8 +172,8 @@ void Log::logNewGameMsg(int gameID, int startCash, int startSmallBlind, unsigned
sql += ",NULL"; sql += ",NULL";
} }
} }
sql += ");"; sql += ");";
exec_transaction(&sql); exec_transaction(&sql);
} }
} }
} }
@@ -183,11 +183,11 @@ void Log::logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, uns
{ {
curHandID = handID; curHandID = handID;
logHoleCardsDone = false; logHoleCardsDone = false;
if(SQLITE_LOG) { if(SQLITE_LOG) {
if(myConfig->readConfigInt("LogOnOff")) { if(myConfig->readConfigInt("LogOnOff")) {
//if write logfiles is enabled //if write logfiles is enabled
PlayerListConstIterator it_c; PlayerListConstIterator it_c;
@@ -196,7 +196,7 @@ void Log::logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, uns
// sqlite-db is open // sqlite-db is open
int i; int i;
sql += "INSERT INTO Hand ("; sql += "INSERT INTO Hand (";
sql += "HandID"; sql += "HandID";
sql += ",GameID"; sql += ",GameID";
sql += ",Dealer_Seat"; sql += ",Dealer_Seat";
@@ -222,31 +222,30 @@ void Log::logNewHandMsg(int handID, unsigned dealerPosition, int smallBlind, uns
sql += ",NULL"; sql += ",NULL";
} }
} }
sql += ");"; sql += ");";
if(myConfig->readConfigInt("LogInterval") == 0) { if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(&sql); exec_transaction(&sql);
} }
// !! TODO !! Hack, weil Button-Regel noch falsch und dealerPosition noch teilweise falsche ID enthält (HeadsUp: dealerPosition=bigBlindPosition <-- falsch) // !! TODO !! Hack, weil Button-Regel noch falsch und dealerPosition noch teilweise falsche ID enthält (HeadsUp: dealerPosition=bigBlindPosition <-- falsch)
bool dealerButtonOnTable = false; bool dealerButtonOnTable = false;
int countActivePlayer = 0; int countActivePlayer = 0;
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()) {
countActivePlayer++; countActivePlayer++;
if((*it_c)->getMyButton()==BUTTON_DEALER && (*it_c)->getMyActiveStatus()) { if((*it_c)->getMyButton()==BUTTON_DEALER && (*it_c)->getMyActiveStatus()) {
dealerButtonOnTable = true; dealerButtonOnTable = true;
} }
} }
} }
if(countActivePlayer==2) { if(countActivePlayer==2) {
logPlayerAction(0,smallBlindPosition,LOG_ACTION_DEALER); logPlayerAction(0,smallBlindPosition,LOG_ACTION_DEALER);
} } else {
else { if(dealerButtonOnTable) {
if(dealerButtonOnTable) { logPlayerAction(0,dealerPosition,LOG_ACTION_DEALER);
logPlayerAction(0,dealerPosition,LOG_ACTION_DEALER); }
} }
} // !! TODO !! Hack
// !! TODO !! Hack
} }
} }
} }
@@ -257,13 +256,13 @@ void Log::logPlayerAction(int bero, int seat, PlayerActionLog action, int amount
if(SQLITE_LOG) { if(SQLITE_LOG) {
if(myConfig->readConfigInt("LogOnOff")) { if(myConfig->readConfigInt("LogOnOff")) {
//if write logfiles is enabled //if write logfiles is enabled
if( mySqliteLogDb != 0 ) { if( mySqliteLogDb != 0 ) {
// sqlite-db is open // sqlite-db is open
sql += "INSERT INTO Action ("; sql += "INSERT INTO Action (";
sql += "HandID"; sql += "HandID";
sql += ",GameID"; sql += ",GameID";
sql += ",BeRo"; sql += ",BeRo";
@@ -326,10 +325,10 @@ void Log::logPlayerAction(int bero, int seat, PlayerActionLog action, int amount
} else { } else {
sql += ",NULL"; sql += ",NULL";
} }
sql += ");"; sql += ");";
if(myConfig->readConfigInt("LogInterval") == 0) { if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(&sql); exec_transaction(&sql);
} }
} }
} }
} }
@@ -339,7 +338,7 @@ void Log::logBoardCards(int bero, int boardCards[5])
{ {
if(SQLITE_LOG) { if(SQLITE_LOG) {
if(myConfig->readConfigInt("LogOnOff")) { if(myConfig->readConfigInt("LogOnOff")) {
//if write logfiles is enabled //if write logfiles is enabled
if( mySqliteLogDb != 0 ) { if( mySqliteLogDb != 0 ) {
@@ -347,19 +346,19 @@ void Log::logBoardCards(int bero, int boardCards[5])
switch(bero) { switch(bero) {
case 2: { case 2: {
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]) + ",";
sql += "BoardCard_2=" + boost::lexical_cast<string>(boardCards[1]) + ","; sql += "BoardCard_2=" + boost::lexical_cast<string>(boardCards[1]) + ",";
sql += "BoardCard_3=" + boost::lexical_cast<string>(boardCards[2]); sql += "BoardCard_3=" + boost::lexical_cast<string>(boardCards[2]);
} }
break; break;
case 3: { case 3: {
sql += "UPDATE Hand SET "; sql += "UPDATE Hand SET ";
sql += "BoardCard_4=" + boost::lexical_cast<string>(boardCards[3]); sql += "BoardCard_4=" + boost::lexical_cast<string>(boardCards[3]);
} }
break; break;
case 4: { case 4: {
sql += "UPDATE Hand SET "; sql += "UPDATE Hand SET ";
sql += "BoardCard_5=" + boost::lexical_cast<string>(boardCards[4]); sql += "BoardCard_5=" + boost::lexical_cast<string>(boardCards[4]);
} }
break; break;
@@ -369,10 +368,10 @@ void Log::logBoardCards(int bero, int boardCards[5])
sql += " WHERE "; sql += " WHERE ";
sql += "GameID=" + boost::lexical_cast<string>(curGameID) + " AND "; sql += "GameID=" + boost::lexical_cast<string>(curGameID) + " AND ";
sql += "HandID=" + boost::lexical_cast<string>(curHandID); sql += "HandID=" + boost::lexical_cast<string>(curHandID);
sql += ";"; sql += ";";
if(myConfig->readConfigInt("LogInterval") == 0) { if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(&sql); exec_transaction(&sql);
} }
} }
} }
} }
@@ -382,47 +381,47 @@ void Log::logHoleCardsHandName(int bero, PlayerList activePlayerList)
{ {
if(SQLITE_LOG) { if(SQLITE_LOG) {
if(myConfig->readConfigInt("LogOnOff")) { if(myConfig->readConfigInt("LogOnOff")) {
//if write logfiles is enabled //if write logfiles is enabled
if( mySqliteLogDb != 0 && (bero==5 || !logHoleCardsDone)) { if( mySqliteLogDb != 0 && (bero==5 || !logHoleCardsDone)) {
// sqlite-db is open and we are in postriver or before postriver doesn't log hole cards til now // sqlite-db is open and we are in postriver or before postriver doesn't log hole cards til now
PlayerListConstIterator it_c; PlayerListConstIterator it_c;
int myCards[2]; int myCards[2];
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) { if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
(*it_c)->getMyCards(myCards); (*it_c)->getMyCards(myCards);
sql += "UPDATE Hand SET "; sql += "UPDATE Hand SET ";
if(bero==5) { if(bero==5) {
sql += "Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Hand_text=\"" + CardsValue::determineHandName((*it_c)->getMyCardsValueInt(),activePlayerList) + "\""; sql += "Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Hand_text=\"" + CardsValue::determineHandName((*it_c)->getMyCardsValueInt(),activePlayerList) + "\"";
sql += ",Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Hand_int=" + boost::lexical_cast<string>((*it_c)->getMyCardsValueInt()); sql += ",Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Hand_int=" + boost::lexical_cast<string>((*it_c)->getMyCardsValueInt());
} }
if(bero==5 && !logHoleCardsDone) { if(bero==5 && !logHoleCardsDone) {
sql+= ","; sql+= ",";
} }
if(!logHoleCardsDone) { if(!logHoleCardsDone) {
sql += "Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Card_1=" + boost::lexical_cast<string>(myCards[0]); sql += "Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Card_1=" + boost::lexical_cast<string>(myCards[0]);
sql += ",Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Card_2=" + boost::lexical_cast<string>(myCards[1]); sql += ",Seat_" + boost::lexical_cast<string>((*it_c)->getMyID()+1) + "_Card_2=" + boost::lexical_cast<string>(myCards[1]);
} }
sql += " WHERE "; sql += " WHERE ";
sql += "GameID=" + boost::lexical_cast<string>(curGameID) + " AND "; sql += "GameID=" + boost::lexical_cast<string>(curGameID) + " AND ";
sql += "HandID=" + boost::lexical_cast<string>(curHandID); sql += "HandID=" + boost::lexical_cast<string>(curHandID);
sql += ";"; sql += ";";
if(myConfig->readConfigInt("LogInterval") == 0) { if(myConfig->readConfigInt("LogInterval") == 0) {
exec_transaction(&sql); exec_transaction(&sql);
} }
if(!logHoleCardsDone) { if(!logHoleCardsDone) {
logPlayerAction(bero,(*it_c)->getMyID()+1,LOG_ACTION_SHOW); logPlayerAction(bero,(*it_c)->getMyID()+1,LOG_ACTION_SHOW);
} else { } else {
logPlayerAction(bero,(*it_c)->getMyID()+1,LOG_ACTION_HAS); logPlayerAction(bero,(*it_c)->getMyID()+1,LOG_ACTION_HAS);
} }
} }
} }
logHoleCardsDone = true; logHoleCardsDone = true;
} }
} }
} }
@@ -430,16 +429,16 @@ void Log::logHoleCardsHandName(int bero, PlayerList activePlayerList)
void Log::exec_transaction(string *sql) void Log::exec_transaction(string *sql)
{ {
char *errmsg = NULL; char *errmsg = NULL;
string sql_transaction = "BEGIN;" + *sql + "COMMIT;"; string sql_transaction = "BEGIN;" + *sql + "COMMIT;";
*sql = ""; *sql = "";
if(sqlite3_exec(mySqliteLogDb, sql_transaction.data(), 0, 0, &errmsg) != SQLITE_OK) { if(sqlite3_exec(mySqliteLogDb, sql_transaction.data(), 0, 0, &errmsg) != SQLITE_OK) {
cout << "Error in statement: " << sql_transaction.data() << "[" << errmsg << "]." << endl; cout << "Error in statement: " << sql_transaction.data() << "[" << errmsg << "]." << endl;
sqlite3_free(errmsg); sqlite3_free(errmsg);
errmsg = NULL; errmsg = NULL;
} }
} }
//void //void
+6 -6
View File
@@ -30,7 +30,7 @@ class Log
{ {
public: public:
Log(ConfigFile *c); Log(ConfigFile *c);
~Log(); ~Log();
@@ -38,18 +38,18 @@ public:
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(int bero, int seat, PlayerActionLog action, int amount = 0); void logPlayerAction(int bero, int seat, PlayerActionLog action, int amount = 0);
void logBoardCards(int bero, int boardCards[5]); void logBoardCards(int bero, int boardCards[5]);
void logHoleCardsHandName(int bero, PlayerList activePlayerList); void logHoleCardsHandName(int bero, PlayerList activePlayerList);
void exec_transaction(std::string *sql); void exec_transaction(std::string *sql);
// void closeLogDbAtExit(); // void closeLogDbAtExit();
private: private:
sqlite3 *mySqliteLogDb; sqlite3 *mySqliteLogDb;
ConfigFile *myConfig; ConfigFile *myConfig;
int curGameID; int curGameID;
int curHandID; int curHandID;
std::string sql; std::string sql;
bool logHoleCardsDone; bool logHoleCardsDone;
}; };
#endif // LOG_H #endif // LOG_H
+1 -1
View File
@@ -30,7 +30,7 @@ class HandInterface;
class ClientBeRo : public BeRoInterface class ClientBeRo : public BeRoInterface
{ {
public: public:
ClientBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS); ClientBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS);
~ClientBeRo(); ~ClientBeRo();
GameState getMyBeRoID() const; GameState getMyBeRoID() const;
+2 -2
View File
@@ -24,7 +24,7 @@
using namespace std; using namespace std;
ClientBoard::ClientBoard(unsigned dp) ClientBoard::ClientBoard(unsigned dp)
: pot(0), sets(0), dealerPosition(dp), allInCondition(false), lastActionPlayerID(0) : pot(0), sets(0), dealerPosition(dp), allInCondition(false), lastActionPlayerID(0)
{ {
myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0; myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0;
} }
@@ -98,7 +98,7 @@ void
ClientBoard::setLastActionPlayerID(unsigned theValue) ClientBoard::setLastActionPlayerID(unsigned theValue)
{ {
boost::recursive_mutex::scoped_lock lock(m_syncMutex); boost::recursive_mutex::scoped_lock lock(m_syncMutex);
lastActionPlayerID = theValue; lastActionPlayerID = theValue;
} }
void void
+2 -2
View File
@@ -45,7 +45,7 @@ public:
void setSets(int theValue); void setSets(int theValue);
void setAllInCondition(bool theValue); void setAllInCondition(bool theValue);
void setLastActionPlayerID(unsigned theValue); void setLastActionPlayerID(unsigned theValue);
void collectSets(); void collectSets();
void collectPot(); void collectPot();
@@ -74,7 +74,7 @@ private:
int sets; int sets;
unsigned dealerPosition; unsigned dealerPosition;
bool allInCondition; bool allInCondition;
unsigned lastActionPlayerID; unsigned lastActionPlayerID;
}; };
#endif #endif
@@ -58,11 +58,11 @@ ClientEngineFactory::createBeRo(HandInterface *hi, unsigned dP, int sB)
{ {
std::vector<boost::shared_ptr<BeRoInterface> > myBeRo; std::vector<boost::shared_ptr<BeRoInterface> > myBeRo;
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_PREFLOP))); myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_PREFLOP)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_FLOP))); myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_FLOP)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_TURN))); myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_TURN)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_RIVER))); myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_RIVER)));
myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_POST_RIVER))); myBeRo.push_back(boost::shared_ptr<BeRoInterface>(new ClientBeRo(hi, dP, sB, GAME_STATE_POST_RIVER)));
return myBeRo; return myBeRo;
@@ -41,7 +41,7 @@ public:
virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC); virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC);
virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp); virtual boost::shared_ptr<BoardInterface> createBoard(unsigned dp);
virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB); virtual boost::shared_ptr<PlayerInterface> createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB);
virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB); virtual std::vector<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB);
}; };
#endif #endif
+7 -7
View File
@@ -22,8 +22,8 @@
using namespace std; using namespace std;
ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC)
: myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(GAME_STATE_PREFLOP), : myFactory(f), myGui(g), myBoard(b), myLog(l), seatsList(sl), activePlayerList(apl), runningPlayerList(rpl), myID(id), startQuantityPlayers(sP), dealerPosition(dP), currentRound(GAME_STATE_PREFLOP),
smallBlind(sB), startCash(sC), previousPlayerID(-1), allInCondition(0), smallBlind(sB), startCash(sC), previousPlayerID(-1), allInCondition(0),
cardsShown(false), bettingRoundsPlayed(0) cardsShown(false), bettingRoundsPlayed(0)
{ {
PlayerListIterator it; PlayerListIterator it;
@@ -51,7 +51,7 @@ ClientHand::ClientHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boos
// the rest of the buttons are assigned later as received from the server. // the rest of the buttons are assigned later as received from the server.
// Preflop, Flop, Turn und River erstellen // Preflop, Flop, Turn und River erstellen
myBeRo = myFactory->createBeRo(this, dealerPosition, smallBlind); myBeRo = myFactory->createBeRo(this, dealerPosition, smallBlind);
} }
@@ -290,28 +290,28 @@ void
ClientHand::setPreviousPlayerID(int theValue) ClientHand::setPreviousPlayerID(int theValue)
{ {
boost::recursive_mutex::scoped_lock lock(m_syncMutex); boost::recursive_mutex::scoped_lock lock(m_syncMutex);
previousPlayerID = theValue; previousPlayerID = theValue;
} }
int int
ClientHand::getPreviousPlayerID() const ClientHand::getPreviousPlayerID() const
{ {
boost::recursive_mutex::scoped_lock lock(m_syncMutex); boost::recursive_mutex::scoped_lock lock(m_syncMutex);
return previousPlayerID; return previousPlayerID;
} }
void void
ClientHand::setLastActionPlayerID (unsigned theValue) ClientHand::setLastActionPlayerID (unsigned theValue)
{ {
boost::recursive_mutex::scoped_lock lock(m_syncMutex); boost::recursive_mutex::scoped_lock lock(m_syncMutex);
lastActionPlayerID = theValue; lastActionPlayerID = theValue;
} }
unsigned unsigned
ClientHand::getLastActionPlayerID() const ClientHand::getLastActionPlayerID() const
{ {
boost::recursive_mutex::scoped_lock lock(m_syncMutex); boost::recursive_mutex::scoped_lock lock(m_syncMutex);
return lastActionPlayerID; return lastActionPlayerID;
} }
void void
+9 -9
View File
@@ -63,8 +63,8 @@ public:
void setStartQuantityPlayers ( int theValue ); void setStartQuantityPlayers ( int theValue );
int getStartQuantityPlayers() const; int getStartQuantityPlayers() const;
void setCurrentRound ( GameState theValue ); void setCurrentRound ( GameState theValue );
GameState getCurrentRound() const; GameState getCurrentRound() const;
void setDealerPosition ( int theValue ); void setDealerPosition ( int theValue );
int getDealerPosition() const; int getDealerPosition() const;
@@ -81,11 +81,11 @@ public:
void setBettingRoundsPlayed ( int theValue ); void setBettingRoundsPlayed ( int theValue );
int getBettingRoundsPlayed() const; int getBettingRoundsPlayed() const;
void setPreviousPlayerID ( int theValue ); void setPreviousPlayerID ( int theValue );
int getPreviousPlayerID() const; int getPreviousPlayerID() const;
void setLastActionPlayerID ( unsigned theValue ); void setLastActionPlayerID ( unsigned theValue );
unsigned getLastActionPlayerID() const; unsigned getLastActionPlayerID() const;
void setCardsShown ( bool theValue ); void setCardsShown ( bool theValue );
bool getCardsShown() const; bool getCardsShown() const;
@@ -115,12 +115,12 @@ private:
int myID; int myID;
int startQuantityPlayers; int startQuantityPlayers;
unsigned dealerPosition; unsigned dealerPosition;
GameState currentRound; GameState currentRound;
int smallBlind; int smallBlind;
int startCash; int startCash;
int previousPlayerID; int previousPlayerID;
unsigned lastActionPlayerID; unsigned lastActionPlayerID;
bool allInCondition; bool allInCondition;
bool cardsShown; bool cardsShown;
+1 -1
View File
@@ -25,7 +25,7 @@ using namespace std;
ClientPlayer::ClientPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB) ClientPlayer::ClientPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
: PlayerInterface(), myConfig(c), currentHand(0), myID(id), myUniqueID(uniqueId), myType(type), : PlayerInterface(), myConfig(c), currentHand(0), myID(id), myUniqueID(uniqueId), myType(type),
myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0),
myAction(PLAYER_ACTION_NONE), myButton(mB), myActiveStatus(aS), myStayOnTableStatus(true), myTurn(false), myCardsFlip(false), myRoundStartCash(0), myAction(PLAYER_ACTION_NONE), myButton(mB), myActiveStatus(aS), myStayOnTableStatus(true), myTurn(false), myCardsFlip(false), myRoundStartCash(0),
lastMoneyWon(0), sBluff(0), sBluffStatus(false), myWinnerState(false), m_isConnected(false) lastMoneyWon(0), sBluff(0), sBluffStatus(false), myWinnerState(false), m_isConnected(false)
{ {
myBestHandPosition[0] = myBestHandPosition[1] = myBestHandPosition[2] = myBestHandPosition[3] = myBestHandPosition[4] = 0; myBestHandPosition[0] = myBestHandPosition[1] = myBestHandPosition[2] = myBestHandPosition[3] = myBestHandPosition[4] = 0;
+3 -3
View File
@@ -64,8 +64,8 @@ public:
int getMySet() const; int getMySet() const;
int getMyLastRelativeSet() const; int getMyLastRelativeSet() const;
void setMyAction(PlayerAction theValue, bool blind); void setMyAction(PlayerAction theValue, bool blind);
PlayerAction getMyAction() const; PlayerAction getMyAction() const;
void setMyButton(int theValue); void setMyButton(int theValue);
int getMyButton() const; int getMyButton() const;
@@ -172,7 +172,7 @@ private:
int myCash; int myCash;
int mySet; int mySet;
int myLastRelativeSet; int myLastRelativeSet;
PlayerAction myAction; PlayerAction myAction;
int myButton; // 0 = none, 1 = dealer, 2 =small, 3 = big int myButton; // 0 = none, 1 = dealer, 2 =small, 3 = big
bool myActiveStatus; // 0 = inactive, 1 = active bool myActiveStatus; // 0 = inactive, 1 = active
bool myStayOnTableStatus; // 0 = left, 1 = stay bool myStayOnTableStatus; // 0 = left, 1 = stay
+2 -2
View File
@@ -62,8 +62,8 @@ public:
virtual int getMySet() const =0; virtual int getMySet() const =0;
virtual int getMyLastRelativeSet() const =0; virtual int getMyLastRelativeSet() const =0;
virtual void setMyAction(PlayerAction theValue, bool blind=0) =0; virtual void setMyAction(PlayerAction theValue, bool blind=0) =0;
virtual PlayerAction getMyAction() const =0; virtual PlayerAction getMyAction() const =0;
virtual void setMyButton(int theValue) =0; virtual void setMyButton(int theValue) =0;
virtual int getMyButton() const =0; virtual int getMyButton() const =0;
+16 -16
View File
@@ -69,7 +69,7 @@ enum PlayerAction {
PLAYER_ACTION_CALL, PLAYER_ACTION_CALL,
PLAYER_ACTION_BET, PLAYER_ACTION_BET,
PLAYER_ACTION_RAISE, PLAYER_ACTION_RAISE,
PLAYER_ACTION_ALLIN PLAYER_ACTION_ALLIN
}; };
enum PlayerActionCode { enum PlayerActionCode {
@@ -80,21 +80,21 @@ enum PlayerActionCode {
}; };
enum PlayerActionLog { enum PlayerActionLog {
LOG_ACTION_NONE = 0, LOG_ACTION_NONE = 0,
LOG_ACTION_DEALER, // starts as dealer LOG_ACTION_DEALER, // starts as dealer
LOG_ACTION_SMALL_BLIND, // posts small blind LOG_ACTION_SMALL_BLIND, // posts small blind
LOG_ACTION_BIG_BLIND, // posts big blind LOG_ACTION_BIG_BLIND, // posts big blind
LOG_ACTION_FOLD, // folds LOG_ACTION_FOLD, // folds
LOG_ACTION_CHECK, // checks LOG_ACTION_CHECK, // checks
LOG_ACTION_CALL, // calls LOG_ACTION_CALL, // calls
LOG_ACTION_BET, // bets LOG_ACTION_BET, // bets
LOG_ACTION_ALL_IN, // is all in with LOG_ACTION_ALL_IN, // is all in with
LOG_ACTION_SHOW, // shows LOG_ACTION_SHOW, // shows
LOG_ACTION_HAS, // has LOG_ACTION_HAS, // has
LOG_ACTION_WIN, // wins LOG_ACTION_WIN, // wins
LOG_ACTION_WIN_SIDE_POT,// wins (side pot) LOG_ACTION_WIN_SIDE_POT,// wins (side pot)
LOG_ACTION_SIT_OUT, // sits out LOG_ACTION_SIT_OUT, // sits out
LOG_ACTION_WIN_GAME // wins game LOG_ACTION_WIN_GAME // wins game
}; };
enum DenyKickPlayerReason { enum DenyKickPlayerReason {
+2 -4
View File
@@ -248,13 +248,11 @@ void ChatTools::nickAutoCompletition()
if(lastChatString == "") { if(lastChatString == "") {
myLineEdit->setText(lastMatchStringList.at(nickAutoCompletitionCounter)+": "); myLineEdit->setText(lastMatchStringList.at(nickAutoCompletitionCounter)+": ");
} } else {
else {
//check if lastChatString is pm-code //check if lastChatString is pm-code
if((lastChatString == "/msg" || lastChatString == "/msg ") && lastMatchStringList.at(nickAutoCompletitionCounter).contains(" ")) { if((lastChatString == "/msg" || lastChatString == "/msg ") && lastMatchStringList.at(nickAutoCompletitionCounter).contains(" ")) {
myLineEdit->setText(lastChatString+" \""+lastMatchStringList.at(nickAutoCompletitionCounter)+"\" "); myLineEdit->setText(lastChatString+" \""+lastMatchStringList.at(nickAutoCompletitionCounter)+"\" ");
} } else {
else {
myLineEdit->setText(lastChatString+" "+lastMatchStringList.at(nickAutoCompletitionCounter)+" "); myLineEdit->setText(lastChatString+" "+lastMatchStringList.at(nickAutoCompletitionCounter)+" ");
} }
} }
+25 -26
View File
@@ -1823,12 +1823,12 @@ void gameTableImpl::myFold()
boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
boost::shared_ptr<PlayerInterface> humanPlayer = currentHand->getSeatsList()->front(); boost::shared_ptr<PlayerInterface> humanPlayer = currentHand->getSeatsList()->front();
humanPlayer->setMyAction(PLAYER_ACTION_FOLD); humanPlayer->setMyAction(PLAYER_ACTION_FOLD);
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_FOLD); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_FOLD);
humanPlayer->setMyTurn(0); humanPlayer->setMyTurn(0);
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setPreviousPlayerID(0); currentHand->setPreviousPlayerID(0);
// statusBar()->clearMessage(); // statusBar()->clearMessage();
@@ -1844,10 +1844,10 @@ void gameTableImpl::myCheck()
boost::shared_ptr<PlayerInterface> humanPlayer = currentHand->getSeatsList()->front(); boost::shared_ptr<PlayerInterface> humanPlayer = currentHand->getSeatsList()->front();
humanPlayer->setMyTurn(0); humanPlayer->setMyTurn(0);
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CHECK); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CHECK);
humanPlayer->setMyAction(PLAYER_ACTION_CHECK); humanPlayer->setMyAction(PLAYER_ACTION_CHECK);
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setPreviousPlayerID(0); currentHand->setPreviousPlayerID(0);
// statusBar()->clearMessage(); // statusBar()->clearMessage();
@@ -1911,11 +1911,11 @@ void gameTableImpl::myCall()
humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMySet(humanPlayer->getMyCash());
humanPlayer->setMyCash(0); humanPlayer->setMyCash(0);
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet());
humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN);
} else { } else {
humanPlayer->setMySet(tempHighestSet - humanPlayer->getMySet()); humanPlayer->setMySet(tempHighestSet - humanPlayer->getMySet());
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CALL,humanPlayer->getMySet()); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_CALL,humanPlayer->getMySet());
humanPlayer->setMyAction(PLAYER_ACTION_CALL); humanPlayer->setMyAction(PLAYER_ACTION_CALL);
} }
humanPlayer->setMyTurn(0); humanPlayer->setMyTurn(0);
@@ -1923,7 +1923,7 @@ void gameTableImpl::myCall()
refreshPot(); refreshPot();
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setPreviousPlayerID(0); currentHand->setPreviousPlayerID(0);
// statusBar()->clearMessage(); // statusBar()->clearMessage();
@@ -1948,7 +1948,7 @@ void gameTableImpl::mySet()
humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMySet(humanPlayer->getMyCash());
humanPlayer->setMyCash(0); humanPlayer->setMyCash(0);
humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN);
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet());
// full bet rule // full bet rule
@@ -1960,7 +1960,7 @@ void gameTableImpl::mySet()
if(myActionIsRaise) { if(myActionIsRaise) {
//do not if allIn //do not if allIn
if(humanPlayer->getMyAction() != 6) { if(humanPlayer->getMyAction() != 6) {
humanPlayer->setMyAction(PLAYER_ACTION_RAISE); humanPlayer->setMyAction(PLAYER_ACTION_RAISE);
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet()); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet());
} }
myActionIsRaise = 0; myActionIsRaise = 0;
@@ -1971,7 +1971,7 @@ void gameTableImpl::mySet()
if(myActionIsBet) { if(myActionIsBet) {
//do not if allIn //do not if allIn
if(humanPlayer->getMyAction() != 6) { if(humanPlayer->getMyAction() != 6) {
humanPlayer->setMyAction(PLAYER_ACTION_BET); humanPlayer->setMyAction(PLAYER_ACTION_BET);
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet()); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_BET,humanPlayer->getMySet());
} }
myActionIsBet = 0; myActionIsBet = 0;
@@ -1989,10 +1989,10 @@ void gameTableImpl::mySet()
// statusBar()->clearMessage(); // statusBar()->clearMessage();
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setPreviousPlayerID(0); currentHand->setPreviousPlayerID(0);
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(humanPlayer->getMyUniqueID()); currentHand->setLastActionPlayerID(humanPlayer->getMyUniqueID());
//Spiel läuft weiter //Spiel läuft weiter
myActionDone(); myActionDone();
@@ -2009,7 +2009,7 @@ void gameTableImpl::myAllIn()
humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMySet(humanPlayer->getMyCash());
humanPlayer->setMyCash(0); humanPlayer->setMyCash(0);
humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN);
// currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet()); // currentHand->getLog()->logPlayerAction(currentHand->getCurrentRound()+1,1,LOG_ACTION_ALL_IN,humanPlayer->getMySet());
// full bet rule // full bet rule
@@ -2023,7 +2023,7 @@ void gameTableImpl::myAllIn()
currentHand->getCurrentBeRo()->setHighestSet(humanPlayer->getMySet()); currentHand->getCurrentBeRo()->setHighestSet(humanPlayer->getMySet());
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(humanPlayer->getMyUniqueID()); currentHand->setLastActionPlayerID(humanPlayer->getMyUniqueID());
} }
@@ -2033,7 +2033,7 @@ void gameTableImpl::myAllIn()
refreshPot(); refreshPot();
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setPreviousPlayerID(0); currentHand->setPreviousPlayerID(0);
//Spiel läuft weiter //Spiel läuft weiter
myActionDone(); myActionDone();
@@ -2174,11 +2174,11 @@ void gameTableImpl::nextPlayerAnimation()
PlayerListConstIterator it_c; PlayerListConstIterator it_c;
PlayerList seatsList = currentHand->getSeatsList(); PlayerList seatsList = currentHand->getSeatsList();
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)->getMyID() == currentHand->getPreviousPlayerID()) break; if((*it_c)->getMyID() == currentHand->getPreviousPlayerID()) break;
} }
if(currentHand->getPreviousPlayerID() != -1) { if(currentHand->getPreviousPlayerID() != -1) {
refreshAction(currentHand->getPreviousPlayerID(), (*it_c)->getMyAction()); refreshAction(currentHand->getPreviousPlayerID(), (*it_c)->getMyAction());
} }
refreshCash(); refreshCash();
@@ -2512,7 +2512,7 @@ void gameTableImpl::postRiverRunAnimation3()
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) {
currentHand->getGuiInterface()->logPlayerSitsOut((*it_c)->getMyName()); currentHand->getGuiInterface()->logPlayerSitsOut((*it_c)->getMyName());
currentHand->getLog()->logPlayerAction(5, (*it_c)->getMyID()+1, LOG_ACTION_SIT_OUT); currentHand->getLog()->logPlayerAction(5, (*it_c)->getMyID()+1, LOG_ACTION_SIT_OUT);
} }
} }
@@ -2651,12 +2651,11 @@ void gameTableImpl::showHoleCards(unsigned playerId, bool allIn)
} }
} }
//set Player value (logging) //set Player value (logging)
if(currentHand->getCurrentRound() < GAME_STATE_RIVER || allIn) { if(currentHand->getCurrentRound() < GAME_STATE_RIVER || allIn) {
(*it_c)->setMyCardsFlip(1,2); //for bero before postriver or allin just log the hole cards (*it_c)->setMyCardsFlip(1,2); //for bero before postriver or allin just log the hole cards
} } else {
else { (*it_c)->setMyCardsFlip(1,1); //for postriver log the value
(*it_c)->setMyCardsFlip(1,1); //for postriver log the value }
}
} }
} }
} }
@@ -2666,7 +2665,7 @@ void gameTableImpl::flipHolecardsAllIn()
boost::shared_ptr<Game> currentGame = myStartWindow->getSession()->getCurrentGame(); boost::shared_ptr<Game> currentGame = myStartWindow->getSession()->getCurrentGame();
if(!flipHolecardsAllInAlreadyDone && currentGame->getCurrentHand()->getCurrentRound() < GAME_STATE_RIVER) { if(!flipHolecardsAllInAlreadyDone && currentGame->getCurrentHand()->getCurrentRound() < GAME_STATE_RIVER) {
//Aktive Spieler zählen --> wenn nur noch einer nicht-folded dann keine Karten umdrehen //Aktive Spieler zählen --> wenn nur noch einer nicht-folded dann keine Karten umdrehen
int nonfoldPlayersCounter = 0; int nonfoldPlayersCounter = 0;
PlayerListConstIterator it_c; PlayerListConstIterator it_c;
@@ -3229,7 +3228,7 @@ void gameTableImpl::updateMyButtonsState(int mode)
boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
if(currentHand->getPreviousPlayerID() == 0) { if(currentHand->getPreviousPlayerID() == 0) {
myButtonsCheckable(FALSE); myButtonsCheckable(FALSE);
clearMyButtons(); clearMyButtons();
} else { } else {
+6 -6
View File
@@ -1756,10 +1756,10 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
netActionDone->totalPlayerBet - tmpPlayer->getMySet()); netActionDone->totalPlayerBet - tmpPlayer->getMySet());
} }
// Update last players turn only after the blinds. // Update last players turn only after the blinds.
curGame->getCurrentHand()->setPreviousPlayerID(tmpPlayer->getMyID()); curGame->getCurrentHand()->setPreviousPlayerID(tmpPlayer->getMyID());
} }
tmpPlayer->setMyAction(PlayerAction(netActionDone->playerAction)); tmpPlayer->setMyAction(PlayerAction(netActionDone->playerAction));
tmpPlayer->setMySetAbsolute(netActionDone->totalPlayerBet); tmpPlayer->setMySetAbsolute(netActionDone->totalPlayerBet);
tmpPlayer->setMyCash(netActionDone->playerMoney); tmpPlayer->setMyCash(netActionDone->playerMoney);
curGame->getCurrentHand()->getCurrentBeRo()->setHighestSet(netActionDone->highestSet); curGame->getCurrentHand()->getCurrentBeRo()->setHighestSet(netActionDone->highestSet);
@@ -1835,7 +1835,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
tmpCards[3] = tmpCards[4] = 0; tmpCards[3] = tmpCards[4] = 0;
curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards); curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards);
curGame->getCurrentHand()->getBoard()->collectPot(); curGame->getCurrentHand()->getBoard()->collectPot();
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->GetGui().refreshGameLabels(GAME_STATE_FLOP); client->GetGui().refreshGameLabels(GAME_STATE_FLOP);
@@ -1850,7 +1850,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
tmpCards[3] = static_cast<int>(netDealTurn->turnCard); tmpCards[3] = static_cast<int>(netDealTurn->turnCard);
curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards); curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards);
curGame->getCurrentHand()->getBoard()->collectPot(); curGame->getCurrentHand()->getBoard()->collectPot();
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->GetGui().refreshGameLabels(GAME_STATE_TURN); client->GetGui().refreshGameLabels(GAME_STATE_TURN);
@@ -1865,7 +1865,7 @@ ClientStateRunHand::InternalHandlePacket(boost::shared_ptr<ClientThread> client,
tmpCards[4] = static_cast<int>(netDealRiver->riverCard); tmpCards[4] = static_cast<int>(netDealRiver->riverCard);
curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards); curGame->getCurrentHand()->getBoard()->setMyCards(tmpCards);
curGame->getCurrentHand()->getBoard()->collectPot(); curGame->getCurrentHand()->getBoard()->collectPot();
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->GetGui().refreshGameLabels(GAME_STATE_RIVER); client->GetGui().refreshGameLabels(GAME_STATE_RIVER);
@@ -1995,7 +1995,7 @@ ClientStateRunHand::ResetPlayerActions(Game &curGame)
while (i != end) { while (i != end) {
int action = (*i)->getMyAction(); int action = (*i)->getMyAction();
if (action != 1 && action != 6) if (action != 1 && action != 6)
(*i)->setMyAction(PLAYER_ACTION_NONE); (*i)->setMyAction(PLAYER_ACTION_NONE);
(*i)->setMySetNull(); (*i)->setMySetNull();
++i; ++i;
} }
+3 -3
View File
@@ -154,12 +154,12 @@ static void PerformPlayerAction(ServerGame &server, boost::shared_ptr<PlayerInte
switch(action) { switch(action) {
case PLAYER_ACTION_BET: { case PLAYER_ACTION_BET: {
curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(bet); curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(bet);
curGame.getCurrentHand()->setLastActionPlayerID(player->getMyUniqueID()); curGame.getCurrentHand()->setLastActionPlayerID(player->getMyUniqueID());
} }
break; break;
case PLAYER_ACTION_RAISE: { case PLAYER_ACTION_RAISE: {
curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet()); curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet());
curGame.getCurrentHand()->setLastActionPlayerID(player->getMyUniqueID()); curGame.getCurrentHand()->setLastActionPlayerID(player->getMyUniqueID());
} }
break; break;
case PLAYER_ACTION_ALLIN: { case PLAYER_ACTION_ALLIN: {
@@ -167,7 +167,7 @@ static void PerformPlayerAction(ServerGame &server, boost::shared_ptr<PlayerInte
curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet()); curGame.getCurrentHand()->getCurrentBeRo()->setMinimumRaise(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet());
} }
if(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() > 0) { if(player->getMySet() - curGame.getCurrentHand()->getCurrentBeRo()->getHighestSet() > 0) {
curGame.getCurrentHand()->setLastActionPlayerID(player->getMyUniqueID()); curGame.getCurrentHand()->setLastActionPlayerID(player->getMyUniqueID());
} }
} }
break; break;
+1 -1
View File
@@ -905,7 +905,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)
+1 -1
View File
@@ -43,7 +43,7 @@ Session::Session(GuiInterface *g, ConfigFile *c)
: currentGameNum(0), myGui(g), myConfig(c), myLog(0), myGameType(GAME_TYPE_NONE) : currentGameNum(0), myGui(g), myConfig(c), myLog(0), myGameType(GAME_TYPE_NONE)
{ {
myQtToolsInterface = CreateQtToolsWrapper(); myQtToolsInterface = CreateQtToolsWrapper();
myLog = new Log(myConfig); myLog = new Log(myConfig);
} }