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 93fc3f66c2..75ceff9419 100644 --- a/Content.Client/Entry/EntryPoint.cs +++ b/Content.Client/Entry/EntryPoint.cs @@ -1,3 +1,5 @@ +using Content.Client._White.ItemSlotRenderer; +using Content.Client._White.Overlays; using Content.Client.Administration.Managers; using Content.Client.Changelog; using Content.Client.Chat.Managers; @@ -38,8 +40,6 @@ using Robust.Shared.ContentPack; using Robust.Shared.Prototypes; using Robust.Shared.Replays; using Robust.Shared.Timing; -using Content.Client._White.Overlays; -using Content.Client._White.ItemSlotRenderer; namespace Content.Client.Entry { @@ -125,7 +125,6 @@ namespace Content.Client.Entry _prototypeManager.RegisterIgnore("wireLayout"); _prototypeManager.RegisterIgnore("alertLevels"); _prototypeManager.RegisterIgnore("nukeopsRole"); - _prototypeManager.RegisterIgnore("stationGoal"); _prototypeManager.RegisterIgnore("ghostRoleRaffleDecider"); // WD EDIT START diff --git a/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs b/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs index c6f3748eea..da5026f58d 100644 --- a/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs +++ b/Content.Server/Administration/Systems/AdminVerbSystem.Tools.cs @@ -56,7 +56,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!; [Dependency] private readonly SharedPassportSystem _passportSystem = default!; @@ -354,7 +353,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"), @@ -560,7 +559,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 4016fb588d..5a4f3ce03b 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; using Content.Shared._Impstation.Thaven.Components; @@ -65,7 +63,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!; @@ -297,7 +294,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.Monstermos.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs index 7b5241adca..958e1c8e5e 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Monstermos.cs @@ -679,7 +679,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 790a6a10bf..64ca3338c5 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.cs @@ -17,7 +17,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; @@ -30,7 +29,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!; @@ -42,7 +40,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!; [Dependency] private readonly ThrowingSystem _throwing = default!; [Dependency] private readonly ThrownItemSystem _thrown = default!; @@ -132,6 +129,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 ab391de684..bb04e3517c 100644 --- a/Content.Server/Body/Systems/LungSystem.cs +++ b/Content.Server/Body/Systems/LungSystem.cs @@ -17,7 +17,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!; [Dependency] private readonly InventorySystem _inventory = default!; // Goobstation public static string LungSolutionName = "Lung"; @@ -34,7 +33,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) @@ -79,11 +78,12 @@ public sealed class LungSystem : EntitySystem _internals.ConnectBreathTool((parent.Value, internals), ent); } + private void OnMaskToggled(Entity ent, ref ItemMaskToggledEvent args) { if (args.IsToggled || args.IsEquip) { - _atmosphereSystem.DisconnectInternals(ent); + _atmos.DisconnectInternals(ent); } else { @@ -115,7 +115,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 f63d77adb9..04a977b994 100644 --- a/Content.Server/Connection/ConnectionManager.cs +++ b/Content.Server/Connection/ConnectionManager.cs @@ -223,10 +223,10 @@ namespace Content.Server.Connection var showReason = _cfg.GetCVar(CCVars.PanicBunkerShowReason); var customReason = _cfg.GetCVar(CCVars.PanicBunkerCustomReason); - var minHoursAge = _cfg.GetCVar(CCVars.PanicBunkerMinAccountAge); + var minMinutesAge = _cfg.GetCVar(CCVars.PanicBunkerMinAccountAge); var record = await _db.GetPlayerRecordByUserId(userId); var validAccountAge = record != null && - record.FirstSeenTime.CompareTo(DateTimeOffset.UtcNow - TimeSpan.FromHours(minHoursAge)) <= 0; + record.FirstSeenTime.CompareTo(DateTimeOffset.UtcNow - TimeSpan.FromMinutes(minMinutesAge)) <= 0; var bypassAllowed = _cfg.GetCVar(CCVars.BypassBunkerWhitelist) && await _db.GetWhitelistStatusAsync(userId); // Use the custom reason if it exists & they don't have the minimum account age @@ -239,7 +239,7 @@ namespace Content.Server.Connection { return (ConnectionDenyReason.Panic, Loc.GetString("panic-bunker-account-denied-reason", - ("reason", Loc.GetString("panic-bunker-account-reason-account", ("hours", minHoursAge)))), null); + ("reason", Loc.GetString("panic-bunker-account-reason-account", ("minutes", minMinutesAge)))), null); } var minOverallMinutes = _cfg.GetCVar(CCVars.PanicBunkerMinOverallMinutes); @@ -347,8 +347,8 @@ namespace Content.Server.Connection // Initial cvar retrieval var showReason = _cfg.GetCVar(CCVars.BabyJailShowReason); var reason = _cfg.GetCVar(CCVars.BabyJailCustomReason); - var maxAccountAgeHours = _cfg.GetCVar(CCVars.BabyJailMaxAccountAge); - var maxPlaytimeHours = _cfg.GetCVar(CCVars.BabyJailMaxOverallMinutes); + var maxAccountAgeMinutes = _cfg.GetCVar(CCVars.BabyJailMaxAccountAge); + var maxPlaytimeMinutes = _cfg.GetCVar(CCVars.BabyJailMaxOverallMinutes); // Wait some time to lookup data var record = await _db.GetPlayerRecordByUserId(userId); @@ -357,7 +357,7 @@ namespace Content.Server.Connection if (record == null) return (false, ""); - var isAccountAgeInvalid = record.FirstSeenTime.CompareTo(DateTimeOffset.UtcNow - TimeSpan.FromHours(maxAccountAgeHours)) <= 0; + var isAccountAgeInvalid = record.FirstSeenTime.CompareTo(DateTimeOffset.UtcNow - TimeSpan.FromMinutes(maxAccountAgeMinutes)) <= 0; if (isAccountAgeInvalid) { @@ -372,14 +372,13 @@ namespace Content.Server.Connection ("reason", Loc.GetString( "baby-jail-account-reason-account", - ("hours", maxAccountAgeHours)))); + ("minutes", maxAccountAgeMinutes)))); return (true, locAccountReason); } var overallTime = ( await _db.GetPlayTimes(e.UserId)).Find(p => p.Tracker == PlayTimeTrackingShared.TrackerOverall); - var isTotalPlaytimeInvalid = overallTime != null && overallTime.TimeSpent.TotalHours >= maxAccountAgeHours; - + var isTotalPlaytimeInvalid = overallTime != null && overallTime.TimeSpent.TotalMinutes >= maxPlaytimeMinutes; if (isTotalPlaytimeInvalid) { _sawmill.Debug($"Baby jail will deny {userId} for playtime {overallTime!.TimeSpent}"); // Remove on or after 2024-09 @@ -393,7 +392,7 @@ namespace Content.Server.Connection ("reason", Loc.GetString( "baby-jail-account-reason-overall", - ("hours", maxPlaytimeHours)))); + ("minutes", maxPlaytimeMinutes)))); return (true, locPlaytimeReason); } 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 702dc966b0..949d916351 100644 --- a/Content.Server/GameTicking/GameTicker.GamePreset.cs +++ b/Content.Server/GameTicking/GameTicker.GamePreset.cs @@ -42,9 +42,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) @@ -89,7 +89,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) @@ -193,7 +193,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 154e870d31..015538ad7b 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; @@ -7,9 +5,7 @@ using Content.Shared.GameWindow; using Content.Shared.Players; 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; @@ -55,6 +51,10 @@ namespace Content.Server.GameTicking session.Data.ContentDataUncast = data; } + // Make the player actually join the game. + // timer time must be > tick length + Timer.Spawn(0, () => _playerManager.JoinGame(args.Session)); + var record = await _db.GetPlayerRecordByUserId(args.Session.UserId); var firstConnection = record != null && Math.Abs((record.FirstSeenTime - record.LastSeenTime).TotalMinutes) < 1; @@ -65,7 +65,7 @@ namespace Content.Server.GameTicking RaiseNetworkEvent(GetConnectionStatusMsg(), session.Channel); - if (firstConnection && _configurationManager.GetCVar(CCVars.AdminNewPlayerJoinSound)) + 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 dd99eeec3a..223167bc69 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -380,7 +380,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 f68e08c0b7..8220be80c7 100644 --- a/Content.Server/GameTicking/GameTicker.cs +++ b/Content.Server/GameTicking/GameTicker.cs @@ -8,13 +8,10 @@ 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; @@ -22,7 +19,6 @@ using Robust.Server.GameStates; using Robust.Server.Player; using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; -using Robust.Shared.Configuration; using Robust.Shared.Console; using Robust.Shared.Map; using Robust.Shared.Prototypes; @@ -41,7 +37,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 d1b0ca8b0e..79a0ba5bd6 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!; @@ -73,6 +71,7 @@ namespace Content.Server.Ghost _ghostQuery = GetEntityQuery(); _physicsQuery = GetEntityQuery(); + SubscribeLocalEvent(OnGhostStartup); SubscribeLocalEvent(OnMapInit); SubscribeLocalEvent(OnGhostShutdown); @@ -164,6 +163,24 @@ namespace Content.Server.Ghost OnGhostAttempt(mindId, component.CanReturn, mind: mind); } + private void OnGhostStartup(EntityUid uid, GhostComponent component, ComponentStartup args) + { + // Allow this entity to be seen by other ghosts. + var visibility = EnsureComp(uid); + + if (_gameTicker.RunLevel != GameRunLevel.PostRound) + { + _visibilitySystem.AddLayer((uid, visibility), (int) VisibilityFlags.Ghost, false); + _visibilitySystem.RemoveLayer((uid, visibility), (int) VisibilityFlags.Normal, false); + _visibilitySystem.RefreshVisibility(uid, visibilityComponent: visibility); + } + + SetCanSeeGhosts(uid, true); + + var time = _gameTiming.CurTime; + component.TimeOfDeath = time; + } + private void OnGhostShutdown(EntityUid uid, GhostComponent component, ComponentShutdown args) { // Perf: If the entity is deleting itself, no reason to change these back. @@ -196,22 +213,14 @@ namespace Content.Server.Ghost private void OnMapInit(EntityUid uid, GhostComponent component, MapInitEvent args) { - // Allow this entity to be seen by other ghosts. - var visibility = EnsureComp(uid); - - if (_ticker.RunLevel != GameRunLevel.PostRound) + if (_actions.AddAction(uid, ref component.BooActionEntity, out var act, component.BooAction) + && act.UseDelay != null) { - _visibilitySystem.AddLayer((uid, visibility), (int) VisibilityFlags.Ghost, false); - _visibilitySystem.RemoveLayer((uid, visibility), (int) VisibilityFlags.Normal, false); - _visibilitySystem.RefreshVisibility(uid, visibilityComponent: visibility); + var start = _gameTiming.CurTime; + var end = start + act.UseDelay.Value; + _actions.SetCooldown(component.BooActionEntity.Value, start, end); } - SetCanSeeGhosts(uid, true); - - var time = _gameTiming.CurTime; - component.TimeOfDeath = time; - - _actions.AddAction(uid, ref component.BooActionEntity, component.BooAction); _actions.AddAction(uid, ref component.ToggleGhostHearingActionEntity, component.ToggleGhostHearingAction); _actions.AddAction(uid, ref component.ToggleLightingActionEntity, component.ToggleLightingAction); _actions.AddAction(uid, ref component.ToggleFoVActionEntity, component.ToggleFoVAction); @@ -220,7 +229,7 @@ namespace Content.Server.Ghost private void OnGhostExamine(EntityUid uid, GhostComponent component, ExaminedEvent args) { - var timeSinceDeath = _gameTiming.CurTime.Subtract(component.TimeOfDeath); // WD EDIT + var timeSinceDeath = _gameTiming.CurTime.Subtract(component.TimeOfDeath); var deathTimeInfo = timeSinceDeath.Minutes > 0 ? Loc.GetString("comp-ghost-examine-time-minutes", ("minutes", timeSinceDeath.Minutes)) : Loc.GetString("comp-ghost-examine-time-seconds", ("seconds", timeSinceDeath.Seconds)); @@ -266,7 +275,7 @@ namespace Content.Server.Ghost return; } - _mindSystem.UnVisit(actor.PlayerSession); + _mind.UnVisit(actor.PlayerSession); } #region Warp @@ -444,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 3b1408268e..910d277f7e 100644 --- a/Content.Server/MassMedia/Systems/NewsSystem.cs +++ b/Content.Server/MassMedia/Systems/NewsSystem.cs @@ -1,11 +1,9 @@ using System.Diagnostics.CodeAnalysis; -using Content.Server.Access.Systems; using Content.Server.Administration.Logs; 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; @@ -28,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!; @@ -36,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 IdCardSystem _idCardSystem = 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 597cf42e3f..09d8ce4958 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/Store/Systems/StoreSystem.Ui.cs b/Content.Server/Store/Systems/StoreSystem.Ui.cs index d186ce1e3b..827fe5d8d3 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 e7e394ccde..56a93278b8 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/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 30d047ebbc..4304c681e4 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";