From 981073ee780e51f7257a163e5e87cf987efee1fe Mon Sep 17 00:00:00 2001 From: supinf0 Date: Sat, 5 Aug 2017 22:36:51 +0200 Subject: [PATCH 1/4] raised nickname display limit to 13 chars, fixed length when ... is appended --- src/gui/qt/gametable/mynamelabel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/qt/gametable/mynamelabel.cpp b/src/gui/qt/gametable/mynamelabel.cpp index aa19f31d2..f792efeaf 100644 --- a/src/gui/qt/gametable/mynamelabel.cpp +++ b/src/gui/qt/gametable/mynamelabel.cpp @@ -93,10 +93,10 @@ void MyNameLabel::setText ( const QString &t, bool trans, bool guest, bool compu linkString = QString("http://pokerth.net/redirect_user_profile.php?nick="+QUrl::toPercentEncoding(t)); } - // truncate nicknames longer than 10 characters + // truncate nicknames longer than 13 characters QString t2 = t; - if(t2.size() > 10){ - int chop = t.size() - 10 - 3; + if(t2.size() > 13){ + int chop = t.size() - 13 + 3; t2.chop(chop); t2.append("..."); } From 8a9efbb77a3f0548727688599770729fc68225e7 Mon Sep 17 00:00:00 2001 From: Albert Medela Date: Wed, 9 Aug 2017 12:56:37 +0200 Subject: [PATCH 2/4] update changelog & add protoc for windows --- ChangeLog | 10 ++++++++++ pokerth_protocol.pro | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0c066a6b2..3c489bdf4 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2017-09-01 version 1.1.2 +- PokerTH is now fully compatible with c++11 compilation mode +- Upgraded to websockets 0.7 +- BUGFIX: SQL errors are saved to server log (partly #324) +- BUGFIX: Players deliberately preventing start of play (#304) +- BUGFIX: Rating feature didn't work for special usernames (#319) +- BUGFIX: Ignore feature only works after restart (#320) +- BUGFIX: Shorten too long usernames on the table gui (#326) +- BUGFIX: "accidentally call" blocker now for working for FKey presses (#330) + 2014-01-10 version 1.1.1 - BUGFIX: Fixed crash when the first action in the first game times out (#258) - BUGFIX: Properly refresh the game table graphics after changing settings (#253) diff --git a/pokerth_protocol.pro b/pokerth_protocol.pro index ede4fb166..046eabcfc 100644 --- a/pokerth_protocol.pro +++ b/pokerth_protocol.pro @@ -34,6 +34,10 @@ SOURCES += src/third_party/protobuf/pokerth.pb.cc \ win32 { DEFINES += CURL_STATICLIB DEFINES += _WIN32_WINNT=0x0501 + + system(protoc pokerth.proto --cpp_out=src/third_party/protobuf) + system(protoc chatcleaner.proto --cpp_out=src/third_party/protobuf) + system(protoc pokerth.proto --java_out=tests/src) } unix : !mac { INCLUDEPATH += $${PREFIX}/include From 94d87ed33ea7acae51a0622a7957b52907e31262 Mon Sep 17 00:00:00 2001 From: Albert Medela Date: Mon, 14 Aug 2017 20:38:29 +0200 Subject: [PATCH 3/4] add catalonia tooltip --- src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index ad891aa8e..2ce503fbb 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -2168,6 +2168,7 @@ QString gameLobbyDialogImpl::getFullCountryString(QString cs) countryStringMap.insert(CountryStringMap::value_type("YE", tr("Yemen"))); countryStringMap.insert(CountryStringMap::value_type("ZM", tr("Zambia"))); countryStringMap.insert(CountryStringMap::value_type("ZW", tr("Zimbabwe"))); + countryStringMap.insert(CountryStringMap::value_type("CATALONIA", tr("Catalonia"))); } QString fullString(""); From 65e10c71b06a6398e6acf173094e6ac5b791236e Mon Sep 17 00:00:00 2001 From: Albert Medela Date: Wed, 16 Aug 2017 13:55:18 +0200 Subject: [PATCH 4/4] run astyle --- src/chatcleaner/badwordcheck.h | 6 +- src/chatcleaner/capsfloodcheck.h | 3 +- src/chatcleaner/cleanerconfig.h | 3 +- src/chatcleaner/letterrepeatingcheck.h | 3 +- src/chatcleaner/textfloodcheck.h | 3 +- src/chatcleaner/urlcheck.h | 6 +- src/core/common/thread.cpp | 3 +- src/core/pokerthexception.h | 6 +- src/dbofficial/serverdbthread.cpp | 8 +- src/engine/boardinterface.h | 2 +- src/engine/enginefactory.h | 2 +- src/engine/game.cpp | 2 +- src/engine/game.h | 48 +++-- src/engine/local_engine/cardsvalue.cpp | 12 +- src/engine/local_engine/localbero.cpp | 2 +- src/engine/local_engine/localbero.h | 92 ++++++---- .../local_engine/localberopostriver.cpp | 2 +- src/engine/local_engine/localberopostriver.h | 6 +- src/engine/local_engine/localboard.h | 40 +++-- .../local_engine/localenginefactory.cpp | 2 +- src/engine/local_engine/localenginefactory.h | 2 +- src/engine/local_engine/localhand.cpp | 8 +- src/engine/local_engine/localhand.h | 93 ++++++---- src/engine/local_engine/localplayer.cpp | 34 ++-- src/engine/local_engine/localplayer.h | 159 +++++++++++------ src/engine/local_engine/tools.cpp | 3 +- src/engine/local_engine/tools_android.cpp | 3 +- src/engine/log.h | 6 +- src/engine/network_engine/clientboard.cpp | 2 +- src/engine/network_engine/clientboard.h | 4 +- .../network_engine/clientenginefactory.cpp | 2 +- .../network_engine/clientenginefactory.h | 2 +- src/engine/network_engine/clienthand.h | 3 +- src/engine/network_engine/clientplayer.h | 3 +- src/gui/generic/serverguiwrapper.h | 6 +- .../changecompleteblindsdialogimpl.h | 3 +- src/gui/qt/chattools/chattools.h | 18 +- .../createinternetgamedialogimpl.h | 3 +- .../createnetworkgamedialogimpl.h | 3 +- .../qt/gamelobbydialog/gamelobbydialogimpl.h | 18 +- .../mygamelistsortfilterproxymodel.h | 15 +- .../mynicklistsortfilterproxymodel.h | 6 +- src/gui/qt/gametable/gametableimpl.cpp | 18 +- src/gui/qt/gametable/gametableimpl.h | 24 ++- src/gui/qt/gametable/log/guilog.h | 6 +- src/gui/qt/gametable/myactionbutton.cpp | 6 +- src/gui/qt/gametable/myactionbutton.h | 11 +- src/gui/qt/gametable/myavatarlabel.h | 15 +- src/gui/qt/gametable/mycardspixmaplabel.h | 18 +- src/gui/qt/gametable/mycashlabel.h | 3 +- src/gui/qt/gametable/mychancelabel.h | 6 +- src/gui/qt/gametable/mylefttabwidget.h | 3 +- src/gui/qt/gametable/mynamelabel.cpp | 6 +- src/gui/qt/gametable/mynamelabel.h | 3 +- src/gui/qt/gametable/myrighttabwidget.h | 3 +- src/gui/qt/gametable/mysetlabel.h | 3 +- src/gui/qt/gametable/myslider.h | 15 +- src/gui/qt/gametable/mystatuslabel.h | 3 +- src/gui/qt/gametable/mytimeoutlabel.h | 3 +- src/gui/qt/guiwrapper.h | 6 +- .../internetgamelogindialogimpl.h | 3 +- src/gui/qt/logfiledialog/logfiledialog.h | 9 +- .../qt/newlocalgamedialog/newgamedialogimpl.h | 3 +- .../manualblindsorderdialogimpl.h | 3 +- src/gui/qt/settingsdialog/myavatarbutton.h | 6 +- src/gui/qt/settingsdialog/myhpavatarbutton.h | 6 +- .../selectavatardialog/myavatarlistitem.h | 6 +- .../selectavatardialogimpl.h | 3 +- .../qt/settingsdialog/settingsdialogimpl.h | 18 +- .../startnetworkgamedialogimpl.h | 12 +- src/gui/qt/startwindow/startwindowimpl.cpp | 12 +- src/gui/qt/startwindow/startwindowimpl.h | 15 +- src/gui/qt/styles/carddeckstylereader.h | 33 ++-- src/gui/qt/styles/gametablestylereader.cpp | 6 +- src/gui/qt/styles/gametablestylereader.h | 165 ++++++++++++------ src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.h | 9 +- src/net/asiosendbuffer.h | 12 +- src/net/clientcontext.h | 90 ++++++---- src/net/clientthread.h | 15 +- src/net/common/clientstate.cpp | 3 +- src/net/common/servergame.cpp | 3 +- src/net/common/serverlobbythread.cpp | 88 ++++++---- src/net/common/sessiondata.cpp | 2 +- src/net/common/websendbuffer.cpp | 4 +- src/net/netpacket.h | 6 +- src/net/serveraccepthelper.h | 24 ++- src/net/servermanager.h | 6 +- src/net/sessiondata.h | 12 +- src/session.h | 3 +- 89 files changed, 888 insertions(+), 488 deletions(-) diff --git a/src/chatcleaner/badwordcheck.h b/src/chatcleaner/badwordcheck.h index 0cdeb9914..e985aa820 100644 --- a/src/chatcleaner/badwordcheck.h +++ b/src/chatcleaner/badwordcheck.h @@ -39,11 +39,13 @@ class BadWordCheck: public QObject public: BadWordCheck(); - void setBadWords(QStringList bw) { + void setBadWords(QStringList bw) + { badWords = bw; } - void setBadWordsException(QStringList bwe) { + void setBadWordsException(QStringList bwe) + { badWordsException = bwe; } diff --git a/src/chatcleaner/capsfloodcheck.h b/src/chatcleaner/capsfloodcheck.h index 007ff5ede..a9cb9fe9f 100644 --- a/src/chatcleaner/capsfloodcheck.h +++ b/src/chatcleaner/capsfloodcheck.h @@ -39,7 +39,8 @@ class CapsFloodCheck: public QObject public: CapsFloodCheck(); - void setCapsNumberToTrigger(int n) { + void setCapsNumberToTrigger(int n) + { capsNumberToTrigger = n; } bool run(QString); diff --git a/src/chatcleaner/cleanerconfig.h b/src/chatcleaner/cleanerconfig.h index 64830dfb1..e7cd26f7c 100644 --- a/src/chatcleaner/cleanerconfig.h +++ b/src/chatcleaner/cleanerconfig.h @@ -46,7 +46,8 @@ class CleanerConfig ~CleanerConfig(); - std::string getConfigFileName() const { + std::string getConfigFileName() const + { return configFileName; } diff --git a/src/chatcleaner/letterrepeatingcheck.h b/src/chatcleaner/letterrepeatingcheck.h index 51f2ecc16..b8e8ca1bc 100644 --- a/src/chatcleaner/letterrepeatingcheck.h +++ b/src/chatcleaner/letterrepeatingcheck.h @@ -39,7 +39,8 @@ class LetterRepeatingCheck: public QObject public: LetterRepeatingCheck(); - void setLetterNumberToTrigger(int n) { + void setLetterNumberToTrigger(int n) + { letterNumberToTrigger = n; } bool run(QString); diff --git a/src/chatcleaner/textfloodcheck.h b/src/chatcleaner/textfloodcheck.h index 29b3cf385..070563efd 100644 --- a/src/chatcleaner/textfloodcheck.h +++ b/src/chatcleaner/textfloodcheck.h @@ -45,7 +45,8 @@ class TextFloodCheck: public QObject TextFloodCheck(); ~TextFloodCheck(); - void setTextFloodLevelToTrigger(int level) { + void setTextFloodLevelToTrigger(int level) + { textFloodLevelToTrigger = level; } diff --git a/src/chatcleaner/urlcheck.h b/src/chatcleaner/urlcheck.h index f1e3c7120..85175d8f0 100644 --- a/src/chatcleaner/urlcheck.h +++ b/src/chatcleaner/urlcheck.h @@ -39,10 +39,12 @@ class UrlCheck: public QObject public: UrlCheck(); - void setUrlStrings(QStringList us) { + void setUrlStrings(QStringList us) + { urlStrings = us; } - void setUrlExceptionStrings(QStringList ues) { + void setUrlExceptionStrings(QStringList ues) + { urlExceptionStrings = ues; } bool run(QString); diff --git a/src/core/common/thread.cpp b/src/core/common/thread.cpp index 14fd9625c..706fb3e0a 100644 --- a/src/core/common/thread.cpp +++ b/src/core/common/thread.cpp @@ -38,7 +38,8 @@ class ThreadStarter { public: ThreadStarter(Thread &thread) : m_thread(thread) {} - void operator()() { + void operator()() + { m_thread.MainWrapper(); } diff --git a/src/core/pokerthexception.h b/src/core/pokerthexception.h index ecb7460d7..15a17859c 100644 --- a/src/core/pokerthexception.h +++ b/src/core/pokerthexception.h @@ -43,10 +43,12 @@ class PokerTHException : public std::exception PokerTHException(const char *sourcefile, int sourceline, int errorId, int osErrorCode); virtual ~PokerTHException() throw(); - int GetErrorId() const { + int GetErrorId() const + { return m_errorId; } - int GetOsErrorCode() const { + int GetOsErrorCode() const + { return m_osErrorCode; } diff --git a/src/dbofficial/serverdbthread.cpp b/src/dbofficial/serverdbthread.cpp index 98f8ce356..1ae5e7867 100644 --- a/src/dbofficial/serverdbthread.cpp +++ b/src/dbofficial/serverdbthread.cpp @@ -482,9 +482,9 @@ ServerDBThread::EstablishDBConnection() if (!prepareNick.exec() || !prepareAvatarBlacklist.exec() || !prepareLogin.exec() || !prepareCreateGame.exec() || !prepareEndGame.exec() || !prepareRelation.exec() || !prepareScore.exec() || !prepareReportAvatar.exec() || !prepareReportGame.exec() || !prepareAdminPlayer.exec() || !prepareBlockPlayer.exec()) { - string tmpError = string(prepareNick.error()) + prepareAvatarBlacklist.error() + prepareLogin.error() + prepareCreateGame.error() + - prepareEndGame.error() + prepareRelation.error() + prepareScore.error() + prepareReportAvatar.error() + - prepareReportGame.error() + prepareAdminPlayer.error() + prepareBlockPlayer.error(); + string tmpError = string(prepareNick.error()) + prepareAvatarBlacklist.error() + prepareLogin.error() + prepareCreateGame.error() + + prepareEndGame.error() + prepareRelation.error() + prepareScore.error() + prepareReportAvatar.error() + + prepareReportGame.error() + prepareAdminPlayer.error() + prepareBlockPlayer.error(); m_connData->conn.disconnect(); m_ioService->post(boost::bind(&ServerDBCallback::ConnectFailed, &m_callback, tmpError)); m_permanentError = true; @@ -537,7 +537,7 @@ ServerDBThread::HandleNextQuery() ++i; } if (!paramQuery.exec()) { - string tmpError = paramQuery.error(); + string tmpError = paramQuery.error(); m_connData->conn.disconnect(); m_ioService->post(boost::bind(&ServerDBCallback::QueryError, &m_callback, tmpError)); break; diff --git a/src/engine/boardinterface.h b/src/engine/boardinterface.h index 6231e8ee5..965cabfab 100644 --- a/src/engine/boardinterface.h +++ b/src/engine/boardinterface.h @@ -59,7 +59,7 @@ class BoardInterface virtual void collectSets() =0; virtual void collectPot() =0; - virtual void distributePot(unsigned) =0; + virtual void distributePot(unsigned) =0; virtual void determinePlayerNeedToShowCards() =0; virtual std::list getWinners() const =0; diff --git a/src/engine/enginefactory.h b/src/engine/enginefactory.h index 71c931982..c13b547b8 100644 --- a/src/engine/enginefactory.h +++ b/src/engine/enginefactory.h @@ -45,7 +45,7 @@ class EngineFactory virtual ~EngineFactory(); virtual boost::shared_ptr createHand(boost::shared_ptr f, GuiInterface *g, boost::shared_ptr b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) =0; - virtual boost::shared_ptr createBoard() =0; + virtual boost::shared_ptr createBoard() =0; virtual boost::shared_ptr createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, bool sotS, int mB) =0; virtual std::vector > createBeRo(HandInterface *hi, unsigned dP, int sB) =0; }; diff --git a/src/engine/game.cpp b/src/engine/game.cpp index 9f2a6e741..0405e7ad9 100755 --- a/src/engine/game.cpp +++ b/src/engine/game.cpp @@ -77,7 +77,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr factory, throw LocalException(__FILE__, __LINE__, ERR_DEALER_NOT_FOUND); // create board - currentBoard = myFactory->createBoard(); + currentBoard = myFactory->createBoard(); // create player lists seatsList.reset(new std::list >); diff --git a/src/engine/game.h b/src/engine/game.h index 6004e254a..210c90d4a 100755 --- a/src/engine/game.h +++ b/src/engine/game.h @@ -63,60 +63,76 @@ class Game boost::shared_ptr getCurrentHand(); const boost::shared_ptr getCurrentHand() const; - PlayerList getSeatsList() const { + PlayerList getSeatsList() const + { return seatsList; } - PlayerList getActivePlayerList() const { + PlayerList getActivePlayerList() const + { return activePlayerList; } - PlayerList getRunningPlayerList() const { + PlayerList getRunningPlayerList() const + { return runningPlayerList; } - void setStartQuantityPlayers(int theValue) { + void setStartQuantityPlayers(int theValue) + { startQuantityPlayers = theValue; } - int getStartQuantityPlayers() const { + int getStartQuantityPlayers() const + { return startQuantityPlayers; } - void setStartSmallBlind(int theValue) { + void setStartSmallBlind(int theValue) + { startSmallBlind = theValue; } - int getStartSmallBlind() const { + int getStartSmallBlind() const + { return startSmallBlind; } - void setStartCash(int theValue) { + void setStartCash(int theValue) + { startCash = theValue; } - int getStartCash() const { + int getStartCash() const + { return startCash; } - int getMyGameID() const { + int getMyGameID() const + { return myGameID; } - void setCurrentSmallBlind(int theValue) { + void setCurrentSmallBlind(int theValue) + { currentSmallBlind = theValue; } - int getCurrentSmallBlind() const { + int getCurrentSmallBlind() const + { return currentSmallBlind; } - void setCurrentHandID(int theValue) { + void setCurrentHandID(int theValue) + { currentHandID = theValue; } - int getCurrentHandID() const { + int getCurrentHandID() const + { return currentHandID; } - unsigned getDealerPosition() const { + unsigned getDealerPosition() const + { return dealerPosition; } - void replaceDealer(unsigned oldDealer, unsigned newDealer) { + void replaceDealer(unsigned oldDealer, unsigned newDealer) + { if (dealerPosition == oldDealer) dealerPosition = newDealer; } diff --git a/src/engine/local_engine/cardsvalue.cpp b/src/engine/local_engine/cardsvalue.cpp index e309d95fd..84dce7c7c 100755 --- a/src/engine/local_engine/cardsvalue.cpp +++ b/src/engine/local_engine/cardsvalue.cpp @@ -65,7 +65,7 @@ int CardsValue::holeCardsClass(int one, int two) } } switch((one-1)%13+2) { - //Ass + //Ass case 14: { if((one-1)/13 == (two-1)/13) { switch((one-1)%13-(two-1)%13) { @@ -756,7 +756,7 @@ std::string CardsValue::determineHandName(int myCardsValueInt, PlayerList active std::string handName; switch(myCardsValueInt/100000000) { - // Royal Flush + // Royal Flush case 9: { handName = *cardStringIt_c; @@ -1161,8 +1161,8 @@ std::string CardsValue::determineHandName(int myCardsValueInt, PlayerList active } } break; - default: - {} + default: { + } } return handName; @@ -1191,11 +1191,11 @@ std::list CardsValue::translateCardsValueCode(int cardsValueCode) switch (firstPart) { - // Royal Flush + // Royal Flush case 9: cardString.push_back("Royal Flush"); break; - // Straight Flush + // Straight Flush case 8: { cardString.push_back("Straight Flush, "); switch(secondPart) { diff --git a/src/engine/local_engine/localbero.cpp b/src/engine/local_engine/localbero.cpp index ace5b3f20..3e9e031a7 100644 --- a/src/engine/local_engine/localbero.cpp +++ b/src/engine/local_engine/localbero.cpp @@ -38,7 +38,7 @@ using namespace std; LocalBeRo::LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS) - : BeRoInterface(), myHand(hi), myBeRoID(gS), dealerPosition(dP), smallBlindPosition(0), 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), 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(); lastPlayersTurnIt = myHand->getRunningPlayerList()->begin(); diff --git a/src/engine/local_engine/localbero.h b/src/engine/local_engine/localbero.h index a8be1ca18..240949752 100644 --- a/src/engine/local_engine/localbero.h +++ b/src/engine/local_engine/localbero.h @@ -44,28 +44,34 @@ class LocalBeRo : public BeRoInterface LocalBeRo(HandInterface* hi, unsigned dP, int sB, GameState gS); ~LocalBeRo(); - GameState getMyBeRoID() const { + GameState getMyBeRoID() const + { return myBeRoID; } int getHighestCardsValue() const; void setHighestCardsValue(int /*theValue*/) { } - void setMinimumRaise ( int theValue ) { + void setMinimumRaise ( int theValue ) + { minimumRaise = theValue; } - int getMinimumRaise() const { + int getMinimumRaise() const + { return minimumRaise; } - void setFullBetRule ( bool theValue ) { + void setFullBetRule ( bool theValue ) + { fullBetRule = theValue; } - bool getFullBetRule() const { + bool getFullBetRule() const + { return fullBetRule; } - void skipFirstRunGui() { + void skipFirstRunGui() + { firstRunGui = false; } @@ -77,89 +83,113 @@ class LocalBeRo : public BeRoInterface protected: - HandInterface* getMyHand() const { + HandInterface* getMyHand() const + { return myHand; } - unsigned getDealerPosition() const { + unsigned getDealerPosition() const + { return dealerPosition; } - void setCurrentPlayersTurnId(unsigned theValue) { + void setCurrentPlayersTurnId(unsigned theValue) + { currentPlayersTurnId = theValue; } - unsigned getCurrentPlayersTurnId() const { + unsigned getCurrentPlayersTurnId() const + { return currentPlayersTurnId; } - void setFirstRoundLastPlayersTurnId(unsigned theValue) { + void setFirstRoundLastPlayersTurnId(unsigned theValue) + { firstRoundLastPlayersTurnId = theValue; } - unsigned getFirstRoundLastPlayersTurnId() const { + unsigned getFirstRoundLastPlayersTurnId() const + { return firstRoundLastPlayersTurnId; } - void setCurrentPlayersTurnIt(PlayerListIterator theValue) { + void setCurrentPlayersTurnIt(PlayerListIterator theValue) + { currentPlayersTurnIt = theValue; } - PlayerListIterator getCurrentPlayersTurnIt() const { + PlayerListIterator getCurrentPlayersTurnIt() const + { return currentPlayersTurnIt; } - void setLastPlayersTurnIt(PlayerListIterator theValue) { + void setLastPlayersTurnIt(PlayerListIterator theValue) + { lastPlayersTurnIt = theValue; } - PlayerListIterator getLastPlayersTurnIt() const { + PlayerListIterator getLastPlayersTurnIt() const + { return lastPlayersTurnIt; } - void setHighestSet(int theValue) { + void setHighestSet(int theValue) + { highestSet = theValue; } - int getHighestSet() const { + int getHighestSet() const + { return highestSet; } - void setFirstRun(bool theValue) { + void setFirstRun(bool theValue) + { firstRun = theValue; } - bool getFirstRun() const { + bool getFirstRun() const + { return firstRun; } - void setFirstRound(bool theValue) { + void setFirstRound(bool theValue) + { firstRound = theValue; } - bool getFirstRound() const { + bool getFirstRound() const + { return firstRound; } - void setSmallBlindPositionId(unsigned theValue) { + void setSmallBlindPositionId(unsigned theValue) + { smallBlindPositionId = theValue; } - unsigned getSmallBlindPositionId() const { + unsigned getSmallBlindPositionId() const + { return smallBlindPositionId; } - void setBigBlindPositionId(unsigned theValue) { + void setBigBlindPositionId(unsigned theValue) + { bigBlindPositionId = theValue; } - unsigned getBigBlindPositionId() const { + unsigned getBigBlindPositionId() const + { return bigBlindPositionId; } - void setSmallBlindPosition(int theValue) { + void setSmallBlindPosition(int theValue) + { smallBlindPosition = theValue; } - int getSmallBlindPosition() const { + int getSmallBlindPosition() const + { return smallBlindPosition; } - void setSmallBlind(int theValue) { + void setSmallBlind(int theValue) + { smallBlind = theValue; } - int getSmallBlind() const { + int getSmallBlind() const + { return smallBlind; } @@ -171,7 +201,7 @@ class LocalBeRo : public BeRoInterface HandInterface* myHand; const GameState myBeRoID; - unsigned dealerPosition; + unsigned dealerPosition; int smallBlindPosition; unsigned smallBlindPositionId; diff --git a/src/engine/local_engine/localberopostriver.cpp b/src/engine/local_engine/localberopostriver.cpp index a9a2aca5d..02a279ce1 100644 --- a/src/engine/local_engine/localberopostriver.cpp +++ b/src/engine/local_engine/localberopostriver.cpp @@ -91,7 +91,7 @@ void LocalBeRoPostRiver::postRiverRun() getMyHand()->getBoard()->determinePlayerNeedToShowCards(); // Pot-Verteilung - getMyHand()->getBoard()->distributePot(getDealerPosition()); + getMyHand()->getBoard()->distributePot(getDealerPosition()); //Pot auf 0 setzen getMyHand()->getBoard()->setPot(0); diff --git a/src/engine/local_engine/localberopostriver.h b/src/engine/local_engine/localberopostriver.h index 86b604c41..fdba4dc7a 100644 --- a/src/engine/local_engine/localberopostriver.h +++ b/src/engine/local_engine/localberopostriver.h @@ -44,10 +44,12 @@ class LocalBeRoPostRiver : public LocalBeRo LocalBeRoPostRiver(HandInterface*, int, int); ~LocalBeRoPostRiver(); - void setHighestCardsValue(int theValue) { + void setHighestCardsValue(int theValue) + { highestCardsValue = theValue; } - int getHighestCardsValue() const { + int getHighestCardsValue() const + { return highestCardsValue; } diff --git a/src/engine/local_engine/localboard.h b/src/engine/local_engine/localboard.h index 471554328..801a5662f 100755 --- a/src/engine/local_engine/localboard.h +++ b/src/engine/local_engine/localboard.h @@ -45,57 +45,69 @@ class HandInterface; class LocalBoard : public BoardInterface { public: - LocalBoard(); + LocalBoard(); ~LocalBoard(); void setPlayerLists(PlayerList, PlayerList, PlayerList); - void setMyCards(int* theValue) { + void setMyCards(int* theValue) + { int i; for(i=0; i<5; i++) myCards[i] = theValue[i]; } - void getMyCards(int* theValue) { + void getMyCards(int* theValue) + { int i; for(i=0; i<5; i++) theValue[i] = myCards[i]; } - void setAllInCondition(bool theValue) { + void setAllInCondition(bool theValue) + { allInCondition = theValue; } - void setLastActionPlayerID(unsigned theValue) { + void setLastActionPlayerID(unsigned theValue) + { lastActionPlayerID = theValue; } - int getPot() const { + int getPot() const + { return pot; } - void setPot(int theValue) { + void setPot(int theValue) + { pot = theValue; } - int getSets() const { + int getSets() const + { return sets; } - void setSets(int theValue) { + void setSets(int theValue) + { sets = theValue; } void collectSets() ; void collectPot() ; - void distributePot(unsigned dealerPosition); + void distributePot(unsigned dealerPosition); void determinePlayerNeedToShowCards(); - std::list getWinners() const { + std::list getWinners() const + { return winners; } - void setWinners(const std::list &w) { + void setWinners(const std::list &w) + { winners = w; } - std::list getPlayerNeedToShowCards() const { + std::list getPlayerNeedToShowCards() const + { return playerNeedToShowCards; } - void setPlayerNeedToShowCards(const std::list &p) { + void setPlayerNeedToShowCards(const std::list &p) + { playerNeedToShowCards = p; } diff --git a/src/engine/local_engine/localenginefactory.cpp b/src/engine/local_engine/localenginefactory.cpp index a270f224d..25d78f06d 100644 --- a/src/engine/local_engine/localenginefactory.cpp +++ b/src/engine/local_engine/localenginefactory.cpp @@ -63,7 +63,7 @@ LocalEngineFactory::createHand(boost::shared_ptr f, GuiInterface boost::shared_ptr LocalEngineFactory::createBoard() { - return boost::shared_ptr(new LocalBoard()); + return boost::shared_ptr(new LocalBoard()); } boost::shared_ptr diff --git a/src/engine/local_engine/localenginefactory.h b/src/engine/local_engine/localenginefactory.h index e357a19d1..ef7f347f0 100644 --- a/src/engine/local_engine/localenginefactory.h +++ b/src/engine/local_engine/localenginefactory.h @@ -50,7 +50,7 @@ class LocalEngineFactory : public EngineFactory ~LocalEngineFactory(); virtual boost::shared_ptr createHand(boost::shared_ptr f, GuiInterface *g, boost::shared_ptr b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC); - virtual boost::shared_ptr createBoard(); + virtual boost::shared_ptr createBoard(); virtual boost::shared_ptr createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, bool sotS, int mB); virtual std::vector > createBeRo(HandInterface *hi, unsigned dP, int sB); diff --git a/src/engine/local_engine/localhand.cpp b/src/engine/local_engine/localhand.cpp index d9266a462..f2f8af5fc 100755 --- a/src/engine/local_engine/localhand.cpp +++ b/src/engine/local_engine/localhand.cpp @@ -362,8 +362,8 @@ LocalHand::LocalHand(boost::shared_ptr f, GuiInterface *g, boost: } break; - default: - {} + default: { + } } @@ -696,8 +696,8 @@ void LocalHand::switchRounds() myGui->postRiverAnimation1(); } break; - default: - {} + default: { + } } diff --git a/src/engine/local_engine/localhand.h b/src/engine/local_engine/localhand.h index 7f9913a47..49eb01a2b 100755 --- a/src/engine/local_engine/localhand.h +++ b/src/engine/local_engine/localhand.h @@ -51,111 +51,142 @@ class LocalHand : public HandInterface void start(); - PlayerList getSeatsList() const { + PlayerList getSeatsList() const + { return seatsList; } - PlayerList getActivePlayerList() const { + PlayerList getActivePlayerList() const + { return activePlayerList; } - PlayerList getRunningPlayerList() const { + PlayerList getRunningPlayerList() const + { return runningPlayerList; } - boost::shared_ptr getBoard() const { + boost::shared_ptr getBoard() const + { return myBoard; } - boost::shared_ptr getPreflop() const { + boost::shared_ptr getPreflop() const + { return myBeRo[GAME_STATE_PREFLOP]; } - boost::shared_ptr getFlop() const { + boost::shared_ptr getFlop() const + { return myBeRo[GAME_STATE_FLOP]; } - boost::shared_ptr getTurn() const { + boost::shared_ptr getTurn() const + { return myBeRo[GAME_STATE_TURN]; } - boost::shared_ptr getRiver() const { + boost::shared_ptr getRiver() const + { return myBeRo[GAME_STATE_RIVER]; } - GuiInterface* getGuiInterface() const { + GuiInterface* getGuiInterface() const + { return myGui; } - boost::shared_ptr getCurrentBeRo() const { + boost::shared_ptr getCurrentBeRo() const + { return myBeRo[currentRound]; } - Log* getLog() const { + Log* getLog() const + { return myLog; } - void setMyID(int theValue) { + void setMyID(int theValue) + { myID = theValue; } - int getMyID() const { + int getMyID() const + { return myID; } - void setStartQuantityPlayers(int theValue) { + void setStartQuantityPlayers(int theValue) + { startQuantityPlayers = theValue; } - int getStartQuantityPlayers() const { + int getStartQuantityPlayers() const + { return startQuantityPlayers; } - void setCurrentRound(GameState theValue) { + void setCurrentRound(GameState theValue) + { currentRound = theValue; if(myLog) myLog->setCurrentRound(currentRound); } - GameState getCurrentRound() const { + GameState getCurrentRound() const + { return currentRound; } - GameState getRoundBeforePostRiver() const { + GameState getRoundBeforePostRiver() const + { return roundBeforePostRiver; } - void setDealerPosition(int theValue) { + void setDealerPosition(int theValue) + { dealerPosition = theValue; } - int getDealerPosition() const { + int getDealerPosition() const + { return dealerPosition; } - void setSmallBlind(int theValue) { + void setSmallBlind(int theValue) + { smallBlind = theValue; } - int getSmallBlind() const { + int getSmallBlind() const + { return smallBlind; } - void setAllInCondition(bool theValue) { + void setAllInCondition(bool theValue) + { allInCondition = theValue; } - bool getAllInCondition() const { + bool getAllInCondition() const + { return allInCondition; } - void setStartCash(int theValue) { + void setStartCash(int theValue) + { startCash = theValue; } - int getStartCash() const { + int getStartCash() const + { return startCash; } - void setPreviousPlayerID(int theValue) { + void setPreviousPlayerID(int theValue) + { previousPlayerID = theValue; } - int getPreviousPlayerID() const { + int getPreviousPlayerID() const + { return previousPlayerID; } void setLastActionPlayerID ( unsigned theValue ); - unsigned getLastActionPlayerID() const { + unsigned getLastActionPlayerID() const + { return lastActionPlayerID; } - void setCardsShown(bool theValue) { + void setCardsShown(bool theValue) + { cardsShown = theValue; } - bool getCardsShown() const { + bool getCardsShown() const + { return cardsShown; } diff --git a/src/engine/local_engine/localplayer.cpp b/src/engine/local_engine/localplayer.cpp index c3d16b25b..f12bc33f1 100755 --- a/src/engine/local_engine/localplayer.cpp +++ b/src/engine/local_engine/localplayer.cpp @@ -1066,8 +1066,8 @@ void LocalPlayer::action() } break; - default: - {} + default: { + } } // cout << currentHand->getCurrentBeRo()->getMinimumRaise() << endl; @@ -1365,8 +1365,8 @@ void LocalPlayer::preflopEngine() if(DEBUG_MODE) { switch(myUniqueID) { - case 0: - {} + case 0: { + } break; case 1: { // player 1 @@ -1494,8 +1494,8 @@ void LocalPlayer::preflopEngine() // } } break; - default: - {} + default: { + } } @@ -1926,8 +1926,8 @@ void LocalPlayer::flopEngine() myAction = PLAYER_ACTION_CHECK; } break; - default: - {} + default: { + } } @@ -2696,8 +2696,8 @@ void LocalPlayer::turnEngine() } break; - default: - {} + default: { + } } @@ -3206,8 +3206,8 @@ void LocalPlayer::riverEngine() } break; - default: - {} + default: { + } } @@ -3227,9 +3227,9 @@ void LocalPlayer::evaluation(int bet, int raise) int highestSet = currentHand->getCurrentBeRo()->getHighestSet(); switch(myAction) { - // none - case 0: - {} + // none + case 0: { + } break; // fold case 1: { @@ -3337,8 +3337,8 @@ void LocalPlayer::evaluation(int bet, int raise) case 6: { } break; - default: - {} + default: { + } } currentHand->getCurrentBeRo()->setHighestSet(highestSet); diff --git a/src/engine/local_engine/localplayer.h b/src/engine/local_engine/localplayer.h index 58269e9bd..de25f61df 100755 --- a/src/engine/local_engine/localplayer.h +++ b/src/engine/local_engine/localplayer.h @@ -50,129 +50,163 @@ class LocalPlayer : public PlayerInterface void setHand(HandInterface *); - int getMyID() const { + int getMyID() const + { return myID; } - unsigned getMyUniqueID() const { + unsigned getMyUniqueID() const + { return myUniqueID; } - void setMyUniqueID(unsigned newId) { + void setMyUniqueID(unsigned newId) + { myUniqueID = newId; } - void setMyGuid(const std::string &theValue) { + void setMyGuid(const std::string &theValue) + { myGuid = theValue; } - std::string getMyGuid() const { + std::string getMyGuid() const + { return myGuid; } - PlayerType getMyType() const { + PlayerType getMyType() const + { return myType; } - void setMyDude(int theValue) { + void setMyDude(int theValue) + { myDude = theValue; } - int getMyDude() const { + int getMyDude() const + { return myDude; } - void setMyDude4(int theValue) { + void setMyDude4(int theValue) + { myDude4 = theValue; } - int getMyDude4() const { + int getMyDude4() const + { return myDude4; } - void setMyName(const std::string& theValue) { + void setMyName(const std::string& theValue) + { myName = theValue; } - std::string getMyName() const { + std::string getMyName() const + { return myName; } - void setMyAvatar(const std::string& theValue) { + void setMyAvatar(const std::string& theValue) + { myAvatar = theValue; } - std::string getMyAvatar() const { + std::string getMyAvatar() const + { return myAvatar; } - void setMyCash(int theValue) { + void setMyCash(int theValue) + { myCash = theValue; } - int getMyCash() const { + int getMyCash() const + { return myCash; } - void setMySet(int theValue) { + void setMySet(int theValue) + { myLastRelativeSet = theValue; mySet += theValue; myCash -= theValue; } - void setMySetAbsolute(int theValue) { + void setMySetAbsolute(int theValue) + { mySet = theValue; } - void setMySetNull() { + void setMySetNull() + { mySet = 0; myLastRelativeSet = 0; } - int getMySet() const { + int getMySet() const + { return mySet; } - int getMyLastRelativeSet() const { + int getMyLastRelativeSet() const + { return myLastRelativeSet; } - void setMyAction(PlayerAction theValue, bool human = 0) { + void setMyAction(PlayerAction theValue, bool human = 0) + { myAction = theValue; // logging for seat 0 if(myAction && human) currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, myLastRelativeSet); } - PlayerAction getMyAction() const { + PlayerAction getMyAction() const + { return myAction; } - void setMyButton(int theValue) { + void setMyButton(int theValue) + { myButton = theValue; } - int getMyButton() const { + int getMyButton() const + { return myButton; } - void setMyActiveStatus(bool theValue) { + void setMyActiveStatus(bool theValue) + { myActiveStatus = theValue; } - bool getMyActiveStatus() const { + bool getMyActiveStatus() const + { return myActiveStatus; } - void setMyStayOnTableStatus(bool theValue) { + void setMyStayOnTableStatus(bool theValue) + { myStayOnTableStatus = theValue; } - bool getMyStayOnTableStatus() const { + bool getMyStayOnTableStatus() const + { return myStayOnTableStatus; } - void setMyCards(int* theValue) { + void setMyCards(int* theValue) + { int i; for(i=0; i<2; i++) myCards[i] = theValue[i]; } - void getMyCards(int* theValue) const { + void getMyCards(int* theValue) const + { int i; for(i=0; i<2; i++) theValue[i] = myCards[i]; } - void setMyTurn(bool theValue) { + void setMyTurn(bool theValue) + { myTurn = theValue; } - bool getMyTurn() const { + bool getMyTurn() const + { return myTurn; } - void setMyCardsFlip(bool theValue, int state) { + void setMyCardsFlip(bool theValue, int state) + { myCardsFlip = theValue; // log flipping cards if(myCardsFlip) { @@ -191,66 +225,81 @@ class LocalPlayer : public PlayerInterface } } } - bool getMyCardsFlip() const { + bool getMyCardsFlip() const + { return myCardsFlip; } - void setMyCardsValueInt(int theValue) { + void setMyCardsValueInt(int theValue) + { myCardsValueInt = theValue; } - int getMyCardsValueInt() const { + int getMyCardsValueInt() const + { return myCardsValueInt; } - void setLogHoleCardsDone(bool theValue) { + void setLogHoleCardsDone(bool theValue) + { logHoleCardsDone = theValue; } - bool getLogHoleCardsDone() const { + bool getLogHoleCardsDone() const + { return logHoleCardsDone; } - void setMyBestHandPosition(int* theValue) { + void setMyBestHandPosition(int* theValue) + { for (int i = 0; i < 5; i++) myBestHandPosition[i] = theValue[i]; } - void getMyBestHandPosition(int* theValue) const { + void getMyBestHandPosition(int* theValue) const + { for (int i = 0; i < 5; i++) theValue[i] = myBestHandPosition[i]; } - void setMyRoundStartCash(int theValue) { + void setMyRoundStartCash(int theValue) + { myRoundStartCash = theValue; } - int getMyRoundStartCash() const { + int getMyRoundStartCash() const + { return myRoundStartCash; } - void setLastMoneyWon ( int theValue ) { + void setLastMoneyWon ( int theValue ) + { lastMoneyWon = theValue; } - int getLastMoneyWon() const { + int getLastMoneyWon() const + { return lastMoneyWon; } - void setMyAverageSets(int theValue) { + void setMyAverageSets(int theValue) + { myAverageSets[0] = myAverageSets[1]; myAverageSets[1] = myAverageSets[2]; myAverageSets[2] = myAverageSets[3]; myAverageSets[3] = theValue; } - int getMyAverageSets() const { + int getMyAverageSets() const + { return (myAverageSets[0]+myAverageSets[1]+myAverageSets[2]+myAverageSets[3])/4; } - void setMyAggressive(bool theValue) { + void setMyAggressive(bool theValue) + { int i; for(i=0; i<6; i++) { myAggressive[i] = myAggressive[i+1]; } myAggressive[6] = theValue; } - int getMyAggressive() const { + int getMyAggressive() const + { int i, sum = 0; for(i=0; i<7; i++) { sum += myAggressive[i]; @@ -258,17 +307,21 @@ class LocalPlayer : public PlayerInterface return sum; } - void setSBluff ( int theValue ) { + void setSBluff ( int theValue ) + { sBluff = theValue; } - int getSBluff() const { + int getSBluff() const + { return sBluff; } - void setSBluffStatus ( bool theValue ) { + void setSBluffStatus ( bool theValue ) + { sBluffStatus = theValue; } - bool getSBluffStatus() const { + bool getSBluffStatus() const + { return sBluffStatus; } diff --git a/src/engine/local_engine/tools.cpp b/src/engine/local_engine/tools.cpp index ebc47a6c9..29f71439f 100755 --- a/src/engine/local_engine/tools.cpp +++ b/src/engine/local_engine/tools.cpp @@ -51,7 +51,8 @@ boost::thread_specific_ptr g_rand_state; struct nondet_rng : std::unary_function { boost::random_device &_state; - unsigned operator()(unsigned i) { + unsigned operator()(unsigned i) + { boost::uniform_int<> rng(0, i - 1); return rng(_state); } diff --git a/src/engine/local_engine/tools_android.cpp b/src/engine/local_engine/tools_android.cpp index b2f64ae3a..378fbf060 100644 --- a/src/engine/local_engine/tools_android.cpp +++ b/src/engine/local_engine/tools_android.cpp @@ -50,7 +50,8 @@ boost::thread_specific_ptr g_rand_state; struct det_rng : std::unary_function { boost::mt19937 &_state; - unsigned operator()(unsigned i) { + unsigned operator()(unsigned i) + { boost::uniform_int<> rng(0, i - 1); return rng(_state); } diff --git a/src/engine/log.h b/src/engine/log.h index 43c0f8647..7dbf2514d 100644 --- a/src/engine/log.h +++ b/src/engine/log.h @@ -66,11 +66,13 @@ class Log void logAfterGame(); // void closeLogDbAtExit(); - void setCurrentRound(GameState theValue) { + void setCurrentRound(GameState theValue) + { currentRound = theValue; } - std::string getMySqliteLogFileName() { + std::string getMySqliteLogFileName() + { return mySqliteLogFileName.directory_string(); } diff --git a/src/engine/network_engine/clientboard.cpp b/src/engine/network_engine/clientboard.cpp index 2e7978828..e00acd506 100644 --- a/src/engine/network_engine/clientboard.cpp +++ b/src/engine/network_engine/clientboard.cpp @@ -37,7 +37,7 @@ using namespace std; ClientBoard::ClientBoard() - : pot(0), sets(0), allInCondition(false), lastActionPlayerID(0) + : pot(0), sets(0), allInCondition(false), lastActionPlayerID(0) { myCards[0] = myCards[1] = myCards[2] = myCards[3] = myCards[4] = 0; } diff --git a/src/engine/network_engine/clientboard.h b/src/engine/network_engine/clientboard.h index a4b7dc128..66ed8774f 100644 --- a/src/engine/network_engine/clientboard.h +++ b/src/engine/network_engine/clientboard.h @@ -44,7 +44,7 @@ class HandInterface; class ClientBoard : public BoardInterface { public: - ClientBoard(); + ClientBoard(); ~ClientBoard(); void setPlayerLists(PlayerList, PlayerList, PlayerList); @@ -63,7 +63,7 @@ class ClientBoard : public BoardInterface void collectSets(); void collectPot(); - void distributePot(unsigned); + void distributePot(unsigned); void determinePlayerNeedToShowCards(); std::list getWinners() const; diff --git a/src/engine/network_engine/clientenginefactory.cpp b/src/engine/network_engine/clientenginefactory.cpp index 3bc581bcf..b18a0f8c8 100644 --- a/src/engine/network_engine/clientenginefactory.cpp +++ b/src/engine/network_engine/clientenginefactory.cpp @@ -57,7 +57,7 @@ ClientEngineFactory::createHand(boost::shared_ptr f, GuiInterface boost::shared_ptr ClientEngineFactory::createBoard() { - return boost::shared_ptr(new ClientBoard()); + return boost::shared_ptr(new ClientBoard()); } boost::shared_ptr diff --git a/src/engine/network_engine/clientenginefactory.h b/src/engine/network_engine/clientenginefactory.h index 8eb31e9f7..c15646259 100644 --- a/src/engine/network_engine/clientenginefactory.h +++ b/src/engine/network_engine/clientenginefactory.h @@ -52,7 +52,7 @@ class ClientEngineFactory : public EngineFactory ~ClientEngineFactory(); virtual boost::shared_ptr createHand(boost::shared_ptr f, GuiInterface *g, boost::shared_ptr b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC); - virtual boost::shared_ptr createBoard(); + virtual boost::shared_ptr createBoard(); virtual boost::shared_ptr createPlayer(int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, bool sotS, int mB); virtual std::vector > createBeRo(HandInterface *hi, unsigned dP, int sB); }; diff --git a/src/engine/network_engine/clienthand.h b/src/engine/network_engine/clienthand.h index b9cd58ec1..8cae47712 100644 --- a/src/engine/network_engine/clienthand.h +++ b/src/engine/network_engine/clienthand.h @@ -63,7 +63,8 @@ class ClientHand : public HandInterface GuiInterface* getGuiInterface() const; boost::shared_ptr getCurrentBeRo() const; - Log* getLog() const { + Log* getLog() const + { return myLog; } diff --git a/src/engine/network_engine/clientplayer.h b/src/engine/network_engine/clientplayer.h index a4b9c40fc..5e8646640 100644 --- a/src/engine/network_engine/clientplayer.h +++ b/src/engine/network_engine/clientplayer.h @@ -156,7 +156,8 @@ class ClientPlayer : public PlayerInterface bool checkIfINeedToShowCards(); void markRemoteAction() {} - unsigned getTimeSecSinceLastRemoteAction() const { + unsigned getTimeSecSinceLastRemoteAction() const + { return 0; } diff --git a/src/gui/generic/serverguiwrapper.h b/src/gui/generic/serverguiwrapper.h index 2986c0740..889472dbf 100644 --- a/src/gui/generic/serverguiwrapper.h +++ b/src/gui/generic/serverguiwrapper.h @@ -48,10 +48,12 @@ class ServerGuiWrapper : public GuiInterface boost::shared_ptr getSession(); void setSession(boost::shared_ptr session); - gameTableImpl* getMyW() const { + gameTableImpl* getMyW() const + { return NULL; } - guiLog* getMyGuiLog() const { + guiLog* getMyGuiLog() const + { return NULL; } diff --git a/src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.h b/src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.h index 3dd465a8f..81b0ea13c 100644 --- a/src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.h +++ b/src/gui/qt/changecompleteblindsdialog/changecompleteblindsdialogimpl.h @@ -52,7 +52,8 @@ class changeCompleteBlindsDialogImpl: public QDialog, public Ui::changeCompleteB bool eventFilter(QObject *obj, QEvent *event); public slots: - bool getSettingsCorrect() const { + bool getSettingsCorrect() const + { return settingsCorrect; } diff --git a/src/gui/qt/chattools/chattools.h b/src/gui/qt/chattools/chattools.h index 6bf7990a0..961c7414c 100644 --- a/src/gui/qt/chattools/chattools.h +++ b/src/gui/qt/chattools/chattools.h @@ -55,7 +55,8 @@ class ChatTools : public QObject ~ChatTools(); - void setSession(boost::shared_ptr session) { + void setSession(boost::shared_ptr session) + { mySession = session; } @@ -69,24 +70,29 @@ public slots: void fillChatLinesHistory(QString fillString); void showChatHistoryIndex(int index); - int getChatLinesHistorySize() { + int getChatLinesHistorySize() + { return chatLinesHistory.size(); } void nickAutoCompletition(); void setChatTextEdited(); - void setPlayerNicksList(QStringList value) { + void setPlayerNicksList(QStringList value) + { myNickStringList = value; } - void setMyNick ( const QString& theValue ) { + void setMyNick ( const QString& theValue ) + { myNick = theValue; } - QString getMyNick () { + QString getMyNick () + { return myNick; } - void setMyStyle ( GameTableStyleReader* theValue ) { + void setMyStyle ( GameTableStyleReader* theValue ) + { myStyle = theValue; } void refreshIgnoreList(); diff --git a/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.h b/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.h index 3dbc6774b..b108bbf77 100644 --- a/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.h +++ b/src/gui/qt/createinternetgamedialog/createinternetgamedialogimpl.h @@ -51,7 +51,8 @@ class createInternetGameDialogImpl: public QDialog, public Ui::createInternetGam createInternetGameDialogImpl(QWidget *parent = 0, ConfigFile *c = 0); void exec(bool guestMode, QString playerName); - changeCompleteBlindsDialogImpl* getChangeCompleteBlindsDialog() { + changeCompleteBlindsDialogImpl* getChangeCompleteBlindsDialog() + { return myChangeCompleteBlindsDialog; } bool eventFilter(QObject *obj, QEvent *event); diff --git a/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.h b/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.h index c53acec1c..5d15d86df 100644 --- a/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.h +++ b/src/gui/qt/createnetworkgamedialog/createnetworkgamedialogimpl.h @@ -52,7 +52,8 @@ class createNetworkGameDialogImpl: public QDialog, public Ui::createNetworkGameD createNetworkGameDialogImpl(QWidget *parent = 0, ConfigFile *c = 0); int exec(); - changeCompleteBlindsDialogImpl* getChangeCompleteBlindsDialog() { + changeCompleteBlindsDialogImpl* getChangeCompleteBlindsDialog() + { return myChangeCompleteBlindsDialog; } bool eventFilter(QObject *obj, QEvent *event); diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h index b3717b077..dfcffb97a 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.h @@ -66,17 +66,20 @@ class gameLobbyDialogImpl: public QDialog, public Ui::gameLobbyDialog int exec(); - ChatTools *getMyChat() { + ChatTools *getMyChat() + { return myChat; } void setSession(boost::shared_ptr session); - boost::shared_ptr getSession() { + boost::shared_ptr getSession() + { assert(mySession.get()); return mySession; } - void setMyW ( gameTableImpl* theValue ) { + void setMyW ( gameTableImpl* theValue ) + { myW = theValue; } @@ -97,13 +100,16 @@ public slots: void updateStats(ServerStats stats); void refreshGameStats(); void refreshPlayerStats(); - void setCurrentGameName ( const QString& theValue ) { + void setCurrentGameName ( const QString& theValue ) + { currentGameName = theValue; } - QString getCurrentGameName() const { + QString getCurrentGameName() const + { return currentGameName; } - gameTableImpl* getMyW() const { + gameTableImpl* getMyW() const + { return myW; } void checkPlayerQuantity(); diff --git a/src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.h b/src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.h index 80bb74649..156534bad 100644 --- a/src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.h +++ b/src/gui/qt/gamelobbydialog/mygamelistsortfilterproxymodel.h @@ -39,19 +39,24 @@ class MyGameListSortFilterProxyModel : public QSortFilterProxyModel public: MyGameListSortFilterProxyModel(QObject *parent = 0); - void setColumn1RegExp(QRegExp column1) { + void setColumn1RegExp(QRegExp column1) + { column1RegExp = column1; } - void setColumn2RegExp(QRegExp column2) { + void setColumn2RegExp(QRegExp column2) + { column2RegExp = column2; } - void setColumn3RegExp(QRegExp column3) { + void setColumn3RegExp(QRegExp column3) + { column3RegExp = column3; } - void setColumn4RegExp(QRegExp column4) { + void setColumn4RegExp(QRegExp column4) + { column4RegExp = column4; } - void setColumn5RegExp(QRegExp column5) { + void setColumn5RegExp(QRegExp column5) + { column5RegExp = column5; } diff --git a/src/gui/qt/gamelobbydialog/mynicklistsortfilterproxymodel.h b/src/gui/qt/gamelobbydialog/mynicklistsortfilterproxymodel.h index 87f85287c..e3407d47d 100644 --- a/src/gui/qt/gamelobbydialog/mynicklistsortfilterproxymodel.h +++ b/src/gui/qt/gamelobbydialog/mynicklistsortfilterproxymodel.h @@ -41,10 +41,12 @@ class MyNickListSortFilterProxyModel : public QSortFilterProxyModel MyNickListSortFilterProxyModel(QObject *parent = 0); void setFilterState(int state); - void setLastFilterStateCountry( bool country ) { + void setLastFilterStateCountry( bool country ) + { lastFilterStateCountry = country; } - void setLastFilterStateAlpha( bool alpha ) { + void setLastFilterStateAlpha( bool alpha ) + { lastFilterStateAlpha = alpha; } diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index f2bf9ec50..1394186eb 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -113,12 +113,12 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent) tabsDiag = new QDialog(this); tabs.setupUi(tabsDiag); textLabel_handLabel->hide(); - #ifdef ANDROID - tabsDiag->setStyleSheet("QObject { font: 26px; } QDialog { background-image: url(:/android/android-data/gfx/gui/table/default_800x480/table_dark.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); - this->setWindowState(Qt::WindowFullScreen); - #else - tabs.pushButton_settings->hide(); - #endif +#ifdef ANDROID + tabsDiag->setStyleSheet("QObject { font: 26px; } QDialog { background-image: url(:/android/android-data/gfx/gui/table/default_800x480/table_dark.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); + this->setWindowState(Qt::WindowFullScreen); +#else + tabs.pushButton_settings->hide(); +#endif tabs.label_chance->setMyStyle(myGameTableStyle); #else label_chance->setMyStyle(myGameTableStyle); @@ -1290,7 +1290,7 @@ void gameTableImpl::refreshGroupbox(int playerID, int status) } else { switch(status) { - //inactive + //inactive case 0: { if (!playerID) { //hide buttons @@ -1325,8 +1325,8 @@ void gameTableImpl::refreshGroupbox(int playerID, int status) myGameTableStyle->setPlayerSeatInactiveStyle(groupBoxArray[playerID]); } break; - default: - {} + default: { + } } } } diff --git a/src/gui/qt/gametable/gametableimpl.h b/src/gui/qt/gametable/gametableimpl.h index c6eb90bfe..55ac0ec88 100755 --- a/src/gui/qt/gametable/gametableimpl.h +++ b/src/gui/qt/gametable/gametableimpl.h @@ -87,26 +87,33 @@ class gameTableImpl: public QMainWindow, public Ui::gameTable boost::shared_ptr getSession(); - SoundEvents* getMySoundEventHandler() const { + SoundEvents* getMySoundEventHandler() const + { return mySoundEventHandler; } - ChatTools* getMyChat() const { + ChatTools* getMyChat() const + { return myChat; } - ConfigFile* getMyConfig() const { + ConfigFile* getMyConfig() const + { return myConfig; } - GameTableStyleReader* getMyGameTableStyle() const { + GameTableStyleReader* getMyGameTableStyle() const + { return myGameTableStyle; } - bool getGuestMode() const { + bool getGuestMode() const + { return guestMode; } - void setStartWindow(startWindowImpl* s) { + void setStartWindow(startWindowImpl* s) + { myStartWindow = s; } - void setGuiLog(guiLog* l) { + void setGuiLog(guiLog* l) + { myGuiLog = l; } @@ -211,7 +218,8 @@ public slots: void startTimeoutAnimation(int playerId, int timoutSec); void stopTimeoutAnimation(int playerId); - void setGameSpeed(const int theValue) { + void setGameSpeed(const int theValue) + { guiGameSpeed = theValue; // Achtung Faktor 10!!! setSpeeds(); } diff --git a/src/gui/qt/gametable/log/guilog.h b/src/gui/qt/gametable/log/guilog.h index 1202751ee..aec7c61a6 100644 --- a/src/gui/qt/gametable/log/guilog.h +++ b/src/gui/qt/gametable/log/guilog.h @@ -94,10 +94,12 @@ public slots: void writeLogFileStream(QString string); - void setMySqliteLogFileName(std::string theValue) { + void setMySqliteLogFileName(std::string theValue) + { mySqliteLogFileName = theValue; } - std::string getMySqliteLogFileName() { + std::string getMySqliteLogFileName() + { return mySqliteLogFileName; } diff --git a/src/gui/qt/gametable/myactionbutton.cpp b/src/gui/qt/gametable/myactionbutton.cpp index f975f5e15..be69ce84d 100644 --- a/src/gui/qt/gametable/myactionbutton.cpp +++ b/src/gui/qt/gametable/myactionbutton.cpp @@ -76,7 +76,7 @@ bool MyActionButton::event(QEvent *event) void MyActionButton::click() { - if (!eatMyEvents) { - QPushButton::click(); - } + if (!eatMyEvents) { + QPushButton::click(); + } } diff --git a/src/gui/qt/gametable/myactionbutton.h b/src/gui/qt/gametable/myactionbutton.h index 659c665bf..005403f7a 100644 --- a/src/gui/qt/gametable/myactionbutton.h +++ b/src/gui/qt/gametable/myactionbutton.h @@ -47,21 +47,24 @@ class MyActionButton : public QPushButton ~MyActionButton(); void paintEvent(QPaintEvent * event); - void setFKeyText ( const QString& theValue ) { + void setFKeyText ( const QString& theValue ) + { fKeyText = theValue; } - void setMyStyle ( GameTableStyleReader* theValue ) { + void setMyStyle ( GameTableStyleReader* theValue ) + { myStyle = theValue; } - void setEatMyEvents(bool e) { + void setEatMyEvents(bool e) + { eatMyEvents = e; } bool event(QEvent *e); public slots: - void click(); + void click(); private: diff --git a/src/gui/qt/gametable/myavatarlabel.h b/src/gui/qt/gametable/myavatarlabel.h index ee2f62bad..406daf505 100644 --- a/src/gui/qt/gametable/myavatarlabel.h +++ b/src/gui/qt/gametable/myavatarlabel.h @@ -49,13 +49,16 @@ class MyAvatarLabel : public QLabel MyAvatarLabel(QGroupBox*); ~MyAvatarLabel(); - void setMyW(gameTableImpl* theValue) { + void setMyW(gameTableImpl* theValue) + { myW = theValue; } - void setMyId ( int theValue ) { + void setMyId ( int theValue ) + { myId = theValue; } - void setMyUniqueId ( int theValue ) { + void setMyUniqueId ( int theValue ) + { myUniqueId = theValue; } void contextMenuEvent ( QContextMenuEvent * event ); @@ -68,12 +71,14 @@ public slots: void sendTriggerVoteOnKickSignal(); void setEnabledContextMenu(bool); void setVoteOnKickContextMenuEnabled(bool); - void setVoteRunning ( bool theValue ) { + void setVoteRunning ( bool theValue ) + { voteRunning = theValue; } void setPixmap ( const QPixmap &, const bool = false); void setPixmapAndCountry ( const QPixmap &, QString country, int seatPlace, const bool = false); - void setPixmapPath ( const QString theValue) { + void setPixmapPath ( const QString theValue) + { myPath = theValue; } void paintEvent(QPaintEvent*); diff --git a/src/gui/qt/gametable/mycardspixmaplabel.h b/src/gui/qt/gametable/mycardspixmaplabel.h index c279f19f9..cddb46960 100755 --- a/src/gui/qt/gametable/mycardspixmaplabel.h +++ b/src/gui/qt/gametable/mycardspixmaplabel.h @@ -49,21 +49,26 @@ class MyCardsPixmapLabel : public QLabel ~MyCardsPixmapLabel(); - void setMyW ( gameTableImpl* theValue ) { + void setMyW ( gameTableImpl* theValue ) + { myW = theValue; } - void setIsFlipside(bool theValue) { + void setIsFlipside(bool theValue) + { isFlipside = theValue; } - bool getIsFlipside() const { + bool getIsFlipside() const + { return isFlipside; } - void setFadeOutAction(bool theValue) { + void setFadeOutAction(bool theValue) + { fadeOutAction = theValue; } - bool getFadeOutAction() const { + bool getFadeOutAction() const + { return fadeOutAction; } @@ -72,7 +77,8 @@ class MyCardsPixmapLabel : public QLabel void startFlipCards(int, const QPixmap & , const QPixmap &); void stopFlipCardsAnimation(); - void setFlipsidePix(QPixmap p) { + void setFlipsidePix(QPixmap p) + { flipside = p; } diff --git a/src/gui/qt/gametable/mycashlabel.h b/src/gui/qt/gametable/mycashlabel.h index 35a2adae7..4b9f18f18 100644 --- a/src/gui/qt/gametable/mycashlabel.h +++ b/src/gui/qt/gametable/mycashlabel.h @@ -48,7 +48,8 @@ class MyCashLabel : public QLabel MyCashLabel(QGroupBox*); ~MyCashLabel(); - void setMyW(gameTableImpl* theValue) { + void setMyW(gameTableImpl* theValue) + { myW = theValue; } diff --git a/src/gui/qt/gametable/mychancelabel.h b/src/gui/qt/gametable/mychancelabel.h index 2d026acba..4f730ee06 100644 --- a/src/gui/qt/gametable/mychancelabel.h +++ b/src/gui/qt/gametable/mychancelabel.h @@ -50,10 +50,12 @@ class MyChanceLabel : public QLabel ~MyChanceLabel(); - void setMyW ( gameTableImpl* theValue ) { + void setMyW ( gameTableImpl* theValue ) + { myW = theValue; } - void setMyStyle ( GameTableStyleReader* theValue ) { + void setMyStyle ( GameTableStyleReader* theValue ) + { myStyle = theValue; } void paintEvent(QPaintEvent * event); diff --git a/src/gui/qt/gametable/mylefttabwidget.h b/src/gui/qt/gametable/mylefttabwidget.h index a01e35bf7..e72315a3e 100755 --- a/src/gui/qt/gametable/mylefttabwidget.h +++ b/src/gui/qt/gametable/mylefttabwidget.h @@ -56,7 +56,8 @@ public slots: void blinkChatTab(); - QTabBar* getMyTabBar() const { + QTabBar* getMyTabBar() const + { return myTabBar; } diff --git a/src/gui/qt/gametable/mynamelabel.cpp b/src/gui/qt/gametable/mynamelabel.cpp index f792efeaf..3765e4dcc 100644 --- a/src/gui/qt/gametable/mynamelabel.cpp +++ b/src/gui/qt/gametable/mynamelabel.cpp @@ -92,15 +92,15 @@ void MyNameLabel::setText ( const QString &t, bool trans, bool guest, bool compu } else { linkString = QString("http://pokerth.net/redirect_user_profile.php?nick="+QUrl::toPercentEncoding(t)); } - + // truncate nicknames longer than 13 characters QString t2 = t; - if(t2.size() > 13){ + if(t2.size() > 13) { int chop = t.size() - 13 + 3; t2.chop(chop); t2.append("..."); } - + QString tTruncated; if(trans) { diff --git a/src/gui/qt/gametable/mynamelabel.h b/src/gui/qt/gametable/mynamelabel.h index 93ed3a2d0..1a6c6b5c0 100644 --- a/src/gui/qt/gametable/mynamelabel.h +++ b/src/gui/qt/gametable/mynamelabel.h @@ -48,7 +48,8 @@ class MyNameLabel : public QLabel MyNameLabel(QGroupBox*); ~MyNameLabel(); - void setMyW(gameTableImpl* theValue) { + void setMyW(gameTableImpl* theValue) + { myW = theValue; } diff --git a/src/gui/qt/gametable/myrighttabwidget.h b/src/gui/qt/gametable/myrighttabwidget.h index 71643862e..d4de1ba4d 100755 --- a/src/gui/qt/gametable/myrighttabwidget.h +++ b/src/gui/qt/gametable/myrighttabwidget.h @@ -48,7 +48,8 @@ class MyRightTabWidget : public QTabWidget void paintEvent(QPaintEvent * event); - QTabBar* getMyTabBar() const { + QTabBar* getMyTabBar() const + { return myTabBar; } diff --git a/src/gui/qt/gametable/mysetlabel.h b/src/gui/qt/gametable/mysetlabel.h index adf3ea1d1..0e9a42b3c 100644 --- a/src/gui/qt/gametable/mysetlabel.h +++ b/src/gui/qt/gametable/mysetlabel.h @@ -50,7 +50,8 @@ class MySetLabel : public QLabel ~MySetLabel(); - void setMyW ( gameTableImpl* theValue ) { + void setMyW ( gameTableImpl* theValue ) + { myW = theValue; } void paintEvent(QPaintEvent * event); diff --git a/src/gui/qt/gametable/myslider.h b/src/gui/qt/gametable/myslider.h index fdaa984dd..3a1a61b49 100644 --- a/src/gui/qt/gametable/myslider.h +++ b/src/gui/qt/gametable/myslider.h @@ -48,15 +48,18 @@ class Slider : public QSlider public: Slider( QWidget* parent = 0 ) - : QSlider( parent ) { + : QSlider( parent ) + { } Slider( Qt::Orientation orientation, QWidget* parent = 0 ) - : QSlider( orientation, parent ) { + : QSlider( orientation, parent ) + { } protected: - int pixelPosToRangeValue(int pos) const { // getted from QSlider.cpp with little adapt + int pixelPosToRangeValue(int pos) const // getted from QSlider.cpp with little adapt + { QStyleOptionSlider opt; initStyleOption(&opt); QRect gr = style()->subControlRect(QStyle::CC_Slider, &opt, QStyle::SC_SliderGroove, this); @@ -76,11 +79,13 @@ class Slider : public QSlider sliderMax - sliderMin, opt.upsideDown); } - int pick(const QPoint &pt) const { // getted from QSlider.cpp with little adapt + int pick(const QPoint &pt) const // getted from QSlider.cpp with little adapt + { return orientation() == Qt::Horizontal ? pt.x() : pt.y(); } - virtual void mousePressEvent( QMouseEvent* ev ) { // getted from QSlider.cpp with little adapt + virtual void mousePressEvent( QMouseEvent* ev ) // getted from QSlider.cpp with little adapt + { if (maximum() == minimum() || (ev->buttons() ^ ev->button())) { ev->ignore(); return; diff --git a/src/gui/qt/gametable/mystatuslabel.h b/src/gui/qt/gametable/mystatuslabel.h index e11072430..79b2e2550 100755 --- a/src/gui/qt/gametable/mystatuslabel.h +++ b/src/gui/qt/gametable/mystatuslabel.h @@ -50,7 +50,8 @@ class MyStatusLabel : public QLabel ~MyStatusLabel(); - void setMyW ( gameTableImpl* theValue ) { + void setMyW ( gameTableImpl* theValue ) + { myW = theValue; } diff --git a/src/gui/qt/gametable/mytimeoutlabel.h b/src/gui/qt/gametable/mytimeoutlabel.h index 749234a02..137e531e7 100644 --- a/src/gui/qt/gametable/mytimeoutlabel.h +++ b/src/gui/qt/gametable/mytimeoutlabel.h @@ -53,7 +53,8 @@ class MyTimeoutLabel : public QLabel ~MyTimeoutLabel(); - void setMyW ( gameTableImpl* theValue ) { + void setMyW ( gameTableImpl* theValue ) + { myW = theValue; } diff --git a/src/gui/qt/guiwrapper.h b/src/gui/qt/guiwrapper.h index a3548f398..fbce54d99 100644 --- a/src/gui/qt/guiwrapper.h +++ b/src/gui/qt/guiwrapper.h @@ -54,10 +54,12 @@ class GuiWrapper : public GuiInterface boost::shared_ptr getSession(); void setSession(boost::shared_ptr session); - gameTableImpl* getMyW() const { + gameTableImpl* getMyW() const + { return myW; } - guiLog* getMyGuiLog() const { + guiLog* getMyGuiLog() const + { return myGuiLog; } diff --git a/src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h b/src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h index 395ead4d8..490373cda 100644 --- a/src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h +++ b/src/gui/qt/internetgamelogindialog/internetgamelogindialogimpl.h @@ -54,7 +54,8 @@ public slots: void regUserToggled(bool); void guestUserToggled(bool); void okButtonCheck(); - void clickLoginButton() { + void clickLoginButton() + { pushButton_login->click(); } diff --git a/src/gui/qt/logfiledialog/logfiledialog.h b/src/gui/qt/logfiledialog/logfiledialog.h index c542a499a..4ab6c14bc 100644 --- a/src/gui/qt/logfiledialog/logfiledialog.h +++ b/src/gui/qt/logfiledialog/logfiledialog.h @@ -58,7 +58,8 @@ class LogFileDialog : public QDialog, public UploadCallback explicit LogFileDialog(QWidget *parent = 0, ConfigFile *c = 0); ~LogFileDialog(); - void setGuiLog(guiLog *g) { + void setGuiLog(guiLog *g) + { myGuiLog = g; } int exec(); @@ -76,10 +77,12 @@ public slots: void exportLogToHtml(); void exportLogToTxt(); void saveLogFileAs(); - void showLogFilePreviewInit() { + void showLogFilePreviewInit() + { showLogFilePreview(INIT_VIEW); } - void showLogFilePreviewSelected() { + void showLogFilePreviewSelected() + { showLogFilePreview(SELECTED_GAME); } void showLogFilePreview(ShowLogMode); diff --git a/src/gui/qt/newlocalgamedialog/newgamedialogimpl.h b/src/gui/qt/newlocalgamedialog/newgamedialogimpl.h index ab0eda98f..4aeeaf57f 100755 --- a/src/gui/qt/newlocalgamedialog/newgamedialogimpl.h +++ b/src/gui/qt/newlocalgamedialog/newgamedialogimpl.h @@ -53,7 +53,8 @@ class newGameDialogImpl: public QDialog, public Ui::newGameDialog newGameDialogImpl(QMainWindow *parent = 0, ConfigFile* = 0); int exec(); - changeCompleteBlindsDialogImpl* getChangeCompleteBlindsDialog() { + changeCompleteBlindsDialogImpl* getChangeCompleteBlindsDialog() + { return myChangeCompleteBlindsDialog; } diff --git a/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.h b/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.h index 3aabbd2c5..d3fc66c8a 100644 --- a/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.h +++ b/src/gui/qt/settingsdialog/manualblindsorderdialog/manualblindsorderdialogimpl.h @@ -52,7 +52,8 @@ class manualBlindsOrderDialogImpl: public QDialog, public Ui::manualBlindsOrderD public slots: - bool getSettingsCorrect() const { + bool getSettingsCorrect() const + { return settingsCorrect; } diff --git a/src/gui/qt/settingsdialog/myavatarbutton.h b/src/gui/qt/settingsdialog/myavatarbutton.h index 465f20656..c1ffe8aad 100644 --- a/src/gui/qt/settingsdialog/myavatarbutton.h +++ b/src/gui/qt/settingsdialog/myavatarbutton.h @@ -44,10 +44,12 @@ class MyAvatarButton : public QPushButton ~MyAvatarButton(); - void setMyLink(QString theValue) { + void setMyLink(QString theValue) + { myLink = theValue; } - QString getMyLink() const { + QString getMyLink() const + { return myLink; } diff --git a/src/gui/qt/settingsdialog/myhpavatarbutton.h b/src/gui/qt/settingsdialog/myhpavatarbutton.h index ac8ae2fa2..ec3a56d4f 100644 --- a/src/gui/qt/settingsdialog/myhpavatarbutton.h +++ b/src/gui/qt/settingsdialog/myhpavatarbutton.h @@ -44,10 +44,12 @@ class MyHPAvatarButton : public QPushButton ~MyHPAvatarButton(); - void setMyLink(QString theValue) { + void setMyLink(QString theValue) + { myLink = theValue; } - QString getMyLink() const { + QString getMyLink() const + { return myLink; } diff --git a/src/gui/qt/settingsdialog/selectavatardialog/myavatarlistitem.h b/src/gui/qt/settingsdialog/selectavatardialog/myavatarlistitem.h index 6f44af09a..315460b27 100644 --- a/src/gui/qt/settingsdialog/selectavatardialog/myavatarlistitem.h +++ b/src/gui/qt/settingsdialog/selectavatardialog/myavatarlistitem.h @@ -44,10 +44,12 @@ class MyAvatarListItem : public QListWidgetItem ~MyAvatarListItem(); - void setMyLink(QString theValue) { + void setMyLink(QString theValue) + { myLink = theValue; } - QString getMyLink() const { + QString getMyLink() const + { return myLink; } diff --git a/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.h b/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.h index 80cd97055..65c0becb3 100644 --- a/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.h +++ b/src/gui/qt/settingsdialog/selectavatardialog/selectavatardialogimpl.h @@ -63,7 +63,8 @@ public slots: QString getAvatarLink(); void setExternalAvatar(); - bool getSettingsCorrect() const { + bool getSettingsCorrect() const + { return settingsCorrect; } diff --git a/src/gui/qt/settingsdialog/settingsdialogimpl.h b/src/gui/qt/settingsdialog/settingsdialogimpl.h index dce85786d..0292d3549 100644 --- a/src/gui/qt/settingsdialog/settingsdialogimpl.h +++ b/src/gui/qt/settingsdialog/settingsdialogimpl.h @@ -67,25 +67,30 @@ class settingsDialogImpl: public QDialog, public Ui::settingsDialog void prepareDialog(); void exec(bool ingame); - void setPlayerNickIsChanged(bool theValue) { + void setPlayerNickIsChanged(bool theValue) + { playerNickIsChanged = theValue; } - bool getPlayerNickIsChanged() const { + bool getPlayerNickIsChanged() const + { return playerNickIsChanged; } - bool getSettingsCorrect() const { + bool getSettingsCorrect() const + { return settingsCorrect; } - void setGuiLog(guiLog* l) { + void setGuiLog(guiLog* l) + { myGuiLog = l; } public slots: void isAccepted(); - void playerNickChanged() { + void playerNickChanged() + { setPlayerNickIsChanged(true); }; void setFlipsidePicFileName(); @@ -104,7 +109,8 @@ public slots: void callManualBlindsOrderDialog(); void callNetManualBlindsOrderDialog(); - void callSelectAvatarDialog() { + void callSelectAvatarDialog() + { mySelectAvatarDialogImpl->exec(); } diff --git a/src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.h b/src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.h index b748cb287..abe50e52b 100644 --- a/src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.h +++ b/src/gui/qt/startnetworkgamedialog/startnetworkgamedialogimpl.h @@ -56,10 +56,12 @@ class startNetworkGameDialogImpl: public QDialog, public Ui::startNetworkGameDia public slots: - void setMyW ( gameTableImpl* theValue ) { + void setMyW ( gameTableImpl* theValue ) + { myW = theValue; } - ChatTools *getMyChat() { + ChatTools *getMyChat() + { return myChat; } @@ -84,11 +86,13 @@ public slots: void keyPressEvent ( QKeyEvent*); bool eventFilter(QObject *obj, QEvent *event); - void setMaxPlayerNumber ( int theValue ) { + void setMaxPlayerNumber ( int theValue ) + { maxPlayerNumber = theValue; label_maxPlayerNumber->setText(QString::number(theValue,10)); } - int getMaxPlayerNumber() const { + int getMaxPlayerNumber() const + { return maxPlayerNumber; } diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index 11d94b933..aea345579 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -775,9 +775,9 @@ void startWindowImpl::networkError(int errorID, int /*osErrorID*/) } break; case ERR_SOCK_CONNECT_IPV6_FAILED: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Could not connect to the server.\n\nPlease note: IPv6 is enabled in the settings. The connection fails if your provider does not support IPv6.\nThis may be fixed by unchecking the \"Use IPv6\" checkbox in the settings."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Could not connect to the server.\n\nPlease note: IPv6 is enabled in the settings. The connection fails if your provider does not support IPv6.\nThis may be fixed by unchecking the \"Use IPv6\" checkbox in the settings."), + QMessageBox::Close); } break; case ERR_SOCK_CONNECT_TIMEOUT: { @@ -787,9 +787,9 @@ void startWindowImpl::networkError(int errorID, int /*osErrorID*/) } break; case ERR_SOCK_CONNECT_IPV6_TIMEOUT: { - MyMessageBox::warning(this, tr("Network Error"), - tr("Connection timed out.\nPlease check the server address.\n\nPlease note: IPv6 is enabled in the settings. The connection fails if your provider does not support IPv6.\nThis may be fixed by unchecking the \"Use IPv6\" checkbox in the settings."), - QMessageBox::Close); + MyMessageBox::warning(this, tr("Network Error"), + tr("Connection timed out.\nPlease check the server address.\n\nPlease note: IPv6 is enabled in the settings. The connection fails if your provider does not support IPv6.\nThis may be fixed by unchecking the \"Use IPv6\" checkbox in the settings."), + QMessageBox::Close); } break; case ERR_SOCK_SELECT_FAILED: { diff --git a/src/gui/qt/startwindow/startwindowimpl.h b/src/gui/qt/startwindow/startwindowimpl.h index d826902f8..03979ff98 100644 --- a/src/gui/qt/startwindow/startwindowimpl.h +++ b/src/gui/qt/startwindow/startwindowimpl.h @@ -76,21 +76,26 @@ class startWindowImpl: public QMainWindow, public Ui::startWindow startWindowImpl(ConfigFile *c, Log *l); ~startWindowImpl(); - void setSession(boost::shared_ptr session) { + void setSession(boost::shared_ptr session) + { mySession = session; } - boost::shared_ptr getSession() { + boost::shared_ptr getSession() + { assert(mySession.get()); return mySession; } - boost::shared_ptr< GuiInterface > getMyServerGuiInterface() const { + boost::shared_ptr< GuiInterface > getMyServerGuiInterface() const + { return myServerGuiInterface; } - connectToServerDialogImpl* getMyConnectToServerDialog() const { + connectToServerDialogImpl* getMyConnectToServerDialog() const + { return myConnectToServerDialog; } - void setGuiLog(guiLog* l) { + void setGuiLog(guiLog* l) + { myGuiLog = l; } diff --git a/src/gui/qt/styles/carddeckstylereader.h b/src/gui/qt/styles/carddeckstylereader.h index 5559129b1..bf0a6737b 100644 --- a/src/gui/qt/styles/carddeckstylereader.h +++ b/src/gui/qt/styles/carddeckstylereader.h @@ -56,42 +56,53 @@ class CardDeckStyleReader : public QObject void readStyleFile(QString); - QString getStyleDescription() const { + QString getStyleDescription() const + { return StyleDescription; } - QString getStyleMaintainerName() const { + QString getStyleMaintainerName() const + { return StyleMaintainerName; } - QString getStyleMaintainerEMail() const { + QString getStyleMaintainerEMail() const + { return StyleMaintainerEMail; } - QString getStyleCreateDate() const { + QString getStyleCreateDate() const + { return StyleCreateDate; } - QString getCurrentFileName() const { + QString getCurrentFileName() const + { return currentFileName; } - QString getCurrentDir() const { + QString getCurrentDir() const + { return currentDir; } - QString getPreview() const { + QString getPreview() const + { return Preview; } - QString getBigIndexesActionBottom() const { + QString getBigIndexesActionBottom() const + { return BigIndexesActionBottom; } - bool getFallBack() const { + bool getFallBack() const + { return fallBack; } - bool getLoadedSuccessfull() const { + bool getLoadedSuccessfull() const + { return loadedSuccessfull; } - CdStyleState getState() const { + CdStyleState getState() const + { return myState; } diff --git a/src/gui/qt/styles/gametablestylereader.cpp b/src/gui/qt/styles/gametablestylereader.cpp index 030975858..dac8c19fe 100644 --- a/src/gui/qt/styles/gametablestylereader.cpp +++ b/src/gui/qt/styles/gametablestylereader.cpp @@ -1422,7 +1422,7 @@ void GameTableStyleReader::setMenuBarStyle(QMenuBar *mb) void GameTableStyleReader::setBreakButtonStyle(QPushButton *bb, int state) { switch(state) { - // default + // default case 0: #ifdef GUI_800x480 bb->setStyleSheet("QPushButton:enabled { padding: 10px; background-color: #"+BreakLobbyButtonBgColor+"; color: #"+BreakLobbyButtonTextColor+"; font-size: 26px} QPushButton:disabled { padding: 10px; background-color: #"+BreakLobbyButtonBgDisabledColor+"; color: #"+BreakLobbyButtonTextDisabledColor+"; font-weight: 900; font-size: 26px}"); @@ -1430,7 +1430,7 @@ void GameTableStyleReader::setBreakButtonStyle(QPushButton *bb, int state) bb->setStyleSheet("QPushButton:enabled { background-color: #"+BreakLobbyButtonBgColor+"; color: #"+BreakLobbyButtonTextColor+";} QPushButton:disabled { background-color: #"+BreakLobbyButtonBgDisabledColor+"; color: #"+BreakLobbyButtonTextDisabledColor+"; font-weight: 900;}"); #endif break; - // blink + // blink case 1: #ifdef GUI_800x480 bb->setStyleSheet("QPushButton { padding: 10px; background-color: #"+BreakLobbyButtonBgBlinkColor+"; color: "+BreakLobbyButtonTextBlinkColor+"; font-size: 26px}"); @@ -1558,7 +1558,7 @@ void GameTableStyleReader::setButtonsStyle(MyActionButton *br, MyActionButton *c a->setMyStyle(this); switch(state) { - //default + //default case 0: { br->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+BetRaiseButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonCheckedHover+"\");}"); diff --git a/src/gui/qt/styles/gametablestylereader.h b/src/gui/qt/styles/gametablestylereader.h index ad2ff8a54..4cbd7d836 100644 --- a/src/gui/qt/styles/gametablestylereader.h +++ b/src/gui/qt/styles/gametablestylereader.h @@ -66,136 +66,176 @@ class GameTableStyleReader : public QObject void showItemPicsLeftErrorMessage(); void showOutdatedErrorMessage(); - QString getStyleDescription() const { + QString getStyleDescription() const + { return StyleDescription; } - QString getStyleMaintainerName() const { + QString getStyleMaintainerName() const + { return StyleMaintainerName; } - QString getStyleMaintainerEMail() const { + QString getStyleMaintainerEMail() const + { return StyleMaintainerEMail; } - QString getStyleCreateDate() const { + QString getStyleCreateDate() const + { return StyleCreateDate; } - QString getCurrentFileName() const { + QString getCurrentFileName() const + { return currentFileName; } - QString getPreview() const { + QString getPreview() const + { return Preview; } - QString getDefaultAvatar() const { + QString getDefaultAvatar() const + { return DefaultAvatar; } - QString getDealerPuck() const { + QString getDealerPuck() const + { return DealerPuck; } - QString getSmallBlindPuck() const { + QString getSmallBlindPuck() const + { return SmallBlindPuck; } - QString getBigBlindPuck() const { + QString getBigBlindPuck() const + { return BigBlindPuck; } - QString getHandRanking() const { + QString getHandRanking() const + { return HandRanking; } - QString getTable() const { + QString getTable() const + { return Table; } QString getActionPic(int); - QString getFKeyIndicatorColor() const { + QString getFKeyIndicatorColor() const + { return FKeyIndicatorColor; } - QString getChanceLabelImpossibleColor() const { + QString getChanceLabelImpossibleColor() const + { return ChanceLabelImpossibleColor; } - QString getChanceLabelPossibleColor() const { + QString getChanceLabelPossibleColor() const + { return ChanceLabelPossibleColor; } - QString getChatLogTextColor() const { + QString getChatLogTextColor() const + { return ChatLogTextColor; } - QString getChatTextNickNotifyColor() const { + QString getChatTextNickNotifyColor() const + { return ChatTextNickNotifyColor; } - QString getLogWinnerMainPotColor() const { + QString getLogWinnerMainPotColor() const + { return LogWinnerMainPotColor; } - QString getLogWinnerSidePotColor() const { + QString getLogWinnerSidePotColor() const + { return LogWinnerSidePotColor; } - QString getLogPlayerSitsOutColor() const { + QString getLogPlayerSitsOutColor() const + { return LogPlayerSitsOutColor; } - QString getLogNewGameAdminColor() const { + QString getLogNewGameAdminColor() const + { return LogNewGameAdminColor; } - QString getBreakLobbyButtonBgColor() const { + QString getBreakLobbyButtonBgColor() const + { return BreakLobbyButtonBgColor; } - QString getRatingStarsColor() const { + QString getRatingStarsColor() const + { return RatingStarsColor; } - QString getPlayerInfoHintTextColor() const { + QString getPlayerInfoHintTextColor() const + { return PlayerInfoHintTextColor; } - QString getPlayerNickTextColor() const { + QString getPlayerNickTextColor() const + { return PlayerNickTextColor; } - QString getPlayerCashTextColor() const { + QString getPlayerCashTextColor() const + { return PlayerCashTextColor; } - QString getPlayerNameLabelFontSize() const { + QString getPlayerNameLabelFontSize() const + { return playerNameLabelFontSize; } - QString getPlayerCashLabelFontSize() const { + QString getPlayerCashLabelFontSize() const + { return cashFontSize; } - QString getFont2String() const { + QString getFont2String() const + { return font2String; } - QString getFont1String() const { + QString getFont1String() const + { return font1String; } - QString getMinimumWindowWidth() const { + QString getMinimumWindowWidth() const + { return MinimumWindowWidth; } - QString getMinimumWindowHeight() const { + QString getMinimumWindowHeight() const + { return MinimumWindowHeight; } - QString getMaximumWindowWidth() const { + QString getMaximumWindowWidth() const + { return MaximumWindowWidth; } - QString getMaximumWindowHeight() const { + QString getMaximumWindowHeight() const + { return MaximumWindowHeight; } - QString getFixedWindowWidth() const { + QString getFixedWindowWidth() const + { return FixedWindowWidth; } - QString getFixedWindowHeight() const { + QString getFixedWindowHeight() const + { return FixedWindowHeight; } - QString getIfFixedWindowSize() const { + QString getIfFixedWindowSize() const + { return IfFixedWindowSize; } - bool getFallBack() const { + bool getFallBack() const + { return fallBack; } - bool getLoadedSuccessfull() const { + bool getLoadedSuccessfull() const + { return loadedSuccessfull; } - GtStyleState getState() const { + GtStyleState getState() const + { return myState; } @@ -231,49 +271,64 @@ class GameTableStyleReader : public QObject void setShowMyCardsButtonStyle( MyActionButton *sc); void setAwayRadioButtonsStyle(QRadioButton*); - QString getActionAllInI18NString() const { + QString getActionAllInI18NString() const + { return ActionAllInI18NString; } - QString getActionRaiseI18NString() const { + QString getActionRaiseI18NString() const + { return ActionRaiseI18NString; } - QString getActionBetI18NString() const { + QString getActionBetI18NString() const + { return ActionBetI18NString; } - QString getActionCallI18NString() const { + QString getActionCallI18NString() const + { return ActionCallI18NString; } - QString getActionCheckI18NString() const { + QString getActionCheckI18NString() const + { return ActionCheckI18NString; } - QString getActionFoldI18NString() const { + QString getActionFoldI18NString() const + { return ActionFoldI18NString; } - QString getRiverI18NString() const { + QString getRiverI18NString() const + { return RiverI18NString; } - QString getTurnI18NString() const { + QString getTurnI18NString() const + { return TurnI18NString; } - QString getFlopI18NString() const { + QString getFlopI18NString() const + { return FlopI18NString; } - QString getPreflopI18NString() const { + QString getPreflopI18NString() const + { return PreflopI18NString; } - QString getHandI18NString() const { + QString getHandI18NString() const + { return HandI18NString; } - QString getGameI18NString() const { + QString getGameI18NString() const + { return GameI18NString; } - QString getBetsI18NString() const { + QString getBetsI18NString() const + { return BetsI18NString; } - QString getTotalI18NString() const { + QString getTotalI18NString() const + { return TotalI18NString; } - QString getPotI18NString() const { + QString getPotI18NString() const + { return PotI18NString; } diff --git a/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.h b/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.h index 41c01f815..572375b50 100644 --- a/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.h +++ b/src/gui/qt/timeoutmsgbox/timeoutmsgboximpl.h @@ -61,13 +61,16 @@ public slots: void timerRefresh(); void stopTimeout(); - void setMySession ( boost::shared_ptr theValue ) { + void setMySession ( boost::shared_ptr theValue ) + { mySession = theValue; } - void setMsgID ( NetTimeoutReason theValue ) { + void setMsgID ( NetTimeoutReason theValue ) + { msgID = theValue; } - void setTimeoutDuration ( int theValue ) { + void setTimeoutDuration ( int theValue ) + { timeoutDuration = theValue; } diff --git a/src/net/asiosendbuffer.h b/src/net/asiosendbuffer.h index 10fdec1a6..e78644d40 100644 --- a/src/net/asiosendbuffer.h +++ b/src/net/asiosendbuffer.h @@ -47,16 +47,19 @@ class AsioSendBuffer : public SendBuffer AsioSendBuffer(); virtual ~AsioSendBuffer(); - inline size_t GetSendBufLeft() const { + inline size_t GetSendBufLeft() const + { int bytesLeft = (int)(sendBufAllocated - sendBufUsed); return bytesLeft < 0 ? (size_t)0 : (size_t)bytesLeft; } - inline size_t GetAllocated() const { + inline size_t GetAllocated() const + { return sendBufAllocated; } - inline bool ReallocSendBuf() { + inline bool ReallocSendBuf() + { bool retVal = false; size_t allocAmount = sendBufAllocated * 2; if (0 == allocAmount) { @@ -73,7 +76,8 @@ class AsioSendBuffer : public SendBuffer return retVal; } - inline void AppendToSendBufWithoutCheck(const char *data, size_t size) { + inline void AppendToSendBufWithoutCheck(const char *data, size_t size) + { std::memcpy(sendBuf + sendBufUsed, data, size); sendBufUsed += size; } diff --git a/src/net/clientcontext.h b/src/net/clientcontext.h index 5040093c4..7486970b4 100644 --- a/src/net/clientcontext.h +++ b/src/net/clientcontext.h @@ -49,96 +49,126 @@ class ClientContext void SetSessionData(boost::shared_ptr sessionData); boost::shared_ptr GetResolver() const; void SetResolver(boost::shared_ptr resolver); - bool GetSctp() const { + bool GetSctp() const + { return m_sctp; } - void SetSctp(bool sctp) { + void SetSctp(bool sctp) + { m_sctp = sctp; } - int GetAddrFamily() const { + int GetAddrFamily() const + { return m_addrFamily; } - void SetAddrFamily(int addrFamily) { + void SetAddrFamily(int addrFamily) + { m_addrFamily = addrFamily; } - const std::string &GetServerAddr() const { + const std::string &GetServerAddr() const + { return m_serverAddr; } - void SetServerAddr(const std::string &serverAddr) { + void SetServerAddr(const std::string &serverAddr) + { m_serverAddr = serverAddr; } - const std::string &GetServerPassword() const { + const std::string &GetServerPassword() const + { return m_serverPassword; } - void SetServerPassword(const std::string &serverPassword) { + void SetServerPassword(const std::string &serverPassword) + { m_serverPassword = serverPassword; } - const std::string &GetServerListUrl() const { + const std::string &GetServerListUrl() const + { return m_serverListUrl; } - void SetServerListUrl(const std::string &serverListUrl) { + void SetServerListUrl(const std::string &serverListUrl) + { m_serverListUrl = serverListUrl; } - bool GetUseServerList() const { + bool GetUseServerList() const + { return m_useServerList; } - void SetUseServerList(bool use) { + void SetUseServerList(bool use) + { m_useServerList = use; } - unsigned GetServerPort() const { + unsigned GetServerPort() const + { return m_serverPort; } - void SetServerPort(unsigned serverPort) { + void SetServerPort(unsigned serverPort) + { m_serverPort = serverPort; } - const std::string &GetAvatarServerAddr() const { + const std::string &GetAvatarServerAddr() const + { return m_avatarServerAddr; } - void SetAvatarServerAddr(const std::string &avatarServerAddr) { + void SetAvatarServerAddr(const std::string &avatarServerAddr) + { m_avatarServerAddr = avatarServerAddr; } - const std::string &GetPassword() const { + const std::string &GetPassword() const + { return m_password; } - void SetPassword(const std::string &password) { + void SetPassword(const std::string &password) + { m_password = password; } - const std::string &GetPlayerName() const { + const std::string &GetPlayerName() const + { return m_playerName; } - void SetPlayerName(const std::string &playerName) { + void SetPlayerName(const std::string &playerName) + { m_playerName = playerName; } - PlayerRights GetPlayerRights() const { + PlayerRights GetPlayerRights() const + { return m_playerRights; } - void SetPlayerRights(PlayerRights rights) { + void SetPlayerRights(PlayerRights rights) + { m_playerRights = rights; } - const std::string &GetAvatarFile() const { + const std::string &GetAvatarFile() const + { return m_avatarFile; } - void SetAvatarFile(const std::string &avatarFile) { + void SetAvatarFile(const std::string &avatarFile) + { m_avatarFile = avatarFile; } - const std::string &GetCacheDir() const { + const std::string &GetCacheDir() const + { return m_cacheDir; } - void SetCacheDir(const std::string &cacheDir) { + void SetCacheDir(const std::string &cacheDir) + { m_cacheDir = cacheDir; } - bool GetSubscribeLobbyMsg() const { + bool GetSubscribeLobbyMsg() const + { return m_hasSubscribedLobbyMsg; } - void SetSubscribeLobbyMsg(bool setSubscribe) { + void SetSubscribeLobbyMsg(bool setSubscribe) + { m_hasSubscribedLobbyMsg = setSubscribe; } - const std::string &GetSessionGuid() const { + const std::string &GetSessionGuid() const + { return m_sessionGuid; } - void SetSessionGuid(const std::string &sessionGuid) { + void SetSessionGuid(const std::string &sessionGuid) + { m_sessionGuid = sessionGuid; } diff --git a/src/net/clientthread.h b/src/net/clientthread.h index 55ec12a9f..aa5d04bd5 100644 --- a/src/net/clientthread.h +++ b/src/net/clientthread.h @@ -66,19 +66,24 @@ class PingData public: PingData() : pingTimer(boost::posix_time::time_duration(0, 0, 0), boost::timers::portable::microsec_timer::manual_start) {} - unsigned MinPing() { + unsigned MinPing() + { return *std::min_element(pingValues.begin(), pingValues.end()); } - unsigned MaxPing() { + unsigned MaxPing() + { return *std::max_element(pingValues.begin(), pingValues.end()); } - unsigned AveragePing() { + unsigned AveragePing() + { return pingValues.empty() ? 0 : (std::accumulate(pingValues.begin(), pingValues.end(), 0) / (unsigned)pingValues.size()); } - void StartPing() { + void StartPing() + { pingTimer.start(); } - bool EndPing() { + bool EndPing() + { bool retVal = false; if (pingTimer.is_running()) { pingValues.push_back((unsigned)pingTimer.elapsed().total_milliseconds()); diff --git a/src/net/common/clientstate.cpp b/src/net/common/clientstate.cpp index c943d92b6..d7fc7285a 100644 --- a/src/net/common/clientstate.cpp +++ b/src/net/common/clientstate.cpp @@ -535,8 +535,7 @@ ClientStateStartConnect::TimerTimeout(const boost::system::error_code& ec, boost client->GetContext().GetSessionData()->GetAsioSocket()->close(ec); if (client->GetContext().GetAddrFamily() == AF_INET6) { throw ClientException(__FILE__, __LINE__, ERR_SOCK_CONNECT_IPV6_TIMEOUT, 0); - } - else { + } else { throw ClientException(__FILE__, __LINE__, ERR_SOCK_CONNECT_TIMEOUT, 0); } } diff --git a/src/net/common/servergame.cpp b/src/net/common/servergame.cpp index f32e1c7a2..3c219db9c 100644 --- a/src/net/common/servergame.cpp +++ b/src/net/common/servergame.cpp @@ -1175,8 +1175,7 @@ void ServerGame::AddPlayerToNumJoinsPerPlayer(const std::string &playerName) { NumJoinsPerPlayerMap::iterator pos = m_numJoinsPerPlayer.find(playerName); - if (pos != m_numJoinsPerPlayer.end()) - { + if (pos != m_numJoinsPerPlayer.end()) { pos->second++; } else { m_numJoinsPerPlayer[playerName] = 1; diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index fdb4a24d3..d9c5169d9 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -107,35 +107,43 @@ class InternalServerCallback : public SessionDataCallback, public ChatCleanerCal InternalServerCallback(ServerLobbyThread &server) : m_server(server) {} virtual ~InternalServerCallback() {} - virtual void CloseSession(boost::shared_ptr session) { + virtual void CloseSession(boost::shared_ptr session) + { m_server.CloseSession(session); } - virtual void SessionError(boost::shared_ptr session, int errorCode) { + virtual void SessionError(boost::shared_ptr session, int errorCode) + { m_server.SessionError(session, errorCode); } - virtual void SessionTimeoutWarning(boost::shared_ptr session, unsigned remainingSec) { + virtual void SessionTimeoutWarning(boost::shared_ptr session, unsigned remainingSec) + { m_server.SessionTimeoutWarning(session, remainingSec); } - virtual void HandlePacket(boost::shared_ptr session, boost::shared_ptr packet) { + virtual void HandlePacket(boost::shared_ptr session, boost::shared_ptr packet) + { m_server.DispatchPacket(session, packet); } - virtual void SignalChatBotMessage(const string &msg) { + virtual void SignalChatBotMessage(const string &msg) + { m_server.SendChatBotMsg(msg); } - virtual void SignalChatBotMessage(unsigned gameId, const std::string &msg) { + virtual void SignalChatBotMessage(unsigned gameId, const std::string &msg) + { m_server.SendChatBotMsg(gameId, msg); } - virtual void SignalKickPlayer(unsigned playerId) { + virtual void SignalKickPlayer(unsigned playerId) + { m_server.RemovePlayer(playerId, ERR_NET_PLAYER_KICKED); } - virtual void SignalBanPlayer(unsigned playerId) { + virtual void SignalBanPlayer(unsigned playerId) + { string playerName(m_server.GetPlayerNameFromId(playerId)); if (!playerName.empty()) { m_server.GetBanManager().BanPlayerName(playerName, 1); @@ -143,76 +151,94 @@ class InternalServerCallback : public SessionDataCallback, public ChatCleanerCal } } - virtual void SignalMutePlayer(unsigned playerId) { + virtual void SignalMutePlayer(unsigned playerId) + { m_server.MutePlayerInGame(playerId); } - virtual void ConnectSuccess() { + virtual void ConnectSuccess() + { LOG_MSG("Successfully connected to database."); } - virtual void ConnectFailed(string error) { + virtual void ConnectFailed(string error) + { LOG_ERROR("DB connect error: " << error); } - virtual void QueryError(string error) { + virtual void QueryError(string error) + { LOG_ERROR("DB query error: " << error); } - virtual void PlayerLoginSuccess(unsigned requestId, boost::shared_ptr dbPlayerData) { + virtual void PlayerLoginSuccess(unsigned requestId, boost::shared_ptr dbPlayerData) + { m_server.UserValid(requestId, *dbPlayerData); } - virtual void PlayerLoginFailed(unsigned requestId) { + virtual void PlayerLoginFailed(unsigned requestId) + { m_server.UserInvalid(requestId); } - virtual void PlayerLoginBlocked(unsigned requestId) { + virtual void PlayerLoginBlocked(unsigned requestId) + { m_server.UserBlocked(requestId); } - virtual void AvatarIsBlacklisted(unsigned requestId) { + virtual void AvatarIsBlacklisted(unsigned requestId) + { m_server.AvatarBlacklisted(requestId); } - virtual void AvatarIsOK(unsigned requestId) { + virtual void AvatarIsOK(unsigned requestId) + { m_server.AvatarOK(requestId); } - virtual void CreateGameSuccess(unsigned /*requestId*/) { + virtual void CreateGameSuccess(unsigned /*requestId*/) + { // Nothing to do. } - virtual void CreateGameFailed(unsigned requestId) { + virtual void CreateGameFailed(unsigned requestId) + { // TODO maybe handle request id. LOG_ERROR("DB create game failed for request " << requestId); } - virtual void ReportAvatarSuccess(unsigned requestId, unsigned replyId) { + virtual void ReportAvatarSuccess(unsigned requestId, unsigned replyId) + { m_server.SendReportAvatarResult(requestId, replyId, true); } - virtual void ReportAvatarFailed(unsigned requestId, unsigned replyId) { + virtual void ReportAvatarFailed(unsigned requestId, unsigned replyId) + { m_server.SendReportAvatarResult(requestId, replyId, false); } - virtual void ReportGameSuccess(unsigned requestId, unsigned replyId) { + virtual void ReportGameSuccess(unsigned requestId, unsigned replyId) + { m_server.SendReportGameResult(requestId, replyId, true); } - virtual void ReportGameFailed(unsigned requestId, unsigned replyId) { + virtual void ReportGameFailed(unsigned requestId, unsigned replyId) + { m_server.SendReportGameResult(requestId, replyId, false); } - virtual void PlayerAdminList(unsigned /*requestId*/, std::list adminList) { + virtual void PlayerAdminList(unsigned /*requestId*/, std::list adminList) + { m_server.GetBanManager().SetAdminPlayerIds(adminList); } - virtual void BlockPlayerSuccess(unsigned requestId, unsigned replyId) { + virtual void BlockPlayerSuccess(unsigned requestId, unsigned replyId) + { m_server.SendAdminBanPlayerResult(requestId, replyId, true); } - virtual void BlockPlayerFailed(unsigned requestId, unsigned replyId) { + virtual void BlockPlayerFailed(unsigned requestId, unsigned replyId) + { m_server.SendAdminBanPlayerResult(requestId, replyId, false); } @@ -975,9 +1001,8 @@ ServerLobbyThread::HandlePacket(boost::shared_ptr session, boost::s HandleNetPacketRetrievePlayerInfo(session, packet->GetMsg()->playerinforequestmessage()); else if (packet->GetMsg()->messagetype() == PokerTHMessage::Type_AvatarRequestMessage) HandleNetPacketRetrieveAvatar(session, packet->GetMsg()->avatarrequestmessage()); - else if (packet->GetMsg()->messagetype() == PokerTHMessage::Type_ResetTimeoutMessage) - {} - else if (packet->GetMsg()->messagetype() == PokerTHMessage::Type_SubscriptionRequestMessage) { + else if (packet->GetMsg()->messagetype() == PokerTHMessage::Type_ResetTimeoutMessage) { + } else if (packet->GetMsg()->messagetype() == PokerTHMessage::Type_SubscriptionRequestMessage) { const SubscriptionRequestMessage &subscriptionRequest = packet->GetMsg()->subscriptionrequestmessage(); if (subscriptionRequest.subscriptionaction() == SubscriptionRequestMessage::resubscribeGameList) InternalResubscribeMsg(session); @@ -1068,7 +1093,7 @@ ServerLobbyThread::HandleNetPacketInit(boost::shared_ptr session, c // check if a guest session in lobby with same ip is already connected and // if number of lobby guests >= SERVER_MAX_GUEST_USERS_LOBBY if(m_serverConfig.readConfigInt("ServerRestrictGuestLogin") != 0 - && !m_sessionManager.IsGuestAllowedToConnect(session->GetClientAddr())) { + && !m_sessionManager.IsGuestAllowedToConnect(session->GetClientAddr())) { SessionError(session, ERR_NET_SERVER_FULL); return; } @@ -1706,8 +1731,7 @@ ServerLobbyThread::EstablishSession(boost::shared_ptr session) if (session->GetWebData()) { SessionError(session, ERR_NET_PLAYER_NAME_IN_USE); return; - } - else { + } else { // If this is not a websocket connection, disconnect the already connected player. InternalRemovePlayer(previousPlayerId, ERR_NET_PLAYER_NAME_IN_USE); } diff --git a/src/net/common/sessiondata.cpp b/src/net/common/sessiondata.cpp index 3ffb0fca5..549f79cad 100644 --- a/src/net/common/sessiondata.cpp +++ b/src/net/common/sessiondata.cpp @@ -321,7 +321,7 @@ SessionData::CloseWebSocketHandle() #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L) // c++11 std::error_code std_ec; m_webData->webSocketServer->close(m_webData->webHandle, websocketpp::close::status::normal, "PokerTH server closed the connection.", std_ec); -#else +#else boost::system::error_code ec; m_webData->webSocketServer->close(m_webData->webHandle, websocketpp::close::status::normal, "PokerTH server closed the connection.", ec); #endif diff --git a/src/net/common/websendbuffer.cpp b/src/net/common/websendbuffer.cpp index 7e42e1dcb..5b9b9e56f 100644 --- a/src/net/common/websendbuffer.cpp +++ b/src/net/common/websendbuffer.cpp @@ -61,7 +61,7 @@ WebSendBuffer::AsyncSendNextPacket(boost::shared_ptr session) #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103L) std::error_code std_ec; webData->webSocketServer->close(webData->webHandle, websocketpp::close::status::normal, "PokerTH server closed the connection.", std_ec); -#else +#else boost::system::error_code ec; webData->webSocketServer->close(webData->webHandle, websocketpp::close::status::normal, "PokerTH server closed the connection.", ec); #endif @@ -80,7 +80,7 @@ WebSendBuffer::InternalStorePacket(boost::shared_ptr session, boost std::error_code std_ec; webData->webSocketServer->send(webData->webHandle, string((const char *)buf, packetSize), websocketpp::frame::opcode::BINARY, std_ec); if (std_ec) { -#else +#else boost::system::error_code ec; webData->webSocketServer->send(webData->webHandle, string((const char *)buf, packetSize), websocketpp::frame::opcode::BINARY, ec); if (ec) { diff --git a/src/net/netpacket.h b/src/net/netpacket.h index 3a3ea9949..516ab63b2 100644 --- a/src/net/netpacket.h +++ b/src/net/netpacket.h @@ -65,10 +65,12 @@ class NetPacket static boost::shared_ptr Create(const char *data, size_t dataSize); - const PokerTHMessage *GetMsg() const { + const PokerTHMessage *GetMsg() const + { return m_msg; } - PokerTHMessage *GetMsg() { + PokerTHMessage *GetMsg() + { return m_msg; } diff --git a/src/net/serveraccepthelper.h b/src/net/serveraccepthelper.h index 59421f615..19db005ba 100644 --- a/src/net/serveraccepthelper.h +++ b/src/net/serveraccepthelper.h @@ -52,16 +52,19 @@ class ServerAcceptHelper : public ServerAcceptInterface typedef typename P::endpoint P_endpoint; ServerAcceptHelper(ServerCallback &serverCallback, boost::shared_ptr ioService) - : m_ioService(ioService), m_serverCallback(serverCallback) { + : m_ioService(ioService), m_serverCallback(serverCallback) + { m_acceptor.reset(new P_acceptor(*m_ioService)); } - virtual ~ServerAcceptHelper() { + virtual ~ServerAcceptHelper() + { } // Set the parameters. virtual void Listen(unsigned serverPort, bool ipv6, const std::string &/*logDir*/, - boost::shared_ptr lobbyThread) { + boost::shared_ptr lobbyThread) + { m_lobbyThread = lobbyThread; try { @@ -77,14 +80,16 @@ class ServerAcceptHelper : public ServerAcceptInterface } } - virtual void Close() { + virtual void Close() + { boost::system::error_code ec; m_acceptor->close(ec); // Ignore any error, because we are terminating. } protected: - void InternalListen(unsigned serverPort, bool ipv6) { + void InternalListen(unsigned serverPort, bool ipv6) + { if (serverPort < 1024) throw ServerException(__FILE__, __LINE__, ERR_SOCK_INVALID_PORT, 0); @@ -114,7 +119,8 @@ class ServerAcceptHelper : public ServerAcceptInterface } void HandleAccept(boost::shared_ptr acceptedSocket, - const boost::system::error_code &error) { + const boost::system::error_code &error) + { if (!error) { boost::asio::socket_base::non_blocking_io command(true); acceptedSocket->io_control(command); @@ -136,11 +142,13 @@ class ServerAcceptHelper : public ServerAcceptInterface } } - ServerCallback &GetCallback() { + ServerCallback &GetCallback() + { return m_serverCallback; } - ServerLobbyThread &GetLobbyThread() { + ServerLobbyThread &GetLobbyThread() + { return *m_lobbyThread; } diff --git a/src/net/servermanager.h b/src/net/servermanager.h index 600bc3666..1d2355e9e 100644 --- a/src/net/servermanager.h +++ b/src/net/servermanager.h @@ -67,10 +67,12 @@ class ServerManager typedef std::list > AcceptHelperList; ServerLobbyThread &GetLobbyThread(); - ConfigFile &GetConfig() { + ConfigFile &GetConfig() + { return m_playerConfig; } - GuiInterface &GetGui() { + GuiInterface &GetGui() + { return m_gui; } boost::shared_ptr m_ioService; diff --git a/src/net/sessiondata.h b/src/net/sessiondata.h index d9b502ac7..8521e00fb 100644 --- a/src/net/sessiondata.h +++ b/src/net/sessiondata.h @@ -96,19 +96,23 @@ class SessionData : public boost::enable_shared_from_this const std::string &GetClientAddr() const; void SetClientAddr(const std::string &addr); - ReceiveBuffer &GetReceiveBuffer() { + ReceiveBuffer &GetReceiveBuffer() + { return *m_receiveBuffer; } - SendBuffer &GetSendBuffer() { + SendBuffer &GetSendBuffer() + { return *m_sendBuffer; } - void Close() { + void Close() + { m_callback.CloseSession(shared_from_this()); } void CloseSocketHandle(); void CloseWebSocketHandle(); - void HandlePacket(boost::shared_ptr packet) { + void HandlePacket(boost::shared_ptr packet) + { m_callback.HandlePacket(shared_from_this(), packet); } diff --git a/src/session.h b/src/session.h index cdf6a4124..0b410b0d9 100755 --- a/src/session.h +++ b/src/session.h @@ -73,7 +73,8 @@ class Session boost::shared_ptr getCurrentGame(); GuiInterface *getGui(); - Log* getMyLog() { + Log* getMyLog() + { return myLog; } GameType getGameType();