Adding ban functions to irc bot.

This commit is contained in:
lotodore
2009-04-07 22:09:52 +00:00
parent e59e50c10b
commit b1b9215874
+16
View File
@@ -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();