From 347655fac1f1fa67d32b7263e9e79f69b1db063a Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sat, 6 Jan 2024 04:24:42 -0500 Subject: [PATCH] Freeze eventbus dictionaries (#22628) * Freeze event bus * Cleanup --- Content.Benchmarks/EntityManagerGetAllComponents.cs | 1 + Content.Server/Afk/AfkManager.cs | 2 -- Content.Server/Entry/EntryPoint.cs | 5 +---- Content.Server/Holiday/HolidaySystem.cs | 3 +-- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Content.Benchmarks/EntityManagerGetAllComponents.cs b/Content.Benchmarks/EntityManagerGetAllComponents.cs index 14edf54643..0b9683a4ab 100644 --- a/Content.Benchmarks/EntityManagerGetAllComponents.cs +++ b/Content.Benchmarks/EntityManagerGetAllComponents.cs @@ -48,6 +48,7 @@ namespace Content.Benchmarks var componentFactory = new Mock(); componentFactory.Setup(p => p.GetComponent()).Returns(new DummyComponent()); componentFactory.Setup(p => p.GetRegistration(It.IsAny())).Returns(dummyReg); + componentFactory.Setup(p => p.GetAllRegistrations()).Returns(new[] { dummyReg }); componentFactory.Setup(p => p.GetAllRefTypes()).Returns(new[] { CompIdx.Index() }); IoCManager.RegisterInstance(componentFactory.Object); diff --git a/Content.Server/Afk/AfkManager.cs b/Content.Server/Afk/AfkManager.cs index 1f22f2046e..8f70904317 100644 --- a/Content.Server/Afk/AfkManager.cs +++ b/Content.Server/Afk/AfkManager.cs @@ -4,7 +4,6 @@ using Robust.Server.Player; using Robust.Shared.Configuration; using Robust.Shared.Console; using Robust.Shared.Enums; -using Robust.Shared.Input; using Robust.Shared.Player; using Robust.Shared.Timing; @@ -35,7 +34,6 @@ namespace Content.Server.Afk [UsedImplicitly] public sealed class AfkManager : IAfkManager { - [Dependency] private readonly IEntityManager _entityManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IConfigurationManager _cfg = default!; diff --git a/Content.Server/Entry/EntryPoint.cs b/Content.Server/Entry/EntryPoint.cs index d71225116c..bf7f3ea84a 100644 --- a/Content.Server/Entry/EntryPoint.cs +++ b/Content.Server/Entry/EntryPoint.cs @@ -64,10 +64,7 @@ namespace Content.Server.Entry factory.DoAutoRegistrations(); factory.IgnoreMissingComponents("Visuals"); - foreach (var ignoreName in IgnoredComponents.List) - { - factory.RegisterIgnore(ignoreName); - } + factory.RegisterIgnore(IgnoredComponents.List); prototypes.RegisterIgnore("parallax"); prototypes.RegisterIgnore("guideEntry"); diff --git a/Content.Server/Holiday/HolidaySystem.cs b/Content.Server/Holiday/HolidaySystem.cs index 4224b01491..865d78c8f1 100644 --- a/Content.Server/Holiday/HolidaySystem.cs +++ b/Content.Server/Holiday/HolidaySystem.cs @@ -23,8 +23,7 @@ namespace Content.Server.Holiday public override void Initialize() { - _configManager.OnValueChanged(CCVars.HolidaysEnabled, OnHolidaysEnableChange, true); - + _configManager.OnValueChanged(CCVars.HolidaysEnabled, OnHolidaysEnableChange); SubscribeLocalEvent(OnRunLevelChanged); SubscribeLocalEvent(OnVisualsInit); } -- 2.51.2