Skip to content

Commit

Permalink
Merge pull request #336 from albmed/stable
Browse files Browse the repository at this point in the history
Stable
  • Loading branch information
q4z1 committed Aug 16, 2017
2 parents 17ec002 + b3c81c7 commit 2ca2e94
Show file tree
Hide file tree
Showing 92 changed files with 903 additions and 488 deletions.
10 changes: 10 additions & 0 deletions 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)
Expand Down
4 changes: 4 additions & 0 deletions pokerth_protocol.pro
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/chatcleaner/badwordcheck.h
Expand Up @@ -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;
}

Expand Down
3 changes: 2 additions & 1 deletion src/chatcleaner/capsfloodcheck.h
Expand Up @@ -39,7 +39,8 @@ class CapsFloodCheck: public QObject
public:
CapsFloodCheck();

void setCapsNumberToTrigger(int n) {
void setCapsNumberToTrigger(int n)
{
capsNumberToTrigger = n;
}
bool run(QString);
Expand Down
3 changes: 2 additions & 1 deletion src/chatcleaner/cleanerconfig.h
Expand Up @@ -46,7 +46,8 @@ class CleanerConfig

~CleanerConfig();

std::string getConfigFileName() const {
std::string getConfigFileName() const
{
return configFileName;
}

Expand Down
3 changes: 2 additions & 1 deletion src/chatcleaner/letterrepeatingcheck.h
Expand Up @@ -39,7 +39,8 @@ class LetterRepeatingCheck: public QObject
public:
LetterRepeatingCheck();

void setLetterNumberToTrigger(int n) {
void setLetterNumberToTrigger(int n)
{
letterNumberToTrigger = n;
}
bool run(QString);
Expand Down
3 changes: 2 additions & 1 deletion src/chatcleaner/textfloodcheck.h
Expand Up @@ -45,7 +45,8 @@ class TextFloodCheck: public QObject
TextFloodCheck();
~TextFloodCheck();

void setTextFloodLevelToTrigger(int level) {
void setTextFloodLevelToTrigger(int level)
{
textFloodLevelToTrigger = level;
}

Expand Down
6 changes: 4 additions & 2 deletions src/chatcleaner/urlcheck.h
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion src/core/common/thread.cpp
Expand Up @@ -38,7 +38,8 @@ class ThreadStarter
{
public:
ThreadStarter(Thread &thread) : m_thread(thread) {}
void operator()() {
void operator()()
{
m_thread.MainWrapper();
}

Expand Down
6 changes: 4 additions & 2 deletions src/core/pokerthexception.h
Expand Up @@ -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;
}

Expand Down
8 changes: 4 additions & 4 deletions src/dbofficial/serverdbthread.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/engine/boardinterface.h
Expand Up @@ -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<unsigned> getWinners() const =0;
Expand Down
2 changes: 1 addition & 1 deletion src/engine/enginefactory.h
Expand Up @@ -45,7 +45,7 @@ class EngineFactory
virtual ~EngineFactory();

virtual boost::shared_ptr<HandInterface> createHand(boost::shared_ptr<EngineFactory> f, GuiInterface *g, boost::shared_ptr<BoardInterface> b, Log *l, PlayerList sl, PlayerList apl, PlayerList rpl, int id, int sP, int dP, int sB,int sC) =0;
virtual boost::shared_ptr<BoardInterface> createBoard() =0;
virtual boost::shared_ptr<BoardInterface> createBoard() =0;
virtual boost::shared_ptr<PlayerInterface> 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<boost::shared_ptr<BeRoInterface> > createBeRo(HandInterface *hi, unsigned dP, int sB) =0;
};
Expand Down
2 changes: 1 addition & 1 deletion src/engine/game.cpp
Expand Up @@ -77,7 +77,7 @@ Game::Game(GuiInterface* gui, boost::shared_ptr<EngineFactory> 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<boost::shared_ptr<PlayerInterface> >);
Expand Down
48 changes: 32 additions & 16 deletions src/engine/game.h
Expand Up @@ -63,60 +63,76 @@ class Game
boost::shared_ptr<HandInterface> getCurrentHand();
const boost::shared_ptr<HandInterface> 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;
}
Expand Down
12 changes: 6 additions & 6 deletions src/engine/local_engine/cardsvalue.cpp
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -1161,8 +1161,8 @@ std::string CardsValue::determineHandName(int myCardsValueInt, PlayerList active
}
}
break;
default:
{}
default: {
}
}

return handName;
Expand Down Expand Up @@ -1191,11 +1191,11 @@ std::list<std::string> 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) {
Expand Down
2 changes: 1 addition & 1 deletion src/engine/local_engine/localbero.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit 2ca2e94

Please sign in to comment.