Fix RA0032 (#32514)

This commit is contained in:
nikthechampiongr
2024-09-29 03:25:21 +03:00
committed by GitHub
parent 1b9d77a760
commit a5840b925b
27 changed files with 51 additions and 92 deletions

View File

@@ -20,7 +20,6 @@ public sealed partial class ContentAudioSystem
{ {
[Dependency] private readonly IBaseClient _client = default!; [Dependency] private readonly IBaseClient _client = default!;
[Dependency] private readonly ClientGameTicker _gameTicker = default!; [Dependency] private readonly ClientGameTicker _gameTicker = default!;
[Dependency] private readonly IStateManager _stateManager = default!;
[Dependency] private readonly IResourceCache _resourceCache = default!; [Dependency] private readonly IResourceCache _resourceCache = default!;
private readonly AudioParams _lobbySoundtrackParams = new(-5f, 1, 0, 0, 0, false, 0f); 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.LobbyMusicEnabled, LobbyMusicCVarChanged);
Subs.CVar(_configManager, CCVars.LobbyMusicVolume, LobbyMusicVolumeCVarChanged); Subs.CVar(_configManager, CCVars.LobbyMusicVolume, LobbyMusicVolumeCVarChanged);
_stateManager.OnStateChanged += StateManagerOnStateChanged; _state.OnStateChanged += StateManagerOnStateChanged;
_client.PlayerLeaveServer += OnLeave; _client.PlayerLeaveServer += OnLeave;
@@ -115,7 +114,7 @@ public sealed partial class ContentAudioSystem
private void LobbyMusicCVarChanged(bool musicEnabled) private void LobbyMusicCVarChanged(bool musicEnabled)
{ {
if (musicEnabled && _stateManager.CurrentState is LobbyState) if (musicEnabled && _state.CurrentState is LobbyState)
{ {
StartLobbyMusic(); StartLobbyMusic();
} }
@@ -234,7 +233,7 @@ public sealed partial class ContentAudioSystem
private void ShutdownLobbyMusic() private void ShutdownLobbyMusic()
{ {
_stateManager.OnStateChanged -= StateManagerOnStateChanged; _state.OnStateChanged -= StateManagerOnStateChanged;
_client.PlayerLeaveServer -= OnLeave; _client.PlayerLeaveServer -= OnLeave;

View File

@@ -69,7 +69,6 @@ namespace Content.Client.Entry
[Dependency] private readonly IResourceManager _resourceManager = default!; [Dependency] private readonly IResourceManager _resourceManager = default!;
[Dependency] private readonly IReplayLoadManager _replayLoad = default!; [Dependency] private readonly IReplayLoadManager _replayLoad = default!;
[Dependency] private readonly ILogManager _logManager = default!; [Dependency] private readonly ILogManager _logManager = default!;
[Dependency] private readonly ContentReplayPlaybackManager _replayMan = default!;
[Dependency] private readonly DebugMonitorManager _debugMonitorManager = default!; [Dependency] private readonly DebugMonitorManager _debugMonitorManager = default!;
public override void Init() public override void Init()
@@ -191,7 +190,7 @@ namespace Content.Client.Entry
_resourceManager, _resourceManager,
ReplayConstants.ReplayZipFolder.ToRootedPath()); ReplayConstants.ReplayZipFolder.ToRootedPath());
_replayMan.LastLoad = (null, ReplayConstants.ReplayZipFolder.ToRootedPath()); _playbackMan.LastLoad = (null, ReplayConstants.ReplayZipFolder.ToRootedPath());
_replayLoad.LoadAndStartReplay(reader); _replayLoad.LoadAndStartReplay(reader);
} }
else if (_gameController.LaunchState.FromLauncher) else if (_gameController.LaunchState.FromLauncher)

View File

@@ -52,7 +52,6 @@ public sealed partial class AdminVerbSystem
[Dependency] private readonly StationJobsSystem _stationJobsSystem = default!; [Dependency] private readonly StationJobsSystem _stationJobsSystem = default!;
[Dependency] private readonly JointSystem _jointSystem = default!; [Dependency] private readonly JointSystem _jointSystem = default!;
[Dependency] private readonly BatterySystem _batterySystem = default!; [Dependency] private readonly BatterySystem _batterySystem = default!;
[Dependency] private readonly SharedTransformSystem _xformSystem = default!;
[Dependency] private readonly MetaDataSystem _metaSystem = default!; [Dependency] private readonly MetaDataSystem _metaSystem = default!;
[Dependency] private readonly GunSystem _gun = default!; [Dependency] private readonly GunSystem _gun = default!;
@@ -327,7 +326,7 @@ public sealed partial class AdminVerbSystem
Act = () => Act = () =>
{ {
var (mapUid, gridUid) = _adminTestArenaSystem.AssertArenaLoaded(player); 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, Impact = LogImpact.Medium,
Message = Loc.GetString("admin-trick-send-to-test-arena-description"), Message = Loc.GetString("admin-trick-send-to-test-arena-description"),
@@ -533,7 +532,7 @@ public sealed partial class AdminVerbSystem
if (shuttle is null) if (shuttle is null)
return; return;
_xformSystem.SetCoordinates(args.User, new EntityCoordinates(shuttle.Value, Vector2.Zero)); _transformSystem.SetCoordinates(args.User, new EntityCoordinates(shuttle.Value, Vector2.Zero));
}, },
Impact = LogImpact.Low, Impact = LogImpact.Low,
Message = Loc.GetString("admin-trick-locate-cargo-shuttle-description"), Message = Loc.GetString("admin-trick-locate-cargo-shuttle-description"),

View File

@@ -35,10 +35,8 @@ using Robust.Shared.Toolshed;
using Robust.Shared.Utility; using Robust.Shared.Utility;
using System.Linq; using System.Linq;
using Content.Server.Silicons.Laws; using Content.Server.Silicons.Laws;
using Content.Shared.Silicons.Laws;
using Content.Shared.Silicons.Laws.Components; using Content.Shared.Silicons.Laws.Components;
using Robust.Server.Player; using Robust.Server.Player;
using Content.Shared.Mind;
using Robust.Shared.Physics.Components; using Robust.Shared.Physics.Components;
using static Content.Shared.Configurable.ConfigurationComponent; using static Content.Shared.Configurable.ConfigurationComponent;
@@ -63,7 +61,6 @@ namespace Content.Server.Administration.Systems
[Dependency] private readonly ArtifactSystem _artifactSystem = default!; [Dependency] private readonly ArtifactSystem _artifactSystem = default!;
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!; [Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
[Dependency] private readonly PrayerSystem _prayerSystem = default!; [Dependency] private readonly PrayerSystem _prayerSystem = default!;
[Dependency] private readonly EuiManager _eui = default!;
[Dependency] private readonly MindSystem _mindSystem = default!; [Dependency] private readonly MindSystem _mindSystem = default!;
[Dependency] private readonly ToolshedManager _toolshed = default!; [Dependency] private readonly ToolshedManager _toolshed = default!;
[Dependency] private readonly RejuvenateSystem _rejuvenate = default!; [Dependency] private readonly RejuvenateSystem _rejuvenate = default!;
@@ -294,7 +291,7 @@ namespace Content.Server.Administration.Systems
Act = () => Act = () =>
{ {
var ui = new AdminLogsEui(); var ui = new AdminLogsEui();
_eui.OpenEui(ui, player); _euiManager.OpenEui(ui, player);
ui.SetLogFilter(search:args.Target.Id.ToString()); ui.SetLogFilter(search:args.Target.Id.ToString());
}, },
Impact = LogImpact.Low Impact = LogImpact.Low

View File

@@ -210,7 +210,7 @@ namespace Content.Server.Atmos.EntitySystems
MovedByPressureComponent.ProbabilityOffset); MovedByPressureComponent.ProbabilityOffset);
// Can we yeet the thing (due to probability, strength, etc.) // 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) && !float.IsPositiveInfinity(component.MoveResist)
&& (physics.BodyType != BodyType.Static && (physics.BodyType != BodyType.Static
&& (maxForce >= (component.MoveResist * MovedByPressureComponent.MoveForcePushRatio))) && (maxForce >= (component.MoveResist * MovedByPressureComponent.MoveForcePushRatio)))

View File

@@ -689,7 +689,7 @@ namespace Content.Server.Atmos.EntitySystems
var chance = MathHelper.Clamp(0.01f + (sum / SpacingMaxWind) * 0.3f, 0.003f, 0.3f); 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); PryTile(mapGrid, tile.GridIndices);
} }

