mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-03 14:26:09 +00:00
fix "disconnect was called twice" error
this would cause players to stick around after being kicked
This commit is contained in:
@@ -63,8 +63,7 @@ void TClient::Disconnect(std::string_view Reason) {
|
||||
std::unique_lock Lock(mDisconnectMtx);
|
||||
beammp_debugf("Disconnecting client {} for reason: {}", GetID(), Reason);
|
||||
if (mSocket.is_open()) {
|
||||
beammp_debug("Somehow Disconnect() was called twice, ignoring");
|
||||
return;
|
||||
beammp_debugf("Socket for client {} already closed", GetID());
|
||||
}
|
||||
boost::system::error_code ec;
|
||||
mSocket.shutdown(socket_base::shutdown_both, ec);
|
||||
|
||||
Reference in New Issue
Block a user