IP address bans are now time limited and will be removed automatically (minimum duration: 1 hour).

This commit is contained in:
lotodore
2009-06-18 21:32:01 +00:00
parent 9ed8368700
commit 993c2529c3
4 changed files with 52 additions and 14 deletions
+11 -3
View File
@@ -141,11 +141,19 @@ ServerManager::SignalIrcChatMsg(const std::string &nickName, const std::string &
{
while (msgStream.peek() == ' ')
msgStream.get();
string ipAddress(msgStream.str().substr(msgStream.tellg()));
string ipAddress;
unsigned durationHours = 12;
msgStream >> ipAddress;
while (msgStream.peek() == ' ')
msgStream.get();
if (!msgStream.eof())
msgStream >> durationHours;
if (!ipAddress.empty())
{
GetLobbyThread().GetBanManager().BanIPAddress(ipAddress);
m_ircThread->SendChatMessage(nickName + ": The IP address \"" + ipAddress + "\" was added to the IP address ban list.");
ostringstream durationStr;
durationStr << durationHours;
GetLobbyThread().GetBanManager().BanIPAddress(ipAddress, durationHours);
m_ircThread->SendChatMessage(nickName + ": The IP address \"" + ipAddress + "\" was added to the IP address ban list for " + durationStr.str() + (durationHours == 1 ? " hour." : " hours."));
}
}
else if (command == "listban")