(svn r22365) -Codechange: add overload of NetworkServerKickOrBanIP using the ClientID, which later resolves the IP address to ban. This to consolidate the knowledge about resolving IP addresses

This commit is contained in:
rubidium
2011-04-22 15:59:32 +00:00
parent 074644a3f0
commit c4af57ad3b
4 changed files with 11 additions and 4 deletions

View File

@@ -75,6 +75,7 @@ void NetworkServerSendRcon(ClientID client_id, TextColour colour_code, const cha
void NetworkServerSendChat(NetworkAction action, DestType type, int dest, const char *msg, ClientID from_id, int64 data = 0, bool from_admin = false);
void NetworkServerKickClient(ClientID client_id);
uint NetworkServerKickOrBanIP(ClientID client_id, bool ban);
uint NetworkServerKickOrBanIP(const char *ip, bool ban);
void NetworkInitChatMessage();

View File

@@ -1717,7 +1717,7 @@ static void ClientList_Kick(const NetworkClientInfo *ci)
static void ClientList_Ban(const NetworkClientInfo *ci)
{
NetworkServerKickOrBanIP(GetClientIP(const_cast<NetworkClientInfo *>(ci)), true);
NetworkServerKickOrBanIP(ci->client_id, true);
}
static void ClientList_GiveMoney(const NetworkClientInfo *ci)

View File

@@ -1919,6 +1919,11 @@ void NetworkServerKickClient(ClientID client_id)
NetworkServerSendError(client_id, NETWORK_ERROR_KICKED);
}
uint NetworkServerKickOrBanIP(ClientID client_id, bool ban)
{
return NetworkServerKickOrBanIP(GetClientIP(NetworkClientInfo::GetByClientID(client_id)), ban);
}
uint NetworkServerKickOrBanIP(const char *ip, bool ban)
{
/* Add address to ban-list */