diff --git a/Content.Server/GameObjects/EntitySystems/StationEvents/StationEventSystem.cs b/Content.Server/GameObjects/EntitySystems/StationEvents/StationEventSystem.cs index ac1ea379d8..6da998d840 100644 --- a/Content.Server/GameObjects/EntitySystems/StationEvents/StationEventSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/StationEvents/StationEventSystem.cs @@ -4,11 +4,13 @@ using System.Text; using Content.Server.GameTicking; using Content.Server.Interfaces.GameTicking; using Content.Server.StationEvents; +using Content.Shared; using Content.Shared.GameTicking; using JetBrains.Annotations; using Robust.Server.Console; using Robust.Server.Interfaces.Player; using Robust.Shared.GameObjects.Systems; +using Robust.Shared.Interfaces.Configuration; using Robust.Shared.Interfaces.Network; using Robust.Shared.Interfaces.Random; using Robust.Shared.Interfaces.Reflection; @@ -23,6 +25,7 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents // Somewhat based off of TG's implementation of events public sealed class StationEventSystem : EntitySystem, IResettingEntitySystem { + [Dependency] private readonly IConfigurationManager _configurationManager = default!; [Dependency] private readonly IServerNetManager _netManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IGameTicker _gameTicker = default!; @@ -164,6 +167,9 @@ namespace Content.Server.GameObjects.EntitySystems.StationEvents _stationEvents.Add(stationEvent); } + // Can't just check debug / release for a default given mappers need to use release mode + // As such we'll always pause it by default. + _configurationManager.OnValueChanged(CCVars.EventsEnabled, value => Enabled = value, true); _netManager.RegisterNetMessage(nameof(MsgGetStationEvents), GetEventReceived); } diff --git a/Content.Shared/CCVars.cs b/Content.Shared/CCVars.cs index d01c1d9c19..94c17dc378 100644 --- a/Content.Shared/CCVars.cs +++ b/Content.Shared/CCVars.cs @@ -7,6 +7,9 @@ namespace Content.Shared [CVarDefs] public sealed class CCVars : CVars { + public static readonly CVarDef + EventsEnabled = CVarDef.Create("events.enabled", false, CVar.ARCHIVE | CVar.SERVERONLY); + public static readonly CVarDef GameLobbyEnabled = CVarDef.Create("game.lobbyenabled", false, CVar.ARCHIVE);