Codechange: [Network] Make hostname/client IP return strings instead of a C-string

This commit is contained in:
rubidium42
2021-06-13 21:05:15 +02:00
committed by rubidium42
parent a91e29b656
commit 667301e3ec
5 changed files with 7 additions and 7 deletions

View File

@@ -1924,7 +1924,7 @@ void NetworkServerDailyLoop()
* Get the IP address/hostname of the connected client.
* @return The IP address.
*/
const char *ServerNetworkGameSocketHandler::GetClientIP()
const std::string &ServerNetworkGameSocketHandler::GetClientIP()
{
return this->client_address.GetHostname();
}
@@ -2094,7 +2094,7 @@ uint NetworkServerKickOrBanIP(const std::string &ip, bool ban, const std::string
for (NetworkClientSocket *cs : NetworkClientSocket::Iterate()) {
if (cs->client_id == CLIENT_ID_SERVER) continue;
if (cs->client_id == _redirect_console_to_client) continue;
if (cs->client_address.IsInNetmask(ip.c_str())) {
if (cs->client_address.IsInNetmask(ip)) {
NetworkServerKickClient(cs->client_id, reason);
n++;
}