From a5840b925b089e5e82cbddc8439498a6b216ae5d Mon Sep 17 00:00:00 2001 From: nikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com> Date: Sun, 29 Sep 2024 03:25:21 +0300 Subject: [PATCH] Fix RA0032 (#32514) --- .../Audio/ContentAudioSystem.LobbyMusic.cs | 7 +++---- Content.Client/Entry/EntryPoint.cs | 3 +-- .../Systems/AdminVerbSystem.Tools.cs | 5 ++--- .../Administration/Systems/AdminVerbSystem.cs | 5 +---- .../AtmosphereSystem.HighPressureDelta.cs | 2 +- .../AtmosphereSystem.Monstermos.cs | 2 +- .../Atmos/EntitySystems/AtmosphereSystem.cs | 5 +---- Content.Server/Body/Systems/LungSystem.cs | 5 ++--- Content.Server/Connection/ConnectionManager.cs | 7 +++---- Content.Server/GameTicking/GameTicker.CVars.cs | 18 +++++++++--------- .../GameTicking/GameTicker.GamePreset.cs | 8 ++++---- .../GameTicking/GameTicker.Player.cs | 11 +++-------- .../GameTicking/GameTicker.Replays.cs | 4 ++-- .../GameTicking/GameTicker.RoundFlow.cs | 2 +- Content.Server/GameTicking/GameTicker.cs | 5 ----- Content.Server/Ghost/GhostSystem.cs | 8 +++----- Content.Server/MassMedia/Systems/NewsSystem.cs | 3 --- Content.Server/Medical/CryoPodSystem.cs | 7 +------ .../EntitySystems/SmokingSystem.Vape.cs | 5 ++--- .../ParticleAcceleratorSystem.ControlBox.cs | 6 ++---- .../Physics/Controllers/ChaoticJumpSystem.cs | 3 +-- .../Power/EntitySystems/CableSystem.cs | 3 +-- Content.Server/Store/Systems/StoreSystem.Ui.cs | 3 +-- Content.Shared/Anomaly/SharedAnomalySystem.cs | 3 +-- Content.Shared/Roles/Jobs/SharedJobSystem.cs | 10 ++++------ .../Tools/Systems/SharedToolSystem.Welder.cs | 2 +- .../Tools/Systems/SharedToolSystem.cs | 1 - 27 files changed, 51 insertions(+), 92 deletions(-) diff --git a/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs b/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs index 9864dbcb2a..7d7d77f51a 100644 --- a/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs +++ b/Content.Client/Audio/ContentAudioSystem.LobbyMusic.cs @@ -20,7 +20,6 @@ public sealed partial class ContentAudioSystem { [Dependency] private readonly IBaseClient _client = default!; [Dependency] private readonly ClientGameTicker _gameTicker = default!; - [Dependency] private readonly IStateManager _stateManager = default!; [Dependency] private readonly IResourceCache _resourceCache = default!; private readonly AudioParams _lobbySoundtrackParams = new(-5f, 1, 0, 0, 0, false, 0f); @@ -71,7 +70,7 @@ public sealed partial class ContentAudioSystem Subs.CVar(_configManager, CCVars.LobbyMusicEnabled, LobbyMusicCVarChanged); Subs.CVar(_configManager, CCVars.LobbyMusicVolume, LobbyMusicVolumeCVarChanged); - _stateManager.OnStateChanged += StateManagerOnStateChanged; + _state.OnStateChanged += StateManagerOnStateChanged; _client.PlayerLeaveServer += OnLeave; @@ -115,7 +114,7 @@ public sealed partial class ContentAudioSystem private void LobbyMusicCVarChanged(bool musicEnabled) { - if (musicEnabled && _stateManager.CurrentState is LobbyState) + if (musicEnabled && _state.CurrentState is LobbyState) { StartLobbyMusic(); } @@ -234,7 +233,7 @@ public sealed partial class ContentAudioSystem private void ShutdownLobbyMusic() { - _stateManager.OnStateChanged -= StateManagerOnStateChanged; + _state.OnStateChanged -= StateManagerOnStateChanged; _client.PlayerLeaveServer -= OnLeave; diff --git a/Content.Client/Entry/EntryPoint.cs b/Content.Client/Entry/EntryPoint.cs index c4c18f154a..cd73d3397d 100644 --- a/Content.Client/Entry/EntryPoint.cs +++ b/Content.Client/Entry/EntryPoint.cs @@ -69,7 +69,6 @@ namespace Content.Client.Entry [Dependency] private readonly IResourceManager _resourceManager = default!; [Dependency] private readonly IReplayLoadManager _replayLoad = default!; [Dependency] private readonly ILogManager _logManager = default!; - [Dependency] private readonly ContentReplayPlaybackManager _replayMan = default!; [Dependency] private readonly DebugMonitorManager _debugMonitorManager = default!; public override void Init() @@ -191,7 +190,7 @@ namespace Content.Client.Entry _resourceManager, ReplayConstants.ReplayZipFolder.ToRootedPath()); - _replayMan.LastLoad = (null, ReplayConstants.ReplayZipFolder.ToRootedPath()); + _playbackMan.LastLoad = (null, ReplayConstants.ReplayZipFolder.ToRootedPath()); _replayLoad.LoadAndStartReplay(reader); } else if (_gameController.LaunchState.FromLauncher) diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs index 56cf287850..70fcfccc4e 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs @@ -52,7 +52,6 @@ public sealed partial class AdminVerbSystem [Dependency] private readonly StationJobsSystem _stationJobsSystem = default!; [Dependency] private readonly JointSystem _jointSystem = default!; [Dependency] private readonly BatterySystem _batterySystem = default!; - [Dependency] private readonly SharedTransformSystem _xformSystem = default!; [Dependency] private readonly MetaDataSystem _metaSystem = default!; [Dependency] private readonly GunSystem _gun = default!; @@ -327,7 +326,7 @@ public sealed partial class AdminVerbSystem Act = () => { var (mapUid, gridUid) = _adminTestArenaSystem.AssertArenaLoaded(player); - _xformSystem.SetCoordinates(args.Target, new EntityCoordinates(gridUid ?? mapUid, Vector2.One)); + _transformSystem.SetCoordinates(args.Target, new EntityCoordinates(gridUid ?? mapUid, Vector2.One)); }, Impact = LogImpact.Medium, Message = Loc.GetString("admin-trick-send-to-test-arena-description"), @@ -533,7 +532,7 @@ public sealed partial class AdminVerbSystem if (shuttle is null) return; - _xformSystem.SetCoordinates(args.User, new EntityCoordinates(shuttle.Value, Vector2.Zero)); + _transformSystem.SetCoordinates(args.User, new EntityCoordinates(shuttle.Value, Vector2.Zero)); }, Impact = LogImpact.Low, Message = Loc.GetString("admin-trick-locate-cargo-shuttle-description"), diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.cs b/Content.Server/Administration/Systems/AdminVerbSystem.cs index 5aa05ce28b..2ab27e4388 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.cs @@ -35,10 +35,8 @@ using Robust.Shared.Toolshed; using Robust.Shared.Utility; using System.Linq; using Content.Server.Silicons.Laws; -using Content.Shared.Silicons.Laws; using Content.Shared.Silicons.Laws.Components; using Robust.Server.Player; -using Content.Shared.Mind; using Robust.Shared.Physics.Components; using static Content.Shared.Configurable.ConfigurationComponent; @@ -63,7 +61,6 @@ namespace Content.Server.Administration.Systems [Dependency] private readonly ArtifactSystem _artifactSystem = default!; [Dependency] private readonly UserInterfaceSystem _uiSystem = default!; [Dependency] private readonly PrayerSystem _prayerSystem = default!; - [Dependency] private readonly EuiManager _eui = default!; [Dependency] private readonly MindSystem _mindSystem = default!; [Dependency] private readonly ToolshedManager _toolshed = default!; [Dependency] private readonly RejuvenateSystem _rejuvenate = default!; @@ -294,7 +291,7 @@ namespace Content.Server.Administration.Systems Act = () => { var ui = new AdminLogsEui(); - _eui.OpenEui(ui, player); + _euiManager.OpenEui(ui, player); ui.SetLogFilter(search:args.Target.Id.ToString()); }, Impact = LogImpact.Low diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs index b96dd0ac48..0b43c92414 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.HighPressureDelta.cs @@ -210,7 +210,7 @@ namespace Content.Server.Atmos.EntitySystems MovedByPressureComponent.ProbabilityOffset); // Can we yeet the thing (due to probability, strength, etc.) - if (moveProb > MovedByPressureComponent.ProbabilityOffset && _robustRandom.Prob(MathF.Min(moveProb / 100f, 1f)) + if (moveProb > MovedByPressureComponent.ProbabilityOffset && _random.Prob(MathF.Min(moveProb / 100f, 1f)) && !float.IsPositiveInfinity(component.MoveResist) && (physics.BodyType != BodyType.Static && (maxForce >= (component.MoveResist * MovedByPressureComponent.MoveForcePushRatio))) diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs index 08193027d6..d703a98154 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs @@ -689,7 +689,7 @@ namespace Content.Server.Atmos.EntitySystems var chance = MathHelper.Clamp(0.01f + (sum / SpacingMaxWind) * 0.3f, 0.003f, 0.3f); - if (sum > 20 && _robustRandom.Prob(chance)) + if (sum > 20 && _random.Prob(chance)) PryTile(mapGrid, tile.GridIndices); } diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs index 13d8f73dc5..f27f7411bf 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs @@ -14,7 +14,6 @@ using Robust.Shared.Containers; using Robust.Shared.Map; using Robust.Shared.Physics.Systems; using Robust.Shared.Prototypes; -using Robust.Shared.Random; using System.Linq; namespace Content.Server.Atmos.EntitySystems; @@ -27,7 +26,6 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem { [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!; - [Dependency] private readonly IRobustRandom _robustRandom = default!; [Dependency] private readonly IAdminLogManager _adminLog = default!; [Dependency] private readonly EntityLookupSystem _lookup = default!; [Dependency] private readonly InternalsSystem _internals = default!; @@ -39,7 +37,6 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem [Dependency] private readonly SharedTransformSystem _transformSystem = default!; [Dependency] private readonly TileSystem _tile = default!; [Dependency] private readonly MapSystem _map = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] public readonly PuddleSystem Puddle = default!; private const float ExposedUpdateDelay = 1f; @@ -124,6 +121,6 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem private void CacheDecals() { - _burntDecals = _prototypeManager.EnumeratePrototypes().Where(x => x.Tags.Contains("burnt")).Select(x => x.ID).ToArray(); + _burntDecals = _protoMan.EnumeratePrototypes().Where(x => x.Tags.Contains("burnt")).Select(x => x.ID).ToArray(); } } diff --git a/Content.Server/Body/Systems/LungSystem.cs b/Content.Server/Body/Systems/LungSystem.cs index 901d61f8fc..859618ae1a 100644 --- a/Content.Server/Body/Systems/LungSystem.cs +++ b/Content.Server/Body/Systems/LungSystem.cs @@ -14,7 +14,6 @@ public sealed class LungSystem : EntitySystem [Dependency] private readonly AtmosphereSystem _atmos = default!; [Dependency] private readonly InternalsSystem _internals = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!; - [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!; public static string LungSolutionName = "Lung"; @@ -29,7 +28,7 @@ public sealed class LungSystem : EntitySystem private void OnGotUnequipped(Entity ent, ref GotUnequippedEvent args) { - _atmosphereSystem.DisconnectInternals(ent); + _atmos.DisconnectInternals(ent); } private void OnGotEquipped(Entity ent, ref GotEquippedEvent args) @@ -93,7 +92,7 @@ public sealed class LungSystem : EntitySystem if (moles <= 0) continue; - var reagent = _atmosphereSystem.GasReagents[i]; + var reagent = _atmos.GasReagents[i]; if (reagent is null) continue; diff --git a/Content.Server/Connection/ConnectionManager.cs b/Content.Server/Connection/ConnectionManager.cs index 1b142830f1..2c1f9fb36f 100644 --- a/Content.Server/Connection/ConnectionManager.cs +++ b/Content.Server/Connection/ConnectionManager.cs @@ -46,7 +46,6 @@ namespace Content.Server.Connection /// public sealed partial class ConnectionManager : IConnectionManager { - [Dependency] private readonly IServerDbManager _dbManager = default!; [Dependency] private readonly IPlayerManager _plyMgr = default!; [Dependency] private readonly IServerNetManager _netMgr = default!; [Dependency] private readonly IServerDbManager _db = default!; @@ -205,7 +204,7 @@ namespace Content.Server.Connection return null; } - var adminData = await _dbManager.GetAdminDataForAsync(e.UserId); + var adminData = await _db.GetAdminDataForAsync(e.UserId); if (_cfg.GetCVar(CCVars.PanicBunkerEnabled) && adminData == null) { @@ -213,7 +212,7 @@ namespace Content.Server.Connection var customReason = _cfg.GetCVar(CCVars.PanicBunkerCustomReason); var minMinutesAge = _cfg.GetCVar(CCVars.PanicBunkerMinAccountAge); - var record = await _dbManager.GetPlayerRecordByUserId(userId); + var record = await _db.GetPlayerRecordByUserId(userId); var validAccountAge = record != null && record.FirstSeenTime.CompareTo(DateTimeOffset.UtcNow - TimeSpan.FromMinutes(minMinutesAge)) <= 0; var bypassAllowed = _cfg.GetCVar(CCVars.BypassBunkerWhitelist) && await _db.GetWhitelistStatusAsync(userId); @@ -317,7 +316,7 @@ namespace Content.Server.Connection var maxPlaytimeMinutes = _cfg.GetCVar(CCVars.BabyJailMaxOverallMinutes); // Wait some time to lookup data - var record = await _dbManager.GetPlayerRecordByUserId(userId); + var record = await _db.GetPlayerRecordByUserId(userId); // No player record = new account or the DB is having a skill issue if (record == null) diff --git a/Content.Server/GameTicking/GameTicker.CVars.cs b/Content.Server/GameTicking/GameTicker.CVars.cs index 60ffa660f5..bb68459740 100644 --- a/Content.Server/GameTicking/GameTicker.CVars.cs +++ b/Content.Server/GameTicking/GameTicker.CVars.cs @@ -36,7 +36,7 @@ namespace Content.Server.GameTicking private void InitializeCVars() { - Subs.CVar(_configurationManager, CCVars.GameLobbyEnabled, value => + Subs.CVar(_cfg, CCVars.GameLobbyEnabled, value => { LobbyEnabled = value; foreach (var (userId, status) in _playerGameStatuses) @@ -47,23 +47,23 @@ namespace Content.Server.GameTicking LobbyEnabled ? PlayerGameStatus.NotReadyToPlay : PlayerGameStatus.ReadyToPlay; } }, true); - 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, + Subs.CVar(_cfg, CCVars.GameDummyTicker, value => DummyTicker = value, true); + Subs.CVar(_cfg, CCVars.GameLobbyDuration, value => LobbyDuration = TimeSpan.FromSeconds(value), true); + Subs.CVar(_cfg, CCVars.GameDisallowLateJoins, value => { DisallowLateJoin = value; UpdateLateJoinStatus(); }, true); - Subs.CVar(_configurationManager, CCVars.AdminLogsServerName, value => + Subs.CVar(_cfg, CCVars.AdminLogsServerName, value => { // TODO why tf is the server name on admin logs ServerName = value; }, true); - Subs.CVar(_configurationManager, CCVars.DiscordRoundUpdateWebhook, value => + Subs.CVar(_cfg, CCVars.DiscordRoundUpdateWebhook, value => { if (!string.IsNullOrWhiteSpace(value)) { _discord.GetWebhook(value, data => _webhookIdentifier = data.ToIdentifier()); } }, true); - Subs.CVar(_configurationManager, CCVars.DiscordRoundEndRoleWebhook, value => + Subs.CVar(_cfg, CCVars.DiscordRoundEndRoleWebhook, value => { DiscordRoundEndRole = value; @@ -72,9 +72,9 @@ namespace Content.Server.GameTicking DiscordRoundEndRole = null; } }, true); - Subs.CVar(_configurationManager, CCVars.RoundEndSoundCollection, value => RoundEndSoundCollection = value, true); + Subs.CVar(_cfg, CCVars.RoundEndSoundCollection, value => RoundEndSoundCollection = value, true); #if EXCEPTION_TOLERANCE - Subs.CVar(_configurationManager, CCVars.RoundStartFailShutdownCount, value => RoundStartFailShutdownCount = value, true); + Subs.CVar(_cfg, CCVars.RoundStartFailShutdownCount, value => RoundStartFailShutdownCount = value, true); #endif } } diff --git a/Content.Server/GameTicking/GameTicker.GamePreset.cs b/Content.Server/GameTicking/GameTicker.GamePreset.cs index 5642e84f90..d1a8b062c4 100644 --- a/Content.Server/GameTicking/GameTicker.GamePreset.cs +++ b/Content.Server/GameTicking/GameTicker.GamePreset.cs @@ -41,9 +41,9 @@ namespace Content.Server.GameTicking DelayStart(TimeSpan.FromSeconds(PresetFailedCooldownIncrease)); } - if (_configurationManager.GetCVar(CCVars.GameLobbyFallbackEnabled)) + if (_cfg.GetCVar(CCVars.GameLobbyFallbackEnabled)) { - var fallbackPresets = _configurationManager.GetCVar(CCVars.GameLobbyFallbackPreset).Split(","); + var fallbackPresets = _cfg.GetCVar(CCVars.GameLobbyFallbackPreset).Split(","); var startFailed = true; foreach (var preset in fallbackPresets) @@ -86,7 +86,7 @@ namespace Content.Server.GameTicking private void InitializeGamePreset() { - SetGamePreset(LobbyEnabled ? _configurationManager.GetCVar(CCVars.GameLobbyDefaultPreset) : "sandbox"); + SetGamePreset(LobbyEnabled ? _cfg.GetCVar(CCVars.GameLobbyDefaultPreset) : "sandbox"); } public void SetGamePreset(GamePresetPrototype? preset, bool force = false) @@ -190,7 +190,7 @@ namespace Content.Server.GameTicking private void IncrementRoundNumber() { var playerIds = _playerGameStatuses.Keys.Select(player => player.UserId).ToArray(); - var serverName = _configurationManager.GetCVar(CCVars.AdminLogsServerName); + var serverName = _cfg.GetCVar(CCVars.AdminLogsServerName); // TODO FIXME AAAAAAAAAAAAAAAAAAAH THIS IS BROKEN // Task.Run as a terrible dirty workaround to avoid synchronization context deadlock from .Result here. diff --git a/Content.Server/GameTicking/GameTicker.Player.cs b/Content.Server/GameTicking/GameTicker.Player.cs index 61cdf6f855..f376408130 100644 --- a/Content.Server/GameTicking/GameTicker.Player.cs +++ b/Content.Server/GameTicking/GameTicker.Player.cs @@ -1,5 +1,3 @@ -using System.Linq; -using Content.Server.Database; using Content.Shared.Administration; using Content.Shared.CCVar; using Content.Shared.GameTicking; @@ -9,7 +7,6 @@ using Content.Shared.Preferences; using JetBrains.Annotations; using Robust.Server.Player; using Robust.Shared.Audio; -using Robust.Shared.Audio.Systems; using Robust.Shared.Enums; using Robust.Shared.Player; using Robust.Shared.Timing; @@ -21,8 +18,6 @@ namespace Content.Server.GameTicking public sealed partial class GameTicker { [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly IServerDbManager _dbManager = default!; - [Dependency] private readonly SharedAudioSystem _audioSystem = default!; private void InitializePlayer() { @@ -64,7 +59,7 @@ namespace Content.Server.GameTicking // timer time must be > tick length Timer.Spawn(0, () => _playerManager.JoinGame(args.Session)); - var record = await _dbManager.GetPlayerRecordByUserId(args.Session.UserId); + var record = await _db.GetPlayerRecordByUserId(args.Session.UserId); var firstConnection = record != null && Math.Abs((record.FirstSeenTime - record.LastSeenTime).TotalMinutes) < 1; @@ -74,8 +69,8 @@ namespace Content.Server.GameTicking RaiseNetworkEvent(GetConnectionStatusMsg(), session.Channel); - if (firstConnection && _configurationManager.GetCVar(CCVars.AdminNewPlayerJoinSound)) - _audioSystem.PlayGlobal(new SoundPathSpecifier("/Audio/Effects/newplayerping.ogg"), + if (firstConnection && _cfg.GetCVar(CCVars.AdminNewPlayerJoinSound)) + _audio.PlayGlobal(new SoundPathSpecifier("/Audio/Effects/newplayerping.ogg"), Filter.Empty().AddPlayers(_adminManager.ActiveAdmins), false, audioParams: new AudioParams { Volume = -5f }); diff --git a/Content.Server/GameTicking/GameTicker.Replays.cs b/Content.Server/GameTicking/GameTicker.Replays.cs index 9109fbf96a..7efa52bd00 100644 --- a/Content.Server/GameTicking/GameTicker.Replays.cs +++ b/Content.Server/GameTicking/GameTicker.Replays.cs @@ -127,8 +127,8 @@ public sealed partial class GameTicker metadata["gamemode"] = new ValueDataNode(CurrentPreset != null ? Loc.GetString(CurrentPreset.ModeTitle) : string.Empty); metadata["roundEndPlayers"] = _serialman.WriteValue(_replayRoundPlayerInfo); metadata["roundEndText"] = new ValueDataNode(_replayRoundText); - metadata["server_id"] = new ValueDataNode(_configurationManager.GetCVar(CCVars.ServerId)); - metadata["server_name"] = new ValueDataNode(_configurationManager.GetCVar(CCVars.AdminLogsServerName)); + metadata["server_id"] = new ValueDataNode(_cfg.GetCVar(CCVars.ServerId)); + metadata["server_name"] = new ValueDataNode(_cfg.GetCVar(CCVars.AdminLogsServerName)); metadata["roundId"] = new ValueDataNode(RoundId.ToString()); } diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index ca087c46ed..0c7668d354 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -364,7 +364,7 @@ namespace Content.Server.GameTicking var listOfPlayerInfo = new List(); // Grab the great big book of all the Minds, we'll need them for this. var allMinds = EntityQueryEnumerator(); - var pvsOverride = _configurationManager.GetCVar(CCVars.RoundEndPVSOverrides); + var pvsOverride = _cfg.GetCVar(CCVars.RoundEndPVSOverrides); while (allMinds.MoveNext(out var mindId, out var mind)) { // TODO don't list redundant observer roles? diff --git a/Content.Server/GameTicking/GameTicker.cs b/Content.Server/GameTicking/GameTicker.cs index fa1e01c7a8..f8ba7e1d7d 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -8,19 +8,15 @@ using Content.Server.Maps; using Content.Server.Players.PlayTimeTracking; using Content.Server.Preferences.Managers; using Content.Server.ServerUpdates; -using Content.Server.Shuttles.Systems; using Content.Server.Station.Systems; using Content.Shared.Chat; -using Content.Shared.Damage; using Content.Shared.GameTicking; using Content.Shared.Mind; -using Content.Shared.Mobs.Systems; using Content.Shared.Roles; using Robust.Server; using Robust.Server.GameObjects; using Robust.Server.GameStates; using Robust.Shared.Audio.Systems; -using Robust.Shared.Configuration; using Robust.Shared.Console; using Robust.Shared.Map; using Robust.Shared.Prototypes; @@ -39,7 +35,6 @@ namespace Content.Server.GameTicking [Dependency] private readonly IBanManager _banManager = default!; [Dependency] private readonly IBaseServer _baseServer = default!; [Dependency] private readonly IChatManager _chatManager = default!; - [Dependency] private readonly IConfigurationManager _configurationManager = default!; [Dependency] private readonly IConsoleHost _consoleHost = default!; [Dependency] private readonly IGameMapManager _gameMapManager = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; diff --git a/Content.Server/Ghost/GhostSystem.cs b/Content.Server/Ghost/GhostSystem.cs index 945b0ff998..85fec0d7d1 100644 --- a/Content.Server/Ghost/GhostSystem.cs +++ b/Content.Server/Ghost/GhostSystem.cs @@ -46,11 +46,9 @@ namespace Content.Server.Ghost [Dependency] private readonly JobSystem _jobs = default!; [Dependency] private readonly EntityLookupSystem _lookup = default!; [Dependency] private readonly MindSystem _minds = default!; - [Dependency] private readonly SharedMindSystem _mindSystem = default!; [Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; - [Dependency] private readonly GameTicker _ticker = default!; [Dependency] private readonly TransformSystem _transformSystem = default!; [Dependency] private readonly VisibilitySystem _visibilitySystem = default!; [Dependency] private readonly MetaDataSystem _metaData = default!; @@ -170,7 +168,7 @@ namespace Content.Server.Ghost // Allow this entity to be seen by other ghosts. var visibility = EnsureComp(uid); - if (_ticker.RunLevel != GameRunLevel.PostRound) + if (_gameTicker.RunLevel != GameRunLevel.PostRound) { _visibilitySystem.AddLayer((uid, visibility), (int) VisibilityFlags.Ghost, false); _visibilitySystem.RemoveLayer((uid, visibility), (int) VisibilityFlags.Normal, false); @@ -277,7 +275,7 @@ namespace Content.Server.Ghost return; } - _mindSystem.UnVisit(actor.PlayerSession); + _mind.UnVisit(actor.PlayerSession); } #region Warp @@ -455,7 +453,7 @@ namespace Content.Server.Ghost spawnPosition = null; // If it's bad, look for a valid point to spawn - spawnPosition ??= _ticker.GetObserverSpawnPoint(); + spawnPosition ??= _gameTicker.GetObserverSpawnPoint(); // Make sure the new point is valid too if (!IsValidSpawnPosition(spawnPosition)) diff --git a/Content.Server/MassMedia/Systems/NewsSystem.cs b/Content.Server/MassMedia/Systems/NewsSystem.cs index 3ac4ecc37b..641f2074b8 100644 --- a/Content.Server/MassMedia/Systems/NewsSystem.cs +++ b/Content.Server/MassMedia/Systems/NewsSystem.cs @@ -4,7 +4,6 @@ using Content.Server.CartridgeLoader; using Content.Server.CartridgeLoader.Cartridges; using Content.Server.Chat.Managers; using Content.Server.GameTicking; -using Content.Server.Interaction; using Content.Server.MassMedia.Components; using Content.Server.Popups; using Content.Server.Station.Systems; @@ -27,7 +26,6 @@ public sealed class NewsSystem : SharedNewsSystem { [Dependency] private readonly AccessReaderSystem _accessReaderSystem = default!; [Dependency] private readonly IGameTiming _timing = default!; - [Dependency] private readonly InteractionSystem _interaction = default!; [Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!; [Dependency] private readonly CartridgeLoaderSystem _cartridgeLoaderSystem = default!; @@ -35,7 +33,6 @@ public sealed class NewsSystem : SharedNewsSystem [Dependency] private readonly PopupSystem _popup = default!; [Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly GameTicker _ticker = default!; - [Dependency] private readonly AccessReaderSystem _accessReader = default!; [Dependency] private readonly IChatManager _chatManager = default!; public override void Initialize() diff --git a/Content.Server/Medical/CryoPodSystem.cs b/Content.Server/Medical/CryoPodSystem.cs index a1c1f1f9ce..fc9ab081d2 100644 --- a/Content.Server/Medical/CryoPodSystem.cs +++ b/Content.Server/Medical/CryoPodSystem.cs @@ -1,16 +1,13 @@ using Content.Server.Administration.Logs; -using Content.Server.Atmos; using Content.Server.Atmos.EntitySystems; using Content.Server.Atmos.Piping.Components; using Content.Server.Atmos.Piping.Unary.EntitySystems; using Content.Server.Body.Components; using Content.Server.Body.Systems; using Content.Server.Medical.Components; -using Content.Server.NodeContainer; using Content.Server.NodeContainer.EntitySystems; using Content.Server.NodeContainer.NodeGroups; using Content.Server.NodeContainer.Nodes; -using Content.Server.Power.Components; using Content.Server.Temperature.Components; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Atmos; @@ -18,7 +15,6 @@ using Content.Shared.UserInterface; using Content.Shared.Chemistry; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Components.SolutionManager; -using Content.Shared.Chemistry.Reagent; using Content.Shared.Climbing.Systems; using Content.Shared.Containers.ItemSlots; using Content.Shared.Database; @@ -46,7 +42,6 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem [Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!; [Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!; - [Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!; [Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!; [Dependency] private readonly UserInterfaceSystem _uiSystem = default!; [Dependency] private readonly SharedToolSystem _toolSystem = default!; @@ -196,7 +191,7 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem } // TODO: This should be a state my dude - _userInterfaceSystem.ServerSendUiMessage( + _uiSystem.ServerSendUiMessage( entity.Owner, HealthAnalyzerUiKey.Key, new HealthAnalyzerScannedUserMessage(GetNetEntity(entity.Comp.BodyContainer.ContainedEntity), diff --git a/Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs b/Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs index f7650f599b..c3d41cead6 100644 --- a/Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs +++ b/Content.Server/Nutrition/EntitySystems/SmokingSystem.Vape.cs @@ -27,7 +27,6 @@ namespace Content.Server.Nutrition.EntitySystems [Dependency] private readonly FoodSystem _foodSystem = default!; [Dependency] private readonly ExplosionSystem _explosionSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; - [Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!; private void InitializeVapes() { @@ -127,7 +126,7 @@ namespace Content.Server.Nutrition.EntitySystems || args.Args.Target == null) return; - var environment = _atmosphereSystem.GetContainingMixture(args.Args.Target.Value, true, true); + var environment = _atmos.GetContainingMixture(args.Args.Target.Value, true, true); if (environment == null) { return; @@ -139,7 +138,7 @@ namespace Content.Server.Nutrition.EntitySystems var merger = new GasMixture(1) { Temperature = args.Solution.Temperature }; merger.SetMoles(entity.Comp.GasType, args.Solution.Volume.Value / entity.Comp.ReductionFactor); - _atmosphereSystem.Merge(environment, merger); + _atmos.Merge(environment, merger); args.Solution.RemoveAllSolution(); diff --git a/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs b/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs index 404eb00fef..90a5cb2ea0 100644 --- a/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs +++ b/Content.Server/ParticleAccelerator/EntitySystems/ParticleAcceleratorSystem.ControlBox.cs @@ -9,7 +9,6 @@ using Content.Shared.CCVar; using Content.Shared.Power; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; -using Robust.Shared.Timing; using Robust.Shared.Player; namespace Content.Server.ParticleAccelerator.EntitySystems; @@ -18,7 +17,6 @@ public sealed partial class ParticleAcceleratorSystem { [Dependency] private readonly IAdminManager _adminManager = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; - [Dependency] private readonly IGameTiming _timing = default!; private void InitializeControlBoxSystem() { @@ -175,7 +173,7 @@ public sealed partial class ParticleAcceleratorSystem if (strength >= alertMinPowerState) { var pos = Transform(uid); - if (_timing.CurTime > comp.EffectCooldown) + if (_gameTiming.CurTime > comp.EffectCooldown) { _chat.SendAdminAlert(player, Loc.GetString("particle-accelerator-admin-power-strength-warning", @@ -186,7 +184,7 @@ public sealed partial class ParticleAcceleratorSystem Filter.Empty().AddPlayers(_adminManager.ActiveAdmins), false, AudioParams.Default.WithVolume(-8f)); - comp.EffectCooldown = _timing.CurTime + comp.CooldownDuration; + comp.EffectCooldown = _gameTiming.CurTime + comp.CooldownDuration; } } } diff --git a/Content.Server/Physics/Controllers/ChaoticJumpSystem.cs b/Content.Server/Physics/Controllers/ChaoticJumpSystem.cs index ee4b776cf0..3f2493b43f 100644 --- a/Content.Server/Physics/Controllers/ChaoticJumpSystem.cs +++ b/Content.Server/Physics/Controllers/ChaoticJumpSystem.cs @@ -18,7 +18,6 @@ public sealed class ChaoticJumpSystem : VirtualController [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!; - [Dependency] private readonly SharedTransformSystem _xform = default!; public override void Initialize() { @@ -73,6 +72,6 @@ public sealed class ChaoticJumpSystem : VirtualController Spawn(component.Effect, transform.Coordinates); - _xform.SetWorldPosition(uid, targetPos); + _transform.SetWorldPosition(uid, targetPos); } } diff --git a/Content.Server/Power/EntitySystems/CableSystem.cs b/Content.Server/Power/EntitySystems/CableSystem.cs index 62eb08d7cb..d0f45b54fc 100644 --- a/Content.Server/Power/EntitySystems/CableSystem.cs +++ b/Content.Server/Power/EntitySystems/CableSystem.cs @@ -17,7 +17,6 @@ public sealed partial class CableSystem : EntitySystem [Dependency] private readonly SharedToolSystem _toolSystem = default!; [Dependency] private readonly StackSystem _stack = default!; [Dependency] private readonly ElectrocutionSystem _electrocutionSystem = default!; - [Dependency] private readonly IAdminLogManager _adminLogs = default!; public override void Initialize() { @@ -51,7 +50,7 @@ public sealed partial class CableSystem : EntitySystem if (_electrocutionSystem.TryDoElectrifiedAct(uid, args.User)) return; - _adminLogs.Add(LogType.CableCut, LogImpact.Medium, $"The {ToPrettyString(uid)} at {xform.Coordinates} was cut by {ToPrettyString(args.User)}."); + _adminLogger.Add(LogType.CableCut, LogImpact.Medium, $"The {ToPrettyString(uid)} at {xform.Coordinates} was cut by {ToPrettyString(args.User)}."); Spawn(cable.CableDroppedOnCutPrototype, xform.Coordinates); QueueDel(uid); diff --git a/Content.Server/Store/Systems/StoreSystem.Ui.cs b/Content.Server/Store/Systems/StoreSystem.Ui.cs index 247055c2a7..95e5711984 100644 --- a/Content.Server/Store/Systems/StoreSystem.Ui.cs +++ b/Content.Server/Store/Systems/StoreSystem.Ui.cs @@ -30,7 +30,6 @@ public sealed partial class StoreSystem [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly StackSystem _stack = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!; - [Dependency] private readonly IPrototypeManager _prototypeManager = default!; private void InitializeUi() { @@ -260,7 +259,7 @@ public sealed partial class StoreSystem //log dat shit. _admin.Add(LogType.StorePurchase, LogImpact.Low, - $"{ToPrettyString(buyer):player} purchased listing \"{ListingLocalisationHelpers.GetLocalisedNameOrEntityName(listing, _prototypeManager)}\" from {ToPrettyString(uid)}"); + $"{ToPrettyString(buyer):player} purchased listing \"{ListingLocalisationHelpers.GetLocalisedNameOrEntityName(listing, _proto)}\" from {ToPrettyString(uid)}"); listing.PurchaseAmount++; //track how many times something has been purchased _audio.PlayEntity(component.BuySuccessSound, msg.Actor, uid); //cha-ching! diff --git a/Content.Shared/Anomaly/SharedAnomalySystem.cs b/Content.Shared/Anomaly/SharedAnomalySystem.cs index 07beb1444d..00d97c1a46 100644 --- a/Content.Shared/Anomaly/SharedAnomalySystem.cs +++ b/Content.Shared/Anomaly/SharedAnomalySystem.cs @@ -33,7 +33,6 @@ public abstract class SharedAnomalySystem : EntitySystem [Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] protected readonly SharedPopupSystem Popup = default!; [Dependency] private readonly IPrototypeManager _prototype = default!; - [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; public override void Initialize() @@ -372,7 +371,7 @@ public abstract class SharedAnomalySystem : EntitySystem if (tilerefs.Count == 0) break; - var tileref = _random.Pick(tilerefs); + var tileref = Random.Pick(tilerefs); var distance = MathF.Sqrt(MathF.Pow(tileref.X - xform.LocalPosition.X, 2) + MathF.Pow(tileref.Y - xform.LocalPosition.Y, 2)); //cut outer & inner circle diff --git a/Content.Shared/Roles/Jobs/SharedJobSystem.cs b/Content.Shared/Roles/Jobs/SharedJobSystem.cs index ce4428d9fe..939a57baad 100644 --- a/Content.Shared/Roles/Jobs/SharedJobSystem.cs +++ b/Content.Shared/Roles/Jobs/SharedJobSystem.cs @@ -15,8 +15,6 @@ public abstract class SharedJobSystem : EntitySystem { [Dependency] private readonly IPrototypeManager _prototypes = default!; [Dependency] private readonly SharedPlayerSystem _playerSystem = default!; - - [Dependency] private readonly IPrototypeManager _protoManager = default!; private readonly Dictionary _inverseTrackerLookup = new(); public override void Initialize() @@ -37,7 +35,7 @@ public abstract class SharedJobSystem : EntitySystem _inverseTrackerLookup.Clear(); // This breaks if you have N trackers to 1 JobId but future concern. - foreach (var job in _protoManager.EnumeratePrototypes()) + foreach (var job in _prototypes.EnumeratePrototypes()) { _inverseTrackerLookup.Add(job.PlayTimeTracker, job.ID); } @@ -50,7 +48,7 @@ public abstract class SharedJobSystem : EntitySystem /// public string GetJobPrototype(string trackerProto) { - DebugTools.Assert(_protoManager.HasIndex(trackerProto)); + DebugTools.Assert(_prototypes.HasIndex(trackerProto)); return _inverseTrackerLookup[trackerProto]; } @@ -60,7 +58,7 @@ public abstract class SharedJobSystem : EntitySystem public bool TryGetDepartment(string jobProto, [NotNullWhen(true)] out DepartmentPrototype? departmentPrototype) { // Not that many departments so we can just eat the cost instead of storing the inverse lookup. - var departmentProtos = _protoManager.EnumeratePrototypes().ToList(); + var departmentProtos = _prototypes.EnumeratePrototypes().ToList(); departmentProtos.Sort((x, y) => string.Compare(x.ID, y.ID, StringComparison.Ordinal)); foreach (var department in departmentProtos) @@ -85,7 +83,7 @@ public abstract class SharedJobSystem : EntitySystem { // not sorting it since there should only be 1 primary department for a job. // this is enforced by the job tests. - var departmentProtos = _protoManager.EnumeratePrototypes(); + var departmentProtos = _prototypes.EnumeratePrototypes(); foreach (var department in departmentProtos) { diff --git a/Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs b/Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs index 60eafce474..a6c3c4779d 100644 --- a/Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs +++ b/Content.Shared/Tools/Systems/SharedToolSystem.Welder.cs @@ -55,7 +55,7 @@ public abstract partial class SharedToolSystem if (!Resolve(uid, ref welder, ref solutionContainer)) return default; - if (!SolutionContainer.TryGetSolution( + if (!SolutionContainerSystem.TryGetSolution( (uid, solutionContainer), welder.FuelSolutionName, out _, diff --git a/Content.Shared/Tools/Systems/SharedToolSystem.cs b/Content.Shared/Tools/Systems/SharedToolSystem.cs index 86b91dcda4..4c7383a38c 100644 --- a/Content.Shared/Tools/Systems/SharedToolSystem.cs +++ b/Content.Shared/Tools/Systems/SharedToolSystem.cs @@ -31,7 +31,6 @@ public abstract partial class SharedToolSystem : EntitySystem [Dependency] private readonly SharedTransformSystem _transformSystem = default!; [Dependency] private readonly TileSystem _tiles = default!; [Dependency] private readonly TurfSystem _turfs = default!; - [Dependency] protected readonly SharedSolutionContainerSystem SolutionContainer = default!; public const string CutQuality = "Cutting"; public const string PulseQuality = "Pulsing";