AFK players are now kicked from ranking games after some timeouts if they do not enable autocheck/fold.
This commit is contained in:
@@ -850,7 +850,7 @@ static const RoundData FlopValues[] =
|
||||
#define NUM_FLOP_VALUES (sizeof(FlopValues)/sizeof(RoundData))
|
||||
|
||||
LocalPlayer::LocalPlayer(ConfigFile *c, BoardInterface *b, int id, unsigned uniqueId, PlayerType type, std::string name, std::string avatar, int sC, bool aS, int mB)
|
||||
: PlayerInterface(), myConfig(c), currentHand(0), currentBoard(b), myCardsValue(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(0), myButton(mB), myActiveStatus(aS), myStayOnTableStatus(1), myTurn(0), myRoundStartCash(0), lastMoneyWon(0), sBluff(0), sBluffStatus(0)
|
||||
: PlayerInterface(), myConfig(c), currentHand(0), currentBoard(b), myCardsValue(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(0), myButton(mB), myActiveStatus(aS), myStayOnTableStatus(1), myTurn(0), myRoundStartCash(0), lastMoneyWon(0), sBluff(0), sBluffStatus(0), m_actionTimeoutCounter(0)
|
||||
{
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!! testing !!!!!!!!!!!!!!!!!!!!!!!!
|
||||
@@ -4911,6 +4911,24 @@ boost::shared_ptr<SessionData> LocalPlayer::getNetSessionData()
|
||||
return myNetSessionData;
|
||||
}
|
||||
|
||||
unsigned
|
||||
LocalPlayer::getActionTimeoutCounter() const
|
||||
{
|
||||
return m_actionTimeoutCounter;
|
||||
}
|
||||
|
||||
void
|
||||
LocalPlayer::incrementActionTimeoutCounter()
|
||||
{
|
||||
m_actionTimeoutCounter++;
|
||||
}
|
||||
|
||||
void
|
||||
LocalPlayer::resetActionTimeoutCounter()
|
||||
{
|
||||
m_actionTimeoutCounter = 0;
|
||||
}
|
||||
|
||||
bool LocalPlayer::checkIfINeedToShowCards()
|
||||
{
|
||||
std::list<unsigned> playerNeedToShowCardsList = currentBoard->getPlayerNeedToShowCards();
|
||||
|
||||
@@ -179,8 +179,11 @@ public:
|
||||
void setNetSessionData(boost::shared_ptr<SessionData> session);
|
||||
boost::shared_ptr<SessionData> getNetSessionData();
|
||||
|
||||
bool checkIfINeedToShowCards();
|
||||
|
||||
unsigned getActionTimeoutCounter() const;
|
||||
void incrementActionTimeoutCounter();
|
||||
void resetActionTimeoutCounter();
|
||||
|
||||
bool checkIfINeedToShowCards();
|
||||
|
||||
private:
|
||||
|
||||
@@ -227,6 +230,7 @@ private:
|
||||
|
||||
bool myWinnerState;
|
||||
|
||||
unsigned m_actionTimeoutCounter;
|
||||
boost::shared_ptr<SessionData> myNetSessionData;
|
||||
};
|
||||
|
||||
|
||||
@@ -71,8 +71,8 @@ public:
|
||||
void setMyActiveStatus(bool theValue);
|
||||
bool getMyActiveStatus() const;
|
||||
|
||||
void setMyStayOnTableStatus(bool theValue);
|
||||
bool getMyStayOnTableStatus() const;
|
||||
void setMyStayOnTableStatus(bool theValue);
|
||||
bool getMyStayOnTableStatus() const;
|
||||
|
||||
void setMyCards(int* theValue);
|
||||
void getMyCards(int* theValue) const;
|
||||
@@ -134,6 +134,13 @@ public:
|
||||
void setNetSessionData(boost::shared_ptr<SessionData> session);
|
||||
boost::shared_ptr<SessionData> getNetSessionData();
|
||||
|
||||
// unused as client
|
||||
unsigned getActionTimeoutCounter() const {return 0;}
|
||||
void incrementActionTimeoutCounter() {}
|
||||
void resetActionTimeoutCounter() {}
|
||||
|
||||
bool checkIfINeedToShowCards();
|
||||
|
||||
private:
|
||||
mutable boost::recursive_mutex m_syncMutex;
|
||||
|
||||
@@ -181,8 +188,6 @@ private:
|
||||
bool myWinnerState;
|
||||
|
||||
boost::shared_ptr<SessionData> myNetSessionData;
|
||||
|
||||
bool checkIfINeedToShowCards();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -116,7 +116,11 @@ public:
|
||||
virtual void setNetSessionData(boost::shared_ptr<SessionData> session) =0;
|
||||
virtual boost::shared_ptr<SessionData> getNetSessionData() =0;
|
||||
|
||||
virtual bool checkIfINeedToShowCards() =0;
|
||||
virtual unsigned getActionTimeoutCounter() const =0;
|
||||
virtual void incrementActionTimeoutCounter() =0;
|
||||
virtual void resetActionTimeoutCounter() =0;
|
||||
|
||||
virtual bool checkIfINeedToShowCards() =0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user