Fix exception being thrown on disconnect

It could happen that the socket is already closed when getting the
address, switched to the cached ip
This commit is contained in:
SaltySnail
2026-04-05 14:35:25 +02:00
parent d56d9892c4
commit fdc445486c
+1 -1
View File
@@ -661,7 +661,7 @@ void TNetwork::DisconnectClient(const std::weak_ptr<TClient> &c, const std::stri
void TNetwork::DisconnectClient(TClient &c, const std::string &R)
{
if (c.IsDisconnected()) return;
std::string ClientIP = c.GetTCPSock().remote_endpoint().address().to_string();
std::string ClientIP = c.GetIdentifiers().at("ip");
mClientMapMutex.lock();
if (mClientMap[ClientIP] > 0) {
mClientMap[ClientIP]--;