(svn r22368) -Codechange: move the IP address field from the ClientInfo to ClientSocket

This commit is contained in:
rubidium
2011-04-22 16:03:48 +00:00
parent 146d532d51
commit 2cae0cd54c
5 changed files with 9 additions and 14 deletions

View File

@@ -1813,7 +1813,7 @@ void NetworkServerDailyLoop()
*/
const char *ServerNetworkGameSocketHandler::GetClientIP()
{
return this->GetInfo()->client_address.GetHostname();
return this->client_address.GetHostname();
}
void NetworkServerShowStatusToConsole()
@@ -1936,11 +1936,11 @@ uint NetworkServerKickOrBanIP(const char *ip, bool ban)
uint n = 0;
/* There can be multiple clients with the same IP, kick them all */
NetworkClientInfo *ci;
FOR_ALL_CLIENT_INFOS(ci) {
if (ci->client_id == CLIENT_ID_SERVER) continue;
if (ci->client_address.IsInNetmask(const_cast<char *>(ip))) {
NetworkServerKickClient(ci->client_id);
NetworkClientSocket *cs;
FOR_ALL_CLIENT_SOCKETS(cs) {
if (cs->client_id == CLIENT_ID_SERVER) continue;
if (cs->client_address.IsInNetmask(const_cast<char *>(ip))) {
NetworkServerKickClient(cs->client_id);
n++;
}
}