Cleanup warnings: CS0414, CS0618 (#42068)

Cleanup
This commit is contained in:
B_Kirill 2025-12-28 00:14:42 +10:00 committed by BarryNorfolk
parent e66a43a2bc
commit 0a6a32e8a1
6 changed files with 26 additions and 15 deletions

View File

@ -30,7 +30,10 @@ namespace Content.Client.Construction.UI
[Dependency] private readonly IUserInterfaceManager _uiManager = default!; [Dependency] private readonly IUserInterfaceManager _uiManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!; [Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IClientPreferencesManager _preferencesManager = default!; [Dependency] private readonly IClientPreferencesManager _preferencesManager = default!;
[Dependency] private readonly ILogManager _logManager = default!;
private readonly SpriteSystem _spriteSystem; private readonly SpriteSystem _spriteSystem;
private readonly ISawmill _sawmill;
private readonly IConstructionMenuView _constructionView; private readonly IConstructionMenuView _constructionView;
private readonly EntityWhitelistSystem _whitelistSystem; private readonly EntityWhitelistSystem _whitelistSystem;
@ -90,6 +93,7 @@ namespace Content.Client.Construction.UI
_constructionView = new ConstructionMenu(); _constructionView = new ConstructionMenu();
_whitelistSystem = _entManager.System<EntityWhitelistSystem>(); _whitelistSystem = _entManager.System<EntityWhitelistSystem>();
_spriteSystem = _entManager.System<SpriteSystem>(); _spriteSystem = _entManager.System<SpriteSystem>();
_sawmill = _logManager.GetSawmill("construction.ui");
// This is required so that if we load after the system is initialized, we can bind to it immediately // This is required so that if we load after the system is initialized, we can bind to it immediately
if (_systemManager.TryGetEntitySystem<ConstructionSystem>(out var constructionSystem)) if (_systemManager.TryGetEntitySystem<ConstructionSystem>(out var constructionSystem))
@ -284,7 +288,7 @@ namespace Content.Client.Construction.UI
if (!_constructionSystem!.TryGetRecipePrototype(recipe.ID, out var targetProtoId)) if (!_constructionSystem!.TryGetRecipePrototype(recipe.ID, out var targetProtoId))
{ {
Logger.Error("Cannot find the target prototype in the recipe cache with the id \"{0}\" of {1}.", _sawmill.Error("Cannot find the target prototype in the recipe cache with the id \"{0}\" of {1}.",
recipe.ID, recipe.ID,
nameof(ConstructionPrototype)); nameof(ConstructionPrototype));
continue; continue;

View File

@ -20,8 +20,10 @@ namespace Content.Client.Launcher
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IClipboardManager _clipboard = default!; [Dependency] private readonly IClipboardManager _clipboard = default!;
[Dependency] private readonly ILogManager _logManager = default!;
private LauncherConnectingGui? _control; private LauncherConnectingGui? _control;
private ISawmill _sawmill = default!;
private Page _currentPage; private Page _currentPage;
private string? _connectFailReason; private string? _connectFailReason;
@ -61,6 +63,8 @@ namespace Content.Client.Launcher
{ {
_control = new LauncherConnectingGui(this, _random, _prototypeManager, _cfg, _clipboard); _control = new LauncherConnectingGui(this, _random, _prototypeManager, _cfg, _clipboard);
_sawmill = _logManager.GetSawmill("launcher-ui");
_userInterfaceManager.StateRoot.AddChild(_control); _userInterfaceManager.StateRoot.AddChild(_control);
_clientNetManager.ConnectFailed += OnConnectFailed; _clientNetManager.ConnectFailed += OnConnectFailed;
@ -115,12 +119,12 @@ namespace Content.Client.Launcher
} }
else else
{ {
Logger.InfoS("launcher-ui", $"Redial not possible, no Ss14Address"); _sawmill.Info($"Redial not possible, no Ss14Address");
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
Logger.ErrorS("launcher-ui", $"Redial exception: {ex}"); _sawmill.Error($"Redial exception: {ex}");
} }
return false; return false;
} }

View File

@ -45,6 +45,9 @@ internal sealed partial class ChatManager : IChatManager
[Dependency] private readonly PlayerRateLimitManager _rateLimitManager = default!; [Dependency] private readonly PlayerRateLimitManager _rateLimitManager = default!;
[Dependency] private readonly ISharedPlayerManager _player = default!; [Dependency] private readonly ISharedPlayerManager _player = default!;
[Dependency] private readonly DiscordChatLink _discordLink = default!; [Dependency] private readonly DiscordChatLink _discordLink = default!;
[Dependency] private readonly ILogManager _logManager = default!;
private ISawmill _sawmill = default!;
/// <summary> /// <summary>
/// The maximum length a player-sent message can be sent /// The maximum length a player-sent message can be sent
@ -64,6 +67,8 @@ internal sealed partial class ChatManager : IChatManager
_configurationManager.OnValueChanged(CCVars.OocEnabled, OnOocEnabledChanged, true); _configurationManager.OnValueChanged(CCVars.OocEnabled, OnOocEnabledChanged, true);
_configurationManager.OnValueChanged(CCVars.AdminOocEnabled, OnAdminOocEnabledChanged, true); _configurationManager.OnValueChanged(CCVars.AdminOocEnabled, OnAdminOocEnabledChanged, true);
_sawmill = _logManager.GetSawmill("SERVER");
RegisterRateLimits(); RegisterRateLimits();
} }
@ -111,7 +116,7 @@ internal sealed partial class ChatManager : IChatManager
{ {
var wrappedMessage = Loc.GetString("chat-manager-server-wrap-message", ("message", FormattedMessage.EscapeText(message))); var wrappedMessage = Loc.GetString("chat-manager-server-wrap-message", ("message", FormattedMessage.EscapeText(message)));
ChatMessageToAll(ChatChannel.Server, message, wrappedMessage, EntityUid.Invalid, hideChat: false, recordReplay: true, colorOverride: colorOverride); ChatMessageToAll(ChatChannel.Server, message, wrappedMessage, EntityUid.Invalid, hideChat: false, recordReplay: true, colorOverride: colorOverride);
Logger.InfoS("SERVER", message); _sawmill.Info(message);
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Server announcement: {message}"); _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Server announcement: {message}");
} }

