From 29304a771464f56889c25c8f2ffe66c67c8f30e2 Mon Sep 17 00:00:00 2001 From: Pieter-Jan Briers Date: Wed, 8 May 2019 16:42:36 +0200 Subject: [PATCH] Handle existing players on restartround correctly. --- Content.Server/GameTicking/GameTicker.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index 4830150745..5b98912752 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -142,6 +142,8 @@ namespace Content.Server.GameTicking { _roundStartTimeUtc = DateTime.UtcNow + TimeSpan.FromSeconds(LobbyDuration); } + + _sendStatusToAll(); } } @@ -158,7 +160,7 @@ namespace Content.Server.GameTicking foreach (var (playerSession, ready) in _playersInLobby.ToList()) { - if (!ready) + if (LobbyEnabled && !ready) { continue; } @@ -325,6 +327,17 @@ namespace Content.Server.GameTicking } _gameRules.Clear(); + + // Move everybody currently in the server to lobby. + foreach (var player in _playerManager.GetAllPlayers()) + { + if (_playersInLobby.ContainsKey(player)) + { + continue; + } + + _playerJoinLobby(player); + } } private void _preRoundSetup() @@ -369,7 +382,6 @@ namespace Content.Server.GameTicking case SessionStatus.InGame: { - //TODO: Check for existing mob and re-attach var data = session.ContentData(); if (data.Mind == null) {