]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Random spontaneous cleanup PR (#25131)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Tue, 13 Feb 2024 21:48:39 +0000 (22:48 +0100)
committerGitHub <noreply@github.com>
Tue, 13 Feb 2024 21:48:39 +0000 (16:48 -0500)
* Use new Subs.CVar helper

Removes manual config OnValueChanged calls, removes need to remember to manually unsubscribe.

This both reduces boilerplate and fixes many issues where subscriptions weren't removed on entity system shutdown.

* Fix a bunch of warnings

* More warning fixes

* Use new DateTime serializer to get rid of ISerializationHooks in changelog code.

* Get rid of some more ISerializationHooks for enums

* And a little more

* Apply suggestions from code review

Co-authored-by: 0x6273 <0x40@keemail.me>
---------

Co-authored-by: 0x6273 <0x40@keemail.me>
210 files changed:
Content.Benchmarks/ColorInterpolateBenchmark.cs
Content.Benchmarks/Program.cs
Content.Client/Actions/ActionsSystem.cs
Content.Client/Administration/Managers/ClientAdminManager.cs
Content.Client/Administration/UI/SpawnExplosion/SpawnExplosionWindow.xaml.cs
Content.Client/Administration/UI/Tabs/AdminbusTab/LoadBlueprintsWindow.xaml.cs
Content.Client/Administration/UI/Tabs/AtmosTab/AddAtmosWindow.xaml.cs
Content.Client/Administration/UI/Tabs/AtmosTab/AddGasWindow.xaml.cs
Content.Client/Administration/UI/Tabs/AtmosTab/FillGasWindow.xaml.cs
Content.Client/Administration/UI/Tabs/AtmosTab/SetTemperatureWindow.xaml.cs
Content.Client/Alerts/ClientAlertsSystem.cs
Content.Client/Animations/EntityPickupAnimationSystem.cs
Content.Client/Anomaly/Ui/AnomalyGeneratorWindow.xaml.cs
Content.Client/Atmos/Monitor/UI/AirAlarmWindow.xaml.cs
Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml
Content.Client/Atmos/Monitor/UI/Widgets/ThresholdBoundControl.xaml.cs
Content.Client/Audio/AmbientSoundSystem.cs
Content.Client/Audio/BackgroundAudioSystem.cs
Content.Client/Audio/ClientGlobalSoundSystem.cs
Content.Client/Audio/ContentAudioSystem.AmbientMusic.cs
Content.Client/Audio/ContentAudioSystem.cs
Content.Client/Camera/CameraRecoilSystem.cs
Content.Client/CardboardBox/CardboardBoxSystem.cs
Content.Client/Cargo/UI/BountyEntry.xaml.cs
Content.Client/Changelog/ChangelogManager.cs
Content.Client/CharacterInfo/CharacterInfoSystem.cs
Content.Client/Chat/TypingIndicator/TypingIndicatorSystem.cs
Content.Client/CloningConsole/UI/CloningConsoleWindow.xaml.cs
Content.Client/CombatMode/CombatModeSystem.cs
Content.Client/Commands/DebugPathfindingCommand.cs
Content.Client/Construction/ConstructionSystem.cs
Content.Client/ContextMenu/UI/EntityMenuUIController.cs
Content.Client/Damage/DamageVisualsSystem.cs
Content.Client/DoAfter/DoAfterSystem.cs
Content.Client/Doors/FirelockSystem.cs
Content.Client/Drugs/DrugOverlaySystem.cs
Content.Client/Drugs/RainbowOverlay.cs
Content.Client/Drunk/DrunkOverlay.cs
Content.Client/Drunk/DrunkSystem.cs
Content.Client/Examine/ExamineSystem.cs
Content.Client/Explosion/ExplosionOverlay.cs
Content.Client/Eye/Blinding/BlindingSystem.cs
Content.Client/Eye/Blinding/BlurryVisionSystem.cs
Content.Client/Eye/EyeLerpingSystem.cs
Content.Client/Flash/FlashOverlay.cs
Content.Client/Flash/FlashSystem.cs
Content.Client/Fluids/PuddleOverlay.cs
Content.Client/Forensics/ForensicScannerMenu.xaml
Content.Client/Forensics/ForensicScannerMenu.xaml.cs
Content.Client/GameTicking/Managers/ClientGameTicker.cs
Content.Client/Gameplay/GameplayStateBase.cs
Content.Client/Ghost/GhostSystem.cs
Content.Client/Gravity/GravitySystem.Shake.cs
Content.Client/Guidebook/GuidebookSystem.cs
Content.Client/Hands/Systems/HandsSystem.cs
Content.Client/HotPotato/HotPotatoSystem.cs
Content.Client/Instruments/InstrumentSystem.cs
Content.Client/Instruments/UI/InstrumentMenu.xaml.cs
Content.Client/Interaction/DragDropSystem.cs
Content.Client/Inventory/StrippableBoundUserInterface.cs
Content.Client/LateJoin/LateJoinGui.cs
Content.Client/MassMedia/Ui/MiniArticleCardControl.xaml
Content.Client/MassMedia/Ui/MiniArticleCardControl.xaml.cs
Content.Client/MassMedia/Ui/NewsWriteMenu.xaml.cs
Content.Client/MouseRotator/MouseRotatorSystem.cs
Content.Client/Movement/Systems/ContentEyeSystem.cs
Content.Client/NetworkConfigurator/Systems/NetworkConfiguratorSystem.cs
Content.Client/Outline/InteractionOutlineSystem.cs
Content.Client/Outline/TargetOutlineSystem.cs
Content.Client/Parallax/ParallaxSystem.cs
Content.Client/Physics/Controllers/MoverController.cs
Content.Client/Players/PlayTimeTracking/JobRequirementsManager.cs
Content.Client/Replay/ContentReplayPlaybackManager.cs
Content.Client/Replay/ReplayConGroup.cs
Content.Client/Research/UI/ResearchConsoleMenu.xaml.cs
Content.Client/Salvage/SalvageSystem.cs
Content.Client/Shuttles/Systems/ShuttleConsoleSystem.cs
Content.Client/Silicons/Laws/Ui/LawDisplay.xaml.cs
Content.Client/Sprite/SpriteFadeSystem.cs
Content.Client/StatusIcon/StatusIconSystem.cs
Content.Client/SubFloor/TrayScannerSystem.cs
Content.Client/Tabletop/TabletopSystem.cs
Content.Client/Traits/ParacusiaSystem.cs
Content.Client/UserInterface/Controls/SplitBar.xaml.cs
Content.Client/UserInterface/Systems/Bwoink/AHelpUIController.cs
Content.Client/UserInterface/Systems/Chat/ChatUIController.cs
Content.Client/UserInterface/Systems/Chat/Widgets/ChatBox.xaml.cs
Content.Client/UserInterface/Systems/DamageOverlays/DamageOverlayUiController.cs
Content.Client/UserInterface/Systems/DamageOverlays/Overlays/DamageOverlay.cs
Content.Client/UserInterface/Systems/Ghost/Controls/Roles/MakeGhostRoleEui.cs
Content.Client/UserInterface/Systems/Viewport/ViewportUIController.cs
Content.Client/Verbs/VerbSystem.cs
Content.Client/Weapons/Melee/MeleeArcOverlay.cs
Content.Client/Weapons/Melee/MeleeWeaponSystem.cs
Content.Client/Weapons/Misc/GrapplingGunSystem.cs
Content.Client/Weapons/Misc/TetherGunSystem.cs
Content.Client/Weapons/Ranged/GunSpreadOverlay.cs
Content.Client/Weapons/Ranged/Systems/FlyBySoundSystem.cs
Content.Client/Weapons/Ranged/Systems/GunSystem.cs
Content.Client/Weather/WeatherSystem.cs
Content.IntegrationTests/Pair/TestPair.Recycle.cs
Content.IntegrationTests/Tests/Actions/ActionsAddedTest.cs
Content.IntegrationTests/Tests/GameObjects/Components/Mobs/AlertsComponentTests.cs
Content.IntegrationTests/Tests/Interaction/InteractionTest.cs
Content.MapRenderer/Painters/GridPainter.cs
Content.MapRenderer/Painters/TilePainter.cs
Content.Server/Access/AccessWireAction.cs
Content.Server/Access/Systems/AccessOverriderSystem.cs
Content.Server/Access/Systems/AgentIDCardSystem.cs
Content.Server/Access/Systems/IdCardSystem.cs
Content.Server/Administration/Commands/BanCommand.cs
Content.Server/Administration/Notes/AdminNotesSystem.cs
Content.Server/Administration/PlayerLocator.cs
Content.Server/Administration/Systems/AdminSystem.cs
Content.Server/Administration/Systems/BwoinkSystem.cs
Content.Server/Administration/UI/PermissionsEui.cs
Content.Server/Administration/UI/SpawnExplosionEui.cs
Content.Server/Afk/AFKSystem.cs
Content.Server/AlertLevel/AlertLevelSystem.cs
Content.Server/AlertLevel/Commands/SetAlertLevelCommand.cs
Content.Server/Ame/AmeNodeGroup.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs
Content.Server/Atmos/EntitySystems/GasTileOverlaySystem.cs
Content.Server/Atmos/EntitySystems/HeatExchangerSystem.cs
Content.Server/CartridgeLoader/Cartridges/CrewManifestCartridgeSystem.cs
Content.Server/Chat/Systems/ChatSystem.cs
Content.Server/Chunking/ChunkingSystem.cs
Content.Server/Construction/ConstructionSystem.Initial.cs
Content.Server/Construction/ConstructionSystem.Interactions.cs
Content.Server/Construction/ConstructionSystem.cs
Content.Server/Decals/DecalSystem.cs
Content.Server/Explosion/EntitySystems/ClusterGrenadeSystem.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.CVars.cs
Content.Server/Explosion/EntitySystems/ExplosionSystem.cs
Content.Server/Explosion/EntitySystems/SmokeOnTriggerSystem.cs
Content.Server/Flash/FlashSystem.cs
Content.Server/GameTicking/GameTicker.CVars.cs
Content.Server/GameTicking/GameTicker.Spawning.cs
Content.Server/Holiday/HolidaySystem.cs
Content.Server/Info/InfoSystem.cs
Content.Server/Info/ShowRulesCommand.cs
Content.Server/Instruments/InstrumentSystem.CVars.cs
Content.Server/Instruments/InstrumentSystem.cs
Content.Server/Light/EntitySystems/PoweredLightSystem.cs
Content.Server/Mapping/MappingSystem.cs
Content.Server/MassMedia/Systems/NewsSystem.cs
Content.Server/Mind/MindSystem.cs
Content.Server/Motd/MOTDSystem.cs
Content.Server/NPC/Systems/NPCCombatSystem.Melee.cs
Content.Server/NPC/Systems/NPCSteeringSystem.cs
Content.Server/NPC/Systems/NPCSystem.cs
Content.Server/Objectives/Systems/ObjectiveLimitSystem.cs
Content.Server/PDA/Ringer/RingerSystem.cs
Content.Server/Parallax/BiomeSystem.cs
Content.Server/Pinpointer/PinpointerSystem.cs
Content.Server/Radiation/Systems/RadiationSystem.Cvar.cs
Content.Server/Radiation/Systems/RadiationSystem.cs
Content.Server/RandomAppearance/RandomAppearanceComponent.cs
Content.Server/Salvage/SalvageSystem.Expeditions.cs
Content.Server/Salvage/SalvageSystem.cs
Content.Server/Shuttles/Systems/ArrivalsSystem.cs
Content.Server/Shuttles/Systems/EmergencyShuttleSystem.Console.cs
Content.Server/Shuttles/Systems/EmergencyShuttleSystem.cs
Content.Server/Shuttles/Systems/ShuttleSystem.GridFill.cs
Content.Server/Shuttles/Systems/ShuttleSystem.cs
Content.Server/Station/Systems/StationJobsSystem.cs
Content.Server/Station/Systems/StationSpawningSystem.cs
Content.Server/Station/Systems/StationSystem.cs
Content.Server/StationEvents/EventManagerSystem.cs
Content.Server/Storage/EntitySystems/CursedEntityStorageSystem.cs
Content.Server/Store/Conditions/BuyerSpeciesCondition.cs
Content.Server/Tips/TipsSystem.cs
Content.Server/UserInterface/ActivatableUIComponent.cs
Content.Server/Worldgen/Systems/WorldgenConfigSystem.cs
Content.Shared/Access/Systems/SharedAccessSystem.cs
Content.Shared/Actions/SharedActionsSystem.cs
Content.Shared/Alert/AlertPrototype.cs
Content.Shared/Anomaly/Effects/SharedGravityAnomalySystem.cs
Content.Shared/Anomaly/SharedAnomalySystem.cs
Content.Shared/Bed/Cryostorage/SharedCryostorageSystem.cs
Content.Shared/Bed/Sleep/SharedSleepingSystem.cs
Content.Shared/Blocking/BlockingSystem.cs
Content.Shared/CartridgeLoader/SharedCartridgeLoaderSystem.cs
Content.Shared/Charges/Systems/SharedChargesSystem.cs
Content.Shared/Clothing/EntitySystems/StealthClothingSystem.cs
Content.Shared/Construction/SharedFlatpackSystem.cs
Content.Shared/Damage/Systems/DamageableSystem.cs
Content.Shared/Damage/Systems/PassiveDamageSystem.cs
Content.Shared/Doors/Systems/SharedDoorSystem.cs
Content.Shared/Examine/ExamineSystemShared.cs
Content.Shared/Explosion/Components/OnTrigger/SmokeOnTriggerComponent.cs
Content.Shared/Eye/Blinding/Systems/BlurryVisionSystem.cs
Content.Shared/Fluids/SharedDrainSystem.cs
Content.Shared/Friction/TileFrictionController.cs
Content.Shared/Gibbing/Systems/GibbingSystem.cs
Content.Shared/Hands/EntitySystems/SharedHandsSystem.cs
Content.Shared/Inventory/InventorySystem.Slots.cs
Content.Shared/Movement/Systems/SharedMoverController.Input.cs
Content.Shared/Movement/Systems/SharedMoverController.Relay.cs
Content.Shared/Movement/Systems/SharedMoverController.cs
Content.Shared/Pinpointer/SharedPinpointerSystem.cs
Content.Shared/Placeable/ItemPlacerSystem.cs
Content.Shared/Power/Generator/ActiveGeneratorRevvingSystem.cs
Content.Shared/RCD/Systems/RCDSystem.cs
Content.Shared/Spider/SharedSpiderSystem.cs
Content.Shared/SprayPainter/SharedSprayPainterSystem.cs
Content.Shared/Stealth/SharedStealthSystem.cs
Content.Shared/Storage/EntitySystems/DumpableSystem.cs
Content.Shared/Tiles/FloorTileSystem.cs
Content.Shared/UserInterface/OpenUiActionEvent.cs

index 2243bb4819ed3bc9ee6a5a0af1e254d5bc0f4582..eb182328d466b557584e71c35e7c6200ec2ffae5 100644 (file)
@@ -131,8 +131,8 @@ namespace Content.Benchmarks
         public static Color InterpolateSysVector4In(in Color endPoint1, in Color endPoint2,
             float lambda)
         {
-            ref var sva = ref Unsafe.As<Color, SysVector4>(ref Unsafe.AsRef(endPoint1));
-            ref var svb = ref Unsafe.As<Color, SysVector4>(ref Unsafe.AsRef(endPoint2));
+            ref var sva = ref Unsafe.As<Color, SysVector4>(ref Unsafe.AsRef(in endPoint1));
+            ref var svb = ref Unsafe.As<Color, SysVector4>(ref Unsafe.AsRef(in endPoint2));
 
             var res = SysVector4.Lerp(svb, sva, lambda);
 
@@ -156,8 +156,8 @@ namespace Content.Benchmarks
         public static Color InterpolateSimdIn(in Color a, in Color b,
             float lambda)
         {
-            var vecA = Unsafe.As<Color, Vector128<float>>(ref Unsafe.AsRef(a));
-            var vecB = Unsafe.As<Color, Vector128<float>>(ref Unsafe.AsRef(b));
+            var vecA = Unsafe.As<Color, Vector128<float>>(ref Unsafe.AsRef(in a));
+            var vecB = Unsafe.As<Color, Vector128<float>>(ref Unsafe.AsRef(in b));
 
             vecB = Fma.MultiplyAdd(Sse.Subtract(vecB, vecA), Vector128.Create(lambda), vecA);
 
index 0beb0a613d5ed35af481bfae4e5622276d0e4ca9..42a436597d5259ef3b737f57ca4a948892478d7a 100644 (file)
@@ -18,11 +18,6 @@ namespace Content.Benchmarks
 
         public static void Main(string[] args)
         {
-            MainAsync(args).GetAwaiter().GetResult();
-        }
-
-        public static async Task MainAsync(string[] args)
-        {
 #if DEBUG
             Console.ForegroundColor = ConsoleColor.Red;
             Console.WriteLine("\nWARNING: YOU ARE RUNNING A DEBUG BUILD, USE A RELEASE BUILD FOR AN ACCURATE BENCHMARK");
index 508f3404bac6262090b1ee7c4804d29c80acf33b..2343b9eac152f98e7370ee33586f6a5385b54db7 100644 (file)
@@ -101,7 +101,7 @@ namespace Content.Client.Actions
             component.ItemIconStyle = state.ItemIconStyle;
             component.Sound = state.Sound;
 
-            if (_playerManager.LocalPlayer?.ControlledEntity == component.AttachedEntity)
+            if (_playerManager.LocalEntity == component.AttachedEntity)
                 ActionsUpdated?.Invoke();
         }
 
@@ -111,7 +111,7 @@ namespace Content.Client.Actions
                 return;
 
             base.UpdateAction(actionId, action);
-            if (_playerManager.LocalPlayer?.ControlledEntity != action.AttachedEntity)
+            if (_playerManager.LocalEntity != action.AttachedEntity)
                 return;
 
             ActionsUpdated?.Invoke();
@@ -144,7 +144,7 @@ namespace Content.Client.Actions
                 _added.Add((actionId, action));
             }
 
-            if (_playerManager.LocalPlayer?.ControlledEntity != uid)
+            if (_playerManager.LocalEntity != uid)
                 return;
 
             foreach (var action in _removed)
@@ -177,7 +177,7 @@ namespace Content.Client.Actions
         protected override void ActionAdded(EntityUid performer, EntityUid actionId, ActionsComponent comp,
             BaseActionComponent action)
         {
-            if (_playerManager.LocalPlayer?.ControlledEntity != performer)
+            if (_playerManager.LocalEntity != performer)
                 return;
 
             OnActionAdded?.Invoke(actionId);
@@ -185,7 +185,7 @@ namespace Content.Client.Actions
 
         protected override void ActionRemoved(EntityUid performer, EntityUid actionId, ActionsComponent comp, BaseActionComponent action)
         {
-            if (_playerManager.LocalPlayer?.ControlledEntity != performer)
+            if (_playerManager.LocalEntity != performer)
                 return;
 
             OnActionRemoved?.Invoke(actionId);
@@ -193,7 +193,7 @@ namespace Content.Client.Actions
 
         public IEnumerable<(EntityUid Id, BaseActionComponent Comp)> GetClientActions()
         {
-            if (_playerManager.LocalPlayer?.ControlledEntity is not { } user)
+            if (_playerManager.LocalEntity is not { } user)
                 return Enumerable.Empty<(EntityUid, BaseActionComponent)>();
 
             return GetActions(user);
@@ -216,7 +216,7 @@ namespace Content.Client.Actions
 
         public void LinkAllActions(ActionsComponent? actions = null)
         {
-             if (_playerManager.LocalPlayer?.ControlledEntity is not { } user ||
+             if (_playerManager.LocalEntity is not { } user ||
                  !Resolve(user, ref actions, false))
              {
                  return;
@@ -233,7 +233,7 @@ namespace Content.Client.Actions
 
         public void TriggerAction(EntityUid actionId, BaseActionComponent action)
         {
-            if (_playerManager.LocalPlayer?.ControlledEntity is not { } user ||
+            if (_playerManager.LocalEntity is not { } user ||
                 !TryComp(user, out ActionsComponent? actions))
             {
                 return;
@@ -261,7 +261,7 @@ namespace Content.Client.Actions
         /// </summary>
         public void LoadActionAssignments(string path, bool userData)
         {
-            if (_playerManager.LocalPlayer?.ControlledEntity is not { } user)
+            if (_playerManager.LocalEntity is not { } user)
                 return;
 
             var file = new ResPath(path).ToRootedPath();
index 1a1366c6f2ebadb3245c9aa302feb1ede5b1fb0b..d33761be8f237dfb14923193e05dd8167848eb2a 100644 (file)
@@ -15,11 +15,13 @@ namespace Content.Client.Administration.Managers
         [Dependency] private readonly IClientNetManager _netMgr = default!;
         [Dependency] private readonly IClientConGroupController _conGroup = default!;
         [Dependency] private readonly IResourceManager _res = default!;
+        [Dependency] private readonly ILogManager _logManager = default!;
 
         private AdminData? _adminData;
         private readonly HashSet<string> _availableCommands = new();
 
         private readonly AdminCommandPermissions _localCommandPermissions = new();
+        private ISawmill _sawmill = default!;
 
         public event Action? AdminStatusUpdated;
 
@@ -92,17 +94,17 @@ namespace Content.Client.Administration.Managers
             }
 
             _availableCommands.UnionWith(message.AvailableCommands);
-            Logger.DebugS("admin", $"Have {message.AvailableCommands.Length} commands available");
+            _sawmill.Debug($"Have {message.AvailableCommands.Length} commands available");
 
             _adminData = message.Admin;
             if (_adminData != null)
             {
                 var flagsText = string.Join("|", AdminFlagsHelper.FlagsToNames(_adminData.Flags));
-                Logger.InfoS("admin", $"Updated admin status: {_adminData.Active}/{_adminData.Title}/{flagsText}");
+                _sawmill.Info($"Updated admin status: {_adminData.Active}/{_adminData.Title}/{flagsText}");
             }
             else
             {
-                Logger.InfoS("admin", "Updated admin status: Not admin");
+                _sawmill.Info("Updated admin status: Not admin");
             }
 
             AdminStatusUpdated?.Invoke();
@@ -114,18 +116,17 @@ namespace Content.Client.Administration.Managers
         void IPostInjectInit.PostInject()
         {
             _conGroup.Implementation = this;
+            _sawmill = _logManager.GetSawmill("admin");
         }
 
         public AdminData? GetAdminData(EntityUid uid, bool includeDeAdmin = false)
         {
-            return uid == _player.LocalPlayer?.ControlledEntity
-                ? _adminData
-                : null;
+            return uid == _player.LocalEntity ? _adminData : null;
         }
 
         public AdminData? GetAdminData(ICommonSession session, bool includeDeAdmin = false)
         {
-            if (_player.LocalPlayer?.UserId == session.UserId)
+            if (_player.LocalUser == session.UserId)
                 return _adminData;
 
             return null;
@@ -133,7 +134,7 @@ namespace Content.Client.Administration.Managers
 
         public AdminData? GetAdminData(bool includeDeAdmin = false)
         {
-            if (_player.LocalPlayer is { Session: { } session })
+            if (_player.LocalSession is { } session)
                 return GetAdminData(session, includeDeAdmin);
 
             return null;
index 04219fe39b01b153adef95f3d827e5b91175af20..5f187cad794efe8df987aef0db7c698cefd520a9 100644 (file)
@@ -99,7 +99,7 @@ public sealed partial class SpawnExplosionWindow : DefaultWindow
     {
         UpdateMapOptions();
 
-        if (!_entMan.TryGetComponent(_playerManager.LocalPlayer?.ControlledEntity, out TransformComponent? transform))
+        if (!_entMan.TryGetComponent(_playerManager.LocalEntity, out TransformComponent? transform))
             return;
 
         _pausePreview = true;
index 34611f51aff209833965eff37115d76002340885..97c84e5d2fc6a836341d28657a0cc12e61b43d31 100644 (file)
@@ -42,7 +42,7 @@ namespace Content.Client.Administration.UI.Tabs.AdminbusTab
             var entManager = IoCManager.Resolve<IEntityManager>();
             var xformSystem = entManager.System<SharedTransformSystem>();
             var playerManager = IoCManager.Resolve<IPlayerManager>();
-            var player = playerManager.LocalPlayer?.ControlledEntity;
+            var player = playerManager.LocalEntity;
 
             var currentMap = MapId.Nullspace;
             var position = Vector2.Zero;
index 7e2fdda3e25a246b70142e6e9977db3b06100e8c..03fd52f446ae499aba2f1247c825fc5b73753869 100644 (file)
@@ -28,7 +28,7 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab
         {
             _data.Clear();
 
-            var player = _players.LocalPlayer?.ControlledEntity;
+            var player = _players.LocalEntity;
             var playerGrid = _entities.GetComponentOrNull<TransformComponent>(player)?.GridUid;
             var query = IoCManager.Resolve<IEntityManager>().AllEntityQueryEnumerator<MapGridComponent>();
 
index d273ea3e55af9ca7fa206bb3f963daa23f202743..c06d9161334891b4f89e637f890fa25c01429576 100644 (file)
@@ -31,7 +31,7 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab
             while (gridQuery.MoveNext(out var uid, out _))
             {
                 _gridData.Add(entManager.GetNetEntity(uid));
-                var player = playerManager.LocalPlayer?.ControlledEntity;
+                var player = playerManager.LocalEntity;
                 var playerGrid = entManager.GetComponentOrNull<TransformComponent>(player)?.GridUid;
                 GridOptions.AddItem($"{uid} {(playerGrid == uid ? " (Current)" : "")}");
             }
index 276ec3d67dfe25ec7406065c42d2d5214068a101..3353d0873eff352eb0562ed693b14c77b8672535 100644 (file)
@@ -34,7 +34,7 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab
 
             while (gridQuery.MoveNext(out var uid, out _))
             {
-                var player = playerManager.LocalPlayer?.ControlledEntity;
+                var player = playerManager.LocalEntity;
                 var playerGrid = entManager.GetComponentOrNull<TransformComponent>(player)?.GridUid;
                 GridOptions.AddItem($"{uid} {(playerGrid == uid ? " (Current)" : "")}");
                 _gridData.Add(entManager.GetNetEntity(uid));
index 850e43e4188e7fd80806e07b26ad5d0a2763a47b..1183efb9b5b62d68a76a539c676ec44e0d94cf4e 100644 (file)
@@ -30,7 +30,7 @@ namespace Content.Client.Administration.UI.Tabs.AtmosTab
 
             while (gridQuery.MoveNext(out var uid, out _))
             {
-                var player = playerManager.LocalPlayer?.ControlledEntity;
+                var player = playerManager.LocalEntity;
                 var playerGrid = entManager.GetComponentOrNull<TransformComponent>(player)?.GridUid;
                 GridOptions.AddItem($"{uid} {(playerGrid == uid ? " (Current)" : "")}");
                 _data.Add(entManager.GetNetEntity(uid));
index 83327ad77b5af1e69709900bb22a70d803295c25..ab296a96195cd52d02b113be06f329597bf5f05a 100644 (file)
@@ -40,7 +40,7 @@ public sealed class ClientAlertsSystem : AlertsSystem
     {
         get
         {
-            var ent = _playerManager.LocalPlayer?.ControlledEntity;
+            var ent = _playerManager.LocalEntity;
             return ent is not null
                 ? GetActiveAlerts(ent.Value)
                 : null;
@@ -49,7 +49,7 @@ public sealed class ClientAlertsSystem : AlertsSystem
 
     protected override void AfterShowAlert(Entity<AlertsComponent> alerts)
     {
-        if (_playerManager.LocalPlayer?.ControlledEntity != alerts.Owner)
+        if (_playerManager.LocalEntity != alerts.Owner)
             return;
 
         SyncAlerts?.Invoke(this, alerts.Comp.Alerts);
@@ -57,7 +57,7 @@ public sealed class ClientAlertsSystem : AlertsSystem
 
     protected override void AfterClearAlert(Entity<AlertsComponent> alertsComponent)
     {
-        if (_playerManager.LocalPlayer?.ControlledEntity != alertsComponent.Owner)
+        if (_playerManager.LocalEntity != alertsComponent.Owner)
             return;
 
         SyncAlerts?.Invoke(this, alertsComponent.Comp.Alerts);
@@ -65,13 +65,13 @@ public sealed class ClientAlertsSystem : AlertsSystem
 
     private void ClientAlertsHandleState(EntityUid uid, AlertsComponent component, ref AfterAutoHandleStateEvent args)
     {
-        if (_playerManager.LocalPlayer?.ControlledEntity == uid)
+        if (_playerManager.LocalEntity == uid)
             SyncAlerts?.Invoke(this, component.Alerts);
     }
 
     private void OnPlayerAttached(EntityUid uid, AlertsComponent component, LocalPlayerAttachedEvent args)
     {
-        if (_playerManager.LocalPlayer?.ControlledEntity != uid)
+        if (_playerManager.LocalEntity != uid)
             return;
 
         SyncAlerts?.Invoke(this, component.Alerts);
@@ -81,7 +81,7 @@ public sealed class ClientAlertsSystem : AlertsSystem
     {
         base.HandleComponentShutdown(uid, component, args);
 
-        if (_playerManager.LocalPlayer?.ControlledEntity != uid)
+        if (_playerManager.LocalEntity != uid)
             return;
 
         ClearAlerts?.Invoke(this, EventArgs.Empty);
index 2ac51e6eba02747d6d98bd8e27fc4087a608d8ae..abeac664c75c77476e96e8fc6c51ae8c8335dc4b 100644 (file)
@@ -65,7 +65,7 @@ public sealed class EntityPickupAnimationSystem : EntitySystem
         despawn.Lifetime = 0.25f;
         _transform.SetLocalRotationNoLerp(animatableClone, initialAngle);
 
-        _animations.Play(animatableClone, animations, new Animation
+        _animations.Play(new Entity<AnimationPlayerComponent>(animatableClone, animations), new Animation
         {
             Length = TimeSpan.FromMilliseconds(125),
             AnimationTracks =
index ca8682e72d68d6d7f973e4ef9245bfde8fcb8fd7..08438e2a1b28b1517375f289b406ab6e19815201 100644 (file)
@@ -11,7 +11,6 @@ namespace Content.Client.Anomaly.Ui;
 [GenerateTypedNameReferences]
 public sealed partial class AnomalyGeneratorWindow : FancyWindow
 {
-    [Dependency] private readonly IEntityManager _entityManager = default!;
     [Dependency] private readonly IGameTiming _timing = default!;
 
     private TimeSpan _cooldownEnd = TimeSpan.Zero;
index de26eb5f1959ef491e408c296c8df89088d9a206..43be67c9d6bb8758907afe5e66e4b6fa99fec2ae 100644 (file)
@@ -22,7 +22,6 @@ public sealed partial class AirAlarmWindow : FancyWindow
     public event Action<string, AtmosMonitorThresholdType, AtmosAlarmThreshold, Gas?>? AtmosAlarmThresholdChanged;
     public event Action<AirAlarmMode>? AirAlarmModeChanged;
     public event Action<bool>? AutoModeChanged;
-    public event Action<string>? ResyncDeviceRequested;
     public event Action? ResyncAllRequested;
     public event Action<AirAlarmTab>? AirAlarmTabChange;
 
index 3885127384618ed54a5ef1c9a77a5ce837a88e52..0d5e741d0f66c8adea04fa6c1811260c0baa81b6 100644 (file)
@@ -2,6 +2,6 @@
     HorizontalExpand="True" Orientation="Vertical"
             Margin = "20 0 0 0" MinSize="160 0" >
     <Label Name="CBoundLabel" HorizontalAlignment="Center" />
-    <CheckBox Name="CBoundEnabled" HorizontalAlignment="Center" Text="{Loc 'Enable'}"/>
+    <CheckBox Name="CBoundEnabled" HorizontalAlignment="Center" Text="{Loc 'Enable'}" Pressed="True" />
     <FloatSpinBox Name="CSpinner" />
 </BoxContainer>
index da63db77d349948be8615dd8c5a20bf7f51c911d..3612d84de4cbe0ab1b6f20dcb3da9ffe901a84b0 100644 (file)
@@ -72,7 +72,6 @@ public sealed partial class ThresholdBoundControl : BoxContainer
         CBoundLabel.Text = controlLabel;
 
         CSpinner.Value = ScaledValue;
-        CBoundEnabled.Pressed = _value != null;
 
         CSpinner.OnValueChanged += SpinnerValueChanged;
         CBoundEnabled.OnToggled += CheckboxToggled;
index d39073fa330cc68026ec4efb85273e38a2c1c729..9d30cabb1ecb6f41be614b1b23b4c6c6f49b7522 100644 (file)
@@ -99,10 +99,10 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
         UpdatesOutsidePrediction = true;
         UpdatesAfter.Add(typeof(AmbientSoundTreeSystem));
 
-        _cfg.OnValueChanged(CCVars.AmbientCooldown, SetCooldown, true);
-        _cfg.OnValueChanged(CCVars.MaxAmbientSources, SetAmbientCount, true);
-        _cfg.OnValueChanged(CCVars.AmbientRange, SetAmbientRange, true);
-        _cfg.OnValueChanged(CCVars.AmbienceVolume, SetAmbienceGain, true);
+        Subs.CVar(_cfg, CCVars.AmbientCooldown, SetCooldown, true);
+        Subs.CVar(_cfg, CCVars.MaxAmbientSources, SetAmbientCount, true);
+        Subs.CVar(_cfg, CCVars.AmbientRange, SetAmbientRange, true);
+        Subs.CVar(_cfg, CCVars.AmbienceVolume, SetAmbienceGain, true);
         SubscribeLocalEvent<AmbientSoundComponent, ComponentShutdown>(OnShutdown);
     }
 
@@ -138,11 +138,6 @@ public sealed class AmbientSoundSystem : SharedAmbientSoundSystem
     {
         base.Shutdown();
         ClearSounds();
-
-        _cfg.UnsubValueChanged(CCVars.AmbientCooldown, SetCooldown);
-        _cfg.UnsubValueChanged(CCVars.MaxAmbientSources, SetAmbientCount);
-        _cfg.UnsubValueChanged(CCVars.AmbientRange, SetAmbientRange);
-        _cfg.UnsubValueChanged(CCVars.AmbienceVolume, SetAmbienceGain);
     }
 
     private int PlayingCount(string countSound)
index 29279830627e85cb6ae80c29c8e7a789d8132c75..702f810e27cffbbfcf7a6b42dd90a91fb7c9a733 100644 (file)
@@ -34,8 +34,8 @@ public sealed class BackgroundAudioSystem : EntitySystem
     {
         base.Initialize();
 
-        _configManager.OnValueChanged(CCVars.LobbyMusicEnabled, LobbyMusicCVarChanged);
-        _configManager.OnValueChanged(CCVars.LobbyMusicVolume, LobbyMusicVolumeCVarChanged);
+        Subs.CVar(_configManager, CCVars.LobbyMusicEnabled, LobbyMusicCVarChanged);
+        Subs.CVar(_configManager, CCVars.LobbyMusicVolume, LobbyMusicVolumeCVarChanged);
 
         _stateManager.OnStateChanged += StateManagerOnStateChanged;
 
@@ -50,9 +50,6 @@ public sealed class BackgroundAudioSystem : EntitySystem
     {
         base.Shutdown();
 
-        _configManager.UnsubValueChanged(CCVars.LobbyMusicEnabled, LobbyMusicCVarChanged);
-        _configManager.UnsubValueChanged(CCVars.LobbyMusicVolume, LobbyMusicVolumeCVarChanged);
-
         _stateManager.OnStateChanged -= StateManagerOnStateChanged;
 
         _client.PlayerLeaveServer -= OnLeave;
index 1d98564090a14f0ec9069624c1b0d955a912a61b..7c77865f74156da1cb535858f99d6e9fd5371c09 100644 (file)
@@ -26,11 +26,11 @@ public sealed class ClientGlobalSoundSystem : SharedGlobalSoundSystem
         base.Initialize();
         SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
         SubscribeNetworkEvent<AdminSoundEvent>(PlayAdminSound);
-        _cfg.OnValueChanged(CCVars.AdminSoundsEnabled, ToggleAdminSound, true);
+        Subs.CVar(_cfg, CCVars.AdminSoundsEnabled, ToggleAdminSound, true);
 
         SubscribeNetworkEvent<StationEventMusicEvent>(PlayStationEventMusic);
         SubscribeNetworkEvent<StopStationEventMusic>(StopStationEventMusic);
-        _cfg.OnValueChanged(CCVars.EventMusicEnabled, ToggleStationEventMusic, true);
+        Subs.CVar(_cfg, CCVars.EventMusicEnabled, ToggleStationEventMusic, true);
 
         SubscribeNetworkEvent<GameGlobalSoundEvent>(PlayGameSound);
     }
index 89324f22252fb04d06fe28e889aa64db8b04a21c..84b787a4ec9af4363f5c1ddcc224161f460579cb 100644 (file)
@@ -59,7 +59,7 @@ public sealed partial class ContentAudioSystem
 
     private void InitializeAmbientMusic()
     {
-        _configManager.OnValueChanged(CCVars.AmbientMusicVolume, AmbienceCVarChanged, true);
+        Subs.CVar(_configManager, CCVars.AmbientMusicVolume, AmbienceCVarChanged, true);
         _sawmill = IoCManager.Resolve<ILogManager>().GetSawmill("audio.ambience");
 
         // Reset audio
@@ -84,7 +84,6 @@ public sealed partial class ContentAudioSystem
 
     private void ShutdownAmbientMusic()
     {
-        _configManager.UnsubValueChanged(CCVars.AmbientMusicVolume, AmbienceCVarChanged);
         _state.OnStateChanged -= OnStateChange;
         _ambientMusicStream = _audio.Stop(_ambientMusicStream);
     }
@@ -229,7 +228,7 @@ public sealed partial class ContentAudioSystem
 
     private AmbientMusicPrototype? GetAmbience()
     {
-        var player = _player.LocalPlayer?.ControlledEntity;
+        var player = _player.LocalEntity;
 
         if (player == null)
             return null;
index c81e0a44f105a37e0e0f340a9cc0f7c97575e9b2..56921ee43016b9566451789ade5b066b17283261 100644 (file)
@@ -1,18 +1,11 @@
 using Content.Shared.Audio;
 using Content.Shared.GameTicking;
-using Robust.Client.Audio;
-using Robust.Client.ResourceManagement;
-using Robust.Client.UserInterface;
 using AudioComponent = Robust.Shared.Audio.Components.AudioComponent;
 
 namespace Content.Client.Audio;
 
 public sealed partial class ContentAudioSystem : SharedContentAudioSystem
 {
-    [Dependency] private readonly IAudioManager _audioManager = default!;
-    [Dependency] private readonly IResourceCache _cache = default!;
-    [Dependency] private readonly IUserInterfaceManager _uiManager = default!;
-
     // Need how much volume to change per tick and just remove it when it drops below "0"
     private readonly Dictionary<EntityUid, float> _fadingOut = new();
 
index bb419b465d3247bc6030988938de972acb1c62c2..3e04cd5bf197cba3e3f28cd9d13a688869b6e36e 100644 (file)
@@ -9,26 +9,19 @@ public sealed class CameraRecoilSystem : SharedCameraRecoilSystem
 {
     [Dependency] private readonly IConfigurationManager _configManager = default!;
 
-    protected float Intensity;
+    private float _intensity;
 
     public override void Initialize()
     {
         base.Initialize();
         SubscribeNetworkEvent<CameraKickEvent>(OnCameraKick);
 
-        _configManager.OnValueChanged(CCVars.ScreenShakeIntensity, OnCvarChanged, true);
-    }
-
-    public override void Shutdown()
-    {
-        base.Shutdown();
-
-        _configManager.UnsubValueChanged(CCVars.ScreenShakeIntensity, OnCvarChanged);
+        Subs.CVar(_configManager, CCVars.ScreenShakeIntensity, OnCvarChanged, true);
     }
 
     private void OnCvarChanged(float value)
     {
-        Intensity = value;
+        _intensity = value;
     }
 
     private void OnCameraKick(CameraKickEvent ev)
@@ -38,13 +31,13 @@ public sealed class CameraRecoilSystem : SharedCameraRecoilSystem
 
     public override void KickCamera(EntityUid uid, Vector2 recoil, CameraRecoilComponent? component = null)
     {
-        if (Intensity == 0)
+        if (_intensity == 0)
             return;
 
         if (!Resolve(uid, ref component, false))
             return;
 
-        recoil *= Intensity;
+        recoil *= _intensity;
 
         // Use really bad math to "dampen" kicks when we're already kicked.
         var existing = component.CurrentKick.Length();
index 5e479409cf907541076452aee4a82c2194b3b7fb..50f9de239d5209f2c9adc2c32dee98dd2cde62f7 100644 (file)
@@ -10,6 +10,7 @@ namespace Content.Client.CardboardBox;
 public sealed class CardboardBoxSystem : SharedCardboardBoxSystem
 {
     [Dependency] private readonly EntityLookupSystem _entityLookup = default!;
+    [Dependency] private readonly TransformSystem _transform = default!;
 
     public override void Initialize()
     {
@@ -29,7 +30,7 @@ public sealed class CardboardBoxSystem : SharedCardboardBoxSystem
         if (!xformQuery.TryGetComponent(source, out var xform))
             return;
 
-        var sourcePos = xform.MapPosition;
+        var sourcePos = _transform.GetMapCoordinates(source, xform);
 
         //Any mob that can move should be surprised?
         //God mind rework needs to come faster so it can just check for mind
@@ -53,16 +54,17 @@ public sealed class CardboardBoxSystem : SharedCardboardBoxSystem
         //Play the effect for the mobs as long as they can see the box and are in range.
         foreach (var mob in mobMoverEntities)
         {
-            if (!xformQuery.TryGetComponent(mob, out var moverTransform) || !ExamineSystemShared.InRangeUnOccluded(sourcePos, moverTransform.MapPosition, box.Distance, null))
+            var mapPos = _transform.GetMapCoordinates(mob);
+            if (!ExamineSystemShared.InRangeUnOccluded(sourcePos, mapPos, box.Distance, null))
                 continue;
 
-            var ent = Spawn(box.Effect, moverTransform.MapPosition);
+            var ent = Spawn(box.Effect, mapPos);
 
             if (!xformQuery.TryGetComponent(ent, out var entTransform) || !TryComp<SpriteComponent>(ent, out var sprite))
                 continue;
 
             sprite.Offset = new Vector2(0, 1);
-            entTransform.AttachParent(mob);
+            _transform.SetParent(ent, entTransform, mob);
         }
 
     }
index 05c5673dddf5d23e28ff21762a3d7302e024f49b..1fc8a4986a2a6551f9feeebc2960f14251dba05f 100644 (file)
@@ -12,7 +12,6 @@ namespace Content.Client.Cargo.UI;
 [GenerateTypedNameReferences]
 public sealed partial class BountyEntry : BoxContainer
 {
-    [Dependency] private readonly IGameTiming _timing = default!;
     [Dependency] private readonly IPrototypeManager _prototype = default!;
 
     public Action? OnButtonPressed;
index 396af99d2cfa61c1e4a3b60ca7db223f54e04878..4383f4661795baccbfdbd412714c36bb1765d7ca 100644 (file)
@@ -1,10 +1,8 @@
-using System.Globalization;
 using System.Linq;
 using System.Threading.Tasks;
 using Content.Shared.CCVar;
 using Robust.Shared.Configuration;
 using Robust.Shared.ContentPack;
-using Robust.Shared.Serialization;
 using Robust.Shared.Serialization.Manager;
 using Robust.Shared.Serialization.Markdown;
 using Robust.Shared.Serialization.Markdown.Mapping;
@@ -162,7 +160,7 @@ namespace Content.Client.Changelog
         }
 
         [DataDefinition]
-        public sealed partial class ChangelogEntry : ISerializationHooks
+        public sealed partial class ChangelogEntry
         {
             [DataField("id")]
             public int Id { get; private set; }
@@ -170,17 +168,11 @@ namespace Content.Client.Changelog
             [DataField("author")]
             public string Author { get; private set; } = "";
 
-            [DataField("time")] private string _time = default!;
-
+            [DataField]
             public DateTime Time { get; private set; }
 
             [DataField("changes")]
             public List<ChangelogChange> Changes { get; private set; } = default!;
-
-            void ISerializationHooks.AfterDeserialization()
-            {
-                Time = DateTime.Parse(_time, null, DateTimeStyles.RoundtripKind);
-            }
         }
 
         [DataDefinition]
index 844a352a184463bcef8715fa5c8011042f044f2f..aeaa48c6f2d43d97aceeba763a20a074624624a6 100644 (file)
@@ -20,7 +20,7 @@ public sealed class CharacterInfoSystem : EntitySystem
 
     public void RequestCharacterInfo()
     {
-        var entity = _players.LocalPlayer?.ControlledEntity;
+        var entity = _players.LocalEntity;
         if (entity == null)
         {
             return;
index 0eea36aa573b6b9da9e7567a6cf8102d6792fad3..844f793fc49991b6501de1cd25307c3bfd39c10f 100644 (file)
@@ -20,7 +20,8 @@ public sealed class TypingIndicatorSystem : SharedTypingIndicatorSystem
     public override void Initialize()
     {
         base.Initialize();
-        _cfg.OnValueChanged(CCVars.ChatShowTypingIndicator, OnShowTypingChanged);
+
+        Subs.CVar(_cfg, CCVars.ChatShowTypingIndicator, OnShowTypingChanged);
     }
 
     public void ClientChangedChatText()
@@ -67,7 +68,7 @@ public sealed class TypingIndicatorSystem : SharedTypingIndicatorSystem
         _isClientTyping = isClientTyping;
 
         // check if player controls any pawn
-        if (_playerManager.LocalPlayer?.ControlledEntity == null)
+        if (_playerManager.LocalEntity == null)
             return;
 
         // send a networked event to server
index b71f1a282f205ed2b0ace59ce9e9db327008a4d9..a14ce138743f9e39b175ac0fa3ce57c9261f2b94 100644 (file)
@@ -7,7 +7,7 @@ using Content.Shared.Cloning.CloningConsole;
 namespace Content.Client.CloningConsole.UI
 {
     [GenerateTypedNameReferences]
-    public partial class CloningConsoleWindow : DefaultWindow
+    public sealed partial class CloningConsoleWindow : DefaultWindow
     {
         public CloningConsoleWindow()
         {
index 34ae0b1338b50d74fdb42e2f1018beab4a513768..2c938b1b9378cb400670da46a9355e11977ad783 100644 (file)
@@ -28,7 +28,7 @@ public sealed class CombatModeSystem : SharedCombatModeSystem
 
         SubscribeLocalEvent<CombatModeComponent, AfterAutoHandleStateEvent>(OnHandleState);
 
-        _cfg.OnValueChanged(CCVars.CombatModeIndicatorsPointShow, OnShowCombatIndicatorsChanged, true);
+        Subs.CVar(_cfg, CCVars.CombatModeIndicatorsPointShow, OnShowCombatIndicatorsChanged, true);
     }
 
     private void OnHandleState(EntityUid uid, CombatModeComponent component, ref AfterAutoHandleStateEvent args)
@@ -38,7 +38,6 @@ public sealed class CombatModeSystem : SharedCombatModeSystem
 
     public override void Shutdown()
     {
-        _cfg.UnsubValueChanged(CCVars.CombatModeIndicatorsPointShow, OnShowCombatIndicatorsChanged);
         _overlayManager.RemoveOverlay<CombatModeIndicatorsOverlay>();
 
         base.Shutdown();
@@ -46,7 +45,7 @@ public sealed class CombatModeSystem : SharedCombatModeSystem
 
     public bool IsInCombatMode()
     {
-        var entity = _playerManager.LocalPlayer?.ControlledEntity;
+        var entity = _playerManager.LocalEntity;
 
         if (entity == null)
             return false;
@@ -67,7 +66,7 @@ public sealed class CombatModeSystem : SharedCombatModeSystem
 
     private void UpdateHud(EntityUid entity)
     {
-        if (entity != _playerManager.LocalPlayer?.ControlledEntity || !Timing.IsFirstTimePredicted)
+        if (entity != _playerManager.LocalEntity || !Timing.IsFirstTimePredicted)
         {
             return;
         }
index e02b6dcbbda4a07f29db42b5fa34c38a1521be35..b920ccc5edf6b3db2b473af6e2061cc336bc3505 100644 (file)
@@ -38,7 +38,7 @@ public sealed class DebugPathfindingCommand : LocalizedCommands
         }
     }
 
-    public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
+    public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
     {
         if (args.Length > 1)
         {
index 940538670c09cb88cb9a3c62439c3ee9ff8ed6b0..ae1724c3bf63c58f4dff4627fcfc209dd402de97 100644 (file)
@@ -185,7 +185,7 @@ namespace Content.Client.Construction
             [NotNullWhen(true)] out EntityUid? ghost)
         {
             ghost = null;
-            if (_playerManager.LocalPlayer?.ControlledEntity is not { } user ||
+            if (_playerManager.LocalEntity is not { } user ||
                 !user.IsValid())
             {
                 return false;
index 039c03601ade6cb1b8885cabfc1f78f728b332db..ae1b3ec3bf005ba3b2ef039a9876eb7866b818b1 100644 (file)
@@ -148,7 +148,7 @@ namespace Content.Client.ContextMenu.UI
                     Uid = entity.Value,
                 };
 
-                var session = _playerManager.LocalPlayer?.Session;
+                var session = _playerManager.LocalSession;
                 if (session != null)
                 {
                     inputSys.HandleInputCommand(session, func, message);
@@ -189,7 +189,7 @@ namespace Content.Client.ContextMenu.UI
             if (!_context.RootMenu.Visible)
                 return;
 
-            if (_playerManager.LocalPlayer?.ControlledEntity is not { } player ||
+            if (_playerManager.LocalEntity is not { } player ||
                 !player.IsValid())
                 return;
 
index 718d4731823a0df57d362beee2a2aee46ea067b5..e275f13f9355db29667dfec93686ef1cfaa2efb8 100644 (file)
@@ -28,8 +28,6 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
 {
     [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
 
-    private const string SawmillName = "DamageVisuals";
-
     public override void Initialize()
     {
         base.Initialize();
@@ -54,14 +52,14 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
     {
         if (damageVisComp.Thresholds.Count < 1)
         {
-            Logger.ErrorS(SawmillName, $"ThresholdsLookup were invalid for entity {entity}. ThresholdsLookup: {damageVisComp.Thresholds}");
+            Log.Error($"ThresholdsLookup were invalid for entity {entity}. ThresholdsLookup: {damageVisComp.Thresholds}");
             damageVisComp.Valid = false;
             return;
         }
 
         if (damageVisComp.Divisor == 0)
         {
-            Logger.ErrorS(SawmillName, $"Divisor for {entity} is set to zero.");
+            Log.Error($"Divisor for {entity} is set to zero.");
             damageVisComp.Valid = false;
             return;
         }
@@ -70,21 +68,21 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
         {
             if (damageVisComp.DamageOverlayGroups == null && damageVisComp.DamageOverlay == null)
             {
-                Logger.ErrorS(SawmillName, $"Enabled overlay without defined damage overlay sprites on {entity}.");
+                Log.Error($"Enabled overlay without defined damage overlay sprites on {entity}.");
                 damageVisComp.Valid = false;
                 return;
             }
 
             if (damageVisComp.TrackAllDamage && damageVisComp.DamageOverlay == null)
             {
-                Logger.ErrorS(SawmillName, $"Enabled all damage tracking without a damage overlay sprite on {entity}.");
+                Log.Error($"Enabled all damage tracking without a damage overlay sprite on {entity}.");
                 damageVisComp.Valid = false;
                 return;
             }
 
             if (!damageVisComp.TrackAllDamage && damageVisComp.DamageOverlay != null)
             {
-                Logger.WarningS(SawmillName, $"Disabled all damage tracking with a damage overlay sprite on {entity}.");
+                Log.Warning($"Disabled all damage tracking with a damage overlay sprite on {entity}.");
                 damageVisComp.Valid = false;
                 return;
             }
@@ -92,7 +90,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
 
             if (damageVisComp.TrackAllDamage && damageVisComp.DamageOverlayGroups != null)
             {
-                Logger.WarningS(SawmillName, $"Enabled all damage tracking with damage overlay groups on {entity}.");
+                Log.Warning($"Enabled all damage tracking with damage overlay groups on {entity}.");
                 damageVisComp.Valid = false;
                 return;
             }
@@ -101,21 +99,21 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
         {
             if (damageVisComp.TargetLayers == null)
             {
-                Logger.ErrorS(SawmillName, $"Disabled overlay without target layers on {entity}.");
+                Log.Error($"Disabled overlay without target layers on {entity}.");
                 damageVisComp.Valid = false;
                 return;
             }
 
             if (damageVisComp.DamageOverlayGroups != null || damageVisComp.DamageOverlay != null)
             {
-                Logger.ErrorS(SawmillName, $"Disabled overlay with defined damage overlay sprites on {entity}.");
+                Log.Error($"Disabled overlay with defined damage overlay sprites on {entity}.");
                 damageVisComp.Valid = false;
                 return;
             }
 
             if (damageVisComp.DamageGroup == null)
             {
-                Logger.ErrorS(SawmillName, $"Disabled overlay without defined damage group on {entity}.");
+                Log.Error($"Disabled overlay without defined damage group on {entity}.");
                 damageVisComp.Valid = false;
                 return;
             }
@@ -123,12 +121,12 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
 
         if (damageVisComp.DamageOverlayGroups != null && damageVisComp.DamageGroup != null)
         {
-            Logger.WarningS(SawmillName, $"Damage overlay sprites and damage group are both defined on {entity}.");
+            Log.Warning($"Damage overlay sprites and damage group are both defined on {entity}.");
         }
 
         if (damageVisComp.DamageOverlay != null && damageVisComp.DamageGroup != null)
         {
-            Logger.WarningS(SawmillName, $"Damage overlay sprites and damage group are both defined on {entity}.");
+            Log.Warning($"Damage overlay sprites and damage group are both defined on {entity}.");
         }
     }
 
@@ -144,7 +142,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
 
         if (damageVisComp.Thresholds[0] != 0)
         {
-            Logger.ErrorS(SawmillName, $"ThresholdsLookup were invalid for entity {entity}. ThresholdsLookup: {damageVisComp.Thresholds}");
+            Log.Error($"ThresholdsLookup were invalid for entity {entity}. ThresholdsLookup: {damageVisComp.Thresholds}");
             damageVisComp.Valid = false;
             return;
         }
@@ -163,7 +161,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
                 {
                     if (!damageContainer.SupportedGroups.Contains(damageType))
                     {
-                        Logger.ErrorS(SawmillName, $"Damage key {damageType} was invalid for entity {entity}.");
+                        Log.Error($"Damage key {damageType} was invalid for entity {entity}.");
                         damageVisComp.Valid = false;
                         return;
                     }
@@ -177,7 +175,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
             {
                 if (!damageContainer.SupportedGroups.Contains(damageVisComp.DamageGroup))
                 {
-                    Logger.ErrorS(SawmillName, $"Damage keys were invalid for entity {entity}.");
+                    Log.Error($"Damage keys were invalid for entity {entity}.");
                     damageVisComp.Valid = false;
                     return;
                 }
@@ -197,7 +195,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
                 {
                     if (!damagePrototypeIdList.Contains(damageType))
                     {
-                        Logger.ErrorS(SawmillName, $"Damage keys were invalid for entity {entity}.");
+                        Log.Error($"Damage keys were invalid for entity {entity}.");
                         damageVisComp.Valid = false;
                         return;
                     }
@@ -208,7 +206,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
             {
                 if (!damagePrototypeIdList.Contains(damageVisComp.DamageGroup))
                 {
-                    Logger.ErrorS(SawmillName, $"Damage keys were invalid for entity {entity}.");
+                    Log.Error($"Damage keys were invalid for entity {entity}.");
                     damageVisComp.Valid = false;
                     return;
                 }
@@ -232,7 +230,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
             {
                 if (!spriteComponent.LayerMapTryGet(key, out var index))
                 {
-                    Logger.WarningS(SawmillName, $"Layer at key {key} was invalid for entity {entity}.");
+                    Log.Warning($"Layer at key {key} was invalid for entity {entity}.");
                     continue;
                 }
 
@@ -244,7 +242,7 @@ public sealed class DamageVisualsSystem : VisualizerSystem<DamageVisualsComponen
             // invalidate the visualizer without crashing.
             if (damageVisComp.TargetLayerMapKeys.Count == 0)
             {
-                Logger.ErrorS(SawmillName, $"Target layers were invalid for entity {entity}.");
+                Log.Error($"Target layers were invalid for entity {entity}.");
                 damageVisComp.Valid = false;
                 return;
             }
index 38e1a714aca9c8a5af1260aa5e23403c420a52b6..b00904a1fef496662f0859d12b9dfdb3f0d13048 100644 (file)
@@ -38,7 +38,7 @@ public sealed class DoAfterSystem : SharedDoAfterSystem
         // ones that depend on the target not moving, because the cancellation of those do afters should be readily
         // predictable by clients.
 
-        var playerEntity = _player.LocalPlayer?.ControlledEntity;
+        var playerEntity = _player.LocalEntity;
 
         if (!TryComp(playerEntity, out ActiveDoAfterComponent? active))
             return;
@@ -69,7 +69,7 @@ public sealed class DoAfterSystem : SharedDoAfterSystem
         out float progress)
         where T : DoAfterEvent
     {
-        var playerEntity = _player.LocalPlayer?.ControlledEntity;
+        var playerEntity = _player.LocalEntity;
 
         doAfter = null;
         @event = null;
index d4331fd15dcfc1e75355caa44413e16d7e2fb6a4..cfd84a471336cc4a13833c0a3bcdece0fa4a2010 100644 (file)
@@ -5,7 +5,7 @@ namespace Content.Client.Doors;
 
 public sealed class FirelockSystem : EntitySystem
 {
-    [Dependency] protected readonly SharedAppearanceSystem _appearanceSystem = default!;
+    [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
 
     public override void Initialize()
     {
index 3c42033be6c8f8fa76771fae17c44785f49ae583..9bfa4fdf8271f83496afe01eb483b023361ecf8d 100644 (file)
@@ -43,13 +43,13 @@ public sealed class DrugOverlaySystem : EntitySystem
 
     private void OnInit(EntityUid uid, SeeingRainbowsComponent component, ComponentInit args)
     {
-        if (_player.LocalPlayer?.ControlledEntity == uid)
+        if (_player.LocalEntity == uid)
             _overlayMan.AddOverlay(_overlay);
     }
 
     private void OnShutdown(EntityUid uid, SeeingRainbowsComponent component, ComponentShutdown args)
     {
-        if (_player.LocalPlayer?.ControlledEntity == uid)
+        if (_player.LocalEntity == uid)
         {
             _overlay.Intoxication = 0;
             _overlayMan.RemoveOverlay(_overlay);
index 8372f7ea600a7ded344cc6d4451139c44d67acaf..6ef5d0f65ce8e5d6d38ab0ea74b65f79130c889f 100644 (file)
@@ -34,7 +34,7 @@ public sealed class RainbowOverlay : Overlay
 
     protected override void FrameUpdate(FrameEventArgs args)
     {
-        var playerEntity = _playerManager.LocalPlayer?.ControlledEntity;
+        var playerEntity = _playerManager.LocalEntity;
 
         if (playerEntity == null)
             return;
@@ -53,7 +53,7 @@ public sealed class RainbowOverlay : Overlay
 
     protected override bool BeforeDraw(in OverlayDrawArgs args)
     {
-        if (!_entityManager.TryGetComponent(_playerManager.LocalPlayer?.ControlledEntity, out EyeComponent? eyeComp))
+        if (!_entityManager.TryGetComponent(_playerManager.LocalEntity, out EyeComponent? eyeComp))
             return false;
 
         if (args.Viewport.Eye != eyeComp.Eye)
index 96a3beb7022fc37fdecd05740b1cb89523af7103..e01719e62cb91837e76355f96742a80902e14404 100644 (file)
@@ -36,7 +36,7 @@ public sealed class DrunkOverlay : Overlay
     protected override void FrameUpdate(FrameEventArgs args)
     {
 
-        var playerEntity = _playerManager.LocalPlayer?.ControlledEntity;
+        var playerEntity = _playerManager.LocalEntity;
 
         if (playerEntity == null)
             return;
@@ -58,7 +58,7 @@ public sealed class DrunkOverlay : Overlay
 
     protected override bool BeforeDraw(in OverlayDrawArgs args)
     {
-        if (!_entityManager.TryGetComponent(_playerManager.LocalPlayer?.ControlledEntity, out EyeComponent? eyeComp))
+        if (!_entityManager.TryGetComponent(_playerManager.LocalEntity, out EyeComponent? eyeComp))
             return false;
 
         if (args.Viewport.Eye != eyeComp.Eye)
index dcd2758623e2ae461e00e6c4dfde0f320e03e0fe..d9c6bb192fdcaa500c3629b017d6c7d61a8d5674 100644 (file)
@@ -38,13 +38,13 @@ public sealed class DrunkSystem : SharedDrunkSystem
 
     private void OnDrunkInit(EntityUid uid, DrunkComponent component, ComponentInit args)
     {
-        if (_player.LocalPlayer?.ControlledEntity == uid)
+        if (_player.LocalEntity == uid)
             _overlayMan.AddOverlay(_overlay);
     }
 
     private void OnDrunkShutdown(EntityUid uid, DrunkComponent component, ComponentShutdown args)
     {
-        if (_player.LocalPlayer?.ControlledEntity == uid)
+        if (_player.LocalEntity == uid)
         {
             _overlay.CurrentBoozePower = 0;
             _overlayMan.RemoveOverlay(_overlay);
index 32ba78085ae624eaeebd9dfd44a3af940d25f284..1be472b06d67a5766596ee1fd37a7ac6eac8961f 100644 (file)
@@ -33,7 +33,6 @@ namespace Content.Client.Examine
         [Dependency] private readonly IPlayerManager _playerManager = default!;
         [Dependency] private readonly IEyeManager _eyeManager = default!;
         [Dependency] private readonly VerbSystem _verbSystem = default!;
-        [Dependency] private readonly IBaseClient _client = default!;
 
         public const string StyleClassEntityTooltip = "entity-tooltip";
 
@@ -66,12 +65,10 @@ namespace Content.Client.Examine
         {
             if (!args.User.Valid)
                 return;
-            if (_playerManager.LocalPlayer == null)
-                return;
             if (_examineTooltipOpen == null)
                 return;
 
-            if (item == _examinedEntity && args.User == _playerManager.LocalPlayer.ControlledEntity)
+            if (item == _examinedEntity && args.User == _playerManager.LocalEntity)
                 CloseTooltip();
         }
 
@@ -118,7 +115,7 @@ namespace Content.Client.Examine
                 return false;
             }
 
-            _playerEntity = _playerManager.LocalPlayer?.ControlledEntity ?? default;
+            _playerEntity = _playerManager.LocalEntity ?? default;
 
             if (_playerEntity == default || !CanExamine(_playerEntity, entity))
             {
@@ -149,7 +146,7 @@ namespace Content.Client.Examine
 
         private void OnExamineInfoResponse(ExamineSystemMessages.ExamineInfoResponseMessage ev)
         {
-            var player = _playerManager.LocalPlayer?.ControlledEntity;
+            var player = _playerManager.LocalEntity;
             if (player == null)
                 return;
 
@@ -356,7 +353,7 @@ namespace Content.Client.Examine
 
         public void DoExamine(EntityUid entity, bool centeredOnCursor = true, EntityUid? userOverride = null)
         {
-            var playerEnt = userOverride ?? _playerManager.LocalPlayer?.ControlledEntity;
+            var playerEnt = userOverride ?? _playerManager.LocalEntity;
             if (playerEnt == null)
                 return;
 
index 94e8ca59823728254e6606469938dfe268b7fb31..2d8c15f1b9f9ff3340e2c7d8acacbd706a8a824c 100644 (file)
@@ -14,7 +14,6 @@ namespace Content.Client.Explosion;
 public sealed class ExplosionOverlay : Overlay
 {
     [Dependency] private readonly IRobustRandom _robustRandom = default!;
-    [Dependency] private readonly IMapManager _mapManager = default!;
     [Dependency] private readonly IEntityManager _entMan = default!;
     [Dependency] private readonly IPrototypeManager _proto = default!;
 
index 2bff5db4d61a396a25449a94f0b2bd25b3df3913..99d215b7587cd915401f1ef51674368629809ac0 100644 (file)
@@ -43,13 +43,13 @@ public sealed class BlindingSystem : EntitySystem
 
     private void OnBlindInit(EntityUid uid, BlindableComponent component, ComponentInit args)
     {
-        if (_player.LocalPlayer?.ControlledEntity == uid)
+        if (_player.LocalEntity == uid)
             _overlayMan.AddOverlay(_overlay);
     }
 
     private void OnBlindShutdown(EntityUid uid, BlindableComponent component, ComponentShutdown args)
     {
-        if (_player.LocalPlayer?.ControlledEntity == uid)
+        if (_player.LocalEntity == uid)
         {
             _overlayMan.RemoveOverlay(_overlay);
         }
index 91090fc4607570b70b8c5ff2617d62489bf3a473..ba687ead4eb9e8a3647ceac07553361338164738 100644 (file)
@@ -36,13 +36,13 @@ public sealed class BlurryVisionSystem : EntitySystem
 
     private void OnBlurryInit(EntityUid uid, BlurryVisionComponent component, ComponentInit args)
     {
-        if (_player.LocalPlayer?.ControlledEntity == uid)
+        if (_player.LocalEntity == uid)
             _overlayMan.AddOverlay(_overlay);
     }
 
     private void OnBlurryShutdown(EntityUid uid, BlurryVisionComponent component, ComponentShutdown args)
     {
-        if (_player.LocalPlayer?.ControlledEntity == uid)
+        if (_player.LocalEntity == uid)
         {
             _overlayMan.RemoveOverlay(_overlay);
         }
index 8889b97100242948474c8b63356306a727cc7598..78e1b851fcbda8868a47b9181dfdee4c5e639819 100644 (file)
@@ -41,7 +41,7 @@ public sealed class EyeLerpingSystem : EntitySystem
 
     private void OnEyeStartup(EntityUid uid, EyeComponent component, ComponentStartup args)
     {
-        if (_playerManager.LocalPlayer?.ControlledEntity == uid)
+        if (_playerManager.LocalEntity == uid)
             AddEye(uid, component, true);
     }
 
@@ -77,7 +77,7 @@ public sealed class EyeLerpingSystem : EntitySystem
             return;
 
         // If this is the currently controlled entity, we keep the component.
-        if (_playerManager.LocalPlayer?.ControlledEntity == uid)
+        if (_playerManager.LocalEntity == uid)
             lerp.ManuallyAdded = false;
         else
             RemComp(uid, lerp);
index 433ee95e1cbfb1587fd3906d0de360847969cd0e..fe9c888227ec34571884845a93a9798b6a2a61cf 100644 (file)
@@ -51,7 +51,7 @@ namespace Content.Client.Flash
 
         protected override void Draw(in OverlayDrawArgs args)
         {
-            if (!_entityManager.TryGetComponent(_playerManager.LocalPlayer?.ControlledEntity, out EyeComponent? eyeComp))
+            if (!_entityManager.TryGetComponent(_playerManager.LocalEntity, out EyeComponent? eyeComp))
                 return;
 
             if (args.Viewport.Eye != eyeComp.Eye)
index 3393662fa408e12403530e7f190ce072880f218f..ad8f8b0b82bf5fddfbe2eacff61b296b550462e4 100644 (file)
@@ -25,7 +25,7 @@ namespace Content.Client.Flash
                 return;
 
             // Yes, this code is awful. I'm just porting it to an entity system so don't blame me.
-            if (_playerManager.LocalPlayer != null && _playerManager.LocalPlayer.Session.AttachedEntity != uid)
+            if (_playerManager.LocalEntity != uid)
             {
                 return;
             }
index 8c8b13a1efe78ca8fb1d78ed0f91b50f0c6df4de..ac6661cfdd839ecb596751c0be1c466d2a9da8d3 100644 (file)
@@ -9,7 +9,6 @@ namespace Content.Client.Fluids;
 
 public sealed class PuddleOverlay : Overlay
 {
-    [Dependency] private readonly IMapManager _mapManager = default!;
     [Dependency] private readonly IEyeManager _eyeManager = default!;
     [Dependency] private readonly IEntityManager _entityManager = default!;
     [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
index fbfcb06f158f768b56ef495ed0290ce80eaa9ac2..b508fa743384c8f463eb6835a5339a1c8464322d 100644 (file)
@@ -18,7 +18,7 @@
                 Text="{Loc 'forensic-scanner-interface-clear'}" />
         </BoxContainer>
         <Label
-            Name="Name"
+            Name="NameLabel"
             Align="Center" />
         <Label
             Name="Diagnostics"
index 8b6152c86126be55ba02e96b907e1175224ae788..5f7f8e0056c652c7cc8732d3b96238016e72694d 100644 (file)
@@ -29,7 +29,7 @@ namespace Content.Client.Forensics
             {
                 Print.Disabled = true;
                 Clear.Disabled = true;
-                Name.Text = string.Empty;
+                NameLabel.Text = string.Empty;
                 Diagnostics.Text = string.Empty;
                 return;
             }
@@ -37,7 +37,7 @@ namespace Content.Client.Forensics
             Print.Disabled = (msg.PrintReadyAt > _gameTiming.CurTime);
             Clear.Disabled = false;
 
-            Name.Text = msg.LastScannedName;
+            NameLabel.Text = msg.LastScannedName;
 
             var text = new StringBuilder();
 
index 1154dca350ce27e8ea868a0855eab09cfe25979d..25b6802bd73d31add7c8e0f8e555024d459e8100 100644 (file)
@@ -38,7 +38,6 @@ namespace Content.Client.GameTicking.Managers
         [ViewVariables] public bool DisallowedLateJoin { get; private set; }
         [ViewVariables] public string? ServerInfoBlob { get; private set; }
         [ViewVariables] public TimeSpan StartTime { get; private set; }
-        [ViewVariables] public TimeSpan RoundStartTimeSpan { get; private set; }
         [ViewVariables] public new bool Paused { get; private set; }
 
         [ViewVariables] public IReadOnlyDictionary<NetEntity, Dictionary<string, uint?>> JobsAvailable => _jobsAvailable;
index 454c063260510d62aaefe077625adceecb7267c7..bdbd69d108636d526734e02d2754a44d13280902 100644 (file)
@@ -203,7 +203,7 @@ namespace Content.Client.Gameplay
             }; // TODO make entityUid nullable
 
             // client side command handlers will always be sent the local player session.
-            var session = _playerManager.LocalPlayer?.Session;
+            var session = _playerManager.LocalSession;
             if (inputSys.HandleInputCommand(session, func, message))
             {
                 kArgs.Handle();
index f6913d2578648763ec2364f2a96a4334f39f0945..c42e7cd0e0c5f45be4b2a9b79b28d32793566d3a 100644 (file)
@@ -15,7 +15,6 @@ namespace Content.Client.Ghost
         [Dependency] private readonly IPlayerManager _playerManager = default!;
         [Dependency] private readonly SharedActionsSystem _actions = default!;
         [Dependency] private readonly ContentEyeSystem _contentEye = default!;
-        [Dependency] private readonly EyeSystem _eye = default!;
 
         public int AvailableGhostRoleCount { get; private set; }
 
@@ -41,7 +40,7 @@ namespace Content.Client.Ghost
             }
         }
 
-        public GhostComponent? Player => CompOrNull<GhostComponent>(_playerManager.LocalPlayer?.ControlledEntity);
+        public GhostComponent? Player => CompOrNull<GhostComponent>(_playerManager.LocalEntity);
         public bool IsGhost => Player != null;
 
         public event Action<GhostComponent>? PlayerRemoved;
index 55becdd3950fa61b292ff5e62156eef37dd95522..c4356588d3559f50db39701b3cb281eb3a4ce8b1 100644 (file)
@@ -23,7 +23,7 @@ public sealed partial class GravitySystem
 
     private void OnShakeInit(EntityUid uid, GravityShakeComponent component, ComponentInit args)
     {
-        var localPlayer = _playerManager.LocalPlayer?.ControlledEntity;
+        var localPlayer = _playerManager.LocalEntity;
 
         if (!TryComp<TransformComponent>(localPlayer, out var xform) ||
             xform.GridUid != uid && xform.MapUid != uid)
@@ -44,7 +44,7 @@ public sealed partial class GravitySystem
         if (!Resolve(uid, ref gravity) || !Timing.IsFirstTimePredicted)
             return;
 
-        var localPlayer = _playerManager.LocalPlayer?.ControlledEntity;
+        var localPlayer = _playerManager.LocalEntity;
 
         if (!TryComp<TransformComponent>(localPlayer, out var xform))
             return;
index dffc625cb8623c05b9ba28296b2429f26fd6d935..cb13d4ca6e5bcef858a9759031e43f3629d12f2f 100644 (file)
@@ -55,7 +55,7 @@ public sealed class GuidebookSystem : EntitySystem
     /// </summary>
     public EntityUid GetGuidebookUser()
     {
-        var user = _playerManager.LocalPlayer!.ControlledEntity;
+        var user = _playerManager.LocalEntity;
         if (user != null)
             return user.Value;
 
index 9ea094a73abc8239ede9212711630654298ff48d..7319b97b42b79c9bb09014e8ad51b822ff7c95fa 100644 (file)
@@ -22,7 +22,6 @@ namespace Content.Client.Hands.Systems
     [UsedImplicitly]
     public sealed class HandsSystem : SharedHandsSystem
     {
-        [Dependency] private readonly IGameTiming _gameTiming = default!;
         [Dependency] private readonly IPlayerManager _playerManager = default!;
         [Dependency] private readonly IUserInterfaceManager _ui = default!;
 
@@ -147,7 +146,7 @@ namespace Content.Client.Hands.Systems
         /// </summary>
         public bool TryGetPlayerHands([NotNullWhen(true)] out HandsComponent? hands)
         {
-            var player = _playerManager.LocalPlayer?.ControlledEntity;
+            var player = _playerManager.LocalEntity;
             hands = null;
             return player != null && TryComp(player.Value, out hands);
         }
@@ -248,7 +247,7 @@ namespace Content.Client.Hands.Systems
             UpdateHandVisuals(uid, args.Entity, hand);
             _stripSys.UpdateUi(uid);
 
-            if (uid != _playerManager.LocalPlayer?.ControlledEntity)
+            if (uid != _playerManager.LocalEntity)
                 return;
 
             OnPlayerItemAdded?.Invoke(hand.Name, args.Entity);
@@ -266,7 +265,7 @@ namespace Content.Client.Hands.Systems
             UpdateHandVisuals(uid, args.Entity, hand);
             _stripSys.UpdateUi(uid);
 
-            if (uid != _playerManager.LocalPlayer?.ControlledEntity)
+            if (uid != _playerManager.LocalEntity)
                 return;
 
             OnPlayerItemRemoved?.Invoke(hand.Name, args.Entity);
@@ -284,7 +283,7 @@ namespace Content.Client.Hands.Systems
                 return;
 
             // visual update might involve changes to the entity's effective sprite -> need to update hands GUI.
-            if (uid == _playerManager.LocalPlayer?.ControlledEntity)
+            if (uid == _playerManager.LocalEntity)
                 OnPlayerItemAdded?.Invoke(hand.Name, held);
 
             if (!handComp.ShowInHands)
@@ -375,13 +374,13 @@ namespace Content.Client.Hands.Systems
 
         private void OnHandsStartup(EntityUid uid, HandsComponent component, ComponentStartup args)
         {
-            if (_playerManager.LocalPlayer?.ControlledEntity == uid)
+            if (_playerManager.LocalEntity == uid)
                 OnPlayerHandsAdded?.Invoke(component);
         }
 
         private void OnHandsShutdown(EntityUid uid, HandsComponent component, ComponentShutdown args)
         {
-            if (_playerManager.LocalPlayer?.ControlledEntity == uid)
+            if (_playerManager.LocalEntity == uid)
                 OnPlayerHandsRemoved?.Invoke();
         }
         #endregion
@@ -395,7 +394,7 @@ namespace Content.Client.Hands.Systems
         {
             base.AddHand(uid, handName, handLocation, handsComp);
 
-            if (uid == _playerManager.LocalPlayer?.ControlledEntity)
+            if (uid == _playerManager.LocalEntity)
                 OnPlayerAddHand?.Invoke(handName, handLocation);
 
             if (handsComp == null)
@@ -406,9 +405,9 @@ namespace Content.Client.Hands.Systems
         }
         public override void RemoveHand(EntityUid uid, string handName, HandsComponent? handsComp = null)
         {
-            if (uid == _playerManager.LocalPlayer?.ControlledEntity && handsComp != null &&
+            if (uid == _playerManager.LocalEntity && handsComp != null &&
                 handsComp.Hands.ContainsKey(handName) && uid ==
-                _playerManager.LocalPlayer?.ControlledEntity)
+                _playerManager.LocalEntity)
             {
                 OnPlayerRemoveHand?.Invoke(handName);
             }
@@ -421,7 +420,7 @@ namespace Content.Client.Hands.Systems
             if (ent is not { } hand)
                 return;
 
-            if (_playerManager.LocalPlayer?.ControlledEntity != hand.Owner)
+            if (_playerManager.LocalEntity != hand.Owner)
                 return;
 
             if (hand.Comp.ActiveHand == null)
index 8e9c0f9e1993e3c19dbc4d4fe05b791b9053dd44..028a3b70d9f42ac2511bb9d2fddaa797a28a3634 100644 (file)
@@ -2,10 +2,13 @@ using Content.Shared.HotPotato;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
 
+namespace Content.Client.HotPotato;
+
 public sealed class HotPotatoSystem : SharedHotPotatoSystem
 {
     [Dependency] private readonly IGameTiming _timing = default!;
     [Dependency] private readonly IRobustRandom _random = default!;
+    [Dependency] private readonly SharedTransformSystem _transform = default!;
 
     public override void Update(float frameTime)
     {
@@ -20,7 +23,7 @@ public sealed class HotPotatoSystem : SharedHotPotatoSystem
             if (_timing.CurTime < comp.TargetTime)
                 continue;
             comp.TargetTime = _timing.CurTime + TimeSpan.FromSeconds(comp.EffectCooldown);
-            Spawn("HotPotatoEffect", Transform(uid).MapPosition.Offset(_random.NextVector2(0.25f)));
+            Spawn("HotPotatoEffect", _transform.GetMapCoordinates(uid).Offset(_random.NextVector2(0.25f)));
         }
     }
 }
index d9c9b66dcb67f60d886768a2cd7044d39bfa07cc..5bdaa52359da1a2844d6a4855da75641a9a1f0af 100644 (file)
@@ -29,8 +29,8 @@ public sealed class InstrumentSystem : SharedInstrumentSystem
 
         UpdatesOutsidePrediction = true;
 
-        _cfg.OnValueChanged(CCVars.MaxMidiEventsPerBatch, OnMaxMidiEventsPerBatchChanged, true);
-        _cfg.OnValueChanged(CCVars.MaxMidiEventsPerSecond, OnMaxMidiEventsPerSecondChanged, true);
+        Subs.CVar(_cfg, CCVars.MaxMidiEventsPerBatch, OnMaxMidiEventsPerBatchChanged, true);
+        Subs.CVar(_cfg, CCVars.MaxMidiEventsPerSecond, OnMaxMidiEventsPerSecondChanged, true);
 
         SubscribeNetworkEvent<InstrumentMidiEventEvent>(OnMidiEventRx);
         SubscribeNetworkEvent<InstrumentStartMidiEvent>(OnMidiStart);
@@ -60,14 +60,6 @@ public sealed class InstrumentSystem : SharedInstrumentSystem
             EndRenderer(uid, true, component);
     }
 
-    public override void Shutdown()
-    {
-        base.Shutdown();
-
-        _cfg.UnsubValueChanged(CCVars.MaxMidiEventsPerBatch, OnMaxMidiEventsPerBatchChanged);
-        _cfg.UnsubValueChanged(CCVars.MaxMidiEventsPerSecond, OnMaxMidiEventsPerSecondChanged);
-    }
-
     private void OnShutdown(EntityUid uid, InstrumentComponent component, ComponentShutdown args)
     {
         EndRenderer(uid, false, component);
index 85c9cc1447e7a67ba90f1f8481fc38dca98c8da9..da443e3fb5bbec0ca6ad2a0ebd5141e508be7fa6 100644 (file)
@@ -168,14 +168,14 @@ namespace Content.Client.Instruments.UI
             if (instrument == null)
                 return false;
 
-            var localPlayer = _owner.PlayerManager.LocalPlayer;
+            var localEntity = _owner.PlayerManager.LocalEntity;
 
             // If we don't have a player or controlled entity, we return.
-            if (localPlayer?.ControlledEntity == null)
+            if (localEntity == null)
                 return false;
 
             // By default, allow an instrument to play itself and skip all other checks
-            if (localPlayer.ControlledEntity == instrumentEnt)
+            if (localEntity == instrumentEnt)
                 return true;
 
             var container = _owner.Entities.System<SharedContainerSystem>();
@@ -183,14 +183,14 @@ namespace Content.Client.Instruments.UI
             container.TryGetContainingContainer(instrumentEnt, out var conMan);
 
             // If the instrument is handheld and we're not holding it, we return.
-            if ((instrument.Handheld && (conMan == null || conMan.Owner != localPlayer.ControlledEntity)))
+            if ((instrument.Handheld && (conMan == null || conMan.Owner != localEntity)))
                 return false;
 
-            if (!_owner.ActionBlocker.CanInteract(localPlayer.ControlledEntity.Value, instrumentEnt))
+            if (!_owner.ActionBlocker.CanInteract(localEntity.Value, instrumentEnt))
                 return false;
 
             // We check that we're in range unobstructed just in case.
-            return _owner.Interactions.InRangeUnobstructed(localPlayer.ControlledEntity.Value, instrumentEnt);
+            return _owner.Interactions.InRangeUnobstructed(localEntity.Value, instrumentEnt);
         }
 
         private void MidiStopButtonOnPressed(ButtonEventArgs? obj)
index 66571a9d27f7789db922e456702d6b827b0c3d39..8baa4d15fe4b229d82a66cdab52de69334b857c8 100644 (file)
@@ -109,7 +109,7 @@ public sealed class DragDropSystem : SharedDragDropSystem
         UpdatesOutsidePrediction = true;
         UpdatesAfter.Add(typeof(SharedEyeSystem));
 
-        _cfgMan.OnValueChanged(CCVars.DragDropDeadZone, SetDeadZone, true);
+        Subs.CVar(_cfgMan, CCVars.DragDropDeadZone, SetDeadZone, true);
 
         _dropTargetInRangeShader = _prototypeManager.Index<ShaderPrototype>(ShaderDropTargetInRange).Instance();
         _dropTargetOutOfRangeShader = _prototypeManager.Index<ShaderPrototype>(ShaderDropTargetOutOfRange).Instance();
@@ -126,7 +126,6 @@ public sealed class DragDropSystem : SharedDragDropSystem
 
     public override void Shutdown()
     {
-        _cfgMan.UnsubValueChanged(CCVars.DragDropDeadZone, SetDeadZone);
         CommandBinds.Unregister<DragDropSystem>();
         base.Shutdown();
     }
@@ -269,7 +268,7 @@ public sealed class DragDropSystem : SharedDragDropSystem
             return false;
         }
 
-        var player = _playerManager.LocalPlayer?.ControlledEntity;
+        var player = _playerManager.LocalEntity;
 
         // still in range of the thing we are dragging?
         if (player == null || !_interactionSystem.InRangeUnobstructed(player.Value, _draggedEntity.Value))
@@ -346,7 +345,7 @@ public sealed class DragDropSystem : SharedDragDropSystem
             return false;
         }
 
-        var localPlayer = _playerManager.LocalPlayer?.ControlledEntity;
+        var localPlayer = _playerManager.LocalEntity;
 
         if (localPlayer == null || !Exists(_draggedEntity))
         {
@@ -410,7 +409,7 @@ public sealed class DragDropSystem : SharedDragDropSystem
             return;
         }
 
-        var user = _playerManager.LocalPlayer?.ControlledEntity;
+        var user = _playerManager.LocalEntity;
 
         if (user == null)
             return;
index 028c035e8a78f4193503142fab9ee29cfeb2312a..f8eb12df914021ec789b80eb6ba4f9f39b321e90 100644 (file)
@@ -30,10 +30,9 @@ namespace Content.Client.Inventory
     [UsedImplicitly]
     public sealed class StrippableBoundUserInterface : BoundUserInterface
     {
-        [Dependency] private readonly IPrototypeManager _protoMan = default!;
         [Dependency] private readonly IUserInterfaceManager _ui = default!;
-        private readonly ExamineSystem _examine = default!;
-        private readonly InventorySystem _inv = default!;
+        private readonly ExamineSystem _examine;
+        private readonly InventorySystem _inv;
         private readonly SharedCuffableSystem _cuffable;
 
         [ViewVariables]
index 9acfb03126109606981abbb0783f1a21e5977b79..3e7ca574763ba2efdd9d3877cba5d9acdf933364 100644 (file)
@@ -23,7 +23,6 @@ namespace Content.Client.LateJoin
         [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
         [Dependency] private readonly IClientConsoleHost _consoleHost = default!;
         [Dependency] private readonly IConfigurationManager _configManager = default!;
-        [Dependency] private readonly IEntityManager _entManager = default!;
         [Dependency] private readonly IEntitySystemManager _entitySystem = default!;
         [Dependency] private readonly JobRequirementsManager _jobRequirements = default!;
 
index 2da84e9eb1e92a4dcca230fdbdcf01199aa7590c..ede51fc23b051e3279cf7ec4bf6889abe6e958e2 100644 (file)
@@ -6,7 +6,7 @@
                 <PanelContainer.PanelOverride>
                     <gfx:StyleBoxFlat BackgroundColor="#4c6530"/>
                 </PanelContainer.PanelOverride>
-                <Label Name="Name" Margin="6 6 6 6" HorizontalAlignment="Center"/>
+                <Label Name="NameLabel" Margin="6 6 6 6" HorizontalAlignment="Center"/>
             </PanelContainer>
         </BoxContainer>
         <BoxContainer Orientation="Horizontal" HorizontalExpand="True">
index 47c0018804888585801f981e294d0d91c76bb860..3c5076e68f89ed44f139e0757e031b2c416cec6a 100644 (file)
@@ -13,13 +13,13 @@ namespace Content.Client.MassMedia.Ui;
 public sealed partial class MiniArticleCardControl : Control
 {
     public Action? OnDeletePressed;
-    public int ArtcileNum;
+    public int ArticleNum;
 
     public MiniArticleCardControl(string name, string author)
     {
         RobustXamlLoader.Load(this);
 
-        Name.Text = name;
+        NameLabel.Text = name;
         Author.SetMarkup(author);
 
         Delete.OnPressed += _ => OnDeletePressed?.Invoke();
index b3cbf0cf2c2d0f9c709be8201129a6e843a00df8..89ab1490af363076a5b0e8917edad268fb28fea4 100644 (file)
@@ -31,8 +31,8 @@ public sealed partial class NewsWriteMenu : DefaultWindow
         {
             var article = articles[i];
             var mini = new MiniArticleCardControl(article.Name, (article.Author != null ? article.Author : Loc.GetString("news-read-ui-no-author")));
-            mini.ArtcileNum = i;
-            mini.OnDeletePressed += () => DeleteButtonPressed?.Invoke(mini.ArtcileNum);
+            mini.ArticleNum = i;
+            mini.OnDeletePressed += () => DeleteButtonPressed?.Invoke(mini.ArticleNum);
 
             ArticleCardsContainer.AddChild(mini);
         }
index 9615862dc5e578ce1db44f766429aff7d0f410d8..44e82053554184e4aba78967b24ca91f564bc0b8 100644 (file)
@@ -23,7 +23,7 @@ public sealed class MouseRotatorSystem : SharedMouseRotatorSystem
         if (!_timing.IsFirstTimePredicted || !_input.MouseScreenPosition.IsValid)
             return;
 
-        var player = _player.LocalPlayer?.ControlledEntity;
+        var player = _player.LocalEntity;
 
         if (player == null || !TryComp<MouseRotatorComponent>(player, out var rotator))
             return;
index d8f73b0057e0603ad7bf554d9f13975cec9e56d5..182ac92ae0550a7551e031a0ba03f2c186af2de9 100644 (file)
@@ -23,7 +23,7 @@ public sealed class ContentEyeSystem : SharedContentEyeSystem
 
     public void RequestToggleFov()
     {
-        if (_player.LocalPlayer?.ControlledEntity is { } player)
+        if (_player.LocalEntity is { } player)
             RequestToggleFov(player);
     }
 
index 0cc090fcaeb1f429b38a2f8fd500d7238fa2fcaa..2fd4f296556de791512611e9ed80c528adeaa438 100644 (file)
@@ -52,8 +52,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
     /// </summary>
     public void ToggleVisualization(EntityUid uid, bool toggle, NetworkConfiguratorComponent? component = null)
     {
-        if (_playerManager.LocalPlayer == null
-            || _playerManager.LocalPlayer.ControlledEntity == null
+        if (_playerManager.LocalEntity == null
             || !Resolve(uid, ref component)
             || component.ActiveDeviceList == null)
             return;
@@ -77,7 +76,7 @@ public sealed class NetworkConfiguratorSystem : SharedNetworkConfiguratorSystem
         {
             var overlay = new NetworkConfiguratorLinkOverlay();
             _overlay.AddOverlay(overlay);
-            var player = _playerManager.LocalPlayer.ControlledEntity.Value;
+            var player = _playerManager.LocalEntity.Value;
             overlay.Action = Spawn(Action);
             _actions.AddActionDirect(player, overlay.Action.Value);
         }
index bb341785d038f4023e43a7bf1f2530eebfd538e4..3dbbafbcaa3b3ad9340fe1b481ac42a4fb42317f 100644 (file)
@@ -40,17 +40,10 @@ public sealed class InteractionOutlineSystem : EntitySystem
     {
         base.Initialize();
 
-        _configManager.OnValueChanged(CCVars.OutlineEnabled, SetCvarEnabled);
+        Subs.CVar(_configManager, CCVars.OutlineEnabled, SetCvarEnabled);
         UpdatesAfter.Add(typeof(SharedEyeSystem));
     }
 
-    public override void Shutdown()
-    {
-        base.Shutdown();
-
-        _configManager.UnsubValueChanged(CCVars.OutlineEnabled, SetCvarEnabled);
-    }
-
     public void SetCvarEnabled(bool cvarEnabled)
     {
         _cvarEnabled = cvarEnabled;
@@ -94,8 +87,8 @@ public sealed class InteractionOutlineSystem : EntitySystem
             return;
 
         // If there is no local player, there is no session, and therefore nothing to do here.
-        var localPlayer = _playerManager.LocalPlayer;
-        if (localPlayer == null)
+        var localSession = _playerManager.LocalSession;
+        if (localSession == null)
             return;
 
         // TODO InteractionOutlineComponent
@@ -135,9 +128,9 @@ public sealed class InteractionOutlineSystem : EntitySystem
         }
 
         var inRange = false;
-        if (localPlayer.ControlledEntity != null && !Deleted(entityToClick))
+        if (localSession.AttachedEntity != null && !Deleted(entityToClick))
         {
-            inRange = _interactionSystem.InRangeUnobstructed(localPlayer.ControlledEntity.Value, entityToClick.Value);
+            inRange = _interactionSystem.InRangeUnobstructed(localSession.AttachedEntity.Value, entityToClick.Value);
         }
 
         InteractionOutlineComponent? outline;
index 1c396585b3d9649f3cf3ce30414cf36ed97e9918..2a6867f51f55c92d5c5d38fd5c1725c39daaf00d 100644 (file)
@@ -114,7 +114,7 @@ public sealed class TargetOutlineSystem : EntitySystem
 
     private void HighlightTargets()
     {
-        if (_playerManager.LocalPlayer?.ControlledEntity is not { Valid: true } player)
+        if (_playerManager.LocalEntity is not { Valid: true } player)
             return;
 
         // remove current highlights
index 720da72e80edace3c2c05dece9896fc8a2cc41e3..db4cec0be80e05120b79833997ba454702af3af2 100644 (file)
@@ -13,7 +13,6 @@ public sealed class ParallaxSystem : SharedParallaxSystem
     [Dependency] private readonly IMapManager _map = default!;
     [Dependency] private readonly IOverlayManager _overlay = default!;
     [Dependency] private readonly IParallaxManager _parallax = default!;
-    [Dependency] private readonly IPrototypeManager _protoManager = default!;
 
     [ValidatePrototypeId<ParallaxPrototype>]
     private const string Fallback = "Default";
index 763f7b01145b823ee387d6f217a6be06a63ff7e1..7a8a6e39cffc9591c04ceb0dcc728670280de77a 100644 (file)
@@ -30,13 +30,13 @@ namespace Content.Client.Physics.Controllers
         private void OnUpdatePredicted(EntityUid uid, InputMoverComponent component, ref UpdateIsPredictedEvent args)
         {
             // Enable prediction if an entity is controlled by the player
-            if (uid == _playerManager.LocalPlayer?.ControlledEntity)
+            if (uid == _playerManager.LocalEntity)
                 args.IsPredicted = true;
         }
 
         private void OnUpdateRelayTargetPredicted(EntityUid uid, MovementRelayTargetComponent component, ref UpdateIsPredictedEvent args)
         {
-            if (component.Source == _playerManager.LocalPlayer?.ControlledEntity)
+            if (component.Source == _playerManager.LocalEntity)
                 args.IsPredicted = true;
         }
 
@@ -45,7 +45,7 @@ namespace Content.Client.Physics.Controllers
             // Enable prediction if an entity is being pulled by the player.
             // Disable prediction if an entity is being pulled by some non-player entity.
 
-            if (component.Puller == _playerManager.LocalPlayer?.ControlledEntity)
+            if (component.Puller == _playerManager.LocalEntity)
                 args.IsPredicted = true;
             else if (component.Puller != null)
                 args.BlockPrediction = true;
@@ -84,7 +84,7 @@ namespace Content.Client.Physics.Controllers
         {
             base.UpdateBeforeSolve(prediction, frameTime);
 
-            if (_playerManager.LocalPlayer?.ControlledEntity is not {Valid: true} player)
+            if (_playerManager.LocalEntity is not {Valid: true} player)
                 return;
 
             if (RelayQuery.TryGetComponent(player, out var relayMover))
index 0929b90a411fc9568de8461b9d5622e9807b31e6..f896d7fa39b0b3d3e00ceb000e08f67e175ae9f7 100644 (file)
@@ -94,7 +94,7 @@ public sealed class JobRequirementsManager
             return true;
         }
 
-        var player = _playerManager.LocalPlayer?.Session;
+        var player = _playerManager.LocalSession;
         if (player == null)
             return true;
 
index 37c066f5942729b182919884a63fa8a10cd53280..bc979575f5864fe6f1e7c4d3859728953f1aaf56 100644 (file)
@@ -121,7 +121,7 @@ public sealed class ContentReplayPlaybackManager
                 // Mark as handled -- the event won't get raised.
                 return true;
             case TickerJoinGameEvent:
-                if (!_entMan.EntityExists(_player.LocalPlayer?.ControlledEntity))
+                if (!_entMan.EntityExists(_player.LocalEntity))
                     _entMan.System<ReplaySpectatorSystem>().SetSpectatorPosition(default);
                 return true;
             case ChatMessage chat:
index 8e856326831b2719c4c975e72dc45fe9b7f0c9ab..cec20df4125cfbf5d36093f4010ba2950c46c7b8 100644 (file)
@@ -4,7 +4,7 @@ namespace Content.Client.Replay;
 
 public sealed class ReplayConGroup : IClientConGroupImplementation
 {
-    public event Action? ConGroupUpdated;
+    public event Action? ConGroupUpdated { add { } remove { } }
     public bool CanAdminMenu() => true;
     public bool CanAdminPlace() => true;
     public bool CanCommand(string cmdName) => true;
index 52abd0df084175eb15d758e12ed6f2a279e0d064..b364b833124713a8e254ed1e6b1c1430c0ca804c 100644 (file)
@@ -63,7 +63,7 @@ public sealed partial class ResearchConsoleMenu : FancyWindow
             MinHeight = 10
         });
 
-        var hasAccess = _player.LocalPlayer?.ControlledEntity is not { } local ||
+        var hasAccess = _player.LocalEntity is not { } local ||
                         !_entity.TryGetComponent<AccessReaderComponent>(Entity, out var access) ||
                         _accessReader.IsAllowed(local, Entity, access);
         foreach (var techId in _technologyDatabase.CurrentTechnologyCards)
index 0a73c727a4edf540b1144564051e8c498c34a910..fb305c5fdc4aa85d89e11153e4ab2121d6299595 100644 (file)
@@ -36,7 +36,7 @@ public sealed class SalvageSystem : SharedSalvageSystem
         if (ev.Cancelled)
             return;
 
-        var player = _playerManager.LocalPlayer?.ControlledEntity;
+        var player = _playerManager.LocalEntity;
 
         if (!TryComp<TransformComponent>(player, out var xform) ||
             !TryComp<SalvageExpeditionComponent>(xform.MapUid, out var expedition) ||
index 20fff4acfad2c2c6fa5bc73b48a2402d4264b2d3..3bf4bc966a55ebbfe54c6428ef673b088fdb6f2d 100644 (file)
@@ -35,7 +35,7 @@ namespace Content.Client.Shuttles.Systems
         protected override void HandlePilotShutdown(EntityUid uid, PilotComponent component, ComponentShutdown args)
         {
             base.HandlePilotShutdown(uid, component, args);
-            if (_playerManager.LocalPlayer?.ControlledEntity != uid) return;
+            if (_playerManager.LocalEntity != uid) return;
 
             _input.Contexts.SetActiveContext("human");
         }
index 565c3b8e43ca77e8973a2b8212859389cfccc6c9..4135490416f74b86f15416c6fafe7c524872386a 100644 (file)
@@ -19,8 +19,6 @@ public sealed partial class LawDisplay : Control
     [Dependency] private readonly IChatManager _chatManager = default!;
     [Dependency] private readonly EntityManager _entityManager = default!;
 
-    public event Action<BaseButton.ButtonEventArgs>? OnLawAnnouncementButtonPressed;
-
     public LawDisplay(EntityUid uid, SiliconLaw law, HashSet<string>? radioChannels)
     {
         RobustXamlLoader.Load(this);
index d4ed1285a893cfd39bcf324162ecc846b8191396..dda3a6c948ee518e5f63cef4a230c716be14160e 100644 (file)
@@ -39,7 +39,7 @@ public sealed class SpriteFadeSystem : EntitySystem
     {
         base.FrameUpdate(frameTime);
 
-        var player = _playerManager.LocalPlayer?.ControlledEntity;
+        var player = _playerManager.LocalEntity;
         var spriteQuery = GetEntityQuery<SpriteComponent>();
         var change = ChangeRate * frameTime;
 
index bd708b63d019fa5c49696bc250198c8e5a0cdac1..980fd9f2a929c10b821bbac356eb6737f84aa4ce 100644 (file)
@@ -20,16 +20,8 @@ public sealed class StatusIconSystem : SharedStatusIconSystem
     /// <inheritdoc/>
     public override void Initialize()
     {
-        _configuration.OnValueChanged(CCVars.LocalStatusIconsEnabled, OnLocalStatusIconChanged, true);
-        _configuration.OnValueChanged(CCVars.GlobalStatusIconsEnabled, OnGlobalStatusIconChanged, true);
-    }
-
-    public override void Shutdown()
-    {
-        base.Shutdown();
-
-        _configuration.UnsubValueChanged(CCVars.LocalStatusIconsEnabled, OnLocalStatusIconChanged);
-        _configuration.UnsubValueChanged(CCVars.GlobalStatusIconsEnabled, OnGlobalStatusIconChanged);
+        Subs.CVar(_configuration, CCVars.LocalStatusIconsEnabled, OnLocalStatusIconChanged, true);
+        Subs.CVar(_configuration, CCVars.GlobalStatusIconsEnabled, OnGlobalStatusIconChanged, true);
     }
 
     private void OnLocalStatusIconChanged(bool obj)
index f4ba455303ca9b2fba9b603df77180169c13de0a..95bce03c0f9cf5563be3f4593f4e5079e0f3e853 100644 (file)
@@ -33,7 +33,7 @@ public sealed class TrayScannerSystem : SharedTrayScannerSystem
             return;
 
         // TODO: Multiple viewports or w/e
-        var player = _player.LocalPlayer?.ControlledEntity;
+        var player = _player.LocalEntity;
         var xformQuery = GetEntityQuery<TransformComponent>();
 
         if (!xformQuery.TryGetComponent(player, out var playerXform))
index c71c34d0efdf3c578ff099bcb79d317baaab471e..696c1455e0c1bf609eb3ece64520b626300a2050 100644 (file)
@@ -64,7 +64,8 @@ namespace Content.Client.Tabletop
                 return;
 
             // If there is no player entity, return
-            if (_playerManager.LocalPlayer is not { ControlledEntity: { } playerEntity }) return;
+            if (_playerManager.LocalEntity is not { } playerEntity)
+                return;
 
             if (!CanSeeTable(playerEntity, _table))
             {
@@ -85,7 +86,7 @@ namespace Content.Client.Tabletop
             // If the dragged entity has another dragging player, drop the item
             // This should happen if the local player is dragging an item, and another player grabs it out of their hand
             if (draggableComponent.DraggingPlayer != null &&
-                draggableComponent.DraggingPlayer != _playerManager.LocalPlayer?.Session.UserId)
+                draggableComponent.DraggingPlayer != _playerManager.LocalSession!.UserId)
             {
                 StopDragging(false);
                 return;
@@ -186,7 +187,7 @@ namespace Content.Client.Tabletop
         private bool OnMouseDown(in PointerInputCmdArgs args)
         {
             // Return if no player entity
-            if (_playerManager.LocalPlayer is not {ControlledEntity: { } playerEntity})
+            if (_playerManager.LocalEntity is not { } playerEntity)
                 return false;
 
             var entity = args.EntityUid;
index c661254bc9505e2c55b221fc48d0333b05a81037..3789f24cb0d0cd3bf0def66426ee2b673e45e327 100644 (file)
@@ -30,7 +30,7 @@ public sealed class ParacusiaSystem : SharedParacusiaSystem
         if (!_timing.IsFirstTimePredicted)
             return;
 
-        if (_player.LocalPlayer?.ControlledEntity is not EntityUid localPlayer)
+        if (_player.LocalEntity is not EntityUid localPlayer)
             return;
 
         PlayParacusiaSounds(localPlayer);
index 7273f327bfbe520ffc698e0f40f614347887dff3..2c0b716448e24643dd37daaa2caa1cb5ef7004ff 100644 (file)
@@ -7,6 +7,7 @@ using Robust.Client.UserInterface.XAML;
 namespace Content.Client.UserInterface.Controls
 {
     [GenerateTypedNameReferences]
+    [Virtual]
     public partial class SplitBar : BoxContainer
     {
         public Vector2 MinBarSize = new(24, 0);
index a8c4a2b1b41231ff5a96094a30df6fb619c53b11..791d5910f4117f098ba580c1ea16d5ce9dae6b4a 100644 (file)
@@ -169,7 +169,7 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
             return;
 
         UIHelper?.Dispose();
-        var ownerUserId = _playerManager.LocalPlayer!.UserId;
+        var ownerUserId = _playerManager.LocalUser!.Value;
         UIHelper = isAdmin ? new AdminAHelpUIHandler(ownerUserId) : new UserAHelpUIHandler(ownerUserId);
         UIHelper.DiscordRelayChanged(_discordRelayActive);
 
@@ -182,15 +182,15 @@ public sealed class AHelpUIController: UIController, IOnSystemChanged<BwoinkSyst
 
     public void Open()
     {
-        var localPlayer = _playerManager.LocalPlayer;
-        if (localPlayer == null)
+        var localUser = _playerManager.LocalUser;
+        if (localUser == null)
         {
             return;
         }
         EnsureUIHelper();
         if (UIHelper!.IsOpen)
             return;
-        UIHelper!.Open(localPlayer.UserId, _discordRelayActive);
+        UIHelper!.Open(localUser.Value, _discordRelayActive);
     }
 
     public void Open(NetUserId userId)
index 2d15f92f77866d18dd87b078d272865a50c38fb3..1adf9ae59bd570e03ef1ef66362fb32f58e9f6a5 100644 (file)
@@ -587,7 +587,7 @@ public sealed class ChatUIController : UIController
             CreateSpeechBubble(entity, msg);
         }
 
-        var player = _player.LocalPlayer?.ControlledEntity;
+        var player = _player.LocalEntity;
         var predicate = static (EntityUid uid, (EntityUid compOwner, EntityUid? attachedEntity) data)
             => uid == data.compOwner || uid == data.attachedEntity;
         var playerPos = player != null
@@ -644,7 +644,7 @@ public sealed class ChatUIController : UIController
     private bool TryGetRadioChannel(string text, out RadioChannelPrototype? radioChannel)
     {
         radioChannel = null;
-        return _player.LocalPlayer?.ControlledEntity is EntityUid { Valid: true } uid
+        return _player.LocalEntity is EntityUid { Valid: true } uid
            && _chatSys != null
            && _chatSys.TryProccessRadioMessage(uid, text, out _, out radioChannel, quiet: true);
     }
index 936e7cdecd4b6113b0ff82b1b99f8f267817201f..a33bee20f9f9b59de4afaad813c9c0c4c7912aa9 100644 (file)
@@ -33,7 +33,7 @@ public partial class ChatBox : UIWidget
         _entManager = IoCManager.Resolve<IEntityManager>();
 
         ChatInput.Input.OnTextEntered += OnTextEntered;
-        ChatInput.Input.OnKeyBindDown += OnKeyBindDown;
+        ChatInput.Input.OnKeyBindDown += OnInputKeyBindDown;
         ChatInput.Input.OnTextChanged += OnTextChanged;
         ChatInput.ChannelSelector.OnChannelSelect += OnChannelSelect;
         ChatInput.FilterButton.Popup.OnChannelFilter += OnChannelFilter;
@@ -142,7 +142,7 @@ public partial class ChatBox : UIWidget
         ChatInput.ChannelSelector.Select(toSelect);
     }
 
-    private void OnKeyBindDown(GUIBoundKeyEventArgs args)
+    private void OnInputKeyBindDown(GUIBoundKeyEventArgs args)
     {
         if (args.Function == EngineKeyFunctions.TextReleaseFocus)
         {
@@ -182,7 +182,7 @@ public partial class ChatBox : UIWidget
         if (!disposing) return;
         _controller.UnregisterChat(this);
         ChatInput.Input.OnTextEntered -= OnTextEntered;
-        ChatInput.Input.OnKeyBindDown -= OnKeyBindDown;
+        ChatInput.Input.OnKeyBindDown -= OnInputKeyBindDown;
         ChatInput.Input.OnTextChanged -= OnTextChanged;
         ChatInput.ChannelSelector.OnChannelSelect -= OnChannelSelect;
     }
index 0485ea5dff88d45387b94f6e228241d0ce80c462..c10c33a99020cbae949f400b3cda62510a0e4ff8 100644 (file)
@@ -48,7 +48,7 @@ public sealed class DamageOverlayUiController : UIController
 
     private void OnMobStateChanged(MobStateChangedEvent args)
     {
-        if (args.Target != _playerManager.LocalPlayer?.ControlledEntity)
+        if (args.Target != _playerManager.LocalEntity)
             return;
 
         UpdateOverlays(args.Target, args.Component);
@@ -57,7 +57,7 @@ public sealed class DamageOverlayUiController : UIController
     private void OnThresholdCheck(ref MobThresholdChecked args)
     {
 
-        if (args.Target != _playerManager.LocalPlayer?.ControlledEntity)
+        if (args.Target != _playerManager.LocalEntity)
             return;
         UpdateOverlays(args.Target, args.MobState, args.Damageable, args.Threshold);
     }
index 03d7a865f717832fea4ef34dd51f0380fbd789ac..fd748153166b5cba457f0afae9394d913c5810f4 100644 (file)
@@ -56,7 +56,7 @@ public sealed class DamageOverlay : Overlay
 
     protected override void Draw(in OverlayDrawArgs args)
     {
-        if (!_entityManager.TryGetComponent(_playerManager.LocalPlayer?.ControlledEntity, out EyeComponent? eyeComp))
+        if (!_entityManager.TryGetComponent(_playerManager.LocalEntity, out EyeComponent? eyeComp))
             return;
 
         if (args.Viewport.Eye != eyeComp.Eye)
index 926a830e71c493e7cdac2a4f23dbb76e175e8ccf..5c5e31de03b5dff3f70da1a8f8e5367032afc716 100644 (file)
@@ -43,8 +43,8 @@ public sealed class MakeGhostRoleEui : BaseEui
 
     private void OnMake(NetEntity entity, string name, string description, string rules, bool makeSentient)
     {
-        var player = _playerManager.LocalPlayer;
-        if (player == null)
+        var session = _playerManager.LocalSession;
+        if (session == null)
         {
             return;
         }
@@ -56,12 +56,12 @@ public sealed class MakeGhostRoleEui : BaseEui
             $"\"{CommandParsing.Escape(description)}\" " +
             $"\"{CommandParsing.Escape(rules)}\"";
 
-        _consoleHost.ExecuteCommand(player.Session, makeGhostRoleCommand);
+        _consoleHost.ExecuteCommand(session, makeGhostRoleCommand);
 
         if (makeSentient)
         {
             var makeSentientCommand = $"makesentient \"{CommandParsing.Escape(entity.ToString())}\"";
-            _consoleHost.ExecuteCommand(player.Session, makeSentientCommand);
+            _consoleHost.ExecuteCommand(session, makeSentientCommand);
         }
 
         _window.Close();
index 668c8f2d5988ef2d2bf83d7d94661da963302b2b..d117043f425f27c31d5cdc07ba6f80e0195bf270 100644 (file)
@@ -80,7 +80,7 @@ public sealed class ViewportUIController : UIController
 
         // verify that the current eye is not "null". Fuck IEyeManager.
 
-        var ent = _playerMan.LocalPlayer?.ControlledEntity;
+        var ent = _playerMan.LocalEntity;
         if (_eyeManager.CurrentEye.Position != default || ent == null)
             return;
 
index 34634482c61c12705cb750f4ca4573bd6e40eb6e..329a8977a68438e60dd8fb241510c2958be237c5 100644 (file)
@@ -57,7 +57,7 @@ namespace Content.Client.Verbs
             if (_stateManager.CurrentState is not GameplayStateBase gameScreenBase)
                 return false;
 
-            var player = _playerManager.LocalPlayer?.ControlledEntity;
+            var player = _playerManager.LocalEntity;
             if (player == null)
                 return false;
 
index 29bfa0956508caee0b031eb88e43d2022f8b39df..dbd68c15e247a87580c3eb0aa141e240c2e0b949 100644 (file)
@@ -35,7 +35,7 @@ public sealed class MeleeArcOverlay : Overlay
 
     protected override void Draw(in OverlayDrawArgs args)
     {
-        var player = _playerManager.LocalPlayer?.ControlledEntity;
+        var player = _playerManager.LocalEntity;
 
         if (!_entManager.TryGetComponent<TransformComponent>(player, out var xform) ||
             !_combatMode.IsInCombatMode(player))
index 2676a7ea6a921a9b6b83154a6ba6596bd9c1d3b8..641d56d3d14beb37adc76a19805a3e80c59a71f8 100644 (file)
@@ -50,7 +50,7 @@ public sealed partial class MeleeWeaponSystem : SharedMeleeWeaponSystem
         if (!Timing.IsFirstTimePredicted)
             return;
 
-        var entityNull = _player.LocalPlayer?.ControlledEntity;
+        var entityNull = _player.LocalEntity;
 
         if (entityNull == null)
             return;
index b54b11ee09f7c0237c359063b6be81ed9bb331a2..df20042b4be9f1eca69e4c49b9d70c0f260fd314 100644 (file)
@@ -26,7 +26,7 @@ public sealed class GrapplingGunSystem : SharedGrapplingGunSystem
         if (!Timing.IsFirstTimePredicted)
             return;
 
-        var local = _player.LocalPlayer?.ControlledEntity;
+        var local = _player.LocalEntity;
         var handUid = _hands.GetActiveHandEntity();
 
         if (!TryComp<GrapplingGunComponent>(handUid, out var grappling))
index dd8f283cbf5aaca8c6658c7bdef53b93a0aab47a..634dbd24e79285e3209ce2bbc09547066bed8ba9 100644 (file)
@@ -54,7 +54,7 @@ public sealed class TetherGunSystem : SharedTetherGunSystem
         if (!_timing.IsFirstTimePredicted)
             return;
 
-        var player = _player.LocalPlayer?.ControlledEntity;
+        var player = _player.LocalEntity;
 
         if (player == null ||
             !TryGetTetherGun(player.Value, out var gunUid, out var gun) ||
index 84b6ce4048018d985ca82f1bb87f55af2f3e652b..62df764ae50c590c7c5a615602f0bef87268045b 100644 (file)
@@ -33,7 +33,7 @@ public sealed class GunSpreadOverlay : Overlay
     {
         var worldHandle = args.WorldHandle;
 
-        var player = _player.LocalPlayer?.ControlledEntity;
+        var player = _player.LocalEntity;
 
         if (player == null ||
             !_entManager.TryGetComponent<TransformComponent>(player, out var xform))
index 565672ad383d3768e4bbc8831fd3a5ab4dc7ce87..401b7cdfafe7377749c7ee9218f6402af1392129 100644 (file)
@@ -24,7 +24,7 @@ public sealed class FlyBySoundSystem : SharedFlyBySoundSystem
 
     private void OnCollide(EntityUid uid, FlyBySoundComponent component, ref StartCollideEvent args)
     {
-        var attachedEnt = _player.LocalPlayer?.ControlledEntity;
+        var attachedEnt = _player.LocalEntity;
 
         // If it's not our ent or we shot it.
         if (attachedEnt == null ||
index ce43057d631022c0d5b85275d15ac7a19f3d96df..9e50cab3e10f0e0a6068a95bc2124d60af181486 100644 (file)
@@ -132,7 +132,7 @@ public sealed partial class GunSystem : SharedGunSystem
         if (!Timing.IsFirstTimePredicted)
             return;
 
-        var entityNull = _player.LocalPlayer?.ControlledEntity;
+        var entityNull = _player.LocalEntity;
 
         if (entityNull == null || !TryComp<CombatModeComponent>(entityNull, out var combat) || !combat.IsInCombatMode)
         {
index a9c29f96c935bb7e3e10c680597a59bea33b18a8..24de0bc8c4c405498f36b752d71cdd6ab6267b53 100644 (file)
@@ -22,7 +22,6 @@ public sealed class WeatherSystem : SharedWeatherSystem
     [Dependency] private readonly IPlayerManager _playerManager = default!;
     [Dependency] private readonly AudioSystem _audio = default!;
     [Dependency] private readonly MapSystem _mapSystem = default!;
-    [Dependency] private readonly SharedPhysicsSystem _physics = default!;
     [Dependency] private readonly SharedTransformSystem _transform = default!;
 
     public override void Initialize()
index 872af8334fb55573b48791c19b51a5dbc6b6926c..52fdf600bb46e94713a5940d16b26dee0d43ca31 100644 (file)
@@ -189,7 +189,7 @@ public sealed partial class TestPair : IAsyncDisposable
         var sPlayer = Server.ResolveDependency<IPlayerManager>();
         Assert.That(sPlayer.Sessions.Count(), Is.EqualTo(1));
         var session = sPlayer.Sessions.Single();
-        Assert.That(cPlayer.LocalPlayer?.Session.UserId, Is.EqualTo(session.UserId));
+        Assert.That(cPlayer.LocalSession?.UserId, Is.EqualTo(session.UserId));
 
         if (ticker.DummyTicker)
             return;
index 913dcf4a40a125b1f1105b159644253920a16a13..32b152522618579be5ceeb3a5ea57074c65fd037 100644 (file)
@@ -23,7 +23,7 @@ public sealed class ActionsAddedTest
         var client = pair.Client;
         var sEntMan = server.ResolveDependency<IEntityManager>();
         var cEntMan = client.ResolveDependency<IEntityManager>();
-        var clientSession = client.ResolveDependency<Robust.Client.Player.IPlayerManager>().LocalPlayer?.Session;
+        var clientSession = client.Session;
         var serverSession = server.ResolveDependency<IPlayerManager>().Sessions.Single();
         var sActionSystem = server.System<SharedActionsSystem>();
         var cActionSystem = client.System<SharedActionsSystem>();
index bbcd24b4156481b574b7e49cfac630a30f563146..1da77ac55892605f0176c60a9ec1a46329265510 100644 (file)
@@ -24,7 +24,6 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
             var server = pair.Server;
             var client = pair.Client;
 
-            var clientPlayerMgr = client.ResolveDependency<Robust.Client.Player.IPlayerManager>();
             var clientUIMgr = client.ResolveDependency<IUserInterfaceManager>();
             var clientEntManager = client.ResolveDependency<IEntityManager>();
 
@@ -57,9 +56,9 @@ namespace Content.IntegrationTests.Tests.GameObjects.Components.Mobs
             AlertsUI clientAlertsUI = default;
             await client.WaitAssertion(() =>
             {
-                var local = clientPlayerMgr.LocalPlayer;
+                var local = client.Session;
                 Assert.That(local, Is.Not.Null);
-                var controlled = local.ControlledEntity;
+                var controlled = local.AttachedEntity;
 #pragma warning disable NUnit2045 // Interdependent assertions.
                 Assert.That(controlled, Is.Not.Null);
                 // Making sure it exists
index 45a880fe867a80d85a41dfd6fc9dd9bfaeab0045..bed27ba6efe0ffa770f7df9fd7b969778945af67 100644 (file)
@@ -189,10 +189,10 @@ public abstract partial class InteractionTest
         // Get player data
         var sPlayerMan = Server.ResolveDependency<Robust.Server.Player.IPlayerManager>();
         var cPlayerMan = Client.ResolveDependency<Robust.Client.Player.IPlayerManager>();
-        if (cPlayerMan.LocalPlayer?.Session == null)
+        if (Client.Session == null)
             Assert.Fail("No player");
-        ClientSession = cPlayerMan.LocalPlayer!.Session!;
-        ServerSession = sPlayerMan.GetSessionByUserId(ClientSession.UserId);
+        ClientSession = Client.Session!;
+        ServerSession = sPlayerMan.GetSessionById(ClientSession.UserId);
 
         // Spawn player entity & attach
         EntityUid? old = default;
@@ -240,7 +240,7 @@ public abstract partial class InteractionTest
         Assert.Multiple(() =>
         {
             Assert.That(CEntMan.GetNetEntity(cPlayerMan.LocalEntity), Is.EqualTo(Player));
-            Assert.That(sPlayerMan.GetSessionByUserId(ClientSession.UserId).AttachedEntity, Is.EqualTo(SEntMan.GetEntity(Player)));
+            Assert.That(sPlayerMan.GetSessionById(ClientSession.UserId).AttachedEntity, Is.EqualTo(SEntMan.GetEntity(Player)));
         });
     }
 
index 3079db436ba4606966660be61641c1e9d5b188c1..416ec05199539137c951228531ae4f58fb2209b7 100644 (file)
@@ -85,7 +85,7 @@ namespace Content.MapRenderer.Painters
                 }
 
                 var transform = _sEntityManager.GetComponent<TransformComponent>(serverEntity);
-                if (_sMapManager.TryGetGrid(transform.GridUid, out var grid))
+                if (_sEntityManager.TryGetComponent(transform.GridUid, out MapGridComponent? grid))
                 {
                     var position = transform.LocalPosition;
 
index cac0f960c460e0fa80ad4640ed4ce1a357273a87..7084d2caf4a55a5e09741fa9a97348dadc93d26f 100644 (file)
@@ -20,12 +20,15 @@ namespace Content.MapRenderer.Painters
         public const int TileImageSize = EyeManager.PixelsPerMeter;
 
         private readonly ITileDefinitionManager _sTileDefinitionManager;
+        private readonly SharedMapSystem _sMapSystem;
         private readonly IResourceManager _resManager;
 
         public TilePainter(ClientIntegrationInstance client, ServerIntegrationInstance server)
         {
             _sTileDefinitionManager = server.ResolveDependency<ITileDefinitionManager>();
             _resManager = client.ResolveDependency<IResourceManager>();
+            var esm = server.ResolveDependency<IEntitySystemManager>();
+            _sMapSystem = esm.GetEntitySystem<SharedMapSystem>();
         }
 
         public void Run(Image gridCanvas, EntityUid gridUid, MapGridComponent grid)
@@ -41,7 +44,7 @@ namespace Content.MapRenderer.Painters
             var images = GetTileImages(_sTileDefinitionManager, _resManager, tileSize);
             var i = 0;
 
-            grid.GetAllTiles().AsParallel().ForAll(tile =>
+            _sMapSystem.GetAllTiles(gridUid, grid).AsParallel().ForAll(tile =>
             {
                 var path = _sTileDefinitionManager[tile.Tile.TypeId].Sprite.ToString();
 
index 4ed9871c40335278cb84f9e03ea6607eddca876a..7676ce489f4316413358ee4f34ad0eb4d1fe702b 100644 (file)
@@ -25,7 +25,7 @@ public sealed partial class AccessWireAction : ComponentWireAction<AccessReaderC
     {
         WiresSystem.TryCancelWireAction(wire.Owner, PulseTimeoutKey.Key);
         comp.Enabled = false;
-        EntityManager.Dirty(comp);
+        EntityManager.Dirty(wire.Owner, comp);
         return true;
     }
 
@@ -34,7 +34,7 @@ public sealed partial class AccessWireAction : ComponentWireAction<AccessReaderC
         if (!EntityManager.HasComponent<EmaggedComponent>(wire.Owner))
         {
             comp.Enabled = true;
-            EntityManager.Dirty(comp);
+            EntityManager.Dirty(wire.Owner, comp);
         }
         return true;
     }
@@ -42,7 +42,7 @@ public sealed partial class AccessWireAction : ComponentWireAction<AccessReaderC
     public override void Pulse(EntityUid user, Wire wire, AccessReaderComponent comp)
     {
         comp.Enabled = false;
-        EntityManager.Dirty(comp);
+        EntityManager.Dirty(wire.Owner, comp);
         WiresSystem.StartWireAction(wire.Owner, _pulseTimeout, PulseTimeoutKey.Key, new TimedWireEvent(AwaitPulseCancel, wire));
     }
 
@@ -61,7 +61,7 @@ public sealed partial class AccessWireAction : ComponentWireAction<AccessReaderC
             if (EntityManager.TryGetComponent<AccessReaderComponent>(wire.Owner, out var access) && !EntityManager.HasComponent<EmaggedComponent>(wire.Owner))
             {
                 access.Enabled = true;
-                EntityManager.Dirty(access);
+                EntityManager.Dirty(wire.Owner, access);
             }
         }
     }
index 2aa22575782ae0e2d8be712c8f7a0a5418bc3a8f..10d7fd0f7a7f6004364bad097c726574a056b274 100644 (file)
@@ -249,7 +249,7 @@ public sealed class AccessOverriderSystem : SharedAccessOverriderSystem
             $"{ToPrettyString(player):player} has modified {ToPrettyString(component.TargetAccessReaderId):entity} with the following allowed access level holders: [{string.Join(", ", addedTags.Union(removedTags))}] [{string.Join(", ", newAccessList)}]");
 
         accessReader.AccessLists = ConvertAccessListToHashSet(newAccessList);
-        Dirty(accessReader);
+        Dirty(component.TargetAccessReaderId, accessReader);
     }
 
     /// <summary>
index 29657b509a96a839fa010cb538701ee1f1025957..bd4d3b3f2330d77734eb059cdb795b1175e9a6e0 100644 (file)
@@ -48,7 +48,7 @@ namespace Content.Server.Access.Systems
                 return;
             }
 
-            Dirty(access);
+            Dirty(uid, access);
 
             if (addedLength == 1)
             {
index def5e950d2ceee5f44e40107c5bb3c5354e9abce..6b3d8db595fcaacffb2813b49a070605eb08fa28 100644 (file)
@@ -61,7 +61,7 @@ public sealed class IdCardSystem : SharedIdCardSystem
                 _popupSystem.PopupEntity(Loc.GetString("id-card-component-microwave-bricked", ("id", uid)), uid);
 
                 access.Tags.Clear();
-                Dirty(access);
+                Dirty(uid, access);
 
                 _adminLogger.Add(LogType.Action, LogImpact.Medium,
                     $"{ToPrettyString(args.Microwave)} cleared access on {ToPrettyString(uid):entity}");
@@ -75,7 +75,7 @@ public sealed class IdCardSystem : SharedIdCardSystem
             var random = _random.Pick(_prototypeManager.EnumeratePrototypes<AccessLevelPrototype>().ToArray());
 
             access.Tags.Add(random.ID);
-            Dirty(access);
+            Dirty(uid, access);
 
             _adminLogger.Add(LogType.Action, LogImpact.Medium,
                     $"{ToPrettyString(args.Microwave)} added {random.ID} access to {ToPrettyString(uid):entity}");
@@ -109,7 +109,7 @@ public sealed class IdCardSystem : SharedIdCardSystem
         if (id.JobTitle == jobTitle)
             return true;
         id.JobTitle = jobTitle;
-        Dirty(id);
+        Dirty(uid, id);
         UpdateEntityName(uid, id);
 
         if (player != null)
@@ -187,7 +187,7 @@ public sealed class IdCardSystem : SharedIdCardSystem
         if (id.FullName == fullName)
             return true;
         id.FullName = fullName;
-        Dirty(id);
+        Dirty(uid, id);
         UpdateEntityName(uid, id);
 
         if (player != null)
index 156fdf496a9a086584ef8cafc56fa7ee22735962..f76cfded814e774804dc513b5101419a15d91207 100644 (file)
@@ -18,6 +18,7 @@ public sealed class BanCommand : LocalizedCommands
     [Dependency] private readonly IBanManager _bans = default!;
     [Dependency] private readonly IConfigurationManager _cfg = default!;
     [Dependency] private readonly IPlayerManager _playerManager = default!;
+    [Dependency] private readonly ILogManager _logManager = default!;
 
     public override string Command => "ban";
 
@@ -28,7 +29,8 @@ public sealed class BanCommand : LocalizedCommands
         uint minutes;
         if (!Enum.TryParse(_cfg.GetCVar(CCVars.ServerBanDefaultSeverity), out NoteSeverity severity))
         {
-            Logger.WarningS("admin.server_ban", "Server ban severity could not be parsed from config! Defaulting to high.");
+            _logManager.GetSawmill("admin.server_ban")
+                .Warning("Server ban severity could not be parsed from config! Defaulting to high.");
             severity = NoteSeverity.High;
         }
 
index 8fc7a8ebaa7ef4db141350fc5276bf02fb766247..069b8603ce4a1dfb779a40ae78d4ccfb1bbfa5b2 100644 (file)
@@ -3,7 +3,6 @@ using Content.Server.Chat.Managers;
 using Content.Server.EUI;
 using Content.Shared.Database;
 using Content.Shared.Verbs;
-using Robust.Server.GameObjects;
 using Robust.Server.Player;
 using Robust.Shared.Console;
 using Robust.Shared.Enums;
@@ -12,18 +11,14 @@ using Robust.Shared.Utility;
 
 namespace Content.Server.Administration.Notes;
 
-public sealed class AdminNotesSystem : EntitySystem, IPostInjectInit
+public sealed class AdminNotesSystem : EntitySystem
 {
     [Dependency] private readonly IConsoleHost _console = default!;
     [Dependency] private readonly IAdminNotesManager _notes = default!;
-    [Dependency] private readonly ILogManager _logManager = default!;
     [Dependency] private readonly IPlayerManager _playerManager = default!;
     [Dependency] private readonly IChatManager _chat = default!;
     [Dependency] private readonly EuiManager _euis = default!;
 
-    public const string SawmillId = "admin.notes_system";
-    private ISawmill _sawmill = default!;
-
     public override void Initialize()
     {
         SubscribeLocalEvent<GetVerbsEvent<Verb>>(AddVerbs);
@@ -65,7 +60,7 @@ public sealed class AdminNotesSystem : EntitySystem, IPostInjectInit
 
         if (!_playerManager.TryGetPlayerData(e.Session.UserId, out var playerData))
         {
-            _sawmill.Error($"Could not get player data for ID {e.Session.UserId}");
+            Log.Error($"Could not get player data for ID {e.Session.UserId}");
         }
 
         var username = playerData?.UserName ?? e.Session.UserId.ToString();
@@ -83,15 +78,10 @@ public sealed class AdminNotesSystem : EntitySystem, IPostInjectInit
                 var ui = new AdminMessageEui();
                 _euis.OpenEui(ui, e.Session);
                 ui.SetMessage(message);
-                               
+
                                // Only send the message if they haven't seen it yet
                                _chat.DispatchServerMessage(e.Session, messageString);
             }
         }
     }
-
-    public void PostInject()
-    {
-        _sawmill = _logManager.GetSawmill(SawmillId);
-    }
 }
index e2f48c9f7f93aa11ab252a46b7e0a633c67e5500..64a85f19ad0bbb02d3f7b52df20d0a9c52c75ce5 100644 (file)
@@ -44,13 +44,15 @@ namespace Content.Server.Administration
         Task<LocatedPlayerData?> LookupIdAsync(NetUserId userId, CancellationToken cancel = default);
     }
 
-    internal sealed class PlayerLocator : IPlayerLocator, IDisposable
+    internal sealed class PlayerLocator : IPlayerLocator, IDisposable, IPostInjectInit
     {
         [Dependency] private readonly IPlayerManager _playerManager = default!;
         [Dependency] private readonly IConfigurationManager _configurationManager = default!;
         [Dependency] private readonly IServerDbManager _db = default!;
+        [Dependency] private readonly ILogManager _logManager = default!;
 
         private readonly HttpClient _httpClient = new();
+        private ISawmill _sawmill = default!;
 
         public PlayerLocator()
         {
@@ -87,7 +89,7 @@ namespace Content.Server.Administration
 
             if (!resp.IsSuccessStatusCode)
             {
-                Logger.ErrorS("PlayerLocate", "Auth server returned bad response {StatusCode}!", resp.StatusCode);
+                _sawmill.Error("Auth server returned bad response {StatusCode}!", resp.StatusCode);
                 return null;
             }
 
@@ -95,7 +97,7 @@ namespace Content.Server.Administration
 
             if (responseData == null)
             {
-                Logger.ErrorS("PlayerLocate", "Auth server returned null response!");
+                _sawmill.Error("Auth server returned null response!");
                 return null;
             }
 
@@ -127,7 +129,7 @@ namespace Content.Server.Administration
 
             if (!resp.IsSuccessStatusCode)
             {
-                Logger.ErrorS("PlayerLocate", "Auth server returned bad response {StatusCode}!", resp.StatusCode);
+                _sawmill.Error("Auth server returned bad response {StatusCode}!", resp.StatusCode);
                 return null;
             }
 
@@ -135,7 +137,7 @@ namespace Content.Server.Administration
 
             if (responseData == null)
             {
-                Logger.ErrorS("PlayerLocate", "Auth server returned null response!");
+                _sawmill.Error("Auth server returned null response!");
                 return null;
             }
 
@@ -163,5 +165,10 @@ namespace Content.Server.Administration
         {
             _httpClient.Dispose();
         }
+
+        void IPostInjectInit.PostInject()
+        {
+            _sawmill = _logManager.GetSawmill("PlayerLocate");
+        }
     }
 }
index 2d9e3393f3184f069b7d2cde9ece9b83464576bb..9d41e918198883771db826430bb400d744dcd145 100644 (file)
@@ -70,13 +70,13 @@ namespace Content.Server.Administration.Systems
             _playerManager.PlayerStatusChanged += OnPlayerStatusChanged;
             _adminManager.OnPermsChanged += OnAdminPermsChanged;
 
-            _config.OnValueChanged(CCVars.PanicBunkerEnabled, OnPanicBunkerChanged, true);
-            _config.OnValueChanged(CCVars.PanicBunkerDisableWithAdmins, OnPanicBunkerDisableWithAdminsChanged, true);
-            _config.OnValueChanged(CCVars.PanicBunkerEnableWithoutAdmins, OnPanicBunkerEnableWithoutAdminsChanged, true);
-            _config.OnValueChanged(CCVars.PanicBunkerCountDeadminnedAdmins, OnPanicBunkerCountDeadminnedAdminsChanged, true);
-            _config.OnValueChanged(CCVars.PanicBunkerShowReason, OnShowReasonChanged, true);
-            _config.OnValueChanged(CCVars.PanicBunkerMinAccountAge, OnPanicBunkerMinAccountAgeChanged, true);
-            _config.OnValueChanged(CCVars.PanicBunkerMinOverallHours, OnPanicBunkerMinOverallHoursChanged, true);
+            Subs.CVar(_config, CCVars.PanicBunkerEnabled, OnPanicBunkerChanged, true);
+            Subs.CVar(_config, CCVars.PanicBunkerDisableWithAdmins, OnPanicBunkerDisableWithAdminsChanged, true);
+            Subs.CVar(_config, CCVars.PanicBunkerEnableWithoutAdmins, OnPanicBunkerEnableWithoutAdminsChanged, true);
+            Subs.CVar(_config, CCVars.PanicBunkerCountDeadminnedAdmins, OnPanicBunkerCountDeadminnedAdminsChanged, true);
+            Subs.CVar(_config, CCVars.PanicBunkerShowReason, OnShowReasonChanged, true);
+            Subs.CVar(_config, CCVars.PanicBunkerMinAccountAge, OnPanicBunkerMinAccountAgeChanged, true);
+            Subs.CVar(_config, CCVars.PanicBunkerMinOverallHours, OnPanicBunkerMinOverallHoursChanged, true);
 
             SubscribeLocalEvent<IdentityChangedEvent>(OnIdentityChanged);
             SubscribeLocalEvent<PlayerAttachedEvent>(OnPlayerAttached);
@@ -188,14 +188,6 @@ namespace Content.Server.Administration.Systems
             base.Shutdown();
             _playerManager.PlayerStatusChanged -= OnPlayerStatusChanged;
             _adminManager.OnPermsChanged -= OnAdminPermsChanged;
-
-            _config.UnsubValueChanged(CCVars.PanicBunkerEnabled, OnPanicBunkerChanged);
-            _config.UnsubValueChanged(CCVars.PanicBunkerDisableWithAdmins, OnPanicBunkerDisableWithAdminsChanged);
-            _config.UnsubValueChanged(CCVars.PanicBunkerEnableWithoutAdmins, OnPanicBunkerEnableWithoutAdminsChanged);
-            _config.UnsubValueChanged(CCVars.PanicBunkerCountDeadminnedAdmins, OnPanicBunkerCountDeadminnedAdminsChanged);
-            _config.UnsubValueChanged(CCVars.PanicBunkerShowReason, OnShowReasonChanged);
-            _config.UnsubValueChanged(CCVars.PanicBunkerMinAccountAge, OnPanicBunkerMinAccountAgeChanged);
-            _config.UnsubValueChanged(CCVars.PanicBunkerMinOverallHours, OnPanicBunkerMinOverallHoursChanged);
         }
 
         private void OnPlayerStatusChanged(object? sender, SessionStatusEventArgs e)
index 5439b27f42495cd80266b942f9d5bda54f34239e..663754b8ccde9e45e9e7752281c316e9b92a3dec 100644 (file)
@@ -66,11 +66,11 @@ namespace Content.Server.Administration.Systems
         public override void Initialize()
         {
             base.Initialize();
-            _config.OnValueChanged(CCVars.DiscordAHelpWebhook, OnWebhookChanged, true);
-            _config.OnValueChanged(CCVars.DiscordAHelpFooterIcon, OnFooterIconChanged, true);
-            _config.OnValueChanged(CCVars.DiscordAHelpAvatar, OnAvatarChanged, true);
-            _config.OnValueChanged(CVars.GameHostName, OnServerNameChanged, true);
-            _config.OnValueChanged(CCVars.AdminAhelpOverrideClientName, OnOverrideChanged, true);
+            Subs.CVar(_config, CCVars.DiscordAHelpWebhook, OnWebhookChanged, true);
+            Subs.CVar(_config, CCVars.DiscordAHelpFooterIcon, OnFooterIconChanged, true);
+            Subs.CVar(_config, CCVars.DiscordAHelpAvatar, OnAvatarChanged, true);
+            Subs.CVar(_config, CVars.GameHostName, OnServerNameChanged, true);
+            Subs.CVar(_config, CCVars.AdminAhelpOverrideClientName, OnOverrideChanged, true);
             _sawmill = IoCManager.Resolve<ILogManager>().GetSawmill("AHELP");
             _maxAdditionalChars = GenerateAHelpMessage("", "", true, _gameTicker.RoundDuration().ToString("hh\\:mm\\:ss"), _gameTicker.RunLevel).Length;
             _playerManager.PlayerStatusChanged += OnPlayerStatusChanged;
@@ -147,15 +147,6 @@ namespace Content.Server.Administration.Systems
             _serverName = obj;
         }
 
-        public override void Shutdown()
-        {
-            base.Shutdown();
-            _config.UnsubValueChanged(CCVars.DiscordAHelpWebhook, OnWebhookChanged);
-            _config.UnsubValueChanged(CCVars.DiscordAHelpFooterIcon, OnFooterIconChanged);
-            _config.UnsubValueChanged(CVars.GameHostName, OnServerNameChanged);
-            _config.UnsubValueChanged(CCVars.AdminAhelpOverrideClientName, OnOverrideChanged);
-        }
-
         private async void OnWebhookChanged(string url)
         {
             _webhookUrl = url;
index 82ec10577d005ac7f0b421eb95b39e50f0e3d087..7c2d2cbaf20a1baf3431f91e4a376b8b0d5c01c2 100644 (file)
@@ -18,7 +18,9 @@ namespace Content.Server.Administration.UI
         [Dependency] private readonly IPlayerManager _playerManager = default!;
         [Dependency] private readonly IServerDbManager _db = default!;
         [Dependency] private readonly IAdminManager _adminManager = default!;
+        [Dependency] private readonly ILogManager _logManager = default!;
 
+        private readonly ISawmill _sawmill;
         private bool _isLoading;
 
         private readonly List<(Admin a, string? lastUserName)> _admins = new List<(Admin, string? lastUserName)>();
@@ -27,6 +29,7 @@ namespace Content.Server.Administration.UI
         public PermissionsEui()
         {
             IoCManager.InjectDependencies(this);
+            _sawmill = _logManager.GetSawmill("admin.perms");
         }
 
         public override void Opened()
@@ -143,7 +146,7 @@ namespace Content.Server.Administration.UI
 
             if (!CanTouchRank(rank))
             {
-                Logger.WarningS("admin.perms", $"{Player} tried to remove higher-ranked admin rank {rank.Name}");
+                _sawmill.Warning($"{Player} tried to remove higher-ranked admin rank {rank.Name}");
                 return;
             }
 
@@ -162,13 +165,13 @@ namespace Content.Server.Administration.UI
 
             if (!CanTouchRank(rank))
             {
-                Logger.WarningS("admin.perms", $"{Player} tried to update higher-ranked admin rank {rank.Name}");
+                _sawmill.Warning($"{Player} tried to update higher-ranked admin rank {rank.Name}");
                 return;
             }
 
             if (!UserAdminFlagCheck(ur.Flags))
             {
-                Logger.WarningS("admin.perms", $"{Player} tried to give a rank permissions above their authorization.");
+                _sawmill.Warning($"{Player} tried to give a rank permissions above their authorization.");
                 return;
             }
 
@@ -178,7 +181,7 @@ namespace Content.Server.Administration.UI
             await _db.UpdateAdminRankAsync(rank);
 
             var flagText = string.Join(' ', AdminFlagsHelper.FlagsToNames(ur.Flags).Select(f => $"+{f}"));
-            Logger.InfoS("admin.perms", $"{Player} updated admin rank {rank.Name}/{flagText}.");
+            _sawmill.Info($"{Player} updated admin rank {rank.Name}/{flagText}.");
 
             _adminManager.ReloadAdminsWithRank(ur.Id);
         }
@@ -187,7 +190,7 @@ namespace Content.Server.Administration.UI
         {
             if (!UserAdminFlagCheck(ar.Flags))
             {
-                Logger.WarningS("admin.perms", $"{Player} tried to give a rank permissions above their authorization.");
+                _sawmill.Warning($"{Player} tried to give a rank permissions above their authorization.");
                 return;
             }
 
@@ -200,7 +203,7 @@ namespace Content.Server.Administration.UI
             await _db.AddAdminRankAsync(rank);
 
             var flagText = string.Join(' ', AdminFlagsHelper.FlagsToNames(ar.Flags).Select(f => $"+{f}"));
-            Logger.InfoS("admin.perms", $"{Player} added admin rank {rank.Name}/{flagText}.");
+            _sawmill.Info($"{Player} added admin rank {rank.Name}/{flagText}.");
         }
 
         private async Task HandleRemoveAdmin(RemoveAdmin ra)
@@ -214,14 +217,14 @@ namespace Content.Server.Administration.UI
 
             if (!CanTouchAdmin(admin))
             {
-                Logger.WarningS("admin.perms", $"{Player} tried to remove higher-ranked admin {ra.UserId.ToString()}");
+                _sawmill.Warning($"{Player} tried to remove higher-ranked admin {ra.UserId.ToString()}");
                 return;
             }
 
             await _db.RemoveAdminAsync(ra.UserId);
 
             var record = await _db.GetPlayerRecordByUserId(ra.UserId);
-            Logger.InfoS("admin.perms", $"{Player} removed admin {record?.LastSeenUserName ?? ra.UserId.ToString()}");
+            _sawmill.Info($"{Player} removed admin {record?.LastSeenUserName ?? ra.UserId.ToString()}");
 
             if (_playerManager.TryGetSessionById(ra.UserId, out var player))
             {
@@ -245,7 +248,7 @@ namespace Content.Server.Administration.UI
 
             if (!CanTouchAdmin(admin))
             {
-                Logger.WarningS("admin.perms", $"{Player} tried to modify higher-ranked admin {ua.UserId.ToString()}");
+                _sawmill.Warning($"{Player} tried to modify higher-ranked admin {ua.UserId.ToString()}");
                 return;
             }
 
@@ -266,7 +269,7 @@ namespace Content.Server.Administration.UI
             var title = ua.Title ?? "<no title>";
             var flags = AdminFlagsHelper.PosNegFlagsText(ua.PosFlags, ua.NegFlags);
 
-            Logger.InfoS("admin.perms", $"{Player} updated admin {name} to {title}/{rankName}/{flags}");
+            _sawmill.Info($"{Player} updated admin {name} to {title}/{rankName}/{flags}");
 
             if (_playerManager.TryGetSessionById(ua.UserId, out var player))
             {
@@ -304,8 +307,7 @@ namespace Content.Server.Administration.UI
                 {
                     // username not in DB.
                     // TODO: Notify user.
-                    Logger.WarningS("admin.perms",
-                        $"{Player} tried to add admin with unknown username {ca.UserNameOrId}.");
+                    _sawmill.Warning($"{Player} tried to add admin with unknown username {ca.UserNameOrId}.");
                     return;
                 }
 
@@ -341,7 +343,7 @@ namespace Content.Server.Administration.UI
             var title = ca.Title ?? "<no title>";
             var flags = AdminFlagsHelper.PosNegFlagsText(ca.PosFlags, ca.NegFlags);
 
-            Logger.InfoS("admin.perms", $"{Player} added admin {name} as {title}/{rankName}/{flags}");
+            _sawmill.Info($"{Player} added admin {name} as {title}/{rankName}/{flags}");
 
             if (_playerManager.TryGetSessionById(userId, out var player))
             {
@@ -362,7 +364,7 @@ namespace Content.Server.Administration.UI
             if (!UserAdminFlagCheck(posFlags))
             {
                 // Can't create an admin with higher perms than yourself, obviously.
-                Logger.WarningS("admin.perms", $"{Player} tried to grant admin powers above their authorization.");
+                _sawmill.Warning($"{Player} tried to grant admin powers above their authorization.");
                 return false;
             }
 
@@ -378,7 +380,7 @@ namespace Content.Server.Administration.UI
                 if (rank == null)
                 {
                     // Tried to set to nonexistent rank.
-                    Logger.WarningS("admin.perms", $"{Player} tried to assign nonexistent admin rank.");
+                    _sawmill.Warning($"{Player} tried to assign nonexistent admin rank.");
                     return (true, null);
                 }
 
@@ -388,7 +390,7 @@ namespace Content.Server.Administration.UI
                 if (!UserAdminFlagCheck(rankFlags))
                 {
                     // Can't assign a rank with flags you don't have yourself.
-                    Logger.WarningS("admin.perms", $"{Player} tried to assign admin rank above their authorization.");
+                    _sawmill.Warning($"{Player} tried to assign admin rank above their authorization.");
                     return (true, null);
                 }
             }
index 98dc307278416d469202ea95e74f79287d5b3331..a3729b145439ae7ba74312f49ebe1458eeb6c3b8 100644 (file)
@@ -12,6 +12,15 @@ namespace Content.Server.Administration.UI;
 [UsedImplicitly]
 public sealed class SpawnExplosionEui : BaseEui
 {
+    private readonly ExplosionSystem _explosionSystem;
+    private readonly ISawmill _sawmill;
+
+    public SpawnExplosionEui()
+    {
+        _explosionSystem = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ExplosionSystem>();
+        _sawmill = IoCManager.Resolve<ILogManager>().GetSawmill("explosion");
+    }
+
     public override void HandleMessage(EuiMessageBase msg)
     {
         base.HandleMessage(msg);
@@ -26,7 +35,7 @@ public sealed class SpawnExplosionEui : BaseEui
 
         if (explosion == null)
         {
-            Logger.Error("Failed to generate explosion preview.");
+            _sawmill.Error("Failed to generate explosion preview.");
             return;
         }
 
index b8cfdfe6b3dd2d097ed29297285f3d3ec038d20c..39d1e266d70e3ff8381978d57e587f52642af688 100644 (file)
@@ -30,7 +30,7 @@ public sealed class AFKSystem : EntitySystem
     {
         base.Initialize();
         _playerManager.PlayerStatusChanged += OnPlayerChange;
-        _configManager.OnValueChanged(CCVars.AfkTime, SetAfkDelay, true);
+        Subs.CVar(_configManager, CCVars.AfkTime, SetAfkDelay, true);
 
         SubscribeNetworkEvent<FullInputCmdMessage>(HandleInputCmd);
     }
@@ -60,7 +60,6 @@ public sealed class AFKSystem : EntitySystem
         base.Shutdown();
         _afkPlayers.Clear();
         _playerManager.PlayerStatusChanged -= OnPlayerChange;
-        _configManager.UnsubValueChanged(CCVars.AfkTime, SetAfkDelay);
     }
 
     public override void Update(float frameTime)
index 04e274ceeb5cf3e51ed319e9b605e33ac4241c68..848170ba9dc03051b8e9365b23bb6dd1812a7ebd 100644 (file)
@@ -168,7 +168,7 @@ public sealed class AlertLevelSystem : EntitySystem
             if (detail.Sound != null)
             {
                 var filter = _stationSystem.GetInOwningStation(station);
-                _audio.PlayGlobal(detail.Sound.GetSound(), filter, true, detail.Sound.Params);
+                _audio.PlayGlobal(detail.Sound, filter, true, detail.Sound.Params);
             }
             else
             {
index 2c432a24190d8b6787d8493258e3e53e35e27596..f52fc2b7187ae96f04cbd28996175e2908ed3886 100644 (file)
@@ -9,19 +9,19 @@ namespace Content.Server.AlertLevel.Commands
 {
     [UsedImplicitly]
     [AdminCommand(AdminFlags.Admin)]
-    public sealed class SetAlertLevelCommand : IConsoleCommand
+    public sealed class SetAlertLevelCommand : LocalizedCommands
     {
-        public string Command => "setalertlevel";
-        public string Description => Loc.GetString("cmd-setalertlevel-desc");
-        public string Help => Loc.GetString("cmd-setalertlevel-help");
+        [Dependency] private readonly IEntitySystemManager _entitySystems = default!;
 
-        public CompletionResult GetCompletion(IConsoleShell shell, string[] args)
+        public override string Command => "setalertlevel";
+
+        public override CompletionResult GetCompletion(IConsoleShell shell, string[] args)
         {
             var levelNames = new string[] {};
             var player = shell.Player;
             if (player?.AttachedEntity != null)
             {
-                var stationUid = EntitySystem.Get<StationSystem>().GetOwningStation(player.AttachedEntity.Value);
+                var stationUid = _entitySystems.GetEntitySystem<StationSystem>().GetOwningStation(player.AttachedEntity.Value);
                 if (stationUid != null)
                 {
                     levelNames = GetStationLevelNames(stationUid.Value);
@@ -31,39 +31,39 @@ namespace Content.Server.AlertLevel.Commands
             return args.Length switch
             {
                 1 => CompletionResult.FromHintOptions(levelNames,
-                    Loc.GetString("cmd-setalertlevel-hint-1")),
+                    LocalizationManager.GetString("cmd-setalertlevel-hint-1")),
                 2 => CompletionResult.FromHintOptions(CompletionHelper.Booleans,
-                    Loc.GetString("cmd-setalertlevel-hint-2")),
+                    LocalizationManager.GetString("cmd-setalertlevel-hint-2")),
                 _ => CompletionResult.Empty,
             };
         }
 
-        public void Execute(IConsoleShell shell, string argStr, string[] args)
+        public override void Execute(IConsoleShell shell, string argStr, string[] args)
         {
             if (args.Length < 1)
             {
-                shell.WriteError(Loc.GetString("shell-wrong-arguments-number"));
+                shell.WriteError(LocalizationManager.GetString("shell-wrong-arguments-number"));
                 return;
             }
 
             var locked = false;
             if (args.Length > 1 && !bool.TryParse(args[1], out locked))
             {
-                shell.WriteLine(Loc.GetString("shell-argument-must-be-boolean"));
+                shell.WriteLine(LocalizationManager.GetString("shell-argument-must-be-boolean"));
                 return;
             }
 
             var player = shell.Player;
             if (player?.AttachedEntity == null)
             {
-                shell.WriteLine(Loc.GetString("shell-only-players-can-run-this-command"));
+                shell.WriteLine(LocalizationManager.GetString("shell-only-players-can-run-this-command"));
                 return;
             }
 
-            var stationUid = EntitySystem.Get<StationSystem>().GetOwningStation(player.AttachedEntity.Value);
+            var stationUid = _entitySystems.GetEntitySystem<StationSystem>().GetOwningStation(player.AttachedEntity.Value);
             if (stationUid == null)
             {
-                shell.WriteLine(Loc.GetString("cmd-setalertlevel-invalid-grid"));
+                shell.WriteLine(LocalizationManager.GetString("cmd-setalertlevel-invalid-grid"));
                 return;
             }
 
@@ -71,11 +71,11 @@ namespace Content.Server.AlertLevel.Commands
             var levelNames = GetStationLevelNames(stationUid.Value);
             if (!levelNames.Contains(level))
             {
-                shell.WriteLine(Loc.GetString("cmd-setalertlevel-invalid-level"));
+                shell.WriteLine(LocalizationManager.GetString("cmd-setalertlevel-invalid-level"));
                 return;
             }
 
-            EntitySystem.Get<AlertLevelSystem>().SetLevel(stationUid.Value, level, true, true, true, locked);
+            _entitySystems.GetEntitySystem<AlertLevelSystem>().SetLevel(stationUid.Value, level, true, true, true, locked);
         }
 
         private string[] GetStationLevelNames(EntityUid station)
index 25d98bf9942d4c79cf5b03a10b00c87b02de612c..608356f76059fcb045b882447fb9e55f190c053c 100644 (file)
@@ -5,7 +5,8 @@ using Content.Server.Chat.Managers;
 using Content.Server.Explosion.EntitySystems;
 using Content.Server.NodeContainer.NodeGroups;
 using Content.Server.NodeContainer.Nodes;
-using Robust.Shared.Map;
+using Robust.Server.GameObjects;
+using Robust.Shared.Map.Components;
 using Robust.Shared.Random;
 
 namespace Content.Server.Ame;
@@ -18,7 +19,6 @@ public sealed class AmeNodeGroup : BaseNodeGroup
 {
     [Dependency] private readonly IChatManager _chat = default!;
     [Dependency] private readonly IEntityManager _entMan = default!;
-    [Dependency] private readonly IMapManager _mapManager = default!;
     [Dependency] private readonly IRobustRandom _random = default!;
 
     /// <summary>
@@ -46,6 +46,7 @@ public sealed class AmeNodeGroup : BaseNodeGroup
 
         var ameControllerSystem = _entMan.System<AmeControllerSystem>();
         var ameShieldingSystem = _entMan.System<AmeShieldingSystem>();
+        var mapSystem = _entMan.System<MapSystem>();
 
         var shieldQuery = _entMan.GetEntityQuery<AmeShieldComponent>();
         var controllerQuery = _entMan.GetEntityQuery<AmeControllerComponent>();
@@ -57,7 +58,7 @@ public sealed class AmeNodeGroup : BaseNodeGroup
                 continue;
             if (!xformQuery.TryGetComponent(nodeOwner, out var xform))
                 continue;
-            if (!_mapManager.TryGetGrid(xform.GridUid, out var grid))
+            if (!_entMan.TryGetComponent(xform.GridUid, out MapGridComponent? grid))
                 continue;
 
             if (gridEnt == null)
@@ -65,7 +66,7 @@ public sealed class AmeNodeGroup : BaseNodeGroup
             else if (gridEnt != xform.GridUid)
                 continue;
 
-            var nodeNeighbors = grid.GetCellsInSquareArea(xform.Coordinates, 1)
+            var nodeNeighbors = mapSystem.GetCellsInSquareArea(xform.GridUid.Value, grid, xform.Coordinates, 1)
                 .Where(entity => entity != nodeOwner && shieldQuery.HasComponent(entity));
 
             if (nodeNeighbors.Count() >= 8)
index 7f82e6fb57b9bfae64af331350fce03ec3230265..3aaa5429fb0344424da48bbfdf2b45177e2d1512 100644 (file)
@@ -36,25 +36,25 @@ namespace Content.Server.Atmos.EntitySystems
 
         private void InitializeCVars()
         {
-            _cfg.OnValueChanged(CCVars.SpaceWind, value => SpaceWind = value, true);
-            _cfg.OnValueChanged(CCVars.SpaceWindPressureForceDivisorThrow, value => SpaceWindPressureForceDivisorThrow = value, true);
-            _cfg.OnValueChanged(CCVars.SpaceWindPressureForceDivisorPush, value => SpaceWindPressureForceDivisorPush = value, true);
-            _cfg.OnValueChanged(CCVars.SpaceWindMaxVelocity, value => SpaceWindMaxVelocity = value, true);
-            _cfg.OnValueChanged(CCVars.SpaceWindMaxPushForce, value => SpaceWindMaxPushForce = value, true);
-            _cfg.OnValueChanged(CCVars.MonstermosEqualization, value => MonstermosEqualization = value, true);
-            _cfg.OnValueChanged(CCVars.MonstermosDepressurization, value => MonstermosDepressurization = value, true);
-            _cfg.OnValueChanged(CCVars.MonstermosRipTiles, value => MonstermosRipTiles = value, true);
-            _cfg.OnValueChanged(CCVars.AtmosGridImpulse, value => GridImpulse = value, true);
-            _cfg.OnValueChanged(CCVars.AtmosSpacingEscapeRatio, value => SpacingEscapeRatio = value, true);
-            _cfg.OnValueChanged(CCVars.AtmosSpacingMinGas, value => SpacingMinGas = value, true);
-            _cfg.OnValueChanged(CCVars.AtmosSpacingMaxWind, value => SpacingMaxWind = value, true);
-            _cfg.OnValueChanged(CCVars.Superconduction, value => Superconduction = value, true);
-            _cfg.OnValueChanged(CCVars.AtmosMaxProcessTime, value => AtmosMaxProcessTime = value, true);
-            _cfg.OnValueChanged(CCVars.AtmosTickRate, value => AtmosTickRate = value, true);
-            _cfg.OnValueChanged(CCVars.AtmosSpeedup, value => Speedup = value, true);
-            _cfg.OnValueChanged(CCVars.AtmosHeatScale, value => { HeatScale = value; InitializeGases(); }, true);
-            _cfg.OnValueChanged(CCVars.ExcitedGroups, value => ExcitedGroups = value, true);
-            _cfg.OnValueChanged(CCVars.ExcitedGroupsSpaceIsAllConsuming, value => ExcitedGroupsSpaceIsAllConsuming = value, true);
+            Subs.CVar(_cfg, CCVars.SpaceWind, value => SpaceWind = value, true);
+            Subs.CVar(_cfg, CCVars.SpaceWindPressureForceDivisorThrow, value => SpaceWindPressureForceDivisorThrow = value, true);
+            Subs.CVar(_cfg, CCVars.SpaceWindPressureForceDivisorPush, value => SpaceWindPressureForceDivisorPush = value, true);
+            Subs.CVar(_cfg, CCVars.SpaceWindMaxVelocity, value => SpaceWindMaxVelocity = value, true);
+            Subs.CVar(_cfg, CCVars.SpaceWindMaxPushForce, value => SpaceWindMaxPushForce = value, true);
+            Subs.CVar(_cfg, CCVars.MonstermosEqualization, value => MonstermosEqualization = value, true);
+            Subs.CVar(_cfg, CCVars.MonstermosDepressurization, value => MonstermosDepressurization = value, true);
+            Subs.CVar(_cfg, CCVars.MonstermosRipTiles, value => MonstermosRipTiles = value, true);
+            Subs.CVar(_cfg, CCVars.AtmosGridImpulse, value => GridImpulse = value, true);
+            Subs.CVar(_cfg, CCVars.AtmosSpacingEscapeRatio, value => SpacingEscapeRatio = value, true);
+            Subs.CVar(_cfg, CCVars.AtmosSpacingMinGas, value => SpacingMinGas = value, true);
+            Subs.CVar(_cfg, CCVars.AtmosSpacingMaxWind, value => SpacingMaxWind = value, true);
+            Subs.CVar(_cfg, CCVars.Superconduction, value => Superconduction = value, true);
+            Subs.CVar(_cfg, CCVars.AtmosMaxProcessTime, value => AtmosMaxProcessTime = value, true);
+            Subs.CVar(_cfg, CCVars.AtmosTickRate, value => AtmosTickRate = value, true);
+            Subs.CVar(_cfg, CCVars.AtmosSpeedup, value => Speedup = value, true);
+            Subs.CVar(_cfg, CCVars.AtmosHeatScale, value => { HeatScale = value; InitializeGases(); }, true);
+            Subs.CVar(_cfg, CCVars.ExcitedGroups, value => ExcitedGroups = value, true);
+            Subs.CVar(_cfg, CCVars.ExcitedGroupsSpaceIsAllConsuming, value => ExcitedGroupsSpaceIsAllConsuming = value, true);
         }
     }
 }
index c0fc1896e3fe8d0f7d6057724b78c6bc4631c364..8ae9517379e8d4af4e26d98af055f0e30c90a64d 100644 (file)
@@ -76,9 +76,9 @@ namespace Content.Server.Atmos.EntitySystems
             };
 
             _playerManager.PlayerStatusChanged += OnPlayerStatusChanged;
-            _confMan.OnValueChanged(CCVars.NetGasOverlayTickRate, UpdateTickRate, true);
-            _confMan.OnValueChanged(CCVars.GasOverlayThresholds, UpdateThresholds, true);
-            _confMan.OnValueChanged(CVars.NetPVS, OnPvsToggle, true);
+            Subs.CVar(_confMan, CCVars.NetGasOverlayTickRate, UpdateTickRate, true);
+            Subs.CVar(_confMan, CCVars.GasOverlayThresholds, UpdateThresholds, true);
+            Subs.CVar(_confMan, CVars.NetPVS, OnPvsToggle, true);
 
             SubscribeLocalEvent<RoundRestartCleanupEvent>(Reset);
             SubscribeLocalEvent<GasTileOverlayComponent, ComponentStartup>(OnStartup);
@@ -95,9 +95,6 @@ namespace Content.Server.Atmos.EntitySystems
         {
             base.Shutdown();
             _playerManager.PlayerStatusChanged -= OnPlayerStatusChanged;
-            _confMan.UnsubValueChanged(CCVars.NetGasOverlayTickRate, UpdateTickRate);
-            _confMan.UnsubValueChanged(CCVars.GasOverlayThresholds, UpdateThresholds);
-            _confMan.UnsubValueChanged(CVars.NetPVS, OnPvsToggle);
         }
 
         private void OnPvsToggle(bool value)
index af73bcd7f90cbf6f95a59b6482691eaf00cb7ea7..286b154e96fa43625bf51bd9134fe314d18622a5 100644 (file)
@@ -30,13 +30,7 @@ public sealed class HeatExchangerSystem : EntitySystem
         SubscribeLocalEvent<HeatExchangerComponent, AtmosDeviceUpdateEvent>(OnAtmosUpdate);
 
         // Getting CVars is expensive, don't do it every tick
-        _cfg.OnValueChanged(CCVars.SuperconductionTileLoss, CacheTileLoss, true);
-    }
-
-    public override void Shutdown()
-    {
-        base.Shutdown();
-        _cfg.UnsubValueChanged(CCVars.SuperconductionTileLoss, CacheTileLoss);
+        Subs.CVar(_cfg, CCVars.SuperconductionTileLoss, CacheTileLoss, true);
     }
 
     private void CacheTileLoss(float val)
index fca29a401327bf5e8530f55603f95026a317676d..5247aafbd518fd5e1f3ebf97ee36eb17387d3ae2 100644 (file)
@@ -31,7 +31,7 @@ public sealed class CrewManifestCartridgeSystem : EntitySystem
         SubscribeLocalEvent<CrewManifestCartridgeComponent, CartridgeMessageEvent>(OnUiMessage);
         SubscribeLocalEvent<CrewManifestCartridgeComponent, CartridgeUiReadyEvent>(OnUiReady);
         SubscribeLocalEvent<ProgramInstallationAttempt>(OnInstallationAttempt);
-        _configManager.OnValueChanged(CCVars.CrewManifestUnsecure, OnCrewManifestUnsecureChanged, true);
+        Subs.CVar(_configManager, CCVars.CrewManifestUnsecure, OnCrewManifestUnsecureChanged, true);
     }
 
     /// <summary>
@@ -92,10 +92,4 @@ public sealed class CrewManifestCartridgeSystem : EntitySystem
                 _cartridgeLoader.UninstallProgram(loaderUid, program.Value, comp);
         }
     }
-
-    public override void Shutdown()
-    {
-        base.Shutdown();
-        _configManager.UnsubValueChanged(CCVars.CrewManifestUnsecure, OnCrewManifestUnsecureChanged);
-    }
 }
index 13cc6df674128889a0f795a52907b3e4e0c49ca6..111e56a2a35a2d7f669fdd80e383f1ea6ec6baab 100644 (file)
@@ -72,21 +72,13 @@ public sealed partial class ChatSystem : SharedChatSystem
     {
         base.Initialize();
         CacheEmotes();
-        _configurationManager.OnValueChanged(CCVars.LoocEnabled, OnLoocEnabledChanged, true);
-        _configurationManager.OnValueChanged(CCVars.DeadLoocEnabled, OnDeadLoocEnabledChanged, true);
-        _configurationManager.OnValueChanged(CCVars.CritLoocEnabled, OnCritLoocEnabledChanged, true);
+        Subs.CVar(_configurationManager, CCVars.LoocEnabled, OnLoocEnabledChanged, true);
+        Subs.CVar(_configurationManager, CCVars.DeadLoocEnabled, OnDeadLoocEnabledChanged, true);
+        Subs.CVar(_configurationManager, CCVars.CritLoocEnabled, OnCritLoocEnabledChanged, true);
 
         SubscribeLocalEvent<GameRunLevelChangedEvent>(OnGameChange);
     }
 
-    public override void Shutdown()
-    {
-        base.Shutdown();
-        _configurationManager.UnsubValueChanged(CCVars.LoocEnabled, OnLoocEnabledChanged);
-        _configurationManager.UnsubValueChanged(CCVars.DeadLoocEnabled, OnDeadLoocEnabledChanged);
-        _configurationManager.UnsubValueChanged(CCVars.CritLoocEnabled, OnCritLoocEnabledChanged);
-    }
-
     private void OnLoocEnabledChanged(bool val)
     {
         if (_loocEnabled == val) return;
index 3919361af13da31ffdcdc3ed2b7a1ed4bd99696e..e4775439cb614481d4a4e6c7a2c26b7774133075 100644 (file)
@@ -29,13 +29,7 @@ public sealed class ChunkingSystem : EntitySystem
     {
         base.Initialize();
         _xformQuery = GetEntityQuery<TransformComponent>();
-        _configurationManager.OnValueChanged(CVars.NetMaxUpdateRange, OnPvsRangeChanged, true);
-    }
-
-    public override void Shutdown()
-    {
-        base.Shutdown();
-        _configurationManager.UnsubValueChanged(CVars.NetMaxUpdateRange, OnPvsRangeChanged);
+        Subs.CVar(_configurationManager, CVars.NetMaxUpdateRange, OnPvsRangeChanged, true);
     }
 
     private void OnPvsRangeChanged(float value)
index 52cde02d21562815408df8b5ec2d0999ccbc08c6..e0bdf096296f6d7d44810954807e93d3f5eb7fc3 100644 (file)
@@ -269,7 +269,7 @@ namespace Content.Server.Construction
 
             if (!TryComp(newEntity, out ConstructionComponent? construction))
             {
-                _sawmill.Error($"Initial construction does not have a valid target entity! It is missing a ConstructionComponent.\nGraph: {graph.ID}, Initial Target: {edge.Target}, Ent. Prototype: {newEntityProto}\nCreated Entity {ToPrettyString(newEntity)} will be deleted.");
+                Log.Error($"Initial construction does not have a valid target entity! It is missing a ConstructionComponent.\nGraph: {graph.ID}, Initial Target: {edge.Target}, Ent. Prototype: {newEntityProto}\nCreated Entity {ToPrettyString(newEntity)} will be deleted.");
                 Del(newEntity); // Screw you, make proper construction graphs.
                 return null;
             }
@@ -321,14 +321,14 @@ namespace Content.Server.Construction
         {
             if (!_prototypeManager.TryIndex(prototype, out ConstructionPrototype? constructionPrototype))
             {
-                _sawmill.Error($"Tried to start construction of invalid recipe '{prototype}'!");
+                Log.Error($"Tried to start construction of invalid recipe '{prototype}'!");
                 return false;
             }
 
             if (!_prototypeManager.TryIndex(constructionPrototype.Graph,
                     out ConstructionGraphPrototype? constructionGraph))
             {
-                _sawmill.Error(
+                Log.Error(
                     $"Invalid construction graph '{constructionPrototype.Graph}' in recipe '{prototype}'!");
                 return false;
             }
@@ -394,21 +394,21 @@ namespace Content.Server.Construction
         {
             if (!_prototypeManager.TryIndex(ev.PrototypeName, out ConstructionPrototype? constructionPrototype))
             {
-                _sawmill.Error($"Tried to start construction of invalid recipe '{ev.PrototypeName}'!");
+                Log.Error($"Tried to start construction of invalid recipe '{ev.PrototypeName}'!");
                 RaiseNetworkEvent(new AckStructureConstructionMessage(ev.Ack));
                 return;
             }
 
             if (!_prototypeManager.TryIndex(constructionPrototype.Graph, out ConstructionGraphPrototype? constructionGraph))
             {
-                _sawmill.Error($"Invalid construction graph '{constructionPrototype.Graph}' in recipe '{ev.PrototypeName}'!");
+                Log.Error($"Invalid construction graph '{constructionPrototype.Graph}' in recipe '{ev.PrototypeName}'!");
                 RaiseNetworkEvent(new AckStructureConstructionMessage(ev.Ack));
                 return;
             }
 
             if (args.SenderSession.AttachedEntity is not {Valid: true} user)
             {
-                _sawmill.Error($"Client sent {nameof(TryStartStructureConstructionMessage)} with no attached entity!");
+                Log.Error($"Client sent {nameof(TryStartStructureConstructionMessage)} with no attached entity!");
                 return;
             }
 
index a19ee8df6d9acb34224c37942442af8fe0781139..946aaa0d3ee21d0f5f286f6b980392bf05053c3b 100644 (file)
@@ -147,7 +147,7 @@ namespace Content.Server.Construction
 
             if (step == null)
             {
-                _sawmill.Warning($"Called {nameof(HandleEdge)} on entity {ToPrettyString(uid)} but the current state is not valid for that!");
+                Log.Warning($"Called {nameof(HandleEdge)} on entity {ToPrettyString(uid)} but the current state is not valid for that!");
                 return HandleResult.False;
             }
 
@@ -513,10 +513,10 @@ namespace Content.Server.Construction
                 {
                     if (construction.Deleted)
                     {
-                        _sawmill.Error($"Construction component was deleted while still processing interactions." +
-                            $"Entity {ToPrettyString(uid)}, graph: {construction.Graph}, " +
-                            $"Next: {interaction.GetType().Name}, " +
-                            $"Remaining Queue: {string.Join(", ", construction.InteractionQueue.Select(x => x.GetType().Name))}");
+                        Log.Error($"Construction component was deleted while still processing interactions." +
+                                  $"Entity {ToPrettyString(uid)}, graph: {construction.Graph}, " +
+                                  $"Next: {interaction.GetType().Name}, " +
+                                  $"Remaining Queue: {string.Join(", ", construction.InteractionQueue.Select(x => x.GetType().Name))}");
                         break;
                     }
 
@@ -527,7 +527,7 @@ namespace Content.Server.Construction
                 }
                 catch (Exception e)
                 {
-                    _sawmill.Error($"Caught exception while processing construction queue. Entity {ToPrettyString(uid)}, graph: {construction.Graph}");
+                    Log.Error($"Caught exception while processing construction queue. Entity {ToPrettyString(uid)}, graph: {construction.Graph}");
                     _runtimeLog.LogException(e, $"{nameof(ConstructionSystem)}.{nameof(UpdateInteractions)}");
                     Del(uid);
                 }
index 6e40b7b856c37c6f63b4dbe596d007bbf0388818..44c6318b7891c12b5470c41f7ecee53b8743d096 100644 (file)
@@ -2,7 +2,6 @@ using Content.Server.Construction.Components;
 using Content.Server.Stack;
 using Content.Shared.Construction;
 using Content.Shared.DoAfter;
-using Content.Shared.Tools;
 using JetBrains.Annotations;
 using Robust.Server.Containers;
 using Robust.Shared.Prototypes;
@@ -17,7 +16,6 @@ namespace Content.Server.Construction
     [UsedImplicitly]
     public sealed partial class ConstructionSystem : SharedConstructionSystem
     {
-        [Dependency] private readonly ILogManager _logManager = default!;
         [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
         [Dependency] private readonly IRobustRandom _robustRandom = default!;
         [Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
@@ -25,15 +23,10 @@ namespace Content.Server.Construction
         [Dependency] private readonly StackSystem _stackSystem = default!;
         [Dependency] private readonly SharedToolSystem _toolSystem = default!;
 
-        private const string SawmillName = "Construction";
-        private ISawmill _sawmill = default!;
-
         public override void Initialize()
         {
             base.Initialize();
 
-            _sawmill = _logManager.GetSawmill(SawmillName);
-
             InitializeComputer();
             InitializeGraphs();
             InitializeGuided();
@@ -50,13 +43,13 @@ namespace Content.Server.Construction
             var construction = ent.Comp;
             if (GetCurrentGraph(ent, construction) is not {} graph)
             {
-                _sawmill.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid graph specified.");
+                Log.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid graph specified.");
                 return;
             }
 
             if (GetNodeFromGraph(graph, construction.Node) is not {} node)
             {
-                _sawmill.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid node specified.");
+                Log.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid node specified.");
                 return;
             }
 
@@ -65,7 +58,7 @@ namespace Content.Server.Construction
             {
                 if (GetEdgeFromNode(node, edgeIndex) is not {} currentEdge)
                 {
-                    _sawmill.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid edge index specified.");
+                    Log.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid edge index specified.");
                     return;
                 }
 
@@ -76,7 +69,7 @@ namespace Content.Server.Construction
             {
                 if (GetNodeFromGraph(graph, targetNodeId) is not { } targetNode)
                 {
-                    _sawmill.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid target node specified.");
+                    Log.Warning($"Prototype {EntityManager.GetComponent<MetaDataComponent>(ent).EntityPrototype?.ID}'s construction component has an invalid target node specified.");
                     return;
                 }
 
index 101d077d49d3b5413a1efb27c4b36113fc58b823..5bfd91486caee074d557fd71c17989b3837a6b40 100644 (file)
@@ -70,7 +70,7 @@ namespace Content.Server.Decals
             SubscribeNetworkEvent<RequestDecalRemovalEvent>(OnDecalRemovalRequest);
             SubscribeLocalEvent<PostGridSplitEvent>(OnGridSplit);
 
-            _conf.OnValueChanged(CVars.NetPVS, OnPvsToggle, true);
+            Subs.CVar(_conf, CVars.NetPVS, OnPvsToggle, true);
         }
 
         private void OnPvsToggle(bool value)
@@ -153,7 +153,6 @@ namespace Content.Server.Decals
             base.Shutdown();
 
             _playerManager.PlayerStatusChanged -= OnPlayerStatusChanged;
-            _conf.UnsubValueChanged(CVars.NetPVS, OnPvsToggle);
         }
 
         private void OnTileChanged(ref TileChangedEvent args)
index 09c2be33a0edb9e4d23085076f7e132613009f12..78e41c59ae2ec1cbab76f642a10e09ef3a9019e7 100644 (file)
@@ -1,15 +1,12 @@
 using Content.Server.Explosion.Components;
 using Content.Shared.Flash.Components;
-using Content.Shared.Explosion;
 using Content.Shared.Interaction;
-using Content.Shared.Interaction.Events;
 using Content.Shared.Throwing;
 using Robust.Shared.Containers;
 using Robust.Shared.Random;
 using Content.Server.Weapons.Ranged.Systems;
 using System.Numerics;
 using Content.Shared.Explosion.Components;
-using Content.Shared.Flash.Components;
 using Robust.Server.Containers;
 using Robust.Server.GameObjects;
 
index d03c64fd378b8a1a1b4bf1af0c5d33ea29e3aa97..1f031093333f4d0cee6e78c92bc7ef5b114d232f 100644 (file)
@@ -15,34 +15,13 @@ public sealed partial class ExplosionSystem : EntitySystem
 
     private void SubscribeCvars()
     {
-        _cfg.OnValueChanged(CCVars.ExplosionTilesPerTick, SetTilesPerTick, true);
-        _cfg.OnValueChanged(CCVars.ExplosionThrowLimit, SetThrowLimit, true);
-        _cfg.OnValueChanged(CCVars.ExplosionSleepNodeSys, SetSleepNodeSys, true);
-        _cfg.OnValueChanged(CCVars.ExplosionMaxArea, SetMaxArea, true);
-        _cfg.OnValueChanged(CCVars.ExplosionMaxIterations, SetMaxIterations, true);
-        _cfg.OnValueChanged(CCVars.ExplosionMaxProcessingTime, SetMaxProcessingTime, true);
-        _cfg.OnValueChanged(CCVars.ExplosionIncrementalTileBreaking, SetIncrementalTileBreaking, true);
-        _cfg.OnValueChanged(CCVars.ExplosionSingleTickAreaLimit, SetSingleTickAreaLimit, true);
+        Subs.CVar(_cfg, CCVars.ExplosionTilesPerTick, value => TilesPerTick = value, true);
+        Subs.CVar(_cfg, CCVars.ExplosionThrowLimit, value => ThrowLimit = value, true);
+        Subs.CVar(_cfg, CCVars.ExplosionSleepNodeSys, value => SleepNodeSys = value, true);
+        Subs.CVar(_cfg, CCVars.ExplosionMaxArea, value => MaxArea = value, true);
+        Subs.CVar(_cfg, CCVars.ExplosionMaxIterations, value => MaxIterations = value, true);
+        Subs.CVar(_cfg, CCVars.ExplosionMaxProcessingTime, value => MaxProcessingTime = value, true);
+        Subs.CVar(_cfg, CCVars.ExplosionIncrementalTileBreaking, value => IncrementalTileBreaking = value, true);
+        Subs.CVar(_cfg, CCVars.ExplosionSingleTickAreaLimit, value => SingleTickAreaLimit = value, true);
     }
-
-    private void UnsubscribeCvars()
-    {
-        _cfg.UnsubValueChanged(CCVars.ExplosionTilesPerTick, SetTilesPerTick);
-        _cfg.UnsubValueChanged(CCVars.ExplosionThrowLimit, SetThrowLimit);
-        _cfg.UnsubValueChanged(CCVars.ExplosionSleepNodeSys, SetSleepNodeSys);
-        _cfg.UnsubValueChanged(CCVars.ExplosionMaxArea, SetMaxArea);
-        _cfg.UnsubValueChanged(CCVars.ExplosionMaxIterations, SetMaxIterations);
-        _cfg.UnsubValueChanged(CCVars.ExplosionMaxProcessingTime, SetMaxProcessingTime);
-        _cfg.UnsubValueChanged(CCVars.ExplosionIncrementalTileBreaking, SetIncrementalTileBreaking);
-        _cfg.UnsubValueChanged(CCVars.ExplosionSingleTickAreaLimit, SetSingleTickAreaLimit);
-    }
-
-    private void SetTilesPerTick(int value) => TilesPerTick = value;
-    private void SetThrowLimit(int value) => ThrowLimit = value;
-    private void SetSleepNodeSys(bool value) => SleepNodeSys = value;
-    private void SetMaxArea(int value) => MaxArea = value;
-    private void SetMaxIterations(int value) => MaxIterations = value;
-    private void SetMaxProcessingTime(float value) => MaxProcessingTime = value;
-    private void SetIncrementalTileBreaking(bool value) => IncrementalTileBreaking = value;
-    private void SetSingleTickAreaLimit(int value) => SingleTickAreaLimit = value;
 }
index 31df23b89d2759ff7afe53bec39a0c303379fbb6..7495ecbb3490e905be553eccc28a6629ea62aa90 100644 (file)
@@ -122,7 +122,6 @@ public sealed partial class ExplosionSystem : EntitySystem
     public override void Shutdown()
     {
         base.Shutdown();
-        UnsubscribeCvars();
         _nodeGroupSystem.PauseUpdating = false;
         _pathfindingSystem.PauseUpdating = false;
     }
index 2f475a07b44c57d31ee50d93aeda728449b4c2da..c0775947ba44d560abcaf3d9d8d7dc3d60881392 100644 (file)
@@ -3,8 +3,6 @@ using Content.Shared.Explosion.EntitySystems;
 using Content.Server.Fluids.EntitySystems;
 using Content.Shared.Chemistry.Components;
 using Content.Shared.Coordinates.Helpers;
-using Content.Shared.Explosion.Components.OnTrigger;
-using Content.Shared.Explosion.EntitySystems;
 using Content.Shared.Maps;
 using Robust.Shared.Map;
 
index 4f0ccc27fdc4929060e0b85ff20929cba04841a0..bc2cca5c0b8139db97fca5d04d0d05a53899097f 100644 (file)
@@ -8,7 +8,6 @@ using Content.Shared.Charges.Components;
 using Content.Shared.Charges.Systems;
 using Content.Shared.Eye.Blinding.Components;
 using Content.Shared.Flash;
-using Content.Shared.Flash.Components;
 using Content.Shared.IdentityManagement;
 using Content.Shared.Interaction;
 using Content.Shared.Interaction.Events;
@@ -20,7 +19,6 @@ using Content.Shared.Weapons.Melee.Events;
 using Robust.Server.Audio;
 using Robust.Server.GameObjects;
 using Robust.Shared.Audio;
-using Robust.Shared.Player;
 using Robust.Shared.Timing;
 using InventoryComponent = Content.Shared.Inventory.InventoryComponent;
 
index c77d56ad14c1aed4a2ad6e928d766d4d7f5fc4b5..6e1fda3e2d702363f0a0a934a2ef524f12d4865f 100644 (file)
@@ -33,7 +33,7 @@ namespace Content.Server.GameTicking
 
         private void InitializeCVars()
         {
-            _configurationManager.OnValueChanged(CCVars.GameLobbyEnabled, value =>
+            Subs.CVar(_configurationManager, CCVars.GameLobbyEnabled, value =>
             {
                 LobbyEnabled = value;
                 foreach (var (userId, status) in _playerGameStatuses)
@@ -44,23 +44,23 @@ namespace Content.Server.GameTicking
                         LobbyEnabled ? PlayerGameStatus.NotReadyToPlay : PlayerGameStatus.ReadyToPlay;
                 }
             }, true);
-            _configurationManager.OnValueChanged(CCVars.GameDummyTicker, value => DummyTicker = value, true);
-            _configurationManager.OnValueChanged(CCVars.GameLobbyDuration, value => LobbyDuration = TimeSpan.FromSeconds(value), true);
-            _configurationManager.OnValueChanged(CCVars.GameDisallowLateJoins,
+            Subs.CVar(_configurationManager, CCVars.GameDummyTicker, value => DummyTicker = value, true);
+            Subs.CVar(_configurationManager, CCVars.GameLobbyDuration, value => LobbyDuration = TimeSpan.FromSeconds(value), true);
+            Subs.CVar(_configurationManager, CCVars.GameDisallowLateJoins,
                 value => { DisallowLateJoin = value; UpdateLateJoinStatus(); }, true);
-            _configurationManager.OnValueChanged(CCVars.AdminLogsServerName, value =>
+            Subs.CVar(_configurationManager, CCVars.AdminLogsServerName, value =>
             {
                 // TODO why tf is the server name on admin logs
                 ServerName = value;
             }, true);
-            _configurationManager.OnValueChanged(CCVars.DiscordRoundUpdateWebhook, value =>
+            Subs.CVar(_configurationManager, CCVars.DiscordRoundUpdateWebhook, value =>
             {
                 if (!string.IsNullOrWhiteSpace(value))
                 {
                     _discord.GetWebhook(value, data => _webhookIdentifier = data.ToIdentifier());
                 }
             }, true);
-            _configurationManager.OnValueChanged(CCVars.DiscordRoundEndRoleWebhook, value =>
+            Subs.CVar(_configurationManager, CCVars.DiscordRoundEndRoleWebhook, value =>
             {
                 DiscordRoundEndRole = value;
 
@@ -70,7 +70,7 @@ namespace Content.Server.GameTicking
                 }
             }, true);
 #if EXCEPTION_TOLERANCE
-            _configurationManager.OnValueChanged(CCVars.RoundStartFailShutdownCount, value => RoundStartFailShutdownCount = value, true);
+            Subs.CVar(_configurationManager, CCVars.RoundStartFailShutdownCount, value => RoundStartFailShutdownCount = value, true);
 #endif
         }
     }
index 07c79747c0fc368bd02ef4e65d8017d7d0c610d6..882d5e37d8dfe64803afa377fed7ad844ec9bb60 100644 (file)
@@ -93,7 +93,7 @@ namespace Content.Server.GameTicking
             {
                 if (job == null)
                 {
-                    var playerSession = _playerManager.GetSessionByUserId(netUser);
+                    var playerSession = _playerManager.GetSessionById(netUser);
                     _chatManager.DispatchServerMessage(playerSession, Loc.GetString("job-not-available-wait-in-lobby"));
                 }
                 else
@@ -110,13 +110,13 @@ namespace Content.Server.GameTicking
                 if (job == null)
                     continue;
 
-                SpawnPlayer(_playerManager.GetSessionByUserId(player), profiles[player], station, job, false);
+                SpawnPlayer(_playerManager.GetSessionById(player), profiles[player], station, job, false);
             }
 
             RefreshLateJoinAllowed();
 
             // Allow rules to add roles to players who have been spawned in. (For example, on-station traitors)
-            RaiseLocalEvent(new RulePlayerJobsAssignedEvent(assignedJobs.Keys.Select(x => _playerManager.GetSessionByUserId(x)).ToArray(), profiles, force));
+            RaiseLocalEvent(new RulePlayerJobsAssignedEvent(assignedJobs.Keys.Select(x => _playerManager.GetSessionById(x)).ToArray(), profiles, force));
         }
 
         private void SpawnPlayer(ICommonSession player, EntityUid station, string? jobId = null, bool lateJoin = true, bool silent = false)
index 865d78c8f1152f0fc832f0b626e33202bcabd12c..001508593da370c11e8cb08a549cb6806ef7b548 100644 (file)
@@ -23,7 +23,7 @@ namespace Content.Server.Holiday
 
         public override void Initialize()
         {
-            _configManager.OnValueChanged(CCVars.HolidaysEnabled, OnHolidaysEnableChange);
+            Subs.CVar(_configManager, CCVars.HolidaysEnabled, OnHolidaysEnableChange);
             SubscribeLocalEvent<GameRunLevelChangedEvent>(OnRunLevelChanged);
             SubscribeLocalEvent<HolidayVisualsComponent, ComponentInit>(OnVisualsInit);
         }
index 69bce80592d05938dc3ad985beb3fed06901f4b0..04fa6a57e597b26b8b94e2666f1d73d8fb7ad285 100644 (file)
@@ -2,7 +2,6 @@ using Content.Shared.CCVar;
 using Content.Shared.Info;
 using Robust.Shared.Configuration;
 using Robust.Shared.ContentPack;
-using Robust.Shared.Log;
 
 namespace Content.Server.Info;
 
@@ -16,9 +15,9 @@ public sealed class InfoSystem : EntitySystem
         SubscribeNetworkEvent<RequestRulesMessage>(OnRequestRules);
     }
 
-    protected void OnRequestRules(RequestRulesMessage message, EntitySessionEventArgs eventArgs)
+    private void OnRequestRules(RequestRulesMessage message, EntitySessionEventArgs eventArgs)
     {
-        Logger.DebugS("info", "Client requested rules.");
+        Log.Debug("info", "Client requested rules.");
         var title = Loc.GetString(_cfg.GetCVar(CCVars.RulesHeader));
         var path = _cfg.GetCVar(CCVars.RulesFile);
         var rules = "Server could not read its rules.";
@@ -28,7 +27,7 @@ public sealed class InfoSystem : EntitySystem
         }
         catch (Exception)
         {
-            Logger.ErrorS("info", "Could not read server rules file.");
+            Log.Debug("info", "Could not read server rules file.");
         }
         var response = new RulesMessage(title, rules);
         RaiseNetworkEvent(response, eventArgs.SenderSession.Channel);
index 66273e4f63281e1510d29413d307cb0cb0667ff2..32c24c299950f275ce8e94a527197c9602edee53 100644 (file)
@@ -60,7 +60,7 @@ public sealed class ShowRulesCommand : IConsoleCommand
         var message = new SharedRulesManager.ShowRulesPopupMessage();
         message.PopupTime = seconds;
 
-        var player = IoCManager.Resolve<IPlayerManager>().GetSessionByUserId(located.UserId);
+        var player = IoCManager.Resolve<IPlayerManager>().GetSessionById(located.UserId);
         netManager.ServerSendMessage(message, player.Channel);
     }
 }
index 0467d94f2bbe7ea23588b032a1da92673d7ad6e6..cf4cca30b3e1f8a531664a84cedad8e33eb939ab 100644 (file)
@@ -11,37 +11,9 @@ public sealed partial class InstrumentSystem
 
     private void InitializeCVars()
     {
-        _cfg.OnValueChanged(CCVars.MaxMidiEventsPerSecond, OnMaxMidiEventsPerSecondChanged, true);
-        _cfg.OnValueChanged(CCVars.MaxMidiEventsPerBatch, OnMaxMidiEventsPerBatchChanged, true);
-        _cfg.OnValueChanged(CCVars.MaxMidiBatchesDropped, OnMaxMidiBatchesDroppedChanged, true);
-        _cfg.OnValueChanged(CCVars.MaxMidiLaggedBatches, OnMaxMidiLaggedBatchesChanged, true);
-    }
-
-    private void ShutdownCVars()
-    {
-        _cfg.UnsubValueChanged(CCVars.MaxMidiEventsPerSecond, OnMaxMidiEventsPerSecondChanged);
-        _cfg.UnsubValueChanged(CCVars.MaxMidiEventsPerBatch, OnMaxMidiEventsPerBatchChanged);
-        _cfg.UnsubValueChanged(CCVars.MaxMidiBatchesDropped, OnMaxMidiBatchesDroppedChanged);
-        _cfg.UnsubValueChanged(CCVars.MaxMidiLaggedBatches, OnMaxMidiLaggedBatchesChanged);
-    }
-
-    private void OnMaxMidiLaggedBatchesChanged(int obj)
-    {
-        MaxMidiLaggedBatches = obj;
-    }
-
-    private void OnMaxMidiBatchesDroppedChanged(int obj)
-    {
-        MaxMidiBatchesDropped = obj;
-    }
-
-    private void OnMaxMidiEventsPerBatchChanged(int obj)
-    {
-        MaxMidiEventsPerBatch = obj;
-    }
-
-    private void OnMaxMidiEventsPerSecondChanged(int obj)
-    {
-        MaxMidiEventsPerSecond = obj;
+        Subs.CVar(_cfg, CCVars.MaxMidiEventsPerSecond, obj => MaxMidiEventsPerSecond = obj, true);
+        Subs.CVar(_cfg, CCVars.MaxMidiEventsPerBatch, obj => MaxMidiEventsPerBatch = obj, true);
+        Subs.CVar(_cfg, CCVars.MaxMidiBatchesDropped, obj => MaxMidiBatchesDropped = obj, true);
+        Subs.CVar(_cfg, CCVars.MaxMidiLaggedBatches, obj => MaxMidiLaggedBatches = obj, true);
     }
 }
index 17899b723282a540004e80d32ba3d8c9e704a972..8dd9644e3c5ef03d573310c8a710f6c1bc55fc90 100644 (file)
@@ -191,13 +191,6 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem
         Dirty(uid, instrument);
     }
 
-    public override void Shutdown()
-    {
-        base.Shutdown();
-
-        ShutdownCVars();
-    }
-
     private void OnBoundUIClosed(EntityUid uid, InstrumentComponent component, BoundUIClosedEvent args)
     {
         if (HasComp<ActiveInstrumentComponent>(uid)
index ca44b1a4c99d8009f9a5e7e08142b65344cdb1ba..e880cec5bbb300c9fde85cc436342abd6e6b5e1f 100644 (file)
@@ -23,11 +23,6 @@ using Robust.Shared.Audio;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
 using Robust.Shared.Timing;
-using Content.Shared.DoAfter;
-using Content.Server.Emp;
-using Content.Server.DeviceLinking.Events;
-using Content.Server.DeviceLinking.Systems;
-using Content.Shared.Inventory;
 using Robust.Shared.Audio.Systems;
 
 namespace Content.Server.Light.EntitySystems
index 5b4609bcd67c34274de8697ced85d36c9d530b66..0678dab7ce2adcc2dfd5b1572ab88ddbe14e7096 100644 (file)
@@ -45,14 +45,7 @@ public sealed class MappingSystem : EntitySystem
             ToggleAutosaveCommand);
 
         _sawmill = Logger.GetSawmill("autosave");
-        _cfg.OnValueChanged(CCVars.AutosaveEnabled, SetAutosaveEnabled, true);
-    }
-
-    public override void Shutdown()
-    {
-        base.Shutdown();
-
-        _cfg.UnsubValueChanged(CCVars.AutosaveEnabled, SetAutosaveEnabled);
+        Subs.CVar(_cfg, CCVars.AutosaveEnabled, SetAutosaveEnabled, true);
     }
 
     private void SetAutosaveEnabled(bool b)
index 40e2a0911b367d984b10991ee37d20afcd904eb4..01dee54cabc0b3dc457e78d6eded7822144a5762 100644 (file)
@@ -17,22 +17,10 @@ using Content.Shared.MassMedia.Components;
 using Content.Shared.MassMedia.Systems;
 using Content.Shared.PDA;
 using Robust.Server.GameObjects;
-using System.Linq;
-using Content.Server.Administration.Logs;
-using Content.Server.CartridgeLoader.Cartridges;
-using Content.Shared.CartridgeLoader;
-using Content.Shared.CartridgeLoader.Cartridges;
-using Content.Server.CartridgeLoader;
-using Content.Server.GameTicking;
 using Robust.Shared.Timing;
-using Content.Server.Popups;
-using Content.Server.StationRecords.Systems;
-using Content.Shared.Database;
-using Robust.Shared.Audio;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 using Robust.Shared.Player;
-using Robust.Shared.Timing;
 
 namespace Content.Server.MassMedia.Systems;
 
index 5e84e6c94e95e71c38215ad3756a35cd3cc86de5..4035fa0f8641a1eff5cbe09b89d9e5981c11d5d8 100644 (file)
@@ -122,12 +122,6 @@ public sealed class MindSystem : SharedMindSystem
         return false;
     }
 
-    public bool TryGetSession(EntityUid? mindId, [NotNullWhen(true)] out ICommonSession? session)
-    {
-        session = null;
-        return TryComp(mindId, out MindComponent? mind) && (session = mind.Session) != null;
-    }
-
     public ICommonSession? GetSession(MindComponent mind)
     {
         return mind.Session;
@@ -251,7 +245,7 @@ public sealed class MindSystem : SharedMindSystem
 
             var position = Deleted(mind.OwnedEntity)
                 ? _gameTicker.GetObserverSpawnPoint().ToMap(EntityManager, _transform)
-                : Transform(mind.OwnedEntity.Value).MapPosition;
+                : _transform.GetMapCoordinates(mind.OwnedEntity.Value);
 
             entity = Spawn(GameTicker.ObserverPrototypeName, position);
             component = EnsureComp<MindContainerComponent>(entity.Value);
index 65c14040658ab777b4472f829a434c5967fc0cfc..3cf77cdf0815abbff780aa41c47f57860073762e 100644 (file)
@@ -24,16 +24,10 @@ public sealed class MOTDSystem : EntitySystem
     public override void Initialize()
     {
         base.Initialize();
-        _configurationManager.OnValueChanged(CCVars.MOTD, OnMOTDChanged, invokeImmediately: true);
+        Subs.CVar(_configurationManager, CCVars.MOTD, OnMOTDChanged, invokeImmediately: true);
         SubscribeLocalEvent<PlayerJoinedLobbyEvent>(OnPlayerJoinedLobby);
     }
 
-    public override void Shutdown()
-    {
-        _configurationManager.UnsubValueChanged(CCVars.MOTD, OnMOTDChanged);
-        base.Shutdown();
-    }
-
     /// <summary>
     /// Sends the Message Of The Day, if any, to all connected players.
     /// </summary>
index 11ba4d102b101e45d9d369c0ed61954351b9c27a..2ae20817e28a8ae0fac0fbddd752df48eb3efbe8 100644 (file)
@@ -1,10 +1,7 @@
 using System.Numerics;
 using Content.Server.NPC.Components;
-using Content.Server.NPC.Events;
 using Content.Shared.CombatMode;
 using Content.Shared.NPC;
-using Content.Shared.NPC;
-using Content.Shared.Weapons.Melee;
 using Robust.Shared.Map;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Random;
index 3db7c586743dcccf4381b11ff079bdd9247938b8..149a330919f71c2294ed7bbfc1874eb479bfd07a 100644 (file)
@@ -103,8 +103,8 @@ public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem
         }
 
         UpdatesBefore.Add(typeof(SharedPhysicsSystem));
-        _configManager.OnValueChanged(CCVars.NPCEnabled, SetNPCEnabled, true);
-        _configManager.OnValueChanged(CCVars.NPCPathfinding, SetNPCPathfinding, true);
+        Subs.CVar(_configManager, CCVars.NPCEnabled, SetNPCEnabled, true);
+        Subs.CVar(_configManager, CCVars.NPCPathfinding, SetNPCPathfinding, true);
 
         SubscribeLocalEvent<NPCSteeringComponent, ComponentShutdown>(OnSteeringShutdown);
         SubscribeLocalEvent<NPCSteeringComponent, EntityUnpausedEvent>(OnSteeringUnpaused);
@@ -140,13 +140,6 @@ public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem
         }
     }
 
-    public override void Shutdown()
-    {
-        base.Shutdown();
-        _configManager.UnsubValueChanged(CCVars.NPCEnabled, SetNPCEnabled);
-        _configManager.UnsubValueChanged(CCVars.NPCPathfinding, SetNPCPathfinding);
-    }
-
     private void OnDebugRequest(RequestNPCSteeringDebugEvent msg, EntitySessionEventArgs args)
     {
         if (!_admin.IsAdmin(args.SenderSession))
index 7d33133a37675b67d1396e506789c076d27ed850..8abe0f7f54cce8051b1d5d152e85d70d6369ac88 100644 (file)
@@ -34,8 +34,8 @@ namespace Content.Server.NPC.Systems
         {
             base.Initialize();
 
-            _configurationManager.OnValueChanged(CCVars.NPCEnabled, SetEnabled, true);
-            _configurationManager.OnValueChanged(CCVars.NPCMaxUpdates, SetMaxUpdates, true);
+            Subs.CVar(_configurationManager, CCVars.NPCEnabled, value => Enabled = value, true);
+            Subs.CVar(_configurationManager, CCVars.NPCMaxUpdates, obj => _maxUpdates = obj, true);
         }
 
         public void OnPlayerNPCAttach(EntityUid uid, HTNComponent component, PlayerAttachedEvent args)
@@ -51,16 +51,6 @@ namespace Content.Server.NPC.Systems
             WakeNPC(uid, component);
         }
 
-        private void SetMaxUpdates(int obj) => _maxUpdates = obj;
-        private void SetEnabled(bool value) => Enabled = value;
-
-        public override void Shutdown()
-        {
-            base.Shutdown();
-            _configurationManager.UnsubValueChanged(CCVars.NPCEnabled, SetEnabled);
-            _configurationManager.UnsubValueChanged(CCVars.NPCMaxUpdates, SetMaxUpdates);
-        }
-
         public void OnNPCMapInit(EntityUid uid, HTNComponent component, MapInitEvent args)
         {
             component.Blackboard.SetValue(NPCBlackboard.Owner, uid);
index 010230466891b0b827e1a8546a24073c0a7943f3..1954f2bdc10b19b4a7acee9f6fee4fe79a8907b6 100644 (file)
@@ -53,7 +53,7 @@ public sealed class ObjectiveLimitSystem : EntitySystem
         if (!Resolve(mindId, ref mind))
             return false;
 
-        foreach (var objective in mind.AllObjectives)
+        foreach (var objective in mind.Objectives)
         {
             if (Prototype(objective)?.ID == proto)
                 return true;
index f8aadac461de965b200b9153cbc95e7d3663a70d..885503713f8308622dbb29c9b67c5dcae3d6381c 100644 (file)
@@ -13,7 +13,6 @@ using Robust.Shared.Player;
 using Robust.Shared.Random;
 using Robust.Shared.Timing;
 using Robust.Shared.Utility;
-using System.Linq;
 using Robust.Server.Audio;
 
 namespace Content.Server.PDA.Ringer
index f4514ac22854283a270f035d73a09a0a891b444a..0b8c7a4d82d9bf708ee9d153934b801648b3c4d0 100644 (file)
@@ -83,17 +83,11 @@ public sealed partial class BiomeSystem : SharedBiomeSystem
         SubscribeLocalEvent<BiomeComponent, MapInitEvent>(OnBiomeMapInit);
         SubscribeLocalEvent<FTLStartedEvent>(OnFTLStarted);
         SubscribeLocalEvent<ShuttleFlattenEvent>(OnShuttleFlatten);
-        _configManager.OnValueChanged(CVars.NetMaxUpdateRange, SetLoadRange, true);
+        Subs.CVar(_configManager, CVars.NetMaxUpdateRange, SetLoadRange, true);
         InitializeCommands();
         SubscribeLocalEvent<PrototypesReloadedEventArgs>(ProtoReload);
     }
 
-    public override void Shutdown()
-    {
-        base.Shutdown();
-        _configManager.UnsubValueChanged(CVars.NetMaxUpdateRange, SetLoadRange);
-    }
-
     private void ProtoReload(PrototypesReloadedEventArgs obj)
     {
         if (!obj.ByType.TryGetValue(typeof(BiomeTemplatePrototype), out var reloads))
index 63b39b388c65ac5175f68d176662e8728721b7c6..be9a715d5d578926f1d9ebbf5e443155e5fd834b 100644 (file)
@@ -24,7 +24,7 @@ public sealed class PinpointerSystem : SharedPinpointerSystem
         SubscribeLocalEvent<FTLCompletedEvent>(OnLocateTarget);
     }
 
-    public bool TogglePinpointer(EntityUid uid, PinpointerComponent? pinpointer = null)
+    public override bool TogglePinpointer(EntityUid uid, PinpointerComponent? pinpointer = null)
     {
         if (!Resolve(uid, ref pinpointer))
             return false;
@@ -128,26 +128,13 @@ public sealed class PinpointerSystem : SharedPinpointerSystem
     }
 
     /// <summary>
-    ///     Set pinpointers target to track
+    ///     Update direction from pinpointer to selected target (if it was set)
     /// </summary>
-    public void SetTarget(EntityUid uid, EntityUid? target, PinpointerComponent? pinpointer = null)
+    protected override void UpdateDirectionToTarget(EntityUid uid, PinpointerComponent? pinpointer = null)
     {
         if (!Resolve(uid, ref pinpointer))
             return;
 
-        if (pinpointer.Target == target)
-            return;
-
-        pinpointer.Target = target;
-        if (pinpointer.IsActive)
-            UpdateDirectionToTarget(uid, pinpointer);
-    }
-
-    /// <summary>
-    ///     Update direction from pinpointer to selected target (if it was set)
-    /// </summary>
-    private void UpdateDirectionToTarget(EntityUid uid, PinpointerComponent pinpointer)
-    {
         if (!pinpointer.IsActive)
             return;
 
index ffe533f9a613ff1d1e2d4cc25df017b466b1e4e2..cd19367f380ed02b15d3395955f06ba1f2080772 100644 (file)
@@ -12,37 +12,9 @@ public partial class RadiationSystem
 
     private void SubscribeCvars()
     {
-        _cfg.OnValueChanged(CCVars.RadiationMinIntensity, SetMinRadiationIntensity, true);
-        _cfg.OnValueChanged(CCVars.RadiationGridcastUpdateRate, SetGridcastUpdateRate, true);
-        _cfg.OnValueChanged(CCVars.RadiationGridcastSimplifiedSameGrid, SetGridcastSimplifiedSameGrid, true);
-        _cfg.OnValueChanged(CCVars.RadiationGridcastMaxDistance, SetGridcastMaxDistance, true);
-    }
-
-    private void UnsubscribeCvars()
-    {
-        _cfg.UnsubValueChanged(CCVars.RadiationMinIntensity, SetMinRadiationIntensity);
-        _cfg.UnsubValueChanged(CCVars.RadiationGridcastUpdateRate, SetGridcastUpdateRate);
-        _cfg.UnsubValueChanged(CCVars.RadiationGridcastSimplifiedSameGrid, SetGridcastSimplifiedSameGrid);
-        _cfg.UnsubValueChanged(CCVars.RadiationGridcastMaxDistance, SetGridcastMaxDistance);
-    }
-
-    private void SetMinRadiationIntensity(float radiationMinIntensity)
-    {
-        MinIntensity = radiationMinIntensity;
-    }
-
-    private void SetGridcastUpdateRate(float updateRate)
-    {
-        GridcastUpdateRate = updateRate;
-    }
-
-    private void SetGridcastSimplifiedSameGrid(bool simplifiedSameGrid)
-    {
-        GridcastSimplifiedSameGrid = simplifiedSameGrid;
-    }
-
-    private void SetGridcastMaxDistance(float maxDistance)
-    {
-        GridcastMaxDistance = maxDistance;
+        Subs.CVar(_cfg, CCVars.RadiationMinIntensity, radiationMinIntensity => MinIntensity = radiationMinIntensity, true);
+        Subs.CVar(_cfg, CCVars.RadiationGridcastUpdateRate, updateRate => GridcastUpdateRate = updateRate, true);
+        Subs.CVar(_cfg, CCVars.RadiationGridcastSimplifiedSameGrid, simplifiedSameGrid => GridcastSimplifiedSameGrid = simplifiedSameGrid, true);
+        Subs.CVar(_cfg, CCVars.RadiationGridcastMaxDistance, maxDistance => GridcastMaxDistance = maxDistance, true);
     }
 }
index ffb7ab1a11f5bff8633a2f179bc3552b0d2f14ca..e184c022f2f4c441c8bb703e12fca0bdf78301f6 100644 (file)
@@ -21,12 +21,6 @@ public sealed partial class RadiationSystem : EntitySystem
         InitRadBlocking();
     }
 
-    public override void Shutdown()
-    {
-        base.Shutdown();
-        UnsubscribeCvars();
-    }
-
     public override void Update(float frameTime)
     {
         base.Update(frameTime);
index 8560eebb57f29cd40c94b08e0f07ff2c88261721..4631abc13ce5f850eda4c9550cbc2f5e8989cfb4 100644 (file)
@@ -1,11 +1,10 @@
-using Robust.Shared.Reflection;
-using Robust.Shared.Serialization;
+using Robust.Shared.Serialization.TypeSerializers.Implementations;
 
 namespace Content.Server.RandomAppearance;
 
 [RegisterComponent]
 [Access(typeof(RandomAppearanceSystem))]
-public sealed partial class RandomAppearanceComponent : Component, ISerializationHooks
+public sealed partial class RandomAppearanceComponent : Component
 {
     [DataField("spriteStates")]
     public string[] SpriteStates = { "0", "1", "2", "3", "4" };
@@ -13,23 +12,6 @@ public sealed partial class RandomAppearanceComponent : Component, ISerializatio
     /// <summary>
     ///     What appearance enum key should be set to the random sprite state?
     /// </summary>
-    [DataField("key", required: true)]
-    public string EnumKeyRaw = default!;
-
-    /// <summary>
-    ///     The actual enum after reflection.
-    /// </summary>
+    [DataField(required: true, customTypeSerializer: typeof(EnumSerializer))]
     public Enum? EnumKey;
-
-    void ISerializationHooks.AfterDeserialization()
-    {
-        if (IoCManager.Resolve<IReflectionManager>().TryParseEnumReference(EnumKeyRaw, out var @enum))
-        {
-            EnumKey = @enum;
-        }
-        else
-        {
-            Logger.Error($"RandomAppearance enum key {EnumKeyRaw} could not be parsed!");
-        }
-    }
 }
index f0d4661a070966a091fd5dd878e58a7a26c6771f..1eb1cc3027f9b82ee3e9fd011889d748a5170631 100644 (file)
@@ -40,7 +40,7 @@ public sealed partial class SalvageSystem
         SubscribeLocalEvent<SalvageStructureComponent, ExaminedEvent>(OnStructureExamine);
 
         _cooldown = _configurationManager.GetCVar(CCVars.SalvageExpeditionCooldown);
-        _configurationManager.OnValueChanged(CCVars.SalvageExpeditionCooldown, SetCooldownChange);
+        Subs.CVar(_configurationManager, CCVars.SalvageExpeditionCooldown, SetCooldownChange);
     }
 
     private void OnExpeditionGetState(EntityUid uid, SalvageExpeditionComponent component, ref ComponentGetState args)
@@ -51,11 +51,6 @@ public sealed partial class SalvageSystem
         };
     }
 
-    private void ShutdownExpeditions()
-    {
-        _configurationManager.UnsubValueChanged(CCVars.SalvageExpeditionCooldown, SetCooldownChange);
-    }
-
     private void SetCooldownChange(float obj)
     {
         // Update the active cooldowns if we change it.
index 545a385bff8584f2a1ee01a1db528d2fb38baaf8..a1a3b686b2f9784efd0a2954f220ad301640dd62 100644 (file)
@@ -73,12 +73,6 @@ namespace Content.Server.Salvage
             InitializeRunner();
         }
 
-        public override void Shutdown()
-        {
-            base.Shutdown();
-            ShutdownExpeditions();
-        }
-
         private void Report(EntityUid source, string channelName, string messageKey, params (string, object)[] args)
         {
             var message = args.Length == 0 ? Loc.GetString(messageKey) : Loc.GetString(messageKey, args);
index 08f3481cd72d083b5f6081e67a81a4b12f00d9f1..7d63b835881273f32519420f9e0b2a43b5f6b232 100644 (file)
@@ -98,7 +98,7 @@ public sealed class ArrivalsSystem : EntitySystem
 
         // Don't invoke immediately as it will get set in the natural course of things.
         Enabled = _cfgManager.GetCVar(CCVars.ArrivalsShuttles);
-        _cfgManager.OnValueChanged(CCVars.ArrivalsShuttles, SetArrivals);
+        Subs.CVar(_cfgManager, CCVars.ArrivalsShuttles, SetArrivals);
 
         // Command so admins can set these for funsies
         _console.RegisterCommand("arrivals", ArrivalsCommand, ArrivalsCompletion);
@@ -182,12 +182,6 @@ public sealed class ArrivalsSystem : EntitySystem
         }
     }
 
-    public override void Shutdown()
-    {
-        base.Shutdown();
-        _cfgManager.UnsubValueChanged(CCVars.ArrivalsShuttles, SetArrivals);
-    }
-
     /// <summary>
     ///     First sends shuttle timer data, then kicks people off the shuttle if it isn't leaving the arrivals terminal
     /// </summary>
index b589a526403d5340463cd00e48fa68dd000bb68d..f8e6f2423f9ddce75a68b3f748f624792f9b4309 100644 (file)
@@ -85,9 +85,9 @@ public sealed partial class EmergencyShuttleSystem
 
     private void InitializeEmergencyConsole()
     {
-        _configManager.OnValueChanged(CCVars.EmergencyShuttleMinTransitTime, SetMinTransitTime, true);
-        _configManager.OnValueChanged(CCVars.EmergencyShuttleMaxTransitTime, SetMaxTransitTime, true);
-        _configManager.OnValueChanged(CCVars.EmergencyShuttleAuthorizeTime, SetAuthorizeTime, true);
+        Subs.CVar(_configManager, CCVars.EmergencyShuttleMinTransitTime, SetMinTransitTime, true);
+        Subs.CVar(_configManager, CCVars.EmergencyShuttleMaxTransitTime, SetMaxTransitTime, true);
+        Subs.CVar(_configManager, CCVars.EmergencyShuttleAuthorizeTime, SetAuthorizeTime, true);
         SubscribeLocalEvent<EmergencyShuttleConsoleComponent, ComponentStartup>(OnEmergencyStartup);
         SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleAuthorizeMessage>(OnEmergencyAuthorize);
         SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealMessage>(OnEmergencyRepeal);
@@ -123,13 +123,6 @@ public sealed partial class EmergencyShuttleSystem
         MaximumTransitTime = Math.Max(MinimumTransitTime, obj);
     }
 
-    private void ShutdownEmergencyConsole()
-    {
-        _configManager.UnsubValueChanged(CCVars.EmergencyShuttleAuthorizeTime, SetAuthorizeTime);
-        _configManager.UnsubValueChanged(CCVars.EmergencyShuttleMinTransitTime, SetMinTransitTime);
-        _configManager.UnsubValueChanged(CCVars.EmergencyShuttleMaxTransitTime, SetMaxTransitTime);
-    }
-
     private void OnEmergencyStartup(EntityUid uid, EmergencyShuttleConsoleComponent component, ComponentStartup args)
     {
         UpdateConsoleState(uid, component);
index d9ba2de3e590eb59e78480eab8585a79bb36f003..66214b0577ee12366db8ec37c22610bc2eecf9e2 100644 (file)
@@ -77,7 +77,7 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
         _sawmill = Logger.GetSawmill("shuttle.emergency");
         _emergencyShuttleEnabled = _configManager.GetCVar(CCVars.EmergencyShuttleEnabled);
         // Don't immediately invoke as roundstart will just handle it.
-        _configManager.OnValueChanged(CCVars.EmergencyShuttleEnabled, SetEmergencyShuttleEnabled);
+        Subs.CVar(_configManager, CCVars.EmergencyShuttleEnabled, SetEmergencyShuttleEnabled);
 
         SubscribeLocalEvent<RoundStartingEvent>(OnRoundStart);
         SubscribeLocalEvent<StationEmergencyShuttleComponent, ComponentStartup>(OnStationStartup);
@@ -152,12 +152,6 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
         UpdateEmergencyConsole(frameTime);
     }
 
-    public override void Shutdown()
-    {
-        _configManager.UnsubValueChanged(CCVars.EmergencyShuttleEnabled, SetEmergencyShuttleEnabled);
-        ShutdownEmergencyConsole();
-    }
-
     /// <summary>
     ///     If the client is requesting debug info on where an emergency shuttle would dock.
     /// </summary>
index 84097e60ac2259411b6a61206a63c98de1ac46b0..71e02200766515fb1a837c1f3ed581ccd243e8d9 100644 (file)
@@ -18,12 +18,7 @@ public sealed partial class ShuttleSystem
 
         SubscribeLocalEvent<GridFillComponent, MapInitEvent>(OnGridFillMapInit);
 
-        _cfg.OnValueChanged(CCVars.GridFill, OnGridFillChange);
-    }
-
-    private void ShutdownGridFills()
-    {
-        _cfg.UnsubValueChanged(CCVars.GridFill, OnGridFillChange);
+        Subs.CVar(_cfg, CCVars.GridFill, OnGridFillChange);
     }
 
     private void OnGridFillChange(bool obj)
index a2e17b4321c4d8dfa22fa932e594bfbfe90cd9be..471b46e507d7dfa53932f699567c5c2604885270 100644 (file)
@@ -69,13 +69,6 @@ public sealed partial class ShuttleSystem : SharedShuttleSystem
         SubscribeLocalEvent<FixturesComponent, GridFixtureChangeEvent>(OnGridFixtureChange);
     }
 
-    public override void Shutdown()
-    {
-        base.Shutdown();
-        ShutdownGridFills();
-    }
-
-
     public override void Update(float frameTime)
     {
         base.Update(frameTime);
index 7bfc496deae18a7e1ee0566a8ba24995f453dd51..a3b7a573545fd31eee56b7f6cf158fdc07b7a818 100644 (file)
@@ -35,7 +35,7 @@ public sealed partial class StationJobsSystem : EntitySystem
         SubscribeLocalEvent<StationJobsComponent, StationRenamedEvent>(OnStationRenamed);
         SubscribeLocalEvent<StationJobsComponent, ComponentShutdown>(OnStationDeletion);
         SubscribeLocalEvent<PlayerJoinedLobbyEvent>(OnPlayerJoinedLobby);
-        _configurationManager.OnValueChanged(CCVars.GameDisallowLateJoins, _ => UpdateJobsAvailable(), true);
+        Subs.CVar(_configurationManager, CCVars.GameDisallowLateJoins, _ => UpdateJobsAvailable(), true);
     }
 
     public override void Update(float _)
index a5fb66662c81fa1d4868850b3e04577959017b59..d0ebae9a0e64523add1ea27dfa8e36888f272865 100644 (file)
@@ -56,7 +56,7 @@ public sealed class StationSpawningSystem : SharedStationSpawningSystem
     /// <inheritdoc/>
     public override void Initialize()
     {
-        _configurationManager.OnValueChanged(CCVars.ICRandomCharacters, e => _randomizeCharacters = e, true);
+        Subs.CVar(_configurationManager, CCVars.ICRandomCharacters, e => _randomizeCharacters = e, true);
 
         _spawnerCallbacks = new Dictionary<SpawnPriorityPreference, Action<PlayerSpawningEvent>>()
         {
index be3fc57967b3f72de8cd93366209583fae6cdfde..4647392665b52bae4058acf62a122d97959ab418 100644 (file)
@@ -57,9 +57,9 @@ public sealed class StationSystem : EntitySystem
         SubscribeLocalEvent<StationMemberComponent, ComponentShutdown>(OnStationGridDeleted);
         SubscribeLocalEvent<StationMemberComponent, PostGridSplitEvent>(OnStationSplitEvent);
 
-        _configurationManager.OnValueChanged(CCVars.StationOffset, x => _randomStationOffset = x, true);
-        _configurationManager.OnValueChanged(CCVars.MaxStationOffset, x => _maxRandomStationOffset = x, true);
-        _configurationManager.OnValueChanged(CCVars.StationRotation, x => _randomStationRotation = x, true);
+        Subs.CVar(_configurationManager, CCVars.StationOffset, x => _randomStationOffset = x, true);
+        Subs.CVar(_configurationManager, CCVars.MaxStationOffset, x => _maxRandomStationOffset = x, true);
+        Subs.CVar(_configurationManager, CCVars.StationRotation, x => _randomStationRotation = x, true);
 
         _player.PlayerStatusChanged += OnPlayerStatusChanged;
     }
index 7779eafbbacb3a6fb4c0d737dd6f58232899d066..fb3590dcd5645e1f20ce1cd2cb2e4dc6edb6c456 100644 (file)
@@ -28,7 +28,7 @@ public sealed class EventManagerSystem : EntitySystem
 
         _sawmill = Logger.GetSawmill("events");
 
-        _configurationManager.OnValueChanged(CCVars.EventsEnabled, SetEnabled, true);
+        Subs.CVar(_configurationManager, CCVars.EventsEnabled, SetEnabled, true);
 
         SubscribeLocalEvent<StationEventComponent, EntityUnpausedEvent>(OnUnpaused);
     }
@@ -40,12 +40,6 @@ public sealed class EventManagerSystem : EntitySystem
             component.EndTime = component.EndTime.Value + args.PausedTime;
     }
 
-    public override void Shutdown()
-    {
-        base.Shutdown();
-        _configurationManager.UnsubValueChanged(CCVars.EventsEnabled, SetEnabled);
-    }
-
     /// <summary>
     /// Randomly runs a valid event.
     /// </summary>
index 7c58bcccca7e2331c9d121f79b8015771532ff4a..9b65daf461a836b6d269c59d62fde1bb8f4f021b 100644 (file)
@@ -2,11 +2,7 @@ using System.Linq;
 using Content.Server.Storage.Components;
 using Content.Shared.Audio;
 using Content.Shared.Storage.Components;
-using Robust.Shared.Audio;
-using Robust.Shared.Player;
 using Robust.Shared.Random;
-using System.Linq;
-using Content.Shared.Storage.Components;
 using Robust.Shared.Audio.Systems;
 using Robust.Shared.Containers;
 
index 3a3df725c458219cdc94652feb4d9b9b2353ae43..1df4fce177f4791df8073bed3c4b023876478bc3 100644 (file)
@@ -1,9 +1,7 @@
-using Content.Server.Humanoid;
 using Content.Shared.Humanoid;
 using Content.Shared.Store;
 using Content.Shared.Humanoid.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
-using Content.Shared.Humanoid;
 
 namespace Content.Server.Store.Conditions;
 
index 1c342fcadf87d3450fdd16feb4df5746ea31bf22..cc45a3a1d5eb9771a72ddb822cafb65514e59b23 100644 (file)
@@ -36,10 +36,10 @@ public sealed class TipsSystem : EntitySystem
         base.Initialize();
 
         SubscribeLocalEvent<GameRunLevelChangedEvent>(OnGameRunLevelChanged);
-        _cfg.OnValueChanged(CCVars.TipFrequencyOutOfRound, SetOutOfRound, true);
-        _cfg.OnValueChanged(CCVars.TipFrequencyInRound, SetInRound, true);
-        _cfg.OnValueChanged(CCVars.TipsEnabled, SetEnabled, true);
-        _cfg.OnValueChanged(CCVars.TipsDataset, SetDataset, true);
+        Subs.CVar(_cfg, CCVars.TipFrequencyOutOfRound, SetOutOfRound, true);
+        Subs.CVar(_cfg, CCVars.TipFrequencyInRound, SetInRound, true);
+        Subs.CVar(_cfg, CCVars.TipsEnabled, SetEnabled, true);
+        Subs.CVar(_cfg, CCVars.TipsDataset, SetDataset, true);
 
         RecalculateNextTipTime();
     }
index 34f9c0f3970c42dc159820e1a411510881d94dc7..54639dd2b0527f250ab1d7662e5bb74d5334b660 100644 (file)
@@ -1,14 +1,12 @@
 using Robust.Shared.Player;
-using Robust.Shared.Reflection;
-using Robust.Shared.Serialization;
+using Robust.Shared.Serialization.TypeSerializers.Implementations;
 
 namespace Content.Server.UserInterface
 {
     [RegisterComponent]
-    public sealed partial class ActivatableUIComponent : Component,
-            ISerializationHooks
+    public sealed partial class ActivatableUIComponent : Component
     {
-        [ViewVariables]
+        [DataField(required: true, customTypeSerializer:typeof(EnumSerializer))]
         public Enum? Key { get; set; }
 
         [ViewVariables(VVAccess.ReadWrite)]
@@ -22,9 +20,6 @@ namespace Content.Server.UserInterface
         [DataField]
         public bool AdminOnly { get; set; } = false;
 
-        [DataField("key", required: true)]
-        private string _keyRaw = default!;
-
         [DataField]
         public LocId VerbText = "ui-verb-toggle-open";
 
@@ -66,13 +61,6 @@ namespace Content.Server.UserInterface
         /// </summary>
         [ViewVariables]
         public ICommonSession? CurrentSingleUser;
-
-        void ISerializationHooks.AfterDeserialization()
-        {
-            var reflectionManager = IoCManager.Resolve<IReflectionManager>();
-            if (reflectionManager.TryParseEnumReference(_keyRaw, out var key))
-                Key = key;
-        }
     }
 }
 
index 70db152b4e296f5272bd9a501d4aee4d307a6c69..d3eeeb6037ad9c8a54eb3351506bf765df1f6228 100644 (file)
@@ -34,8 +34,8 @@ public sealed class WorldgenConfigSystem : EntitySystem
     {
         SubscribeLocalEvent<RoundStartingEvent>(OnLoadingMaps);
         _conHost.RegisterCommand("applyworldgenconfig", Loc.GetString("cmd-applyworldgenconfig-description"), Loc.GetString("cmd-applyworldgenconfig-help"), ApplyWorldgenConfigCommand);
-        _cfg.OnValueChanged(CCVars.WorldgenEnabled, b => _enabled = b, true);
-        _cfg.OnValueChanged(CCVars.WorldgenConfig, s => _worldgenConfig = s, true);
+        Subs.CVar(_cfg, CCVars.WorldgenEnabled, b => _enabled = b, true);
+        Subs.CVar(_cfg, CCVars.WorldgenConfig, s => _worldgenConfig = s, true);
     }
 
     [AdminCommand(AdminFlags.Mapping)]
index eaacaf277b3eea5bccf87a4815db541137d96e89..965ccb24128e426b48e78d85953523d4c79cdab1 100644 (file)
@@ -27,7 +27,7 @@ namespace Content.Shared.Access.Systems
                     continue;
 
                 component.Tags.UnionWith(proto.Tags);
-                Dirty(component);
+                Dirty(uid, component);
             }
         }
 
@@ -58,7 +58,7 @@ namespace Content.Shared.Access.Systems
 
             access.Tags.Clear();
             access.Tags.UnionWith(newTags);
-            Dirty(access);
+            Dirty(uid, access);
 
             return true;
         }
@@ -85,7 +85,7 @@ namespace Content.Shared.Access.Systems
                 access.Tags.UnionWith(proto.Tags);
             }
 
-            Dirty(access);
+            Dirty(uid, access);
             return true;
         }
 
@@ -107,7 +107,7 @@ namespace Content.Shared.Access.Systems
 
             access.Tags.Clear();
             access.Tags.UnionWith(prototype.Access);
-            Dirty(access);
+            Dirty(uid, access);
 
             TryAddGroups(uid, prototype.AccessGroups, access);
 
index 4eaa641eeb774e62a5ddeab2d6b253738858437d..90508bff9d7636acd108f88abe4c21ffec708de0 100644 (file)
@@ -30,7 +30,6 @@ public abstract class SharedActionsSystem : EntitySystem
     [Dependency] private readonly SharedAudioSystem _audio = default!;
     [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
     [Dependency] private readonly ActionContainerSystem _actionContainer = default!;
-    [Dependency] private readonly MetaDataSystem _metaData = default!;
 
     public override void Initialize()
     {
index c24ac8582b01e45d7a5056af36c31c33c10d3f20..ac43cb45f3b58891a875c649196142d58cd18baf 100644 (file)
@@ -1,5 +1,4 @@
 using Robust.Shared.Prototypes;
-using Robust.Shared.Serialization;
 using Robust.Shared.Utility;
 
 namespace Content.Shared.Alert
@@ -8,7 +7,7 @@ namespace Content.Shared.Alert
     /// An alert popup with associated icon, tooltip, and other data.
     /// </summary>
     [Prototype("alert")]
-    public sealed partial class AlertPrototype : IPrototype, ISerializationHooks
+    public sealed partial class AlertPrototype : IPrototype
     {
         [ViewVariables]
         string IPrototype.ID => AlertType.ToString();
@@ -52,7 +51,7 @@ namespace Content.Shared.Alert
         /// Key which is unique w.r.t category semantics (alerts with same category have equal keys,
         /// alerts with no category have different keys).
         /// </summary>
-        public AlertKey AlertKey { get; private set; }
+        public AlertKey AlertKey => new(AlertType, Category);
 
         /// <summary>
         /// -1 (no effect) unless MaxSeverity is specified. Defaults to 1. Minimum severity level supported by this state.
@@ -80,16 +79,6 @@ namespace Content.Shared.Alert
         [DataField("onClick", serverOnly: true)]
         public IAlertClick? OnClick { get; private set; }
 
-        void ISerializationHooks.AfterDeserialization()
-        {
-            if (AlertType == AlertType.Error)
-            {
-                Logger.ErrorS("alert", "missing or invalid alertType for alert with name {0}", Name);
-            }
-
-            AlertKey = new AlertKey(AlertType, Category);
-        }
-
         /// <param name="severity">severity level, if supported by this alert</param>
         /// <returns>the icon path to the texture for the provided severity level</returns>
         public SpriteSpecifier GetIcon(short? severity = null)
index eca71e6fd7336352ec074649695e95633242e540..f4b7cc8bf4ff839d87baaf12a33b2314daf92a53 100644 (file)
@@ -5,16 +5,17 @@ using Content.Shared.Ghost;
 using Content.Shared.Throwing;
 using Robust.Shared.Map;
 using Content.Shared.Physics;
+using Robust.Shared.Map.Components;
 using Robust.Shared.Physics.Components;
 
 namespace Content.Shared.Anomaly.Effects;
 
 public abstract class SharedGravityAnomalySystem : EntitySystem
 {
-    [Dependency] private readonly IMapManager _map = default!;
     [Dependency] private readonly EntityLookupSystem _lookup = default!;
     [Dependency] private readonly ThrowingSystem _throwing = default!;
     [Dependency] private readonly SharedTransformSystem _xform = default!;
+    [Dependency] private readonly SharedMapSystem _mapSystem = default!;
 
     /// <inheritdoc/>
     public override void Initialize()
@@ -47,13 +48,18 @@ public abstract class SharedGravityAnomalySystem : EntitySystem
     private void OnSupercritical(EntityUid uid, GravityAnomalyComponent component, ref AnomalySupercriticalEvent args)
     {
         var xform = Transform(uid);
-        if (!_map.TryGetGrid(xform.GridUid, out var grid))
+        if (!TryComp(xform.GridUid, out MapGridComponent? grid))
             return;
 
         var worldPos = _xform.GetWorldPosition(xform);
-        var tileref = grid.GetTilesIntersecting(new Circle(worldPos, component.SpaceRange)).ToArray();
+        var tileref = _mapSystem.GetTilesIntersecting(
+                xform.GridUid.Value,
+                grid,
+                new Circle(worldPos, component.SpaceRange))
+            .ToArray();
+
         var tiles = tileref.Select(t => (t.GridIndices, Tile.Empty)).ToList();
-        grid.SetTiles(tiles);
+        _mapSystem.SetTiles(xform.GridUid.Value, grid, tiles);
 
         var range = component.MaxThrowRange * 2;
         var strength = component.MaxThrowStrength * 2;
index 711f9d1493cff7135c4ec820dd41143801943e35..6eba4221b498ce5db814fc33472e1853c26d373b 100644 (file)
@@ -27,7 +27,7 @@ public abstract class SharedAnomalySystem : EntitySystem
     [Dependency] protected readonly IGameTiming Timing = default!;
     [Dependency] private readonly INetManager _net = default!;
     [Dependency] protected readonly IRobustRandom Random = default!;
-    [Dependency] protected readonly ISharedAdminLogManager Log = default!;
+    [Dependency] protected readonly ISharedAdminLogManager AdminLog = default!;
     [Dependency] private readonly DamageableSystem _damageable = default!;
     [Dependency] protected readonly SharedAudioSystem Audio = default!;
     [Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
@@ -92,7 +92,7 @@ public abstract class SharedAnomalySystem : EntitySystem
     private void OnAnomalyUnpause(EntityUid uid, AnomalyComponent component, ref EntityUnpausedEvent args)
     {
         component.NextPulseTime += args.PausedTime;
-        Dirty(component);
+        Dirty(uid, component);
     }
 
     private void OnPulsingUnpause(EntityUid uid, AnomalyPulsingComponent component, ref EntityUnpausedEvent args)
@@ -103,7 +103,7 @@ public abstract class SharedAnomalySystem : EntitySystem
     private void OnSupercriticalUnpause(EntityUid uid, AnomalySupercriticalComponent component, ref EntityUnpausedEvent args)
     {
         component.EndTime += args.PausedTime;
-        Dirty(component);
+        Dirty(uid, component);
     }
 
     public void DoAnomalyPulse(EntityUid uid, AnomalyComponent? component = null)
@@ -132,7 +132,7 @@ public abstract class SharedAnomalySystem : EntitySystem
         var stability = Random.NextFloat(minStability, maxStability);
         ChangeAnomalyStability(uid, stability, component);
 
-        Log.Add(LogType.Anomaly, LogImpact.Medium, $"Anomaly {ToPrettyString(uid)} pulsed with severity {component.Severity}.");
+        AdminLog.Add(LogType.Anomaly, LogImpact.Medium, $"Anomaly {ToPrettyString(uid)} pulsed with severity {component.Severity}.");
         if (_net.IsServer)
             Audio.PlayPvs(component.PulseSound, uid);
 
@@ -154,14 +154,14 @@ public abstract class SharedAnomalySystem : EntitySystem
         if (HasComp<AnomalySupercriticalComponent>(uid))
             return;
 
-        Log.Add(LogType.Anomaly, LogImpact.High, $"Anomaly {ToPrettyString(uid)} began to go supercritical.");
+        AdminLog.Add(LogType.Anomaly, LogImpact.High, $"Anomaly {ToPrettyString(uid)} began to go supercritical.");
         if (_net.IsServer)
             _sawmill.Info($"Anomaly is going supercritical. Entity: {ToPrettyString(uid)}");
 
-        var super = EnsureComp<AnomalySupercriticalComponent>(uid);
+        var super = AddComp<AnomalySupercriticalComponent>(uid);
         super.EndTime = Timing.CurTime + super.SupercriticalDuration;
         Appearance.SetData(uid, AnomalyVisuals.Supercritical, true);
-        Dirty(super);
+        Dirty(uid, super);
     }
 
     /// <summary>
@@ -201,7 +201,7 @@ public abstract class SharedAnomalySystem : EntitySystem
         // Logging before resolve, in case the anomaly has deleted itself.
         if (_net.IsServer)
             _sawmill.Info($"Ending anomaly. Entity: {ToPrettyString(uid)}");
-        Log.Add(LogType.Anomaly, LogImpact.Extreme, $"Anomaly {ToPrettyString(uid)} went supercritical.");
+        AdminLog.Add(LogType.Anomaly, LogImpact.Extreme, $"Anomaly {ToPrettyString(uid)} went supercritical.");
 
         if (!Resolve(uid, ref component))
             return;
@@ -231,7 +231,7 @@ public abstract class SharedAnomalySystem : EntitySystem
         var newVal = component.Stability + change;
 
         component.Stability = Math.Clamp(newVal, 0, 1);
-        Dirty(component);
+        Dirty(uid, component);
 
         var ev = new AnomalyStabilityChangedEvent(uid, component.Stability, component.Severity);
         RaiseLocalEvent(uid, ref ev, true);
@@ -254,7 +254,7 @@ public abstract class SharedAnomalySystem : EntitySystem
             StartSupercriticalEvent(uid);
 
         component.Severity = Math.Clamp(newVal, 0, 1);
-        Dirty(component);
+        Dirty(uid, component);
 
         var ev = new AnomalySeverityChangedEvent(uid, component.Stability, component.Severity);
         RaiseLocalEvent(uid, ref ev, true);
@@ -280,7 +280,7 @@ public abstract class SharedAnomalySystem : EntitySystem
         }
 
         component.Health = Math.Clamp(newVal, 0, 1);
-        Dirty(component);
+        Dirty(uid, component);
 
         var ev = new AnomalyHealthChangedEvent(uid, component.Health);
         RaiseLocalEvent(uid, ref ev, true);
index 14a76ee45c0d6b5e5a7c9d12b675b9ede49ade17..1197e019d07c95068e32005e581bfa4c8400739f 100644 (file)
@@ -42,14 +42,7 @@ public abstract class SharedCryostorageSystem : EntitySystem
 
         SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
 
-        _configuration.OnValueChanged(CCVars.GameCryoSleepRejoining, OnCvarChanged, true);
-    }
-
-    public override void Shutdown()
-    {
-        base.Shutdown();
-
-        _configuration.UnsubValueChanged(CCVars.GameCryoSleepRejoining, OnCvarChanged);
+        Subs.CVar(_configuration, CCVars.GameCryoSleepRejoining, OnCvarChanged, true);
     }
 
     private void OnCvarChanged(bool value)
index 505b2a18e7b96ab170ff3ac97416a9edb12f322d..8e76ce3a3e60d50783a99f4a682b02078054e55e 100644 (file)
@@ -13,7 +13,6 @@ namespace Content.Server.Bed.Sleep
     public abstract class SharedSleepingSystem : EntitySystem
     {
         [Dependency] private readonly IGameTiming _gameTiming = default!;
-        [Dependency] private readonly INetManager _net = default!;
         [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
         [Dependency] private readonly BlindableSystem _blindableSystem = default!;
 
index f2d41e5be953f34c606233b99d14409ddd6797d7..3e1ff4284c713feb834bbe88b7f10086e0106b33 100644 (file)
@@ -26,7 +26,6 @@ namespace Content.Shared.Blocking;
 
 public sealed partial class BlockingSystem : EntitySystem
 {
-    [Dependency] private readonly IPrototypeManager _proto = default!;
     [Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
     [Dependency] private readonly ActionContainerSystem _actionContainer = default!;
     [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
index ac12c5e79165f992038e4075266924f9f4d5c492..859a9f37a812c8c25434ad20ac976fed62c6432e 100644 (file)
@@ -11,7 +11,6 @@ public abstract class SharedCartridgeLoaderSystem : EntitySystem
     [Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!;
     [Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
     [Dependency] private readonly SharedContainerSystem _container = default!;
-    [Dependency] private readonly INetManager _netMan = default!;
 
     public override void Initialize()
     {
index 653a7f22a5a3cce7fe090f5f0b966b07ea86a288..021191ac2634d1b9ad9c04b2b43c15eaca843e99 100644 (file)
@@ -38,7 +38,7 @@ public abstract class SharedChargesSystem : EntitySystem
         var old = comp.Charges;
         comp.Charges = Math.Clamp(comp.Charges + change, 0, comp.MaxCharges);
         if (comp.Charges != old)
-            Dirty(comp);
+            Dirty(uid, comp);
     }
 
     /// <summary>
index 4bf2f76ca3486ed8fcf1316de898171d860aea95..e96d9f866aa4e6dd493879cc02a4fc8d43a355de 100644 (file)
@@ -114,7 +114,7 @@ public sealed class StealthClothingSystem : EntitySystem
 /// <summary>
 /// Raised on the stealth clothing when attempting to add an action.
 /// </summary>
-public class AddStealthActionEvent : CancellableEntityEventArgs
+public sealed class AddStealthActionEvent : CancellableEntityEventArgs
 {
     /// <summary>
     /// User that equipped the stealth clothing.
@@ -130,7 +130,7 @@ public class AddStealthActionEvent : CancellableEntityEventArgs
 /// <summary>
 /// Raised on the stealth clothing when the user is attemping to enable it.
 /// </summary>
-public class AttemptStealthEvent : CancellableEntityEventArgs
+public sealed class AttemptStealthEvent : CancellableEntityEventArgs
 {
     /// <summary>
     /// User that is attempting to enable the stealth clothing.
index c6f3e89744d2a208790bff2177676451a9850096..d4c2513cd3d7b164618a6f1512bdc1471ee27a1d 100644 (file)
@@ -20,7 +20,6 @@ namespace Content.Shared.Construction;
 public abstract class SharedFlatpackSystem : EntitySystem
 {
     [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
-    [Dependency] private readonly IMapManager _mapManager = default!;
     [Dependency] private readonly INetManager _net = default!;
     [Dependency] protected readonly IPrototypeManager PrototypeManager = default!;
     [Dependency] protected readonly SharedAppearanceSystem Appearance = default!;
index 9337e79439f182c2e801146898e1964678ab93c8..4aaf380c47df94701fcafdfd0b0288a691142995 100644 (file)
@@ -18,7 +18,6 @@ namespace Content.Shared.Damage
     public sealed class DamageableSystem : EntitySystem
     {
         [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
-        [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
         [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
         [Dependency] private readonly INetManager _netMan = default!;
         [Dependency] private readonly MobThresholdSystem _mobThreshold = default!;
index 5a37d6a6e6c2847c44a4ff1d20045b3e9e89949e..e750863e243ff6aacb214856b57a18da17ed3d70 100644 (file)
@@ -10,7 +10,6 @@ public sealed class PassiveDamageSystem : EntitySystem
 {
     [Dependency] private readonly DamageableSystem _damageable = default!;
     [Dependency] private readonly IGameTiming _timing = default!;
-    [Dependency] private readonly MobStateSystem _mobState = default!;
 
     public override void Initialize()
     {
@@ -33,14 +32,14 @@ public sealed class PassiveDamageSystem : EntitySystem
         // Go through every entity with the component
         var query = EntityQueryEnumerator<PassiveDamageComponent, DamageableComponent, MobStateComponent>();
         while (query.MoveNext(out var uid, out var comp, out var damage, out var mobState))
-        {   
+        {
             // Make sure they're up for a damage tick
             if (comp.NextDamage > curTime)
                 continue;
 
             if (comp.DamageCap != 0 && damage.TotalDamage >= comp.DamageCap)
                 continue;
-            
+
             // Set the next time they can take damage
             comp.NextDamage = curTime + TimeSpan.FromSeconds(1f);
 
index 53d79cada7ac6a562e878e54bc893258aec88ba9..f04f6c6dfe01311182d090c045b511f376644c72 100644 (file)
@@ -14,7 +14,6 @@ using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Events;
 using Robust.Shared.Physics.Systems;
 using Robust.Shared.Timing;
-using Content.Shared.Prying.Components;
 using Robust.Shared.Audio.Systems;
 
 namespace Content.Shared.Doors.Systems;
index 905492a65ba3ce19ba5c91b099cbd4060d82d43b..5a3fb8722933f9357cc00472883055b11df77ecf 100644 (file)
@@ -17,6 +17,7 @@ namespace Content.Shared.Examine
 {
     public abstract partial class ExamineSystemShared : EntitySystem
     {
+        [Dependency] private readonly SharedTransformSystem _transform = default!;
         [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
         [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
         [Dependency] protected readonly MobStateSystem MobStateSystem = default!;
@@ -77,7 +78,7 @@ namespace Content.Shared.Examine
             if (IsClientSide(examined))
                 return true;
 
-            return !Deleted(examined) && CanExamine(examiner, EntityManager.GetComponent<TransformComponent>(examined).MapPosition,
+            return !Deleted(examined) && CanExamine(examiner, _transform.GetMapCoordinates(examined),
                 entity => entity == examiner || entity == examined, examined);
         }
 
@@ -109,7 +110,7 @@ namespace Content.Shared.Examine
                 return false;
 
             return InRangeUnOccluded(
-                EntityManager.GetComponent<TransformComponent>(examiner).MapPosition,
+                _transform.GetMapCoordinates(examiner),
                 target,
                 GetExaminerRange(examiner),
                 predicate: predicate,
index cfbe1fcb3d9f1d6606ea66853cff3869f7abc3a9..80d65f4c2cdcee0fa30a69176109bd38b0676cf5 100644 (file)
@@ -1,9 +1,7 @@
 using Content.Shared.Explosion.EntitySystems;
 using Content.Shared.Chemistry.Components;
-using Content.Shared.Explosion.EntitySystems;
 using Robust.Shared.GameStates;
 using Robust.Shared.Prototypes;
-using Robust.Shared.GameStates;
 
 namespace Content.Shared.Explosion.Components;
 
index 4577bcda99a90f53edc7c5ded87983370a7a3107..099753d51e0628307687628e3eabe4b41cfdc90f 100644 (file)
@@ -6,8 +6,6 @@ namespace Content.Shared.Eye.Blinding.Systems;
 
 public sealed class BlurryVisionSystem : EntitySystem
 {
-    [Dependency] private readonly IEntityManager _entityManager = default!;
-
     public override void Initialize()
     {
         base.Initialize();
index f9bcee44eee97348720226a6d12f2b136450ca4b..d65dddb0df9a2b0b42787de293307f3ee723f13d 100644 (file)
@@ -3,7 +3,7 @@ using Robust.Shared.Serialization;
 
 namespace Content.Shared.Fluids;
 
-public partial class SharedDrainSystem : EntitySystem
+public abstract partial class SharedDrainSystem : EntitySystem
 {
     [Serializable, NetSerializable]
     public sealed partial class DrainDoAfterEvent : SimpleDoAfterEvent
index 472f5b574b2a527caef2f9d38361457e6c831429..ba4d9fc24f8b40486910734cc4826655a1dd3194 100644 (file)
@@ -31,20 +31,8 @@ namespace Content.Shared.Friction
         {
             base.Initialize();
 
-            _configManager.OnValueChanged(CCVars.TileFrictionModifier, SetFrictionModifier, true);
-            _configManager.OnValueChanged(CCVars.StopSpeed, SetStopSpeed, true);
-        }
-
-        private void SetStopSpeed(float value) => _stopSpeed = value;
-
-        private void SetFrictionModifier(float value) => _frictionModifier = value;
-
-        public override void Shutdown()
-        {
-            base.Shutdown();
-
-            _configManager.UnsubValueChanged(CCVars.TileFrictionModifier, SetFrictionModifier);
-            _configManager.UnsubValueChanged(CCVars.StopSpeed, SetStopSpeed);
+            Subs.CVar(_configManager, CCVars.TileFrictionModifier, value => _frictionModifier = value, true);
+            Subs.CVar(_configManager, CCVars.StopSpeed, value => _stopSpeed = value, true);
         }
 
         public override void UpdateBeforeMapSolve(bool prediction, PhysicsMapComponent mapComponent, float frameTime)
index 2f5a9cb61c0c1a95133a4060d8bbd8d369df400c..f3d982977a75c212795a91577487769b0b0bab6a 100644 (file)
@@ -15,7 +15,6 @@ public sealed class GibbingSystem : EntitySystem
 {
     [Dependency] private readonly SharedContainerSystem _containerSystem = default!;
     [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
-    [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
     [Dependency] private readonly SharedAudioSystem _audioSystem = default!;
     [Dependency] private readonly SharedPhysicsSystem _physicsSystem = default!;
     [Dependency] private readonly IRobustRandom _random = default!;
index 699fb64ee8dee8279abc7d984a22d330e5f1d48e..b72a7c4eb3c5e5c4e2f0b8c5c451482f07783262 100644 (file)
@@ -18,7 +18,6 @@ public abstract partial class SharedHandsSystem
     [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
     [Dependency] protected readonly SharedContainerSystem ContainerSystem = default!;
     [Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
-    [Dependency] private readonly SharedItemSystem _items = default!;
     [Dependency] private readonly SharedStorageSystem _storage = default!;
     [Dependency] protected readonly SharedTransformSystem TransformSystem = default!;
     [Dependency] private readonly SharedVirtualItemSystem _virtualSystem = default!;
index 210e21c2c9d1fe0f950352ef5c58169194f2b4c0..cbbee3a85bd7d320f2e8041877453ee49c2bf5ff 100644 (file)
@@ -51,7 +51,7 @@ public partial class InventorySystem : EntitySystem
         if (!TryGetSlot(uid, slot, out slotDefinition, inventory: inventory))
             return false;
 
-        if (!containerComp.TryGetContainer(slotDefinition.Name, out var container))
+        if (!_containerSystem.TryGetContainer(uid, slotDefinition.Name, out var container, containerComp))
         {
             if (inventory.LifeStage >= ComponentLifeStage.Initialized)
                 Log.Error($"Missing inventory container {slot} on entity {ToPrettyString(uid)}");
index 6fb8c64b8e77d5b2526a434ce2b9039e45bd39f2..bce3aeff5271dfd7aa22470ad82539a1ac60eb9e 100644 (file)
@@ -57,13 +57,8 @@ namespace Content.Shared.Movement.Systems
 
             SubscribeLocalEvent<FollowedComponent, EntParentChangedMessage>(OnFollowedParentChange);
 
-            _configManager.OnValueChanged(CCVars.CameraRotationLocked, SetCameraRotationLocked, true);
-            _configManager.OnValueChanged(CCVars.GameDiagonalMovement, SetDiagonalMovement, true);
-        }
-
-        private void SetCameraRotationLocked(bool obj)
-        {
-            CameraRotationLocked = obj;
+            Subs.CVar(_configManager, CCVars.CameraRotationLocked, obj => CameraRotationLocked = obj, true);
+            Subs.CVar(_configManager, CCVars.GameDiagonalMovement, value => DiagonalMovementEnabled = value, true);
         }
 
         /// <summary>
@@ -141,14 +136,10 @@ namespace Content.Shared.Movement.Systems
         private void ShutdownInput()
         {
             CommandBinds.Unregister<SharedMoverController>();
-            _configManager.UnsubValueChanged(CCVars.CameraRotationLocked, SetCameraRotationLocked);
-            _configManager.UnsubValueChanged(CCVars.GameDiagonalMovement, SetDiagonalMovement);
         }
 
         public bool DiagonalMovementEnabled { get; private set; }
 
-        private void SetDiagonalMovement(bool value) => DiagonalMovementEnabled = value;
-
         protected virtual void HandleShuttleInput(EntityUid uid, ShuttleButtons button, ushort subTick, bool state) {}
 
         private void OnAutoParentChange(EntityUid uid, AutoOrientComponent component, ref EntParentChangedMessage args)
index 846fbfaf7e0aaddee387b68a30247db7a3816ef2..8568290bffbb3de44e05b9d2014bcb8c7a526757 100644 (file)
@@ -57,8 +57,8 @@ public abstract partial class SharedMoverController
         Physics.UpdateIsPredicted(relayEntity);
         component.RelayEntity = relayEntity;
         targetComp.Source = uid;
-        Dirty(component);
-        Dirty(targetComp);
+        Dirty(uid, component);
+        Dirty(relayEntity, targetComp);
     }
 
     private void OnRelayShutdown(EntityUid uid, RelayInputMoverComponent component, ComponentShutdown args)
index 7d5e24a15b187307a583c2064c47922e44613568..2c03507f6174a4067e443de1292610de007ffa30 100644 (file)
@@ -92,20 +92,15 @@ namespace Content.Shared.Movement.Systems
 
             InitializeInput();
             InitializeRelay();
-            _configManager.OnValueChanged(CCVars.RelativeMovement, SetRelativeMovement, true);
-            _configManager.OnValueChanged(CCVars.StopSpeed, SetStopSpeed, true);
+            Subs.CVar(_configManager, CCVars.RelativeMovement, value => _relativeMovement = value, true);
+            Subs.CVar(_configManager, CCVars.StopSpeed, value => _stopSpeed = value, true);
             UpdatesBefore.Add(typeof(TileFrictionController));
         }
 
-        private void SetRelativeMovement(bool value) => _relativeMovement = value;
-        private void SetStopSpeed(float value) => _stopSpeed = value;
-
         public override void Shutdown()
         {
             base.Shutdown();
             ShutdownInput();
-            _configManager.UnsubValueChanged(CCVars.RelativeMovement, SetRelativeMovement);
-            _configManager.UnsubValueChanged(CCVars.StopSpeed, SetStopSpeed);
         }
 
         public override void UpdateAfterSolve(bool prediction, float frameTime)
index 43550f29195c1645b1064c7bae4e38a3dcb82896..7f6b88912559e48867492bc82c48bc1d528677ff 100644 (file)
@@ -41,7 +41,7 @@ public abstract class SharedPinpointerSystem : EntitySystem
     /// <summary>
     ///     Set pinpointers target to track
     /// </summary>
-    public void SetTarget(EntityUid uid, EntityUid? target, PinpointerComponent? pinpointer = null)
+    public virtual void SetTarget(EntityUid uid, EntityUid? target, PinpointerComponent? pinpointer = null)
     {
         if (!Resolve(uid, ref pinpointer))
             return;
@@ -84,7 +84,7 @@ public abstract class SharedPinpointerSystem : EntitySystem
             return;
 
         pinpointer.DistanceToTarget = distance;
-        Dirty(pinpointer);
+        Dirty(uid, pinpointer);
     }
 
     /// <summary>
@@ -101,7 +101,7 @@ public abstract class SharedPinpointerSystem : EntitySystem
             return false;
 
         pinpointer.ArrowAngle = arrowAngle;
-        Dirty(pinpointer);
+        Dirty(uid, pinpointer);
 
         return true;
     }
@@ -117,7 +117,7 @@ public abstract class SharedPinpointerSystem : EntitySystem
             return;
 
         pinpointer.IsActive = isActive;
-        Dirty(pinpointer);
+        Dirty(uid, pinpointer);
     }
 
 
@@ -125,7 +125,7 @@ public abstract class SharedPinpointerSystem : EntitySystem
     ///     Toggle Pinpointer screen. If it has target it will start tracking it.
     /// </summary>
     /// <returns>True if pinpointer was activated, false otherwise</returns>
-    public bool TogglePinpointer(EntityUid uid, PinpointerComponent? pinpointer = null)
+    public virtual bool TogglePinpointer(EntityUid uid, PinpointerComponent? pinpointer = null)
     {
         if (!Resolve(uid, ref pinpointer))
             return false;
index f2fe58adcb83fddc84c24e267a5044400d572c31..9be6a4acd5a68126441b27ef97f8019d71cff9f9 100644 (file)
@@ -11,7 +11,6 @@ public sealed class ItemPlacerSystem : EntitySystem
 {
     [Dependency] private readonly CollisionWakeSystem _wake = default!;
     [Dependency] private readonly PlaceableSurfaceSystem _placeableSurface = default!;
-    [Dependency] private readonly SharedPhysicsSystem _physics = default!;
 
     public override void Initialize()
     {
index 1c39997f30d8585dc9e31c3365090a89a328b4f7..9cd11ae604535277462d1af9f6504a38adefb729 100644 (file)
@@ -1,12 +1,7 @@
-using Content.Shared.DoAfter;
-
 namespace Content.Shared.Power.Generator;
 
 public sealed class ActiveGeneratorRevvingSystem: EntitySystem
 {
-    [Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
-    [Dependency] private readonly EntityManager _entity = default!;
-
     public override void Initialize()
     {
         base.Initialize();
index 402b424fb6dcc15bbdf137dd5c5bcb3a6e8147f7..187c8d8a9d847572eaf21274152b075593da7190 100644 (file)
@@ -34,7 +34,6 @@ public sealed class RCDSystem : EntitySystem
     [Dependency] private readonly SharedChargesSystem _charges = default!;
     [Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
     [Dependency] private readonly SharedInteractionSystem _interaction = default!;
-    [Dependency] private readonly SharedMapSystem _mapSystem = default!;
     [Dependency] private readonly SharedPopupSystem _popup = default!;
     [Dependency] private readonly TagSystem _tag = default!;
     [Dependency] private readonly TurfSystem _turf = default!;
index 2795d64b939a928b38067882a00d61969da738e3..33473303aa917ff54a1444b0e618c8c09a602053 100644 (file)
@@ -7,7 +7,6 @@ namespace Content.Shared.Spider;
 public abstract class SharedSpiderSystem : EntitySystem
 {
     [Dependency] private readonly SharedActionsSystem _action = default!;
-    [Dependency] private readonly INetManager _net = default!;
     [Dependency] private readonly IRobustRandom _robustRandom = default!;
     [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
 
index 1e784797e3388d422408fadab22fa650a45f4bb0..529e321f8daa4f9d5a4371bcca08c7b3ac009735 100644 (file)
@@ -24,7 +24,6 @@ public abstract class SharedSprayPainterSystem : EntitySystem
     [Dependency] protected readonly SharedAudioSystem Audio = default!;
     [Dependency] protected readonly SharedDoAfterSystem DoAfter = default!;
     [Dependency] private   readonly SharedPopupSystem _popup = default!;
-    [Dependency] private   readonly SharedUserInterfaceSystem _ui = default!;
 
     public List<AirlockStyle> Styles { get; private set; } = new();
     public List<AirlockGroupPrototype> Groups { get; private set; } = new();
index aeb42453ca029293a24ad765a2837e3d95088cdd..d0ea8045347f900ae1464e60b3de0a56fc510941 100644 (file)
@@ -10,7 +10,6 @@ namespace Content.Shared.Stealth;
 public abstract class SharedStealthSystem : EntitySystem
 {
     [Dependency] private readonly IGameTiming _timing = default!;
-    [Dependency] private readonly MobStateSystem _mobState = default!;
 
     public override void Initialize()
     {
index cf548693f9d6e69381fcd429ff2915d0a372d0da..c87174ba88c41d08a54802fbc05aae6eb2bb1051 100644 (file)
@@ -141,7 +141,7 @@ public sealed class DumpableSystem : EntitySystem
         {
             var transform = Transform(entity);
             _container.AttachParentToContainerOrGrid((entity, transform));
-            _transformSystem.SetLocalPositionRotation(transform, transform.LocalPosition + _random.NextVector2Box() / 2, _random.NextAngle());
+            _transformSystem.SetLocalPositionRotation(entity, transform.LocalPosition + _random.NextVector2Box() / 2, _random.NextAngle(), transform);
         }
 
         if (args.Args.Target == null)
index 04aa100cd1d4b62fe48b2c0749c1261862918188..1f8408319d3e00e5112ed69fba307b544f534ff0 100644 (file)
@@ -27,7 +27,6 @@ public sealed class FloorTileSystem : EntitySystem
     [Dependency] private readonly IGameTiming _timing = default!;
     [Dependency] private readonly IMapManager _mapManager = default!;
     [Dependency] private readonly INetManager _netManager = default!;
-    [Dependency] private readonly IRobustRandom _random = default!;
     [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
     [Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
     [Dependency] private readonly EntityLookupSystem _lookup = default!;
index 3053861ea15be1d1d0fa2eaf982a0e47a320e8d0..1c5ca3d62c70c03eb5236d8ea8dc6e0445d77e2c 100644 (file)
@@ -1,23 +1,10 @@
 using Content.Shared.Actions;
-using Robust.Shared.Reflection;
-using Robust.Shared.Serialization;
+using Robust.Shared.Serialization.TypeSerializers.Implementations;
 
 namespace Content.Shared.UserInterface;
 
-public sealed partial class OpenUiActionEvent : InstantActionEvent, ISerializationHooks
+public sealed partial class OpenUiActionEvent : InstantActionEvent
 {
-    [ViewVariables]
+    [DataField(required: true, customTypeSerializer: typeof(EnumSerializer))]
     public Enum? Key { get; private set; }
-
-    [DataField("key", required: true)]
-    private string _keyRaw = default!;
-
-    void ISerializationHooks.AfterDeserialization()
-    {
-        var reflectionManager = IoCManager.Resolve<IReflectionManager>();
-        if (reflectionManager.TryParseEnumReference(_keyRaw, out var key))
-            Key = key;
-        else
-            Logger.Error($"Invalid UI key ({_keyRaw}) in open-UI action");
-    }
 }