Compare commits

...

1 Commits

Author SHA1 Message Date
SaltySnail fdc445486c Fix exception being thrown on disconnect
It could happen that the socket is already closed when getting the
address, switched to the cached ip
2026-04-05 14:35:25 +02:00
+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]--;