adds activePlayerList and runningPlayerList (XVIII)
This commit is contained in:
@@ -36,7 +36,7 @@ public:
|
|||||||
|
|
||||||
virtual void start() = 0;
|
virtual void start() = 0;
|
||||||
|
|
||||||
virtual std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const =0;
|
virtual std::vector<boost::shared_ptr<PlayerInterface> > getPlayerArray() const =0; // delete
|
||||||
virtual PlayerList getActivePlayerList() const =0;
|
virtual PlayerList getActivePlayerList() const =0;
|
||||||
virtual PlayerList getRunningPlayerList() const =0;
|
virtual PlayerList getRunningPlayerList() const =0;
|
||||||
|
|
||||||
|
|||||||
@@ -292,8 +292,17 @@ void LocalBeRo::run() {
|
|||||||
// aktuelle bero ist wirklich dran
|
// aktuelle bero ist wirklich dran
|
||||||
|
|
||||||
// Anzahl der effektiv gespielten Runden (des human player) erhöhen
|
// Anzahl der effektiv gespielten Runden (des human player) erhöhen
|
||||||
if(myHand->getPlayerArray()[0]->getMyActiveStatus() && myHand->getPlayerArray()[0]->getMyAction() != 1) {
|
// if(myHand->getPlayerArray()[0]->getMyActiveStatus() && myHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||||
myHand->setBettingRoundsPlayed(myBeRoID);
|
// myHand->setBettingRoundsPlayed(myBeRoID);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Anzahl der effektiv gespielten Runden (des human player) erhöhen
|
||||||
|
it_c = myHand->getActivePlayerIt(0);
|
||||||
|
if( it_c != myHand->getActivePlayerList()->end() ) {
|
||||||
|
// human player is active
|
||||||
|
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD ) {
|
||||||
|
myHand->setBettingRoundsPlayed(myBeRoID);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//// !!!!!!!!!!!!!!!!1!!!! very buggy, rule breaking -> TODO !!!!!!!!!!!!11!!!!!!!! //////////////
|
//// !!!!!!!!!!!!!!!!1!!!! very buggy, rule breaking -> TODO !!!!!!!!!!!!11!!!!!!!! //////////////
|
||||||
|
|||||||
@@ -38,30 +38,63 @@ void LocalBeRoPostRiver::run() {
|
|||||||
|
|
||||||
void LocalBeRoPostRiver::postRiverRun() {
|
void LocalBeRoPostRiver::postRiverRun() {
|
||||||
|
|
||||||
int i;
|
// int i;
|
||||||
|
PlayerListConstIterator it_c;
|
||||||
|
PlayerListIterator it;
|
||||||
|
|
||||||
//berechnen welcher Spieler gewonnen hat
|
//berechnen welcher Spieler gewonnen hat
|
||||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
//
|
||||||
|
// if(getMyHand()->getPlayerArray()[i]->getMyActiveStatus() && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD && getMyHand()->getPlayerArray()[i]->getMyCardsValueInt() > highestCardsValue ) {
|
||||||
|
// highestCardsValue = getMyHand()->getPlayerArray()[i]->getMyCardsValueInt();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if(getMyHand()->getPlayerArray()[i]->getMyActiveStatus() && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD && getMyHand()->getPlayerArray()[i]->getMyCardsValueInt() > highestCardsValue ) {
|
|
||||||
highestCardsValue = getMyHand()->getPlayerArray()[i]->getMyCardsValueInt();
|
|
||||||
|
//berechnen welcher Spieler gewonnen hat
|
||||||
|
for(it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); it_c++) {
|
||||||
|
|
||||||
|
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD && (*it_c)->getMyCardsValueInt() > highestCardsValue ) {
|
||||||
|
highestCardsValue = (*it_c)->getMyCardsValueInt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Durchschnittsets des human player ermitteln
|
// Durchschnittsets des human player ermitteln
|
||||||
// getMyHand()->getPlayerArray()[0]->setMyAverageSets(((getMyHand()->getPlayerArray()[0]->getMyRoundStartCash())-(getMyHand()->getPlayerArray()[0]->getMyCash()))/(getMyHand()->getBettingRoundsPlayed()+1));
|
// getMyHand()->getPlayerArray()[0]->setMyAverageSets(((getMyHand()->getPlayerArray()[0]->getMyRoundStartCash())-(getMyHand()->getPlayerArray()[0]->getMyCash()))/(getMyHand()->getBettingRoundsPlayed()+1));
|
||||||
|
|
||||||
// Aggressivität des human player ermitteln
|
// Aggressivität des human player ermitteln
|
||||||
// anzahl der player die möglichkeit haben am pot teilzuhaben
|
// anzahl der player die möglichkeit haben am pot teilzuhaben
|
||||||
int potPlayers = 0;
|
int potPlayers = 0;
|
||||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
if(getMyHand()->getPlayerArray()[i]->getMyActiveStatus() && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD) {
|
// if(getMyHand()->getPlayerArray()[i]->getMyActiveStatus() && getMyHand()->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD) {
|
||||||
|
// potPlayers++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
for(it_c=getMyHand()->getActivePlayerList()->begin(); it_c!=getMyHand()->getActivePlayerList()->end(); it_c++) {
|
||||||
|
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
|
||||||
potPlayers++;
|
potPlayers++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// prüfen ob nur noch der human player an der verteilung teilnimmt und myAggressive für human player setzen
|
// prüfen ob nur noch der human player an der verteilung teilnimmt und myAggressive für human player setzen
|
||||||
getMyHand()->getPlayerArray()[0]->setMyAggressive(potPlayers == 1 && getMyHand()->getPlayerArray()[0]->getMyActiveStatus() && getMyHand()->getPlayerArray()[0]->getMyAction() != PLAYER_ACTION_FOLD);
|
// getMyHand()->getPlayerArray()[0]->setMyAggressive(potPlayers == 1 && getMyHand()->getPlayerArray()[0]->getMyActiveStatus() && getMyHand()->getPlayerArray()[0]->getMyAction() != PLAYER_ACTION_FOLD);
|
||||||
|
|
||||||
|
|
||||||
|
// prüfen ob nur noch der human player an der verteilung teilnimmt und myAggressive für human player setzen
|
||||||
|
it = getMyHand()->getActivePlayerIt(0);
|
||||||
|
if( it != getMyHand()->getActivePlayerList()->end() ) {
|
||||||
|
if( potPlayers == 1 && (*it)->getMyAction() != PLAYER_ACTION_FOLD ) {
|
||||||
|
(*it)->setMyAggressive(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// cout << "myAggressive: " << getMyHand()->getPlayerArray()[0]->getMyAggressive() << endl;
|
// cout << "myAggressive: " << getMyHand()->getPlayerArray()[0]->getMyAggressive() << endl;
|
||||||
|
|
||||||
@@ -75,6 +108,8 @@ void LocalBeRoPostRiver::postRiverRun() {
|
|||||||
getMyHand()->getGuiInterface()->postRiverRunAnimation1();
|
getMyHand()->getGuiInterface()->postRiverRunAnimation1();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
void LocalBeRoPostRiver::distributePot() {
|
void LocalBeRoPostRiver::distributePot() {
|
||||||
|
|
||||||
// int potCalcAllinArray[5][2]; // 0 -> ID , 1 -> AllInCash
|
// int potCalcAllinArray[5][2]; // 0 -> ID , 1 -> AllInCash
|
||||||
@@ -346,3 +381,5 @@ void LocalBeRoPostRiver::distributePot() {
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public:
|
|||||||
void run();
|
void run();
|
||||||
|
|
||||||
void postRiverRun();
|
void postRiverRun();
|
||||||
void distributePot();
|
// void distributePot();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
@@ -985,6 +985,7 @@ void LocalPlayer::preflopEngine() {
|
|||||||
int bet = 0;
|
int bet = 0;
|
||||||
int raise = 0;
|
int raise = 0;
|
||||||
int cBluff;
|
int cBluff;
|
||||||
|
PlayerListConstIterator it_c;
|
||||||
|
|
||||||
// temporär solange preflopValue und flopValue noch nicht bereinigt für sechs und sieben spieler
|
// temporär solange preflopValue und flopValue noch nicht bereinigt für sechs und sieben spieler
|
||||||
int players = actualHand->getActivePlayerList()->size();
|
int players = actualHand->getActivePlayerList()->size();
|
||||||
@@ -1018,14 +1019,24 @@ void LocalPlayer::preflopEngine() {
|
|||||||
// cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl;
|
// cout << myID << ": " << myHoleCardsValue << " - " << myNiveau[0] << " " << myNiveau[2] << " - " << myCards[0] << " " << myCards[1] << endl;
|
||||||
|
|
||||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
|
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
|
||||||
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
|
// int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
|
||||||
|
//
|
||||||
// cout << aggValue << " ";
|
// if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||||
|
// myNiveau[0] -= aggValue;
|
||||||
|
// myNiveau[2] -= aggValue;
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
|
|
||||||
myNiveau[0] -= aggValue;
|
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
|
||||||
myNiveau[2] -= aggValue;
|
it_c = actualHand->getActivePlayerIt(0);
|
||||||
|
if( it_c != actualHand->getActivePlayerList()->end() ) {
|
||||||
|
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD ) {
|
||||||
|
int aggValue = (int)((( (*it_c)->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
|
||||||
|
myNiveau[0] -= aggValue;
|
||||||
|
myNiveau[2] -= aggValue;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1253,6 +1264,7 @@ void LocalPlayer::flopEngine() {
|
|||||||
int cBluff;
|
int cBluff;
|
||||||
int pBluff;
|
int pBluff;
|
||||||
int rand;
|
int rand;
|
||||||
|
PlayerListConstIterator it_c;
|
||||||
|
|
||||||
// übergang solange preflopValue und flopValue noch nicht bereinigt
|
// übergang solange preflopValue und flopValue noch nicht bereinigt
|
||||||
int players = actualHand->getActivePlayerList()->size();
|
int players = actualHand->getActivePlayerList()->size();
|
||||||
@@ -1273,14 +1285,27 @@ void LocalPlayer::flopEngine() {
|
|||||||
if(individualHighestSet > myCash) individualHighestSet = myCash;
|
if(individualHighestSet > myCash) individualHighestSet = myCash;
|
||||||
|
|
||||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
|
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
|
||||||
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
|
// int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
|
||||||
|
//
|
||||||
|
// if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||||
|
// for(i=0; i<3; i++) {
|
||||||
|
// myNiveau[i] -= aggValue;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
|
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
|
||||||
for(i=0; i<3; i++) {
|
it_c = actualHand->getActivePlayerIt(0);
|
||||||
myNiveau[i] -= aggValue;
|
if( it_c != actualHand->getActivePlayerList()->end() ) {
|
||||||
|
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD ) {
|
||||||
|
int aggValue = (int)((( (*it_c)->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
|
||||||
|
for(i=0; i<3; i++) {
|
||||||
|
myNiveau[i] -= aggValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Check-Bluff generieren
|
// Check-Bluff generieren
|
||||||
Tools::getRandNumber(1,100,1,&cBluff,0);
|
Tools::getRandNumber(1,100,1,&cBluff,0);
|
||||||
|
|
||||||
@@ -1831,6 +1856,7 @@ void LocalPlayer::turnEngine() {
|
|||||||
int cBluff;
|
int cBluff;
|
||||||
int pBluff;
|
int pBluff;
|
||||||
int rand;
|
int rand;
|
||||||
|
PlayerListConstIterator it_c;
|
||||||
|
|
||||||
calcMyOdds();
|
calcMyOdds();
|
||||||
|
|
||||||
@@ -1843,13 +1869,29 @@ void LocalPlayer::turnEngine() {
|
|||||||
myNiveau[2] = 69 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
|
myNiveau[2] = 69 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
|
||||||
|
|
||||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
|
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
|
||||||
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
|
// int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
|
||||||
|
//
|
||||||
|
// if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||||
|
// for(i=0; i<3; i++) {
|
||||||
|
// myNiveau[i] -= aggValue;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
|
|
||||||
for(i=0; i<3; i++) {
|
|
||||||
myNiveau[i] -= aggValue;
|
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
|
||||||
|
it_c = actualHand->getActivePlayerIt(0);
|
||||||
|
if( it_c != actualHand->getActivePlayerList()->end() ) {
|
||||||
|
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD ) {
|
||||||
|
int aggValue = (int)((( (*it_c)->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
|
||||||
|
for(i=0; i<3; i++) {
|
||||||
|
myNiveau[i] -= aggValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl;
|
// cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl;
|
||||||
|
|
||||||
@@ -2167,6 +2209,7 @@ void LocalPlayer::riverEngine() {
|
|||||||
int i;
|
int i;
|
||||||
int rand;
|
int rand;
|
||||||
int pBluff;
|
int pBluff;
|
||||||
|
PlayerListConstIterator it_c;
|
||||||
|
|
||||||
calcMyOdds();
|
calcMyOdds();
|
||||||
|
|
||||||
@@ -2179,13 +2222,28 @@ void LocalPlayer::riverEngine() {
|
|||||||
myNiveau[2] = 69 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
|
myNiveau[2] = 69 + myDude4/* - 6*(actualHand->getActivePlayerList().size() - 2)*/;
|
||||||
|
|
||||||
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
|
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist
|
||||||
int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
|
// int aggValue = (int)(((actualHand->getPlayerArray()[0]->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
|
||||||
|
//
|
||||||
|
// if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
|
||||||
|
// for(i=0; i<3; i++) {
|
||||||
|
// myNiveau[i] -= aggValue;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
if(actualHand->getPlayerArray()[0]->getMyActiveStatus() && actualHand->getPlayerArray()[0]->getMyAction() != 1) {
|
|
||||||
for(i=0; i<3; i++) {
|
// Aggresivität des humanPlayers auslesen -> nur wenn er aktiv ist !
|
||||||
myNiveau[i] -= aggValue;
|
it_c = actualHand->getActivePlayerIt(0);
|
||||||
|
if( it_c != actualHand->getActivePlayerList()->end() ) {
|
||||||
|
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD ) {
|
||||||
|
int aggValue = (int)((( (*it_c)->getMyAggressive()*1.0)/7.0 - 1.0/actualHand->getActivePlayerList()->size())*21.0);
|
||||||
|
for(i=0; i<3; i++) {
|
||||||
|
myNiveau[i] -= aggValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl;
|
// cout << "Spieler " << myID << ": Dude " << myDude4 << "\t Wert " << myHoleCardsValue << "\t Niveau " << myNiveau[0] << " " << myNiveau[1] << " " << myNiveau[2] << "\t Agg " << aggValue << " " << endl;
|
||||||
|
|
||||||
@@ -4245,8 +4303,8 @@ void LocalPlayer::riverEngine3() {
|
|||||||
|
|
||||||
// temp fr das Vielfache des Small Blind, sodass HighestSet zu hoch ist
|
// temp fr das Vielfache des Small Blind, sodass HighestSet zu hoch ist
|
||||||
int tempFold;
|
int tempFold;
|
||||||
tempFold = (actualHand->getPlayerArray()[0]->getMyAverageSets())/(6*actualHand->getSmallBlind());
|
// tempFold = (actualHand->getPlayerArray()[0]->getMyAverageSets())/(6*actualHand->getSmallBlind());
|
||||||
// Tools::getRandNumber(4,6,1,&tempFold,0);
|
Tools::getRandNumber(4,6,1,&tempFold,0);
|
||||||
|
|
||||||
// FOLD
|
// FOLD
|
||||||
// --> wenn potential negativ oder HighestSet zu hoch
|
// --> wenn potential negativ oder HighestSet zu hoch
|
||||||
|
|||||||
@@ -99,8 +99,10 @@ ClientBoard::collectSets()
|
|||||||
{
|
{
|
||||||
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
|
||||||
sets = 0;
|
sets = 0;
|
||||||
for (int i = 0; i < MAX_NUMBER_OF_PLAYERS; i++)
|
PlayerListConstIterator it_c;
|
||||||
sets += playerArray[i]->getMySet();
|
for (it_c=seatsList->begin(); it_c!=seatsList->end(); it_c++)
|
||||||
|
sets += (*it_c)->getMySet();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
@@ -147,11 +147,13 @@ void Log::logPlayerActionMsg(QString msg, int action, int setValue) {
|
|||||||
|
|
||||||
void Log::logNewGameHandMsg(int gameID, int handID) {
|
void Log::logNewGameHandMsg(int gameID, int handID) {
|
||||||
|
|
||||||
int i, j ,k;
|
// int i, j, k;
|
||||||
|
PlayerListConstIterator it_c;
|
||||||
HandInterface *currentHand = myW->getSession().getCurrentGame()->getCurrentHand();
|
HandInterface *currentHand = myW->getSession().getCurrentGame()->getCurrentHand();
|
||||||
|
|
||||||
myW->textBrowser_Log->append("<b>## Game: "+QString::number(gameID,10)+" | Hand: "+QString::number(handID,10)+" ##</b>");
|
myW->textBrowser_Log->append("<b>## Game: "+QString::number(gameID,10)+" | Hand: "+QString::number(handID,10)+" ##</b>");
|
||||||
|
|
||||||
|
|
||||||
if(myConfig->readConfigInt("LogOnOff")) {
|
if(myConfig->readConfigInt("LogOnOff")) {
|
||||||
//if write logfiles is enabled
|
//if write logfiles is enabled
|
||||||
|
|
||||||
@@ -160,67 +162,121 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
|||||||
logFileStreamString += "CASH: ";
|
logFileStreamString += "CASH: ";
|
||||||
|
|
||||||
//Aktive Spieler zählen
|
//Aktive Spieler zählen
|
||||||
int activePlayersCounter = 0;
|
// int activePlayersCounter = 0;
|
||||||
for (k=0; k<MAX_NUMBER_OF_PLAYERS; k++) {
|
// for (k=0; k<MAX_NUMBER_OF_PLAYERS; k++) {
|
||||||
if (currentHand->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
// if (currentHand->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||||
}
|
// }
|
||||||
k = 0;
|
int k = 0;
|
||||||
if(activePlayersCounter > 2) {
|
// if(currentHand->getActivePlayerList()->size() > 2) {
|
||||||
|
//
|
||||||
|
// for(i=0; i<currentHand->getStartQuantityPlayers(); i++) {
|
||||||
|
//
|
||||||
|
// if(currentHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||||
|
// //print cash only for active players
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// if(currentHand->getPlayerArray()[i]->getMyButton() == 1) {
|
||||||
|
// if(k==1) { logFileStreamString += ", "; }
|
||||||
|
// k=1;
|
||||||
|
// logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyName().c_str())+" (Dealer): "+QString::number(currentHand->getPlayerArray()[i]->getMyCash(),10)+"$";
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// if(k==1) { logFileStreamString += ", "; }
|
||||||
|
// k=1;
|
||||||
|
// logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyName().c_str())+": "+QString::number(currentHand->getPlayerArray()[i]->getMyCash()+currentHand->getPlayerArray()[i]->getMySet(),10)+"$";
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// for(i=0; i<currentHand->getStartQuantityPlayers(); i++) {
|
||||||
|
// if(currentHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
||||||
|
// //print cash only for active players
|
||||||
|
// if(currentHand->getPlayerArray()[i]->getMyButton() == 2) {
|
||||||
|
// if(k==1) { logFileStreamString += ", "; }
|
||||||
|
// k=1;
|
||||||
|
// logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyName().c_str())+" (Dealer): "+QString::number(currentHand->getPlayerArray()[i]->getMyCash()+currentHand->getPlayerArray()[i]->getMySet(),10)+"$";
|
||||||
|
// }
|
||||||
|
// else {
|
||||||
|
// if(k==1) { logFileStreamString += ", "; }
|
||||||
|
// k=1;
|
||||||
|
// logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyName().c_str())+": "+QString::number(currentHand->getPlayerArray()[i]->getMyCash()+currentHand->getPlayerArray()[i]->getMySet(),10)+"$";
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
//print cash only for active players
|
||||||
|
for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
||||||
|
|
||||||
|
if(currentHand->getActivePlayerList()->size() > 2) {
|
||||||
|
|
||||||
for(i=0; i<currentHand->getStartQuantityPlayers(); i++) {
|
if((*it_c)->getMyButton() == BUTTON_DEALER) {
|
||||||
|
if(k==1) { logFileStreamString += ", "; }
|
||||||
if(currentHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
k=1;
|
||||||
//print cash only for active players
|
logFileStreamString += QString::fromUtf8((*it_c)->getMyName().c_str())+" (Dealer): "+QString::number((*it_c)->getMyCash(),10)+"$";
|
||||||
|
}
|
||||||
|
else {
|
||||||
if(currentHand->getPlayerArray()[i]->getMyButton() == 1) {
|
if(k==1) { logFileStreamString += ", "; }
|
||||||
if(k==1) { logFileStreamString += ", "; }
|
k=1;
|
||||||
k=1;
|
logFileStreamString += QString::fromUtf8((*it_c)->getMyName().c_str())+": "+QString::number((*it_c)->getMyCash()+(*it_c)->getMySet(),10)+"$";
|
||||||
logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyName().c_str())+" (Dealer): "+QString::number(currentHand->getPlayerArray()[i]->getMyCash(),10)+"$";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if(k==1) { logFileStreamString += ", "; }
|
|
||||||
k=1;
|
|
||||||
logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyName().c_str())+": "+QString::number(currentHand->getPlayerArray()[i]->getMyCash()+currentHand->getPlayerArray()[i]->getMySet(),10)+"$";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
// heads up
|
||||||
else {
|
else {
|
||||||
for(i=0; i<currentHand->getStartQuantityPlayers(); i++) {
|
|
||||||
if(currentHand->getPlayerArray()[i]->getMyActiveStatus()) {
|
if((*it_c)->getMyButton() == BUTTON_SMALL_BLIND) {
|
||||||
//print cash only for active players
|
if(k==1) { logFileStreamString += ", "; }
|
||||||
if(currentHand->getPlayerArray()[i]->getMyButton() == 2) {
|
k=1;
|
||||||
if(k==1) { logFileStreamString += ", "; }
|
logFileStreamString += QString::fromUtf8((*it_c)->getMyName().c_str())+" (Dealer): "+QString::number((*it_c)->getMyCash()+(*it_c)->getMySet(),10)+"$";
|
||||||
k=1;
|
}
|
||||||
logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyName().c_str())+" (Dealer): "+QString::number(currentHand->getPlayerArray()[i]->getMyCash()+currentHand->getPlayerArray()[i]->getMySet(),10)+"$";
|
else {
|
||||||
}
|
if(k==1) { logFileStreamString += ", "; }
|
||||||
else {
|
k=1;
|
||||||
if(k==1) { logFileStreamString += ", "; }
|
logFileStreamString += QString::fromUtf8((*it_c)->getMyName().c_str())+": "+QString::number((*it_c)->getMyCash()+(*it_c)->getMySet(),10)+"$";
|
||||||
k=1;
|
|
||||||
logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[i]->getMyName().c_str())+": "+QString::number(currentHand->getPlayerArray()[i]->getMyCash()+currentHand->getPlayerArray()[i]->getMySet(),10)+"$";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
logFileStreamString += "</br>BLINDS: ";
|
logFileStreamString += "</br>BLINDS: ";
|
||||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
|
//
|
||||||
|
// j = 0;
|
||||||
|
// //Aktive Spieler zählen
|
||||||
|
// int activePlayersCounter = 0;
|
||||||
|
// for (k=0; k<MAX_NUMBER_OF_PLAYERS; k++) {
|
||||||
|
// if (currentHand->getPlayerArray()[k]->getMyAction() != 1 && currentHand->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// switch (currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMyButton()) {
|
||||||
|
// case 2 : logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMyName().c_str())+" ("+QString::number(currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMySet(),10)+"$), ";
|
||||||
|
// break;
|
||||||
|
// case 3 : logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMyName().c_str())+" ("+QString::number(currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMySet(),10)+"$)";
|
||||||
|
// break;
|
||||||
|
// default :;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
||||||
|
|
||||||
j = 0;
|
switch ( (*it_c)->getMyButton() ) {
|
||||||
//Aktive Spieler zählen
|
case 2 : logFileStreamString += QString::fromUtf8((*it_c)->getMyName().c_str())+" ("+QString::number((*it_c)->getMySet(),10)+"$), ";
|
||||||
int activePlayersCounter = 0;
|
|
||||||
for (k=0; k<MAX_NUMBER_OF_PLAYERS; k++) {
|
|
||||||
if (currentHand->getPlayerArray()[k]->getMyAction() != 1 && currentHand->getPlayerArray()[k]->getMyActiveStatus() == 1) activePlayersCounter++;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMyButton()) {
|
|
||||||
case 2 : logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMyName().c_str())+" ("+QString::number(currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMySet(),10)+"$), ";
|
|
||||||
break;
|
break;
|
||||||
case 3 : logFileStreamString += QString::fromUtf8(currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMyName().c_str())+" ("+QString::number(currentHand->getPlayerArray()[(i+currentHand->getDealerPosition()+j)%MAX_NUMBER_OF_PLAYERS]->getMySet(),10)+"$)";
|
case 3 : logFileStreamString += QString::fromUtf8((*it_c)->getMyName().c_str())+" ("+QString::number((*it_c)->getMySet(),10)+"$)";
|
||||||
break;
|
break;
|
||||||
default :;
|
default :;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
logFileStreamString += "</br></br><b>PREFLOP</b>";
|
logFileStreamString += "</br></br><b>PREFLOP</b>";
|
||||||
logFileStreamString += "</br>\n";
|
logFileStreamString += "</br>\n";
|
||||||
@@ -245,8 +301,12 @@ void Log::logNewGameHandMsg(int gameID, int handID) {
|
|||||||
void Log::logPlayerWinsMsg(int playerID, int pot) {
|
void Log::logPlayerWinsMsg(int playerID, int pot) {
|
||||||
|
|
||||||
HandInterface *currentHand = myW->getSession().getCurrentGame()->getCurrentHand();
|
HandInterface *currentHand = myW->getSession().getCurrentGame()->getCurrentHand();
|
||||||
|
|
||||||
myW->textBrowser_Log->append(QString::fromUtf8(currentHand->getPlayerArray()[playerID]->getMyName().c_str())+" wins "+QString::number(pot,10)+"$!!! ");
|
// myW->textBrowser_Log->append(QString::fromUtf8(currentHand->getPlayerArray()[playerID]->getMyName().c_str())+" wins "+QString::number(pot,10)+"$!!! ");
|
||||||
|
|
||||||
|
PlayerListConstIterator playerConstIt = currentHand->getActivePlayerIt(playerID);
|
||||||
|
assert( playerConstIt != currentHand->getActivePlayerList()->end() );
|
||||||
|
myW->textBrowser_Log->append(QString::fromUtf8((*playerConstIt)->getMyName().c_str())+" wins "+QString::number(pot,10)+"$!!! ");
|
||||||
|
|
||||||
if(myConfig->readConfigInt("LogOnOff")) {
|
if(myConfig->readConfigInt("LogOnOff")) {
|
||||||
//if write logfiles is enabled
|
//if write logfiles is enabled
|
||||||
@@ -258,7 +318,9 @@ void Log::logPlayerWinsMsg(int playerID, int pot) {
|
|||||||
// else {
|
// else {
|
||||||
|
|
||||||
|
|
||||||
logFileStreamString += "</br><i>"+QString::fromUtf8(currentHand->getPlayerArray()[playerID]->getMyName().c_str())+" wins "+QString::number(pot,10)+"$!!!</i></p>\n";
|
// logFileStreamString += "</br><i>"+QString::fromUtf8(currentHand->getPlayerArray()[playerID]->getMyName().c_str())+" wins "+QString::number(pot,10)+"$!!!</i></p>\n";
|
||||||
|
|
||||||
|
logFileStreamString += "</br><i>"+QString::fromUtf8((*playerConstIt)->getMyName().c_str())+" wins "+QString::number(pot,10)+"$!!!</i></p>\n";
|
||||||
|
|
||||||
if(myConfig->readConfigInt("LogInterval") == 0) {
|
if(myConfig->readConfigInt("LogInterval") == 0) {
|
||||||
writeLogFileStream(logFileStreamString);
|
writeLogFileStream(logFileStreamString);
|
||||||
@@ -1245,12 +1307,21 @@ QString Log::determineHandName(int myCardsValueInt) {
|
|||||||
list<int> sameHandCardsValueInt;
|
list<int> sameHandCardsValueInt;
|
||||||
bool different = false;
|
bool different = false;
|
||||||
bool equal = false;
|
bool equal = false;
|
||||||
|
HandInterface *currentHand = myW->getSession().getCurrentGame()->getCurrentHand();
|
||||||
|
PlayerListConstIterator it_c;
|
||||||
|
|
||||||
// collect cardsValueInt of all players who will show their cards
|
// collect cardsValueInt of all players who will show their cards
|
||||||
HandInterface *currentHand = myW->getSession().getCurrentGame()->getCurrentHand();
|
// for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||||
for(i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
// if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD) {
|
||||||
if(currentHand->getPlayerArray()[i]->getMyActiveStatus() && currentHand->getPlayerArray()[i]->getMyAction() != PLAYER_ACTION_FOLD) {
|
// shownCardsValueInt.push_back(currentHand->getPlayerArray()[i]->getMyCardsValueInt());
|
||||||
shownCardsValueInt.push_back(currentHand->getPlayerArray()[i]->getMyCardsValueInt());
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
// collect cardsValueInt of all players who will show their cards
|
||||||
|
for(it_c=currentHand->getActivePlayerList()->begin(); it_c!=currentHand->getActivePlayerList()->end(); it_c++) {
|
||||||
|
if( (*it_c)->getMyAction() != PLAYER_ACTION_FOLD) {
|
||||||
|
shownCardsValueInt.push_back( (*it_c)->getMyCardsValueInt());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user