View File

@@ -14,7 +14,6 @@ using Robust.Shared.Containers;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Physics.Systems; using Robust.Shared.Physics.Systems;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using System.Linq; using System.Linq;
namespace Content.Server.Atmos.EntitySystems; namespace Content.Server.Atmos.EntitySystems;
@@ -27,7 +26,6 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
{ {
[Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!; [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly IAdminLogManager _adminLog = default!; [Dependency] private readonly IAdminLogManager _adminLog = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!; [Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly InternalsSystem _internals = 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 SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly TileSystem _tile = default!; [Dependency] private readonly TileSystem _tile = default!;
[Dependency] private readonly MapSystem _map = default!; [Dependency] private readonly MapSystem _map = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] public readonly PuddleSystem Puddle = default!; [Dependency] public readonly PuddleSystem Puddle = default!;
private const float ExposedUpdateDelay = 1f; private const float ExposedUpdateDelay = 1f;
@@ -124,6 +121,6 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
private void CacheDecals() private void CacheDecals()
{ {
_burntDecals = _prototypeManager.EnumeratePrototypes<DecalPrototype>().Where(x => x.Tags.Contains("burnt")).Select(x => x.ID).ToArray(); _burntDecals = _protoMan.EnumeratePrototypes<DecalPrototype>().Where(x => x.Tags.Contains("burnt")).Select(x => x.ID).ToArray();
} }
} }

View File

@@ -14,7 +14,6 @@ public sealed class LungSystem : EntitySystem
[Dependency] private readonly AtmosphereSystem _atmos = default!; [Dependency] private readonly AtmosphereSystem _atmos = default!;
[Dependency] private readonly InternalsSystem _internals = default!; [Dependency] private readonly InternalsSystem _internals = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
public static string LungSolutionName = "Lung"; public static string LungSolutionName = "Lung";
@@ -29,7 +28,7 @@ public sealed class LungSystem : EntitySystem
private void OnGotUnequipped(Entity<BreathToolComponent> ent, ref GotUnequippedEvent args) private void OnGotUnequipped(Entity<BreathToolComponent> ent, ref GotUnequippedEvent args)
{ {
_atmosphereSystem.DisconnectInternals(ent); _atmos.DisconnectInternals(ent);
} }
private void OnGotEquipped(Entity<BreathToolComponent> ent, ref GotEquippedEvent args) private void OnGotEquipped(Entity<BreathToolComponent> ent, ref GotEquippedEvent args)
@@ -93,7 +92,7 @@ public sealed class LungSystem : EntitySystem
if (moles <= 0) if (moles <= 0)
continue; continue;
var reagent = _atmosphereSystem.GasReagents[i]; var reagent = _atmos.GasReagents[i];
if (reagent is null) if (reagent is null)
continue; continue;

View File

@@ -46,7 +46,6 @@ namespace Content.Server.Connection
/// </summary> /// </summary>
public sealed partial class ConnectionManager : IConnectionManager public sealed partial class ConnectionManager : IConnectionManager
{ {
[Dependency] private readonly IServerDbManager _dbManager = default!;
[Dependency] private readonly IPlayerManager _plyMgr = default!; [Dependency] private readonly IPlayerManager _plyMgr = default!;
[Dependency] private readonly IServerNetManager _netMgr = default!; [Dependency] private readonly IServerNetManager _netMgr = default!;
[Dependency] private readonly IServerDbManager _db = default!; [Dependency] private readonly IServerDbManager _db = default!;
@@ -205,7 +204,7 @@ namespace Content.Server.Connection
return null; return null;
} }
var adminData = await _dbManager.GetAdminDataForAsync(e.UserId); var adminData = await _db.GetAdminDataForAsync(e.UserId);
if (_cfg.GetCVar(CCVars.PanicBunkerEnabled) && adminData == null) if (_cfg.GetCVar(CCVars.PanicBunkerEnabled) && adminData == null)
{ {
@@ -213,7 +212,7 @@ namespace Content.Server.Connection
var customReason = _cfg.GetCVar(CCVars.PanicBunkerCustomReason); var customReason = _cfg.GetCVar(CCVars.PanicBunkerCustomReason);
var minMinutesAge = _cfg.GetCVar(CCVars.PanicBunkerMinAccountAge); var minMinutesAge = _cfg.GetCVar(CCVars.PanicBunkerMinAccountAge);
var record = await _dbManager.GetPlayerRecordByUserId(userId); var record = await _db.GetPlayerRecordByUserId(userId);
var validAccountAge = record != null && var validAccountAge = record != null &&
record.FirstSeenTime.CompareTo(DateTimeOffset.UtcNow - TimeSpan.FromMinutes(minMinutesAge)) <= 0; record.FirstSeenTime.CompareTo(DateTimeOffset.UtcNow - TimeSpan.FromMinutes(minMinutesAge)) <= 0;
var bypassAllowed = _cfg.GetCVar(CCVars.BypassBunkerWhitelist) && await _db.GetWhitelistStatusAsync(userId); var bypassAllowed = _cfg.GetCVar(CCVars.BypassBunkerWhitelist) && await _db.GetWhitelistStatusAsync(userId);
@@ -317,7 +316,7 @@ namespace Content.Server.Connection
var maxPlaytimeMinutes = _cfg.GetCVar(CCVars.BabyJailMaxOverallMinutes); var maxPlaytimeMinutes = _cfg.GetCVar(CCVars.BabyJailMaxOverallMinutes);
// Wait some time to lookup data // 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 // No player record = new account or the DB is having a skill issue
if (record == null) if (record == null)

View File

@@ -36,7 +36,7 @@ namespace Content.Server.GameTicking
private void InitializeCVars() private void InitializeCVars()
{ {
Subs.CVar(_configurationManager, CCVars.GameLobbyEnabled, value => Subs.CVar(_cfg, CCVars.GameLobbyEnabled, value =>
{ {
LobbyEnabled = value; LobbyEnabled = value;
foreach (var (userId, status) in _playerGameStatuses) foreach (var (userId, status) in _playerGameStatuses)
@@ -47,23 +47,23 @@ namespace Content.Server.GameTicking
LobbyEnabled ? PlayerGameStatus.NotReadyToPlay : PlayerGameStatus.ReadyToPlay; LobbyEnabled ? PlayerGameStatus.NotReadyToPlay : PlayerGameStatus.ReadyToPlay;
} }
}, true); }, true);
Subs.CVar(_configurationManager, CCVars.GameDummyTicker, value => DummyTicker = value, true); Subs.CVar(_cfg, CCVars.GameDummyTicker, value => DummyTicker = value, true);
Subs.CVar(_configurationManager, CCVars.GameLobbyDuration, value => LobbyDuration = TimeSpan.FromSeconds(value), true); Subs.CVar(_cfg, CCVars.GameLobbyDuration, value => LobbyDuration = TimeSpan.FromSeconds(value), true);
Subs.CVar(_configurationManager, CCVars.GameDisallowLateJoins, Subs.CVar(_cfg, CCVars.GameDisallowLateJoins,
value => { DisallowLateJoin = value; UpdateLateJoinStatus(); }, true); 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 // TODO why tf is the server name on admin logs
ServerName = value; ServerName = value;
}, true); }, true);
Subs.CVar(_configurationManager, CCVars.DiscordRoundUpdateWebhook, value => Subs.CVar(_cfg, CCVars.DiscordRoundUpdateWebhook, value =>
{ {
if (!string.IsNullOrWhiteSpace(value)) if (!string.IsNullOrWhiteSpace(value))
{ {
_discord.GetWebhook(value, data => _webhookIdentifier = data.ToIdentifier()); _discord.GetWebhook(value, data => _webhookIdentifier = data.ToIdentifier());
} }
}, true); }, true);
Subs.CVar(_configurationManager, CCVars.DiscordRoundEndRoleWebhook, value => Subs.CVar(_cfg, CCVars.DiscordRoundEndRoleWebhook, value =>
{ {
DiscordRoundEndRole = value; DiscordRoundEndRole = value;
@@ -72,9 +72,9 @@ namespace Content.Server.GameTicking
DiscordRoundEndRole = null; DiscordRoundEndRole = null;
} }
}, true); }, true);
Subs.CVar(_configurationManager, CCVars.RoundEndSoundCollection, value => RoundEndSoundCollection = value, true); Subs.CVar(_cfg, CCVars.RoundEndSoundCollection, value => RoundEndSoundCollection = value, true);
#if EXCEPTION_TOLERANCE #if EXCEPTION_TOLERANCE
Subs.CVar(_configurationManager, CCVars.RoundStartFailShutdownCount, value => RoundStartFailShutdownCount = value, true); Subs.CVar(_cfg, CCVars.RoundStartFailShutdownCount, value => RoundStartFailShutdownCount = value, true);
#endif #endif
} }
} }

