mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Fix exceptions from netchannel disconnecting during handshake.
This commit is contained in:
@@ -66,10 +66,14 @@ namespace Robust.Server.GameStates
|
||||
|
||||
private void HandleClientDisconnect(object? sender, NetChannelArgs e)
|
||||
{
|
||||
_entityManager.DropPlayerState(_playerManager.GetSessionById(e.Channel.SessionId));
|
||||
_ackedStates.Remove(e.Channel.ConnectionId);
|
||||
|
||||
if (_ackedStates.ContainsKey(e.Channel.ConnectionId))
|
||||
_ackedStates.Remove(e.Channel.ConnectionId);
|
||||
if (!_playerManager.TryGetSessionByChannel(e.Channel, out var session))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_entityManager.DropPlayerState(session);
|
||||
}
|
||||
|
||||
private void HandleStateAck(MsgStateAck msg)
|
||||
|
||||
@@ -344,7 +344,10 @@ namespace Robust.Server.Player
|
||||
/// </summary>
|
||||
private void EndSession(object? sender, NetChannelArgs args)
|
||||
{
|
||||
var session = GetSessionByChannel(args.Channel);
|
||||
if (!TryGetSessionByChannel(args.Channel, out var session))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// make sure nothing got messed up during the life of the session
|
||||
DebugTools.Assert(session.ConnectedClient == args.Channel);
|
||||
|
||||
Reference in New Issue
Block a user