From b1b921587498963df8639bdd062122718a24f899 Mon Sep 17 00:00:00 2001 From: lotodore Date: Tue, 7 Apr 2009 22:09:52 +0000 Subject: [PATCH] Adding ban functions to irc bot. --- src/net/common/servermanager.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/net/common/servermanager.cpp b/src/net/common/servermanager.cpp index 927b825d..a5d0dddb 100644 --- a/src/net/common/servermanager.cpp +++ b/src/net/common/servermanager.cpp @@ -110,6 +110,22 @@ ServerManager::SignalIrcChatMsg(const std::string &nickName, const std::string & m_ircThread->SendChatMessage(nickName + ": Player \"" + playerName + "\" was not found on the server."); } } + else if (command == "ban") + { + while (msgStream.peek() == ' ') + msgStream.get(); + string playerRegex(msgStream.str().substr(msgStream.tellg())); + if (!playerRegex.empty()) + { + GetLobbyThread().BanPlayerRegex(playerRegex); + m_ircThread->SendChatMessage(nickName + ": The regex \"" + playerRegex + "\" was added to the player ban list."); + } + } + else if (command == "clearban") + { + GetLobbyThread().ClearBanList(); + m_ircThread->SendChatMessage(nickName + ": The player ban list was cleared."); + } else if (command == "stat") { ServerStats tmpStats = GetLobbyThread().GetStats();