View File

@@ -41,9 +41,9 @@ namespace Content.Server.GameTicking
DelayStart(TimeSpan.FromSeconds(PresetFailedCooldownIncrease)); 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; var startFailed = true;
foreach (var preset in fallbackPresets) foreach (var preset in fallbackPresets)
@@ -86,7 +86,7 @@ namespace Content.Server.GameTicking
private void InitializeGamePreset() 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) public void SetGamePreset(GamePresetPrototype? preset, bool force = false)
@@ -190,7 +190,7 @@ namespace Content.Server.GameTicking
private void IncrementRoundNumber() private void IncrementRoundNumber()
{ {
var playerIds = _playerGameStatuses.Keys.Select(player => player.UserId).ToArray(); 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 // TODO FIXME AAAAAAAAAAAAAAAAAAAH THIS IS BROKEN
// Task.Run as a terrible dirty workaround to avoid synchronization context deadlock from .Result here. // Task.Run as a terrible dirty workaround to avoid synchronization context deadlock from .Result here.

View File

@@ -1,5 +1,3 @@
using System.Linq;
using Content.Server.Database;
using Content.Shared.Administration; using Content.Shared.Administration;
using Content.Shared.CCVar; using Content.Shared.CCVar;
using Content.Shared.GameTicking; using Content.Shared.GameTicking;
@@ -9,7 +7,6 @@ using Content.Shared.Preferences;
using JetBrains.Annotations; using JetBrains.Annotations;
using Robust.Server.Player; using Robust.Server.Player;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Enums; using Robust.Shared.Enums;
using Robust.Shared.Player; using Robust.Shared.Player;
using Robust.Shared.Timing; using Robust.Shared.Timing;
@@ -21,8 +18,6 @@ namespace Content.Server.GameTicking
public sealed partial class GameTicker public sealed partial class GameTicker
{ {
[Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IServerDbManager _dbManager = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
private void InitializePlayer() private void InitializePlayer()
{ {
@@ -64,7 +59,7 @@ namespace Content.Server.GameTicking
// timer time must be > tick length // timer time must be > tick length
Timer.Spawn(0, () => _playerManager.JoinGame(args.Session)); 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 && var firstConnection = record != null &&
Math.Abs((record.FirstSeenTime - record.LastSeenTime).TotalMinutes) < 1; Math.Abs((record.FirstSeenTime - record.LastSeenTime).TotalMinutes) < 1;
@@ -74,8 +69,8 @@ namespace Content.Server.GameTicking
RaiseNetworkEvent(GetConnectionStatusMsg(), session.Channel); RaiseNetworkEvent(GetConnectionStatusMsg(), session.Channel);
if (firstConnection && _configurationManager.GetCVar(CCVars.AdminNewPlayerJoinSound)) if (firstConnection && _cfg.GetCVar(CCVars.AdminNewPlayerJoinSound))
_audioSystem.PlayGlobal(new SoundPathSpecifier("/Audio/Effects/newplayerping.ogg"), _audio.PlayGlobal(new SoundPathSpecifier("/Audio/Effects/newplayerping.ogg"),
Filter.Empty().AddPlayers(_adminManager.ActiveAdmins), false, Filter.Empty().AddPlayers(_adminManager.ActiveAdmins), false,
audioParams: new AudioParams { Volume = -5f }); audioParams: new AudioParams { Volume = -5f });

View File

@@ -127,8 +127,8 @@ public sealed partial class GameTicker
metadata["gamemode"] = new ValueDataNode(CurrentPreset != null ? Loc.GetString(CurrentPreset.ModeTitle) : string.Empty); metadata["gamemode"] = new ValueDataNode(CurrentPreset != null ? Loc.GetString(CurrentPreset.ModeTitle) : string.Empty);
metadata["roundEndPlayers"] = _serialman.WriteValue(_replayRoundPlayerInfo); metadata["roundEndPlayers"] = _serialman.WriteValue(_replayRoundPlayerInfo);
metadata["roundEndText"] = new ValueDataNode(_replayRoundText); metadata["roundEndText"] = new ValueDataNode(_replayRoundText);
metadata["server_id"] = new ValueDataNode(_configurationManager.GetCVar(CCVars.ServerId)); metadata["server_id"] = new ValueDataNode(_cfg.GetCVar(CCVars.ServerId));
metadata["server_name"] = new ValueDataNode(_configurationManager.GetCVar(CCVars.AdminLogsServerName)); metadata["server_name"] = new ValueDataNode(_cfg.GetCVar(CCVars.AdminLogsServerName));
metadata["roundId"] = new ValueDataNode(RoundId.ToString()); metadata["roundId"] = new ValueDataNode(RoundId.ToString());
} }

View File

@@ -364,7 +364,7 @@ namespace Content.Server.GameTicking
var listOfPlayerInfo = new List<RoundEndMessageEvent.RoundEndPlayerInfo>(); var listOfPlayerInfo = new List<RoundEndMessageEvent.RoundEndPlayerInfo>();
// Grab the great big book of all the Minds, we'll need them for this. // Grab the great big book of all the Minds, we'll need them for this.
var allMinds = EntityQueryEnumerator<MindComponent>(); var allMinds = EntityQueryEnumerator<MindComponent>();
var pvsOverride = _configurationManager.GetCVar(CCVars.RoundEndPVSOverrides); var pvsOverride = _cfg.GetCVar(CCVars.RoundEndPVSOverrides);
while (allMinds.MoveNext(out var mindId, out var mind)) while (allMinds.MoveNext(out var mindId, out var mind))
{ {
// TODO don't list redundant observer roles? // TODO don't list redundant observer roles?

View File

@@ -8,19 +8,15 @@ using Content.Server.Maps;
using Content.Server.Players.PlayTimeTracking; using Content.Server.Players.PlayTimeTracking;
using Content.Server.Preferences.Managers; using Content.Server.Preferences.Managers;
using Content.Server.ServerUpdates; using Content.Server.ServerUpdates;
using Content.Server.Shuttles.Systems;
using Content.Server.Station.Systems; using Content.Server.Station.Systems;
using Content.Shared.Chat; using Content.Shared.Chat;
using Content.Shared.Damage;
using Content.Shared.GameTicking; using Content.Shared.GameTicking;
using Content.Shared.Mind; using Content.Shared.Mind;
using Content.Shared.Mobs.Systems;
using Content.Shared.Roles; using Content.Shared.Roles;
using Robust.Server; using Robust.Server;
using Robust.Server.GameObjects; using Robust.Server.GameObjects;
using Robust.Server.GameStates; using Robust.Server.GameStates;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Console; using Robust.Shared.Console;
using Robust.Shared.Map; using Robust.Shared.Map;
using Robust.Shared.Prototypes; using Robust.Shared.Prototypes;
@@ -39,7 +35,6 @@ namespace Content.Server.GameTicking
[Dependency] private readonly IBanManager _banManager = default!; [Dependency] private readonly IBanManager _banManager = default!;
[Dependency] private readonly IBaseServer _baseServer = default!; [Dependency] private readonly IBaseServer _baseServer = default!;
[Dependency] private readonly IChatManager _chatManager = default!; [Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly IConfigurationManager _configurationManager = default!;
[Dependency] private readonly IConsoleHost _consoleHost = default!; [Dependency] private readonly IConsoleHost _consoleHost = default!;
[Dependency] private readonly IGameMapManager _gameMapManager = default!; [Dependency] private readonly IGameMapManager _gameMapManager = default!;
[Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IGameTiming _gameTiming = default!;

View File

@@ -46,11 +46,9 @@ namespace Content.Server.Ghost
[Dependency] private readonly JobSystem _jobs = default!; [Dependency] private readonly JobSystem _jobs = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!; [Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly MindSystem _minds = default!; [Dependency] private readonly MindSystem _minds = default!;
[Dependency] private readonly SharedMindSystem _mindSystem = default!;
[Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly MobStateSystem _mobState = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly GameTicker _ticker = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!; [Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly VisibilitySystem _visibilitySystem = default!; [Dependency] private readonly VisibilitySystem _visibilitySystem = default!;
[Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly MetaDataSystem _metaData = default!;
@@ -170,7 +168,7 @@ namespace Content.Server.Ghost
// Allow this entity to be seen by other ghosts. // Allow this entity to be seen by other ghosts.
var visibility = EnsureComp<VisibilityComponent>(uid); var visibility = EnsureComp<VisibilityComponent>(uid);
if (_ticker.RunLevel != GameRunLevel.PostRound) if (_gameTicker.RunLevel != GameRunLevel.PostRound)
{ {
_visibilitySystem.AddLayer((uid, visibility), (int) VisibilityFlags.Ghost, false); _visibilitySystem.AddLayer((uid, visibility), (int) VisibilityFlags.Ghost, false);
_visibilitySystem.RemoveLayer((uid, visibility), (int) VisibilityFlags.Normal, false); _visibilitySystem.RemoveLayer((uid, visibility), (int) VisibilityFlags.Normal, false);
@@ -277,7 +275,7 @@ namespace Content.Server.Ghost
return; return;
} }
_mindSystem.UnVisit(actor.PlayerSession); _mind.UnVisit(actor.PlayerSession);
} }
#region Warp #region Warp
@@ -455,7 +453,7 @@ namespace Content.Server.Ghost
spawnPosition = null; spawnPosition = null;
// If it's bad, look for a valid point to spawn // 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 // Make sure the new point is valid too
if (!IsValidSpawnPosition(spawnPosition)) if (!IsValidSpawnPosition(spawnPosition))

View File

@@ -4,7 +4,6 @@ using Content.Server.CartridgeLoader;
using Content.Server.CartridgeLoader.Cartridges; using Content.Server.CartridgeLoader.Cartridges;
using Content.Server.Chat.Managers; using Content.Server.Chat.Managers;
using Content.Server.GameTicking; using Content.Server.GameTicking;
using Content.Server.Interaction;
using Content.Server.MassMedia.Components; using Content.Server.MassMedia.Components;
using Content.Server.Popups; using Content.Server.Popups;
using Content.Server.Station.Systems; using Content.Server.Station.Systems;
@@ -27,7 +26,6 @@ public sealed class NewsSystem : SharedNewsSystem
{ {
[Dependency] private readonly AccessReaderSystem _accessReaderSystem = default!; [Dependency] private readonly AccessReaderSystem _accessReaderSystem = default!;
[Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly InteractionSystem _interaction = default!;
[Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly IAdminLogManager _adminLogger = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly CartridgeLoaderSystem _cartridgeLoaderSystem = 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 PopupSystem _popup = default!;
[Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly GameTicker _ticker = default!; [Dependency] private readonly GameTicker _ticker = default!;
[Dependency] private readonly AccessReaderSystem _accessReader = default!;
[Dependency] private readonly IChatManager _chatManager = default!; [Dependency] private readonly IChatManager _chatManager = default!;
public override void Initialize() public override void Initialize()

View File

@@ -1,16 +1,13 @@
using Content.Server.Administration.Logs; using Content.Server.Administration.Logs;
using Content.Server.Atmos;
using Content.Server.Atmos.EntitySystems; using Content.Server.Atmos.EntitySystems;
using Content.Server.Atmos.Piping.Components; using Content.Server.Atmos.Piping.Components;
using Content.Server.Atmos.Piping.Unary.EntitySystems; using Content.Server.Atmos.Piping.Unary.EntitySystems;
using Content.Server.Body.Components; using Content.Server.Body.Components;
using Content.Server.Body.Systems; using Content.Server.Body.Systems;
using Content.Server.Medical.Components; using Content.Server.Medical.Components;
using Content.Server.NodeContainer;
using Content.Server.NodeContainer.EntitySystems; using Content.Server.NodeContainer.EntitySystems;
using Content.Server.NodeContainer.NodeGroups; using Content.Server.NodeContainer.NodeGroups;
using Content.Server.NodeContainer.Nodes; using Content.Server.NodeContainer.Nodes;
using Content.Server.Power.Components;
using Content.Server.Temperature.Components; using Content.Server.Temperature.Components;
using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Atmos; using Content.Shared.Atmos;
@@ -18,7 +15,6 @@ using Content.Shared.UserInterface;
using Content.Shared.Chemistry; using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Components.SolutionManager; using Content.Shared.Chemistry.Components.SolutionManager;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Climbing.Systems; using Content.Shared.Climbing.Systems;
using Content.Shared.Containers.ItemSlots; using Content.Shared.Containers.ItemSlots;
using Content.Shared.Database; using Content.Shared.Database;
@@ -46,7 +42,6 @@ public sealed partial class CryoPodSystem : SharedCryoPodSystem
[Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!; [Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!;
[Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!; [Dependency] private readonly BloodstreamSystem _bloodstreamSystem = default!;
[Dependency] private readonly UserInterfaceSystem _userInterfaceSystem = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!; [Dependency] private readonly SharedDoAfterSystem _doAfterSystem = default!;
[Dependency] private readonly UserInterfaceSystem _uiSystem = default!; [Dependency] private readonly UserInterfaceSystem _uiSystem = default!;
[Dependency] private readonly SharedToolSystem _toolSystem = 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 // TODO: This should be a state my dude
_userInterfaceSystem.ServerSendUiMessage( _uiSystem.ServerSendUiMessage(
entity.Owner, entity.Owner,
HealthAnalyzerUiKey.Key, HealthAnalyzerUiKey.Key,
new HealthAnalyzerScannedUserMessage(GetNetEntity(entity.Comp.BodyContainer.ContainedEntity), new HealthAnalyzerScannedUserMessage(GetNetEntity(entity.Comp.BodyContainer.ContainedEntity),

View File

@@ -27,7 +27,6 @@ namespace Content.Server.Nutrition.EntitySystems
[Dependency] private readonly FoodSystem _foodSystem = default!; [Dependency] private readonly FoodSystem _foodSystem = default!;
[Dependency] private readonly ExplosionSystem _explosionSystem = default!; [Dependency] private readonly ExplosionSystem _explosionSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
private void InitializeVapes() private void InitializeVapes()
{ {
@@ -127,7 +126,7 @@ namespace Content.Server.Nutrition.EntitySystems
|| args.Args.Target == null) || args.Args.Target == null)
return; return;
var environment = _atmosphereSystem.GetContainingMixture(args.Args.Target.Value, true, true); var environment = _atmos.GetContainingMixture(args.Args.Target.Value, true, true);
if (environment == null) if (environment == null)
{ {
return; return;
@@ -139,7 +138,7 @@ namespace Content.Server.Nutrition.EntitySystems
var merger = new GasMixture(1) { Temperature = args.Solution.Temperature }; var merger = new GasMixture(1) { Temperature = args.Solution.Temperature };
merger.SetMoles(entity.Comp.GasType, args.Solution.Volume.Value / entity.Comp.ReductionFactor); merger.SetMoles(entity.Comp.GasType, args.Solution.Volume.Value / entity.Comp.ReductionFactor);
_atmosphereSystem.Merge(environment, merger); _atmos.Merge(environment, merger);
args.Solution.RemoveAllSolution(); args.Solution.RemoveAllSolution();

View File

@@ -9,7 +9,6 @@ using Content.Shared.CCVar;
using Content.Shared.Power; using Content.Shared.Power;
using Robust.Shared.Audio; using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
using Robust.Shared.Timing;
using Robust.Shared.Player; using Robust.Shared.Player;
namespace Content.Server.ParticleAccelerator.EntitySystems; namespace Content.Server.ParticleAccelerator.EntitySystems;
@@ -18,7 +17,6 @@ public sealed partial class ParticleAcceleratorSystem
{ {
[Dependency] private readonly IAdminManager _adminManager = default!; [Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly IGameTiming _timing = default!;
private void InitializeControlBoxSystem() private void InitializeControlBoxSystem()
{ {
@@ -175,7 +173,7 @@ public sealed partial class ParticleAcceleratorSystem
if (strength >= alertMinPowerState) if (strength >= alertMinPowerState)
{ {
var pos = Transform(uid); var pos = Transform(uid);
if (_timing.CurTime > comp.EffectCooldown) if (_gameTiming.CurTime > comp.EffectCooldown)
{ {
_chat.SendAdminAlert(player, _chat.SendAdminAlert(player,
Loc.GetString("particle-accelerator-admin-power-strength-warning", Loc.GetString("particle-accelerator-admin-power-strength-warning",
@@ -186,7 +184,7 @@ public sealed partial class ParticleAcceleratorSystem
Filter.Empty().AddPlayers(_adminManager.ActiveAdmins), Filter.Empty().AddPlayers(_adminManager.ActiveAdmins),
false, false,
AudioParams.Default.WithVolume(-8f)); AudioParams.Default.WithVolume(-8f));
comp.EffectCooldown = _timing.CurTime + comp.CooldownDuration; comp.EffectCooldown = _gameTiming.CurTime + comp.CooldownDuration;
} }
} }
} }

View File

@@ -18,7 +18,6 @@ public sealed class ChaoticJumpSystem : VirtualController
[Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedTransformSystem _transform = default!;
[Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SharedTransformSystem _xform = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -73,6 +72,6 @@ public sealed class ChaoticJumpSystem : VirtualController
Spawn(component.Effect, transform.Coordinates); Spawn(component.Effect, transform.Coordinates);
_xform.SetWorldPosition(uid, targetPos); _transform.SetWorldPosition(uid, targetPos);
} }
} }

View File

@@ -17,7 +17,6 @@ public sealed partial class CableSystem : EntitySystem
[Dependency] private readonly SharedToolSystem _toolSystem = default!; [Dependency] private readonly SharedToolSystem _toolSystem = default!;
[Dependency] private readonly StackSystem _stack = default!; [Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly ElectrocutionSystem _electrocutionSystem = default!; [Dependency] private readonly ElectrocutionSystem _electrocutionSystem = default!;
[Dependency] private readonly IAdminLogManager _adminLogs = default!;
public override void Initialize() public override void Initialize()
{ {
@@ -51,7 +50,7 @@ public sealed partial class CableSystem : EntitySystem
if (_electrocutionSystem.TryDoElectrifiedAct(uid, args.User)) if (_electrocutionSystem.TryDoElectrifiedAct(uid, args.User))
return; 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); Spawn(cable.CableDroppedOnCutPrototype, xform.Coordinates);
QueueDel(uid); QueueDel(uid);

View File

@@ -30,7 +30,6 @@ public sealed partial class StoreSystem
[Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly StackSystem _stack = default!; [Dependency] private readonly StackSystem _stack = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
private void InitializeUi() private void InitializeUi()
{ {
@@ -260,7 +259,7 @@ public sealed partial class StoreSystem
//log dat shit. //log dat shit.
_admin.Add(LogType.StorePurchase, _admin.Add(LogType.StorePurchase,
LogImpact.Low, 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 listing.PurchaseAmount++; //track how many times something has been purchased
_audio.PlayEntity(component.BuySuccessSound, msg.Actor, uid); //cha-ching! _audio.PlayEntity(component.BuySuccessSound, msg.Actor, uid); //cha-ching!

View File

@@ -33,7 +33,6 @@ public abstract class SharedAnomalySystem : EntitySystem
[Dependency] private readonly SharedPhysicsSystem _physics = default!; [Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] protected readonly SharedPopupSystem Popup = default!; [Dependency] protected readonly SharedPopupSystem Popup = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly IPrototypeManager _prototype = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly SharedTransformSystem _transform = default!;
public override void Initialize() public override void Initialize()
@@ -372,7 +371,7 @@ public abstract class SharedAnomalySystem : EntitySystem
if (tilerefs.Count == 0) if (tilerefs.Count == 0)
break; 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)); var distance = MathF.Sqrt(MathF.Pow(tileref.X - xform.LocalPosition.X, 2) + MathF.Pow(tileref.Y - xform.LocalPosition.Y, 2));
//cut outer & inner circle //cut outer & inner circle

View File

@@ -15,8 +15,6 @@ public abstract class SharedJobSystem : EntitySystem
{ {
[Dependency] private readonly IPrototypeManager _prototypes = default!; [Dependency] private readonly IPrototypeManager _prototypes = default!;
[Dependency] private readonly SharedPlayerSystem _playerSystem = default!; [Dependency] private readonly SharedPlayerSystem _playerSystem = default!;
[Dependency] private readonly IPrototypeManager _protoManager = default!;
private readonly Dictionary<string, string> _inverseTrackerLookup = new(); private readonly Dictionary<string, string> _inverseTrackerLookup = new();
public override void Initialize() public override void Initialize()
@@ -37,7 +35,7 @@ public abstract class SharedJobSystem : EntitySystem
_inverseTrackerLookup.Clear(); _inverseTrackerLookup.Clear();
// This breaks if you have N trackers to 1 JobId but future concern. // This breaks if you have N trackers to 1 JobId but future concern.
foreach (var job in _protoManager.EnumeratePrototypes<JobPrototype>()) foreach (var job in _prototypes.EnumeratePrototypes<JobPrototype>())
{ {
_inverseTrackerLookup.Add(job.PlayTimeTracker, job.ID); _inverseTrackerLookup.Add(job.PlayTimeTracker, job.ID);
} }
@@ -50,7 +48,7 @@ public abstract class SharedJobSystem : EntitySystem
/// <returns></returns> /// <returns></returns>
public string GetJobPrototype(string trackerProto) public string GetJobPrototype(string trackerProto)
{ {
DebugTools.Assert(_protoManager.HasIndex<PlayTimeTrackerPrototype>(trackerProto)); DebugTools.Assert(_prototypes.HasIndex<PlayTimeTrackerPrototype>(trackerProto));
return _inverseTrackerLookup[trackerProto]; return _inverseTrackerLookup[trackerProto];
} }
@@ -60,7 +58,7 @@ public abstract class SharedJobSystem : EntitySystem
public bool TryGetDepartment(string jobProto, [NotNullWhen(true)] out DepartmentPrototype? departmentPrototype) 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. // Not that many departments so we can just eat the cost instead of storing the inverse lookup.
var departmentProtos = _protoManager.EnumeratePrototypes<DepartmentPrototype>().ToList(); var departmentProtos = _prototypes.EnumeratePrototypes<DepartmentPrototype>().ToList();
departmentProtos.Sort((x, y) => string.Compare(x.ID, y.ID, StringComparison.Ordinal)); departmentProtos.Sort((x, y) => string.Compare(x.ID, y.ID, StringComparison.Ordinal));
foreach (var department in departmentProtos) 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. // not sorting it since there should only be 1 primary department for a job.
// this is enforced by the job tests. // this is enforced by the job tests.
var departmentProtos = _protoManager.EnumeratePrototypes<DepartmentPrototype>(); var departmentProtos = _prototypes.EnumeratePrototypes<DepartmentPrototype>();
foreach (var department in departmentProtos) foreach (var department in departmentProtos)
{ {

View File

@@ -55,7 +55,7 @@ public abstract partial class SharedToolSystem
if (!Resolve(uid, ref welder, ref solutionContainer)) if (!Resolve(uid, ref welder, ref solutionContainer))
return default; return default;
if (!SolutionContainer.TryGetSolution( if (!SolutionContainerSystem.TryGetSolution(
(uid, solutionContainer), (uid, solutionContainer),
welder.FuelSolutionName, welder.FuelSolutionName,
out _, out _,

View File

@@ -31,7 +31,6 @@ public abstract partial class SharedToolSystem : EntitySystem
[Dependency] private readonly SharedTransformSystem _transformSystem = default!; [Dependency] private readonly SharedTransformSystem _transformSystem = default!;
[Dependency] private readonly TileSystem _tiles = default!; [Dependency] private readonly TileSystem _tiles = default!;
[Dependency] private readonly TurfSystem _turfs = default!; [Dependency] private readonly TurfSystem _turfs = default!;
[Dependency] protected readonly SharedSolutionContainerSystem SolutionContainer = default!;
public const string CutQuality = "Cutting"; public const string CutQuality = "Cutting";
public const string PulseQuality = "Pulsing"; public const string PulseQuality = "Pulsing";