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

This commit is contained in:
lotodore
2012-01-08 13:02:29 +00:00
parent c3dc99620e
commit 03a1a1dc55
13 changed files with 108 additions and 28 deletions
+21
View File
@@ -102,6 +102,17 @@ ServerGame::RemovePlayer(unsigned playerId, unsigned errorCode)
SessionError(tmpSession, errorCode);
}
void
ServerGame::MutePlayer(unsigned playerId, bool mute)
{
if (m_game) {
boost::shared_ptr<PlayerInterface> tmpPlayer(m_game->getPlayerByUniqueId(playerId));
if (tmpPlayer) {
tmpPlayer->setIsMuted(mute);
}
}
}
void
ServerGame::MarkPlayerAsInactive(unsigned playerId)
{
@@ -612,6 +623,16 @@ ServerGame::GetPlayerInterfaceFromGame(const std::string &playerName)
return tmpPlayer;
}
boost::shared_ptr<PlayerInterface>
ServerGame::GetPlayerInterfaceFromGame(unsigned playerId)
{
boost::shared_ptr<PlayerInterface> tmpPlayer;
if (m_game) {
tmpPlayer = m_game->getPlayerByUniqueId(playerId);
}
return tmpPlayer;
}
bool
ServerGame::IsRunning() const
{