Implement chat bot mute on server side (#1).

This commit is contained in:
lotodore committed 2012-01-08 13:02:29 +00:00
1 parent c3dc99620e
commit 03a1a1dc55
13 files changed
+108 -28

No files matched your search

+11 -1
View File
@@ -849,7 +849,7 @@ LocalPlayer::LocalPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType ty
: PlayerInterface(), myConfig(c), currentHand(0), myID(id), myUniqueID(uniqueId), myType(type), myName(name), myAvatar(avatar),
myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), logHoleCardsDone(false), myCash(sC), mySet(0), myLastRelativeSet(0), myAction(PLAYER_ACTION_NONE),
myButton(mB), myActiveStatus(aS), myStayOnTableStatus(sotS), myTurn(0), myCardsFlip(0), myRoundStartCash(0), lastMoneyWon(0),
sBluff(0), sBluffStatus(false), m_actionTimeoutCounter(0), m_isSessionActive(false), m_isKicked(false)
sBluff(0), sBluffStatus(false), m_actionTimeoutCounter(0), m_isSessionActive(false), m_isKicked(false), m_isMuted(false)
{
// !!!!!!!!!!!!!!!!!!!!!!!! testing !!!!!!!!!!!!!!!!!!!!!!!!
@@ -5114,6 +5114,16 @@ bool LocalPlayer::isKicked() const
return m_isKicked;
}
void LocalPlayer::setIsMuted(bool muted)
{
m_isMuted = muted;
}
bool LocalPlayer::isMuted() const
{
return m_isMuted;
}
bool LocalPlayer::checkIfINeedToShowCards()
{
std::list<unsigned> playerNeedToShowCardsList = currentHand->getBoard()->getPlayerNeedToShowCards();
+3
View File
@@ -284,6 +284,8 @@ public:
bool isSessionActive() const;
void setIsKicked(bool kicked);
bool isKicked() const;
void setIsMuted(bool muted);
bool isMuted() const;
bool checkIfINeedToShowCards();
@@ -335,6 +337,7 @@ private:
unsigned m_actionTimeoutCounter;
bool m_isSessionActive;
bool m_isKicked;
bool m_isMuted;
boost::timers::portable::microsec_timer m_lastRemoteActionTimer;
};
+15 -1
View File
@@ -26,7 +26,7 @@ ClientPlayer::ClientPlayer(ConfigFile *c, int id, unsigned uniqueId, PlayerType
: PlayerInterface(), myConfig(c), currentHand(0), myID(id), myUniqueID(uniqueId), myType(type),
myName(name), myAvatar(avatar), myDude(0), myDude4(0), myCardsValueInt(0), myOdds(-1.0), logHoleCardsDone(false), myCash(sC), mySet(0), myLastRelativeSet(0),
myAction(PLAYER_ACTION_NONE), myButton(mB), myActiveStatus(aS), myStayOnTableStatus(sotS), myTurn(false), myCardsFlip(false), myRoundStartCash(0),
lastMoneyWon(0), sBluff(0), sBluffStatus(false), m_isSessionActive(false), m_isKicked(false)
lastMoneyWon(0), sBluff(0), sBluffStatus(false), m_isSessionActive(false), m_isKicked(false), m_isMuted(false)
{
myBestHandPosition[0] = myBestHandPosition[1] = myBestHandPosition[2] = myBestHandPosition[3] = myBestHandPosition[4] = 0;
myNiveau[0] = myNiveau[1] = myNiveau[2] = 0;
@@ -563,6 +563,20 @@ ClientPlayer::isKicked() const
return m_isKicked;
}
void
ClientPlayer::setIsMuted(bool muted)
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
m_isMuted = muted;
}
bool
ClientPlayer::isMuted() const
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
return m_isMuted;
}
bool ClientPlayer::checkIfINeedToShowCards()
{
boost::recursive_mutex::scoped_lock lock(m_syncMutex);
+3
View File
@@ -137,6 +137,8 @@ public:
bool isSessionActive() const;
void setIsKicked(bool kicked);
bool isKicked() const;
void setIsMuted(bool muted);
bool isMuted() const;
bool checkIfINeedToShowCards();
@@ -190,6 +192,7 @@ private:
bool m_isSessionActive;
bool m_isKicked;
bool m_isMuted;
};
#endif
+2
View File
@@ -122,6 +122,8 @@ public:
virtual bool isSessionActive() const=0;
virtual void setIsKicked(bool kicked) =0;
virtual bool isKicked() const=0;
virtual void setIsMuted(bool muted) =0;
virtual bool isMuted() const=0;
virtual bool checkIfINeedToShowCards() =0;