From 845ef758b3fff4b3605d7faa02783f394fbe2216 Mon Sep 17 00:00:00 2001 From: wrexbe <81056464+wrexbe@users.noreply.github.com> Date: Mon, 15 Aug 2022 17:09:35 -0700 Subject: [PATCH] Keep player status on disconnect (#10624) --- Content.IntegrationTests/Tests/Lobby/ServerReloginTest.cs | 6 ++++++ Content.Server/GameTicking/GameTicker.Player.cs | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 Content.IntegrationTests/Tests/Lobby/ServerReloginTest.cs diff --git a/Content.IntegrationTests/Tests/Lobby/ServerReloginTest.cs b/Content.IntegrationTests/Tests/Lobby/ServerReloginTest.cs new file mode 100644 index 0000000000..45bc012f3f --- /dev/null +++ b/Content.IntegrationTests/Tests/Lobby/ServerReloginTest.cs @@ -0,0 +1,6 @@ +namespace Content.IntegrationTests.Tests.Lobby; + +public class ServerReloginTest +{ + +} diff --git a/Content.Server/GameTicking/GameTicker.Player.cs b/Content.Server/GameTicking/GameTicker.Player.cs index aa07f70cc0..50a93009d0 100644 --- a/Content.Server/GameTicking/GameTicker.Player.cs +++ b/Content.Server/GameTicking/GameTicker.Player.cs @@ -86,8 +86,6 @@ namespace Content.Server.GameTicking case SessionStatus.Disconnected: { - _playerGameStatuses.Remove(session.UserId); - _chatManager.SendAdminAnnouncement(Loc.GetString("player-leave-message", ("name", args.Session.Name))); _userDb.ClientDisconnected(session); @@ -121,9 +119,6 @@ namespace Content.Server.GameTicking { _chatManager.DispatchServerMessage(session, Loc.GetString("game-ticker-player-join-game-message")); - if (!_playerGameStatuses.ContainsKey(session.UserId)) - _playerGameStatuses.Remove(session.UserId); - _playerGameStatuses[session.UserId] = PlayerGameStatus.JoinedGame; RaiseNetworkEvent(new TickerJoinGameEvent(), session.ConnectedClient);