mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-19 22:50:19 +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);
|
std::unique_lock Lock(mDisconnectMtx);
|
||||||
beammp_debugf("Disconnecting client {} for reason: {}", GetID(), Reason);
|
beammp_debugf("Disconnecting client {} for reason: {}", GetID(), Reason);
|
||||||
if (mSocket.is_open()) {
|
if (mSocket.is_open()) {
|
||||||
beammp_debug("Somehow Disconnect() was called twice, ignoring");
|
beammp_debugf("Socket for client {} already closed", GetID());
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
boost::system::error_code ec;
|
boost::system::error_code ec;
|
||||||
mSocket.shutdown(socket_base::shutdown_both, ec);
|
mSocket.shutdown(socket_base::shutdown_both, ec);
|
||||||
|
|||||||
Reference in New Issue
Block a user