]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Cleanup remaining `IMapManager.MapExists` uses (#37851)
authorTayrtahn <tayrtahn@gmail.com>
Mon, 26 May 2025 16:45:55 +0000 (12:45 -0400)
committerGitHub <noreply@github.com>
Mon, 26 May 2025 16:45:55 +0000 (18:45 +0200)
Cleanup remaining IMapManager.MapExists uses

Content.Server/Administration/Commands/PersistenceSaveCommand.cs
Content.Server/GameTicking/GameTicker.RoundFlow.cs
Content.Server/Weather/WeatherSystem.cs
Content.Shared/Explosion/Components/ActiveTimerTriggerComponent.cs
Content.Shared/StoreDiscount/Components/StoreDiscountComponent.cs

index cae507f6d8e69d0f698984761ecda16586c0fabf..56ad2be2609d62c5c795c34a354fc530cfd33733 100644 (file)
@@ -9,17 +9,17 @@ using Robust.Shared.Utility;
 namespace Content.Server.Administration.Commands;
 
 [AdminCommand(AdminFlags.Server)]
-public sealed class PersistenceSave : IConsoleCommand
+public sealed class PersistenceSave : LocalizedEntityCommands
 {
     [Dependency] private readonly IConfigurationManager _config = default!;
     [Dependency] private readonly IEntitySystemManager _system = default!;
-    [Dependency] private readonly IMapManager _map = default!;
+    [Dependency] private readonly SharedMapSystem _map = default!;
 
-    public string Command => "persistencesave";
-    public string Description => "Saves server data to a persistence file to be loaded later.";
-    public string Help => "persistencesave [mapId] [filePath - default: game.map (CCVar) ]";
+    public override string Command => "persistencesave";
+    public override string Description => "Saves server data to a persistence file to be loaded later.";
+    public override string Help => "persistencesave [mapId] [filePath - default: game.map (CCVar) ]";
 
-    public void Execute(IConsoleShell shell, string argStr, string[] args)
+    public override void Execute(IConsoleShell shell, string argStr, string[] args)
     {
         if (args.Length < 1 || args.Length > 2)
         {
index 5d5e68441d074c8e00b6215c28cf0b7df8e02fc0..a6809e050e028914f5d627246fad7cf6273eb342 100644 (file)
@@ -90,7 +90,7 @@ namespace Content.Server.GameTicking
         /// </remarks>
         private void LoadMaps()
         {
-            if (_mapManager.MapExists(DefaultMap))
+            if (_map.MapExists(DefaultMap))
                 return;
 
             AddGamePresetRules();
@@ -208,7 +208,7 @@ namespace Content.Server.GameTicking
                 }
 
                 _metaData.SetEntityName(mapUid, proto.MapName);
-                var g = new List<EntityUid> {grid.Value.Owner};
+                var g = new List<EntityUid> { grid.Value.Owner };
                 RaiseLocalEvent(new PostGameMapLoad(proto, mapId, g, stationName));
                 return g;
             }
@@ -258,7 +258,7 @@ namespace Content.Server.GameTicking
                 }
 
                 _metaData.SetEntityName(mapUid, proto.MapName);
-                var g = new List<EntityUid> {grid.Value.Owner};
+                var g = new List<EntityUid> { grid.Value.Owner };
                 RaiseLocalEvent(new PostGameMapLoad(proto, mapId, g, stationName));
                 return g;
             }
@@ -308,7 +308,7 @@ namespace Content.Server.GameTicking
                     throw new Exception($"Failed to load game-map grid {ev.GameMap.ID}");
                 }
 
-                var g = new List<EntityUid> {grid.Value.Owner};
+                var g = new List<EntityUid> { grid.Value.Owner };
                 // TODO MAP LOADING use a new event?
                 RaiseLocalEvent(new PostGameMapLoad(proto, targetMap, g, stationName));
                 return g;
@@ -390,7 +390,7 @@ namespace Content.Server.GameTicking
                 HumanoidCharacterProfile profile;
                 if (_prefsManager.TryGetCachedPreferences(userId, out var preferences))
                 {
-                    profile = (HumanoidCharacterProfile) preferences.SelectedCharacter;
+                    profile = (HumanoidCharacterProfile)preferences.SelectedCharacter;
                 }
                 else
                 {
index ec377809133d726ffe89cc8d8d41452174e5e711..1ed61b8626b8f102b3236bc63f5cbea8dd226c5a 100644 (file)
@@ -43,7 +43,7 @@ public sealed class WeatherSystem : SharedWeatherSystem
 
         var mapId = new MapId(mapInt);
 
-        if (!MapManager.MapExists(mapId))
+        if (!_mapSystem.MapExists(mapId))
             return;
 
         if (!_mapSystem.TryGetMap(mapId, out var mapUid))
index b0304715b1b5e8dc2ce917a9eef2e5e862f277c4..6d43abc9d9a31d0964aa5058727044fdb6d50822 100644 (file)
@@ -6,7 +6,7 @@ namespace Content.Shared.Explosion.Components;
 /// <summary>
 ///     Component for tracking active trigger timers. A timers can activated by some other component, e.g. <see cref="OnUseTimerTriggerComponent"/>.
 /// </summary>
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent]
 public sealed partial class ActiveTimerTriggerComponent : Component
 {
     [DataField] public float TimeRemaining;
index 3736b4d4234ccc938206764f06c3aa85d498364f..c0dab4e537eff1e3846777e97901cd610a608919 100644 (file)
@@ -9,7 +9,7 @@ namespace Content.Shared.StoreDiscount.Components;
 /// <summary>
 /// Partner-component for adding discounts functionality to StoreSystem using StoreDiscountSystem.
 /// </summary>
-[RegisterComponent, NetworkedComponent]
+[RegisterComponent]
 public sealed partial class StoreDiscountComponent : Component
 {
     /// <summary>