From eff25810c5db125509bcde0bca2ed3eeaf42a280 Mon Sep 17 00:00:00 2001 From: Simon <63975668+Simyon264@users.noreply.github.com> Date: Tue, 18 Feb 2025 11:26:08 +0100 Subject: [PATCH] [ChangeCVarCommand] Mapping Command (#35239) [ChangeCVarCommand] MappingCommand --- Content.Server/Mapping/MappingCommand.cs | 4 ++-- Content.Shared/CCVar/CCVars.Events.cs | 5 ++++- Content.Shared/CCVar/CCVars.Shuttle.cs | 5 ++++- Resources/Locale/en-US/cvar/cvar-help.ftl | 6 ++++++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/Content.Server/Mapping/MappingCommand.cs b/Content.Server/Mapping/MappingCommand.cs index b85b0953dd..85c561b9db 100644 --- a/Content.Server/Mapping/MappingCommand.cs +++ b/Content.Server/Mapping/MappingCommand.cs @@ -117,8 +117,8 @@ namespace Content.Server.Mapping } // don't interrupt mapping with events or auto-shuttle - shell.ExecuteCommand("sudo cvar events.enabled false"); - shell.ExecuteCommand("sudo cvar shuttle.auto_call_time 0"); + shell.ExecuteCommand("changecvar events.enabled false"); + shell.ExecuteCommand("changecvar shuttle.auto_call_time 0"); if (_cfg.GetCVar(CCVars.AutosaveEnabled)) shell.ExecuteCommand($"toggleautosave {mapId} {toLoad ?? "NEWMAP"}"); diff --git a/Content.Shared/CCVar/CCVars.Events.cs b/Content.Shared/CCVar/CCVars.Events.cs index 48797b8438..c1be29a023 100644 --- a/Content.Shared/CCVar/CCVars.Events.cs +++ b/Content.Shared/CCVar/CCVars.Events.cs @@ -1,4 +1,6 @@ -using Robust.Shared.Configuration; +using Content.Shared.Administration; +using Content.Shared.CCVar.CVarAccess; +using Robust.Shared.Configuration; namespace Content.Shared.CCVar; @@ -7,6 +9,7 @@ public sealed partial class CCVars /// /// Controls if the game should run station events /// + [CVarControl(AdminFlags.Server | AdminFlags.Mapping)] public static readonly CVarDef EventsEnabled = CVarDef.Create("events.enabled", true, CVar.ARCHIVE | CVar.SERVERONLY); } diff --git a/Content.Shared/CCVar/CCVars.Shuttle.cs b/Content.Shared/CCVar/CCVars.Shuttle.cs index caf7f81b0e..74d3bf8cfb 100644 --- a/Content.Shared/CCVar/CCVars.Shuttle.cs +++ b/Content.Shared/CCVar/CCVars.Shuttle.cs @@ -1,4 +1,6 @@ -using Robust.Shared.Configuration; +using Content.Shared.Administration; +using Content.Shared.CCVar.CVarAccess; +using Robust.Shared.Configuration; namespace Content.Shared.CCVar; @@ -170,6 +172,7 @@ public sealed partial class CCVars /// /// Time in minutes after round start to auto-call the shuttle. Set to zero to disable. /// + [CVarControl(AdminFlags.Server | AdminFlags.Mapping, min: 0, max: int.MaxValue)] public static readonly CVarDef EmergencyShuttleAutoCallTime = CVarDef.Create("shuttle.auto_call_time", 90, CVar.SERVERONLY); diff --git a/Resources/Locale/en-US/cvar/cvar-help.ftl b/Resources/Locale/en-US/cvar/cvar-help.ftl index 39f7c7636b..55b0cb6188 100644 --- a/Resources/Locale/en-US/cvar/cvar-help.ftl +++ b/Resources/Locale/en-US/cvar/cvar-help.ftl @@ -1,6 +1,12 @@ changecvar-simple-debug_test_cvar = Does nothing. changecvar-full-debug_test_cvar = Just a simple testing cvar. Does nothing. +changecvar-simple-events_enabled = Controls if the game should run station events. +changecvar-full-events_enabled = Controls if the game should run station events. + +changecvar-simple-shuttle_auto_call_time = Time after round start to auto-call the shuttle. +changecvar-full-shuttle_auto_call_time = Time in minutes after round start to auto-call the shuttle. Set to zero to disable. + changecvar-simple-playtest_all_damage_modifier = Multiplier for all damage dealt. changecvar-full-playtest_all_damage_modifier = Multiplier for all damage dealt. changecvar-simple-playtest_all_heal_modifier = Multiplier for all healing done.