View File

@ -17,6 +17,9 @@ namespace Content.Server.GameTicking.Commands
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IAdminManager _adminManager = default!; [Dependency] private readonly IAdminManager _adminManager = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!; [Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly ILogManager _logManager = default!;
private readonly ISawmill _sawmill;
public string Command => "joingame"; public string Command => "joingame";
public string Description => ""; public string Description => "";
@ -25,7 +28,10 @@ namespace Content.Server.GameTicking.Commands
public JoinGameCommand() public JoinGameCommand()
{ {
IoCManager.InjectDependencies(this); IoCManager.InjectDependencies(this);
_sawmill = _logManager.GetSawmill("security");
} }
public void Execute(IConsoleShell shell, string argStr, string[] args) public void Execute(IConsoleShell shell, string argStr, string[] args)
{ {
if (args.Length != 2) if (args.Length != 2)
@ -46,8 +52,8 @@ namespace Content.Server.GameTicking.Commands
if (ticker.PlayerGameStatuses.TryGetValue(player.UserId, out var status) && status == PlayerGameStatus.JoinedGame) if (ticker.PlayerGameStatuses.TryGetValue(player.UserId, out var status) && status == PlayerGameStatus.JoinedGame)
{ {
Logger.InfoS("security", $"{player.Name} ({player.UserId}) attempted to latejoin while in-game."); _sawmill.Info($"{player.Name} ({player.UserId}) attempted to latejoin while in-game.");
shell.WriteError($"{player.Name} is not in the lobby. This incident will be reported."); shell.WriteError($"{player.Name} is not in the lobby. This incident will be reported.");
return; return;
} }

View File

@ -2,7 +2,6 @@
// using Content.Shared.Hands.Components; // using Content.Shared.Hands.Components;
// using Content.Shared.Hands.EntitySystems; // using Content.Shared.Hands.EntitySystems;
// using Content.Shared.Roles; // using Content.Shared.Roles;
// using Content.Shared.StatusEffectNew;
// using Content.Shared.Traits; // using Content.Shared.Traits;
// using Content.Shared.Whitelist; // using Content.Shared.Whitelist;
// using Robust.Shared.Prototypes; // using Robust.Shared.Prototypes;
@ -14,7 +13,6 @@
// [Dependency] private readonly IPrototypeManager _prototypeManager = default!; // [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
// [Dependency] private readonly SharedHandsSystem _sharedHandsSystem = default!; // [Dependency] private readonly SharedHandsSystem _sharedHandsSystem = default!;
// [Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!; // [Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
// [Dependency] private readonly StatusEffectsSystem _statusEffects = default!;
// //
// public override void Initialize() // public override void Initialize()
// { // {
@ -56,11 +54,6 @@
// special.AfterEquip(args.Mob); // special.AfterEquip(args.Mob);
// } // }
// //
// // Begin DeltaV - Add overridden components
// if(traitPrototype.OverriddenComponents != null)
// EntityManager.AddComponents(args.Mob, traitPrototype.OverriddenComponents, true);
// // End DeltaV
//
// // Add item required by the trait // // Add item required by the trait
// if (traitPrototype.TraitGear == null) // if (traitPrototype.TraitGear == null)
// continue; // continue;
@ -77,3 +70,4 @@
// } // }
// } // }
// } // }
//

View File

@ -1,7 +1,6 @@
using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.Fluids.Components; using Content.Shared.Fluids.Components;
using Content.Shared.Item.ItemToggle; using Content.Shared.Item.ItemToggle;
using Content.Shared.Popups;
using Robust.Shared.Audio.Systems; using Robust.Shared.Audio.Systems;
namespace Content.Shared.Fluids; namespace Content.Shared.Fluids;
@ -10,7 +9,6 @@ public sealed class SpraySafetySystem : EntitySystem
{ {
[Dependency] private readonly ItemToggleSystem _toggle = default!; [Dependency] private readonly ItemToggleSystem _toggle = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
public override void Initialize() public override void Initialize()
{ {