disable observer respawn metatrolling (#3044)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas 2025-02-25 10:06:17 +00:00 committed by GitHub
parent 63bd3662e8
commit 8bc6f7ce14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 0 deletions

View File

@ -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

View File

@ -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;

View File

@ -66,6 +66,15 @@ public sealed class RespawnSystem : EntitySystem
SetRespawnTime(session.UserId, ref respawnData, _timing.CurTime + TimeSpan.FromSeconds(_respawnTime));
}
/// <summary>
/// DeltaV: Sets the respawn time for a player to the full death cooldown.
/// </summary>
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)