From 8bc6f7ce14e8fb2b0941ebed89b96159aca750d4 Mon Sep 17 00:00:00 2001 From: deltanedas <39013340+deltanedas@users.noreply.github.com> Date: Tue, 25 Feb 2025 10:06:17 +0000 Subject: [PATCH] disable observer respawn metatrolling (#3044) Co-authored-by: deltanedas <@deltanedas:kde.org> --- Content.Server/GameTicking/GameTicker.Spawning.cs | 1 + Content.Server/GameTicking/GameTicker.cs | 2 ++ Content.Server/_Corvax/Respawn/RespawnSystem.cs | 9 +++++++++ 3 files changed, 12 insertions(+) diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs index f1cac42e3a..7b322707ae 100644 --- a/Content.Server/GameTicking/GameTicker.Spawning.cs +++ b/Content.Server/GameTicking/GameTicker.Spawning.cs @@ -381,6 +381,7 @@ namespace Content.Server.GameTicking _adminLogger.Add(LogType.LateJoin, LogImpact.Low, $"{player.Name} late joined the round as an Observer with {ToPrettyString(ghost):entity}."); + _respawn.SetDeathRespawnTime(player.UserId); // DeltaV - no seeing all the valids then respawning immediately } #region Spawn Points diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index f8ba7e1d7d..9eb132bc79 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -1,3 +1,4 @@ +using Content.Server._Corvax.Respawn; // DeltaV using Content.Server.Administration.Logs; using Content.Server.Administration.Managers; using Content.Server.Chat.Managers; @@ -62,6 +63,7 @@ namespace Content.Server.GameTicking [Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly SharedRoleSystem _roles = default!; [Dependency] private readonly ServerDbEntryManager _dbEntryManager = default!; + [Dependency] private readonly RespawnSystem _respawn = default!; // DeltaV [ViewVariables] private bool _initialized; [ViewVariables] private bool _postInitialized; diff --git a/Content.Server/_Corvax/Respawn/RespawnSystem.cs b/Content.Server/_Corvax/Respawn/RespawnSystem.cs index 19736de2c5..50f982cba5 100644 --- a/Content.Server/_Corvax/Respawn/RespawnSystem.cs +++ b/Content.Server/_Corvax/Respawn/RespawnSystem.cs @@ -66,6 +66,15 @@ public sealed class RespawnSystem : EntitySystem SetRespawnTime(session.UserId, ref respawnData, _timing.CurTime + TimeSpan.FromSeconds(_respawnTime)); } + /// + /// DeltaV: Sets the respawn time for a player to the full death cooldown. + /// + public void SetDeathRespawnTime(NetUserId player) + { + var respawnData = GetRespawnData(player); + SetRespawnTime(player, ref respawnData, _timing.CurTime + TimeSpan.FromSeconds(_respawnTime)); + } + private void OnMindRemoved(EntityUid entity, MindContainerComponent _, MindRemovedMessage e) { if (e.Mind.Comp.UserId is null)