diff --git a/Content.Server/_Sunrise/CryoTeleport/CryoTeleportSystem.cs b/Content.Server/_Sunrise/CryoTeleport/CryoTeleportSystem.cs index 626d264770a..1c89ae13368 100644 --- a/Content.Server/_Sunrise/CryoTeleport/CryoTeleportSystem.cs +++ b/Content.Server/_Sunrise/CryoTeleport/CryoTeleportSystem.cs @@ -4,12 +4,14 @@ using Content.Server.Mind; using Content.Server.Station.Components; using Content.Server.Station.Systems; +using Content.Shared._Sunrise.SunriseCCVars; using Content.Shared.Bed.Cryostorage; using Content.Shared.Mobs; using Content.Shared.Mobs.Components; using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.Audio.Systems; +using Robust.Shared.Configuration; using Robust.Shared.Enums; using Robust.Shared.Player; using Robust.Shared.Timing; @@ -28,6 +30,7 @@ public sealed class CryoTeleportSystem : EntitySystem [Dependency] private readonly StationSystem _stationSystem = default!; [Dependency] private readonly TransformSystem _transformSystem = default!; [Dependency] private readonly IPlayerManager _playerMan = default!; + [Dependency] private readonly IConfigurationManager _configurationManager = default!; public TimeSpan NextTick = TimeSpan.Zero; public TimeSpan RefreshCooldown = TimeSpan.FromSeconds(5); @@ -44,6 +47,9 @@ public override void Update(float delay) NextTick += RefreshCooldown; + if (!_configurationManager.GetCVar(SunriseCCVars.EnableCryoteleport)) + return; + var query = AllEntityQuery(); while (query.MoveNext(out var uid, out var comp, out var mobStateComponent)) { @@ -92,6 +98,9 @@ public override void Update(float delay) private void OnCompleteSpawn(PlayerSpawnCompleteEvent ev) { + if (!_configurationManager.GetCVar(SunriseCCVars.EnableCryoteleport)) + return; + if (!TryComp(ev.Station, out var cryoTeleportComponent)) return; if (ev.JobId == null) @@ -107,6 +116,9 @@ private void OnCompleteSpawn(PlayerSpawnCompleteEvent ev) private void OnSessionStatus(object? sender, SessionStatusEventArgs args) { + if (!_configurationManager.GetCVar(SunriseCCVars.EnableCryoteleport)) + return; + if (!TryComp(args.Session.AttachedEntity, out var comp)) return; diff --git a/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs b/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs index 4f9b75382e1..ee2ecba2c52 100644 --- a/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs +++ b/Content.Shared/_Sunrise/SunriseCCVars/SunriseCCVars.cs @@ -203,4 +203,10 @@ public static readonly CVarDef public static readonly CVarDef LobbyChangelogs = CVarDef.Create("lobby_changelog.id", "ChangelogSunrise.yml,Changelog.yml", CVar.SERVER | CVar.REPLICATED); + /* + * Cryoteleport + */ + + public static readonly CVarDef EnableCryoteleport = + CVarDef.Create("station.enablecryoteleport", false, CVar.SERVERONLY); }