diff options
author | rubidium42 <rubidium@openttd.org> | 2021-06-13 21:05:15 +0200 |
---|---|---|
committer | rubidium42 <rubidium42@users.noreply.github.com> | 2021-06-15 06:13:00 +0200 |
commit | 667301e3ecc39ecd6bce286fafe25247d774642f (patch) | |
tree | 1ce0a0f24272e5ac8ff7cf0ce58b4d0c07e18034 /src/network/network_server.cpp | |
parent | a91e29b656d91b1f1c6a906ee8e81ddd716723aa (diff) | |
download | openttd-667301e3ecc39ecd6bce286fafe25247d774642f.tar.xz |
Codechange: [Network] Make hostname/client IP return strings instead of a C-string
Diffstat (limited to 'src/network/network_server.cpp')
-rw-r--r-- | src/network/network_server.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/network_server.cpp b/src/network/network_server.cpp index 81d4500a2..9868c905e 100644 --- a/src/network/network_server.cpp +++ b/src/network/network_server.cpp @@ -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++; } |