diff --git a/Robust.Server/AI/AiLogicProcessor.cs b/Robust.Server/AI/AiLogicProcessor.cs
index 45ac81a34..4b097b12f 100644
--- a/Robust.Server/AI/AiLogicProcessor.cs
+++ b/Robust.Server/AI/AiLogicProcessor.cs
@@ -15,7 +15,7 @@ namespace Robust.Server.AI
///
/// Entity this AI is controlling.
///
- public IEntity SelfEntity { get; set; }
+ public IEntity SelfEntity { get; set; } = default!;
///
/// One-Time setup when the processor is created.
diff --git a/Robust.Server/BaseServer.cs b/Robust.Server/BaseServer.cs
index cb2f57a9c..c05633c25 100644
--- a/Robust.Server/BaseServer.cs
+++ b/Robust.Server/BaseServer.cs
@@ -58,38 +58,36 @@ namespace Robust.Server
"The IGameTiming.CurTick of the server.");
-#pragma warning disable 649
- [Dependency] private readonly IConfigurationManager _config;
- [Dependency] private readonly IComponentManager _components;
- [Dependency] private readonly IServerEntityManager _entities;
- [Dependency] private readonly ILogManager _log;
- [Dependency] private readonly IRobustSerializer _serializer;
- [Dependency] private readonly IGameTiming _time;
- [Dependency] private readonly IResourceManagerInternal _resources;
- [Dependency] private readonly IMapManager _mapManager;
- [Dependency] private readonly ITimerManager timerManager;
- [Dependency] private readonly IServerGameStateManager _stateManager;
- [Dependency] private readonly IServerNetManager _network;
- [Dependency] private readonly ISystemConsoleManager _systemConsole;
- [Dependency] private readonly ITaskManager _taskManager;
- [Dependency] private readonly IRuntimeLog runtimeLog;
- [Dependency] private readonly IModLoader _modLoader;
- [Dependency] private readonly IWatchdogApi _watchdogApi;
- [Dependency] private readonly IScriptHost _scriptHost;
- [Dependency] private readonly IMetricsManager _metricsManager;
-#pragma warning restore 649
+ [Dependency] private readonly IConfigurationManager _config = default!;
+ [Dependency] private readonly IComponentManager _components = default!;
+ [Dependency] private readonly IServerEntityManager _entities = default!;
+ [Dependency] private readonly ILogManager _log = default!;
+ [Dependency] private readonly IRobustSerializer _serializer = default!;
+ [Dependency] private readonly IGameTiming _time = default!;
+ [Dependency] private readonly IResourceManagerInternal _resources = default!;
+ [Dependency] private readonly IMapManager _mapManager = default!;
+ [Dependency] private readonly ITimerManager timerManager = default!;
+ [Dependency] private readonly IServerGameStateManager _stateManager = default!;
+ [Dependency] private readonly IServerNetManager _network = default!;
+ [Dependency] private readonly ISystemConsoleManager _systemConsole = default!;
+ [Dependency] private readonly ITaskManager _taskManager = default!;
+ [Dependency] private readonly IRuntimeLog runtimeLog = default!;
+ [Dependency] private readonly IModLoader _modLoader = default!;
+ [Dependency] private readonly IWatchdogApi _watchdogApi = default!;
+ [Dependency] private readonly IScriptHost _scriptHost = default!;
+ [Dependency] private readonly IMetricsManager _metricsManager = default!;
private readonly Stopwatch _uptimeStopwatch = new Stopwatch();
- private CommandLineArgs _commandLineArgs;
- private FileLogHandler fileLogHandler;
- private IGameLoop _mainLoop;
+ private CommandLineArgs _commandLineArgs = default!;
+ private FileLogHandler fileLogHandler = default!;
+ private IGameLoop _mainLoop = default!;
private TimeSpan _lastTitleUpdate;
private int _lastReceivedBytes;
private int _lastSentBytes;
- private string _shutdownReason;
+ private string? _shutdownReason;
private readonly ManualResetEventSlim _shutdownEvent = new ManualResetEventSlim(false);
@@ -109,7 +107,7 @@ namespace Robust.Server
}
///
- public void Shutdown(string reason)
+ public void Shutdown(string? reason)
{
if (string.IsNullOrWhiteSpace(reason))
Logger.InfoS("srv", "Shutting down...");
@@ -281,7 +279,7 @@ namespace Robust.Server
return false;
}
- private void ProcessExiting(object sender, EventArgs e)
+ private void ProcessExiting(object? sender, EventArgs e)
{
_taskManager.RunOnMainThread(() => Shutdown("ProcessExited"));
// Give the server 10 seconds to shut down.
diff --git a/Robust.Server/CommandLineArgs.cs b/Robust.Server/CommandLineArgs.cs
index c6b247714..6ba5bb3a3 100644
--- a/Robust.Server/CommandLineArgs.cs
+++ b/Robust.Server/CommandLineArgs.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using Robust.Shared.Utility;
using C = System.Console;
@@ -6,17 +7,17 @@ namespace Robust.Server
{
internal sealed class CommandLineArgs
{
- public string ConfigFile { get; }
- public string DataDir { get; }
+ public string? ConfigFile { get; }
+ public string? DataDir { get; }
public IReadOnlyCollection<(string key, string value)> CVars { get; }
// Manual parser because C# has no good command line parsing libraries. Also dependencies bad.
// Also I don't like spending 100ms parsing command line args. Do you?
- public static bool TryParse(IReadOnlyList args, out CommandLineArgs parsed)
+ public static bool TryParse(IReadOnlyList args, [NotNullWhen(true)] out CommandLineArgs? parsed)
{
parsed = null;
- string configFile = null;
- string dataDir = null;
+ string? configFile = null;
+ string? dataDir = null;
var cvars = new List<(string, string)>();
using var enumerator = args.GetEnumerator();
@@ -90,7 +91,7 @@ Options:
");
}
- private CommandLineArgs(string configFile, string dataDir, IReadOnlyCollection<(string, string)> cVars)
+ private CommandLineArgs(string? configFile, string? dataDir, IReadOnlyCollection<(string, string)> cVars)
{
ConfigFile = configFile;
DataDir = dataDir;
diff --git a/Robust.Server/Console/Commands/AddCompCommand.cs b/Robust.Server/Console/Commands/AddCompCommand.cs
index e2d6b2c74..eb0439086 100644
--- a/Robust.Server/Console/Commands/AddCompCommand.cs
+++ b/Robust.Server/Console/Commands/AddCompCommand.cs
@@ -14,7 +14,7 @@ namespace Robust.Server.Console.Commands
public string Description => "Adds a component to an entity";
public string Help => "addcomp ";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
if (args.Length != 2)
{
diff --git a/Robust.Server/Console/Commands/CVarCommand.cs b/Robust.Server/Console/Commands/CVarCommand.cs
index 22f496aa5..18dc981cc 100644
--- a/Robust.Server/Console/Commands/CVarCommand.cs
+++ b/Robust.Server/Console/Commands/CVarCommand.cs
@@ -11,7 +11,7 @@ namespace Robust.Server.Console.Commands
[UsedImplicitly]
internal sealed class CVarCommand : SharedCVarCommand, IClientCommand
{
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
if (args.Length < 1 || args.Length > 2)
{
diff --git a/Robust.Server/Console/Commands/DeleteCommand.cs b/Robust.Server/Console/Commands/DeleteCommand.cs
index 744cbff73..53d432741 100644
--- a/Robust.Server/Console/Commands/DeleteCommand.cs
+++ b/Robust.Server/Console/Commands/DeleteCommand.cs
@@ -12,7 +12,7 @@ namespace Robust.Server.Console.Commands
public string Description => "Deletes the entity with the specified ID.";
public string Help => "delete ";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
if (args.Length != 1)
{
diff --git a/Robust.Server/Console/Commands/ListAssembliesCommand.cs b/Robust.Server/Console/Commands/ListAssembliesCommand.cs
index a8e373450..4af32f2c8 100644
--- a/Robust.Server/Console/Commands/ListAssembliesCommand.cs
+++ b/Robust.Server/Console/Commands/ListAssembliesCommand.cs
@@ -13,7 +13,7 @@ namespace Robust.Server.Console.Commands
public string Description => "Lists loaded assemblies by load context.";
public string Help => Command;
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
var sb = new StringBuilder();
foreach (var context in AssemblyLoadContext.All)
diff --git a/Robust.Server/Console/Commands/ListCommands.cs b/Robust.Server/Console/Commands/ListCommands.cs
index 7f5cb6233..550ad4565 100644
--- a/Robust.Server/Console/Commands/ListCommands.cs
+++ b/Robust.Server/Console/Commands/ListCommands.cs
@@ -11,7 +11,7 @@ namespace Robust.Server.Console.Commands
public string Description => "Outputs a list of all commands which are currently available to you.";
public string Help => "list";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
var builder = new StringBuilder("SIDE NAME DESC\n-------------------------\n");
foreach (var command in shell.AvailableCommands.Values.OrderBy(c => c.Command))
diff --git a/Robust.Server/Console/Commands/LogCommands.cs b/Robust.Server/Console/Commands/LogCommands.cs
index 871cbb854..f2b8d7d67 100644
--- a/Robust.Server/Console/Commands/LogCommands.cs
+++ b/Robust.Server/Console/Commands/LogCommands.cs
@@ -13,7 +13,7 @@ namespace Robust.Server.Console.Commands
+ "\n sawmill: A label prefixing log messages. This is the one you're setting the level for."
+ "\n level: The log level. Must match one of the values of the LogLevel enum.";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
if (args.Length != 2)
{
@@ -50,7 +50,7 @@ namespace Robust.Server.Console.Commands
+ "\n level: The log level. Must match one of the values of the LogLevel enum."
+ "\n message: The message to be logged. Wrap this in double quotes if you want to use spaces.";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
if (args.Length != 3)
{
diff --git a/Robust.Server/Console/Commands/MapCommands.cs b/Robust.Server/Console/Commands/MapCommands.cs
index c1a562f5e..dea1fdf0e 100644
--- a/Robust.Server/Console/Commands/MapCommands.cs
+++ b/Robust.Server/Console/Commands/MapCommands.cs
@@ -18,7 +18,7 @@ namespace Robust.Server.Console.Commands
public string Description => "Adds a new empty map to the round. If the mapID already exists, this command does nothing.";
public string Help => "addmap [initialize]";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
if (args.Length < 1)
return;
@@ -48,7 +48,7 @@ namespace Robust.Server.Console.Commands
public string Command => "rmmap";
public string Description => "Removes a map from the world. You cannot remove nullspace.";
public string Help => "rmmap ";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
if (args.Length != 1)
{
@@ -76,7 +76,7 @@ namespace Robust.Server.Console.Commands
public string Description => "Serializes a grid to disk.";
public string Help => "savebp ";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
if (args.Length < 2)
{
@@ -118,7 +118,7 @@ namespace Robust.Server.Console.Commands
public string Description => "Loads a blueprint from disk into the game.";
public string Help => "loadbp ";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
if (args.Length < 2)
{
@@ -157,7 +157,7 @@ namespace Robust.Server.Console.Commands
public string Description => "Serializes a map to disk.";
public string Help => "savemap ";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
if (args.Length < 1)
return;
@@ -186,7 +186,7 @@ namespace Robust.Server.Console.Commands
public string Description => "Loads a map from disk into the game.";
public string Help => "loadmap ";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
if (args.Length < 1)
return;
@@ -223,9 +223,9 @@ namespace Robust.Server.Console.Commands
public string Description => "Prints the absolute location of the player's entity to console.";
public string Help => "loc";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
- if(player.AttachedEntity == null)
+ if(player?.AttachedEntity == null)
return;
var pos = player.AttachedEntity.Transform.GridPosition;
@@ -239,7 +239,7 @@ namespace Robust.Server.Console.Commands
public string Command => "pausemap";
public string Description => "Pauses a map, pausing all simulation processing on it.";
public string Help => "Usage: pausemap
internal class ConGroupController : IConGroupController
{
-#pragma warning disable 649
- [Dependency] private readonly IResourceManager _resourceManager;
- [Dependency] private readonly IConfigurationManager _configurationManager;
- [Dependency] private readonly ILogManager _logManager;
- [Dependency] private readonly IPlayerManager _playerManager;
- [Dependency] private readonly INetManager _netManager;
-#pragma warning restore 649
+ [Dependency] private readonly IResourceManager _resourceManager = default!;
+ [Dependency] private readonly IConfigurationManager _configurationManager = default!;
+ [Dependency] private readonly ILogManager _logManager = default!;
+ [Dependency] private readonly IPlayerManager _playerManager = default!;
+ [Dependency] private readonly INetManager _netManager = default!;
- private ConGroupContainer _groups;
- private SessionGroupContainer _sessions;
+ private ConGroupContainer _groups = default!;
+ private SessionGroupContainer _sessions = default!;
public void Initialize()
{
@@ -49,7 +47,7 @@ namespace Robust.Server.Console
UpdateAllClientData();
}
- private void _onClientStatusChanged(object sender, SessionStatusEventArgs e)
+ private void _onClientStatusChanged(object? sender, SessionStatusEventArgs e)
{
_sessions.OnClientStatusChanged(sender, e);
diff --git a/Robust.Server/Console/ConsoleShell.cs b/Robust.Server/Console/ConsoleShell.cs
index 4b98da1e8..819eeb26d 100644
--- a/Robust.Server/Console/ConsoleShell.cs
+++ b/Robust.Server/Console/ConsoleShell.cs
@@ -21,15 +21,13 @@ namespace Robust.Server.Console
{
private const string SawmillName = "con";
-#pragma warning disable 649
- [Dependency] private readonly IReflectionManager _reflectionManager;
- [Dependency] private readonly IPlayerManager _players;
- [Dependency] private readonly IServerNetManager _net;
- [Dependency] private readonly ISystemConsoleManager _systemConsole;
- [Dependency] private readonly ILogManager _logMan;
- [Dependency] private readonly IConfigurationManager _configMan;
- [Dependency] private readonly IConGroupController _groupController;
-#pragma warning restore 649
+ [Dependency] private readonly IReflectionManager _reflectionManager = default!;
+ [Dependency] private readonly IPlayerManager _players = default!;
+ [Dependency] private readonly IServerNetManager _net = default!;
+ [Dependency] private readonly ISystemConsoleManager _systemConsole = default!;
+ [Dependency] private readonly ILogManager _logMan = default!;
+ [Dependency] private readonly IConfigurationManager _configMan = default!;
+ [Dependency] private readonly IConGroupController _groupController = default!;
private readonly Dictionary _availableCommands =
new Dictionary();
@@ -87,7 +85,7 @@ namespace Robust.Server.Console
_availableCommands.Clear();
foreach (var type in _reflectionManager.GetAllChildren())
{
- var instance = (IClientCommand) Activator.CreateInstance(type, null);
+ var instance = (IClientCommand) Activator.CreateInstance(type, null)!;
if (AvailableCommands.TryGetValue(instance.Command, out var duplicate))
throw new InvalidImplementationException(instance.GetType(), typeof(IClientCommand),
$"Command name already registered: {instance.Command}, previous: {duplicate.GetType()}");
@@ -114,7 +112,7 @@ namespace Robust.Server.Console
}
///
- public void ExecuteCommand(IPlayerSession session, string command)
+ public void ExecuteCommand(IPlayerSession? session, string command)
{
try
{
@@ -156,7 +154,7 @@ namespace Robust.Server.Console
}
///
- public void SendText(IPlayerSession session, string text)
+ public void SendText(IPlayerSession? session, string? text)
{
if (session != null)
SendText(session.ConnectedClient, text);
@@ -165,14 +163,14 @@ namespace Robust.Server.Console
}
///
- public void SendText(INetChannel target, string text)
+ public void SendText(INetChannel target, string? text)
{
var replyMsg = _net.CreateNetMessage();
replyMsg.Text = text;
_net.ServerSendMessage(replyMsg, target);
}
- private static string FormatPlayerString(IPlayerSession session)
+ private static string FormatPlayerString(IPlayerSession? session)
{
return session != null ? $"{session.Name}" : "[HOST]";
}
@@ -204,7 +202,7 @@ namespace Robust.Server.Console
public string Description => "Elevates client to admin permission group.";
public string Help => "login";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
// system console can't log in to itself, and is pointless anyways
if (player == null)
@@ -234,7 +232,7 @@ namespace Robust.Server.Console
public string Description => "Prints your current permission group.";
public string Help => "group";
- public void Execute(IConsoleShell shell, IPlayerSession player, string[] args)
+ public void Execute(IConsoleShell shell, IPlayerSession? player, string[] args)
{
// only the local server console bypasses permissions
if (player == null)
diff --git a/Robust.Server/Console/SessionGroupContainer.cs b/Robust.Server/Console/SessionGroupContainer.cs
index 9e7593909..d9ecc47a0 100644
--- a/Robust.Server/Console/SessionGroupContainer.cs
+++ b/Robust.Server/Console/SessionGroupContainer.cs
@@ -45,7 +45,7 @@ namespace Robust.Server.Console
///
/// Event handler for when the status of a player session changes.
///
- public void OnClientStatusChanged(object sender, SessionStatusEventArgs e)
+ public void OnClientStatusChanged(object? sender, SessionStatusEventArgs e)
{
switch (e.NewStatus)
{
diff --git a/Robust.Server/Console/SystemConsoleManager.cs b/Robust.Server/Console/SystemConsoleManager.cs
index 0d09f0074..0584aa643 100644
--- a/Robust.Server/Console/SystemConsoleManager.cs
+++ b/Robust.Server/Console/SystemConsoleManager.cs
@@ -11,11 +11,9 @@ namespace Robust.Server.Console
{
internal sealed class SystemConsoleManager : ISystemConsoleManager, IPostInjectInit, IDisposable
{
-#pragma warning disable 649
- [Dependency] private readonly IConsoleShell _conShell;
- [Dependency] private readonly ITaskManager _taskManager;
- [Dependency] private readonly IBaseServer _baseServer;
-#pragma warning restore 649
+ [Dependency] private readonly IConsoleShell _conShell = default!;
+ [Dependency] private readonly ITaskManager _taskManager = default!;
+ [Dependency] private readonly IBaseServer _baseServer = default!;
private readonly Dictionary commandHistory = new Dictionary();
private string currentBuffer = "";
diff --git a/Robust.Server/Debugging/DebugDrawingManager.cs b/Robust.Server/Debugging/DebugDrawingManager.cs
index 1e18df554..ba965d93d 100644
--- a/Robust.Server/Debugging/DebugDrawingManager.cs
+++ b/Robust.Server/Debugging/DebugDrawingManager.cs
@@ -9,10 +9,8 @@ namespace Robust.Server.Debugging
{
internal class DebugDrawingManager : IDebugDrawingManager
{
-#pragma warning disable 649
- [Dependency] private readonly IServerNetManager _net;
- [Dependency] private readonly IPhysicsManager _physics;
-#pragma warning restore 649
+ [Dependency] private readonly IServerNetManager _net = default!;
+ [Dependency] private readonly IPhysicsManager _physics = default!;
public void Initialize()
{
diff --git a/Robust.Server/GameObjects/Components/Actor/BasicActorComponent.cs b/Robust.Server/GameObjects/Components/Actor/BasicActorComponent.cs
index e86640b53..d889fd3e0 100644
--- a/Robust.Server/GameObjects/Components/Actor/BasicActorComponent.cs
+++ b/Robust.Server/GameObjects/Components/Actor/BasicActorComponent.cs
@@ -12,8 +12,7 @@ namespace Robust.Server.GameObjects
{
public override string Name => "BasicActor";
- [ViewVariables]
- public IPlayerSession playerSession { get; internal set; }
+ [ViewVariables] public IPlayerSession playerSession { get; internal set; } = default!;
///
protected override void Shutdown()
diff --git a/Robust.Server/GameObjects/Components/Appearance/AppearanceComponent.cs b/Robust.Server/GameObjects/Components/Appearance/AppearanceComponent.cs
index 103ed8f5d..516c2c5fc 100644
--- a/Robust.Server/GameObjects/Components/Appearance/AppearanceComponent.cs
+++ b/Robust.Server/GameObjects/Components/Appearance/AppearanceComponent.cs
@@ -2,6 +2,7 @@
using Robust.Shared.GameObjects.Components.Appearance;
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
namespace Robust.Server.GameObjects
{
@@ -31,17 +32,17 @@ namespace Robust.Server.GameObjects
return (T)data[key];
}
- public override bool TryGetData(Enum key, out T data)
+ public override bool TryGetData(Enum key, [MaybeNullWhen(false)] out T data)
{
return TryGetData(key, out data);
}
- public override bool TryGetData(string key, out T data)
+ public override bool TryGetData(string key, [MaybeNullWhen(false)] out T data)
{
return TryGetData(key, out data);
}
- bool TryGetData(object key, out T data)
+ bool TryGetData(object key, [MaybeNullWhen(false)] out T data)
{
if (this.data.TryGetValue(key, out var dat))
{
diff --git a/Robust.Server/GameObjects/Components/Container/Container.cs b/Robust.Server/GameObjects/Components/Container/Container.cs
index 1904ff3fb..1a1a08032 100644
--- a/Robust.Server/GameObjects/Components/Container/Container.cs
+++ b/Robust.Server/GameObjects/Components/Container/Container.cs
@@ -77,7 +77,7 @@ namespace Robust.Server.GameObjects.Components.Container
///
[ViewVariables]
- public IEntity Owner => Manager?.Owner;
+ public IEntity Owner => Manager.Owner;
///
[ViewVariables]
@@ -96,7 +96,7 @@ namespace Robust.Server.GameObjects.Components.Container
protected BaseContainer(string id, IContainerManager manager)
{
DebugTools.Assert(!string.IsNullOrEmpty(id));
- DebugTools.Assert(manager != null);
+ DebugTools.AssertNotNull(manager);
ID = id;
Manager = manager;
@@ -195,8 +195,9 @@ namespace Robust.Server.GameObjects.Components.Container
protected virtual void InternalRemove(IEntity toremove)
{
DebugTools.Assert(!Deleted);
- DebugTools.Assert(Manager != null);
- DebugTools.Assert(toremove != null && toremove.IsValid());
+ DebugTools.AssertNotNull(Manager);
+ DebugTools.AssertNotNull(toremove);
+ DebugTools.Assert(toremove.IsValid());
Owner?.EntityManager.EventBus.RaiseEvent(EventSource.Local, new EntRemovedFromContainerMessage(toremove, this));
@@ -219,7 +220,6 @@ namespace Robust.Server.GameObjects.Components.Container
{
Manager.Dirty();
Deleted = true;
- Manager = null;
}
}
diff --git a/Robust.Server/GameObjects/Components/Container/ContainerManagerComponent.cs b/Robust.Server/GameObjects/Components/Container/ContainerManagerComponent.cs
index effc713cd..28f6f7a31 100644
--- a/Robust.Server/GameObjects/Components/Container/ContainerManagerComponent.cs
+++ b/Robust.Server/GameObjects/Components/Container/ContainerManagerComponent.cs
@@ -2,6 +2,7 @@
using Robust.Shared.Interfaces.GameObjects;
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Robust.Shared.GameObjects.Components.Containers;
using Robust.Shared.Interfaces.GameObjects.Components;
@@ -15,12 +16,10 @@ namespace Robust.Server.GameObjects.Components.Container
{
public sealed class ContainerManagerComponent : SharedContainerManagerComponent
{
-#pragma warning disable 649
- [Dependency] private readonly IReflectionManager _reflectionManager;
-#pragma warning restore 649
+ [Dependency] private readonly IReflectionManager _reflectionManager = default!;
private readonly Dictionary EntityContainers = new Dictionary();
- private Dictionary> _entitiesWaitingResolve;
+ private Dictionary>? _entitiesWaitingResolve;
[ViewVariables]
private IEnumerable _allContainers => EntityContainers.Values;
@@ -82,7 +81,7 @@ namespace Robust.Server.GameObjects.Components.Container
{
throw new ArgumentException($"Container with specified ID already exists: '{id}'");
}
- var container = (IContainer)Activator.CreateInstance(type, id, this);
+ var container = (IContainer)Activator.CreateInstance(type, id, this)!;
EntityContainers[id] = container;
Dirty();
return container;
@@ -105,7 +104,7 @@ namespace Robust.Server.GameObjects.Components.Container
}
///
- public override bool TryGetContainer(string id, out IContainer container)
+ public override bool TryGetContainer(string id, [NotNullWhen(true)] out IContainer? container)
{
if (!HasContainer(id))
{
@@ -116,7 +115,7 @@ namespace Robust.Server.GameObjects.Components.Container
return true;
}
- public override bool TryGetContainer(IEntity entity, out IContainer container)
+ public override bool TryGetContainer(IEntity entity, [NotNullWhen(true)] out IContainer? container)
{
foreach (var contain in EntityContainers.Values)
{
@@ -198,6 +197,11 @@ namespace Robust.Server.GameObjects.Components.Container
_entitiesWaitingResolve = new Dictionary>();
foreach (var (key, datum) in data)
{
+ if (datum.Type == null)
+ {
+ throw new InvalidOperationException("Container does not have type set.");
+ }
+
var type = _reflectionManager.LooseGetType(datum.Type);
MakeContainer(key, type);
@@ -216,11 +220,12 @@ namespace Robust.Server.GameObjects.Components.Container
foreach (var (key, container) in EntityContainers)
{
var list = new List(container.ContainedEntities.Select(e => e.Uid));
- var data = new ContainerPrototypeData(list, container.GetType().FullName);
+ var data = new ContainerPrototypeData(list, container.GetType().FullName!);
dict.Add(key, data);
}
- serializer.DataWriteFunction("containers", null, () => dict);
+ // ReSharper disable once RedundantTypeArgumentsOfMethod
+ serializer.DataWriteFunction?>("containers", null, () => dict);
}
}
@@ -256,7 +261,7 @@ namespace Robust.Server.GameObjects.Components.Container
private struct ContainerPrototypeData : IExposeData
{
public List Entities;
- public string Type;
+ public string? Type;
public ContainerPrototypeData(List entities, string type)
{
@@ -266,7 +271,7 @@ namespace Robust.Server.GameObjects.Components.Container
public void ExposeData(ObjectSerializer serializer)
{
- serializer.DataField(ref Entities, "entities", null);
+ serializer.DataField(ref Entities, "entities", new List());
serializer.DataField(ref Type, "type", null);
}
}
diff --git a/Robust.Server/GameObjects/Components/Physics/PhysicsComponent.cs b/Robust.Server/GameObjects/Components/Physics/PhysicsComponent.cs
index 88ff91626..2a68246d7 100644
--- a/Robust.Server/GameObjects/Components/Physics/PhysicsComponent.cs
+++ b/Robust.Server/GameObjects/Components/Physics/PhysicsComponent.cs
@@ -19,7 +19,7 @@ namespace Robust.Server.GameObjects
private float _mass;
private Vector2 _linVelocity;
private float _angVelocity;
- private VirtualController _controller = null;
+ private VirtualController? _controller = null;
private BodyStatus _status;
///
@@ -99,7 +99,7 @@ namespace Robust.Server.GameObjects
///
/// Represents a virtual controller acting on the physics component.
///
- public override VirtualController Controller
+ public override VirtualController? Controller
{
get => _controller;
}
diff --git a/Robust.Server/GameObjects/Components/Renderable/SpriteComponent.cs b/Robust.Server/GameObjects/Components/Renderable/SpriteComponent.cs
index cd17a1322..3faffade4 100644
--- a/Robust.Server/GameObjects/Components/Renderable/SpriteComponent.cs
+++ b/Robust.Server/GameObjects/Components/Renderable/SpriteComponent.cs
@@ -23,7 +23,7 @@ namespace Robust.Server.GameObjects
private Vector2 _offset;
private Color _color;
private bool _directional;
- private string _baseRSIPath;
+ private string? _baseRSIPath;
private Angle _rotation;
[ViewVariables]
@@ -104,7 +104,7 @@ namespace Robust.Server.GameObjects
}
[ViewVariables(VVAccess.ReadWrite)]
- public string BaseRSIPath
+ public string? BaseRSIPath
{
get => _baseRSIPath;
set
@@ -415,8 +415,8 @@ namespace Robust.Server.GameObjects
serializer.ReadDataField>("layers", new List());
{
- var baseState = serializer.ReadDataField("state", null);
- var texturePath = serializer.ReadDataField("texture", null);
+ var baseState = serializer.ReadDataField("state", null);
+ var texturePath = serializer.ReadDataField("texture", null);
if (baseState != null || texturePath != null)
{
diff --git a/Robust.Server/GameObjects/Components/UserInterface/ServerUserInterfaceComponent.cs b/Robust.Server/GameObjects/Components/UserInterface/ServerUserInterfaceComponent.cs
index ddb7e5188..1b3490471 100644
--- a/Robust.Server/GameObjects/Components/UserInterface/ServerUserInterfaceComponent.cs
+++ b/Robust.Server/GameObjects/Components/UserInterface/ServerUserInterfaceComponent.cs
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Robust.Server.GameObjects.EntitySystems;
using Robust.Server.Interfaces.Player;
@@ -54,7 +55,7 @@ namespace Robust.Server.GameObjects.Components.UserInterface
return _interfaces[uiKey];
}
- public bool TryGetBoundUserInterface(object uiKey, out BoundUserInterface boundUserInterface)
+ public bool TryGetBoundUserInterface(object uiKey, [NotNullWhen(true)] out BoundUserInterface? boundUserInterface)
{
return _interfaces.TryGetValue(uiKey, out boundUserInterface);
}
@@ -70,7 +71,7 @@ namespace Robust.Server.GameObjects.Components.UserInterface
}
public override void HandleNetworkMessage(ComponentMessage message, INetChannel netChannel,
- ICommonSession session = null)
+ ICommonSession? session = null)
{
base.HandleNetworkMessage(message, netChannel, session);
@@ -89,7 +90,7 @@ namespace Robust.Server.GameObjects.Components.UserInterface
return;
}
- @interface.ReceiveMessage(wrapped.Message, session as IPlayerSession);
+ @interface.ReceiveMessage(wrapped.Message, (IPlayerSession)session);
break;
}
}
@@ -105,7 +106,7 @@ namespace Robust.Server.GameObjects.Components.UserInterface
public object UiKey { get; }
public ServerUserInterfaceComponent Owner { get; }
private readonly HashSet _subscribedSessions = new HashSet();
- private BoundUserInterfaceState _lastState;
+ private BoundUserInterfaceState? _lastState;
private bool _stateDirty;
@@ -117,8 +118,8 @@ namespace Robust.Server.GameObjects.Components.UserInterface
///
public IEnumerable SubscribedSessions => _subscribedSessions;
- public event Action OnReceiveMessage;
- public event Action OnClosed;
+ public event Action? OnReceiveMessage;
+ public event Action? OnClosed;
public BoundUserInterface(object uiKey, ServerUserInterfaceComponent owner)
{
@@ -140,7 +141,7 @@ namespace Robust.Server.GameObjects.Components.UserInterface
/// The player session to send this new state to.
/// Set to null for sending it to every subscribed player session.
///
- public void SetState(BoundUserInterfaceState state, IPlayerSession session = null)
+ public void SetState(BoundUserInterfaceState state, IPlayerSession? session = null)
{
if (session == null)
{
@@ -197,7 +198,7 @@ namespace Robust.Server.GameObjects.Components.UserInterface
session.PlayerStatusChanged += OnSessionOnPlayerStatusChanged;
}
- private void OnSessionOnPlayerStatusChanged(object sender, SessionStatusEventArgs args)
+ private void OnSessionOnPlayerStatusChanged(object? sender, SessionStatusEventArgs args)
{
if (args.NewStatus == SessionStatus.Disconnected)
{
@@ -339,7 +340,7 @@ namespace Robust.Server.GameObjects.Components.UserInterface
foreach (var playerSession in _subscribedSessions)
{
- if (!_playerStateOverrides.ContainsKey(playerSession))
+ if (!_playerStateOverrides.ContainsKey(playerSession) && _lastState != null)
{
SendMessage(new UpdateBoundStateMessage(_lastState), playerSession);
}
diff --git a/Robust.Server/GameObjects/EntitySystems/AudioSystem.cs b/Robust.Server/GameObjects/EntitySystems/AudioSystem.cs
index f61f1f778..2ca8b5ce5 100644
--- a/Robust.Server/GameObjects/EntitySystems/AudioSystem.cs
+++ b/Robust.Server/GameObjects/EntitySystems/AudioSystem.cs
@@ -13,7 +13,7 @@ namespace Robust.Server.GameObjects.EntitySystems
{
public class AudioSystem : EntitySystem
{
- [Dependency] private IPlayerManager _playerManager;
+ [Dependency] private readonly IPlayerManager _playerManager = default!;
public const int AudioDistanceRange = 25;
@@ -23,9 +23,9 @@ namespace Robust.Server.GameObjects.EntitySystems
{
private readonly uint _id;
private readonly AudioSystem _audioSystem;
- private readonly IEnumerable _sessions;
+ private readonly IEnumerable? _sessions;
- internal AudioSourceServer(AudioSystem parent, uint identifier, IEnumerable sessions = null)
+ internal AudioSourceServer(AudioSystem parent, uint identifier, IEnumerable? sessions = null)
{
_audioSystem = parent;
_id = identifier;
@@ -37,7 +37,7 @@ namespace Robust.Server.GameObjects.EntitySystems
}
}
- private void InternalStop(uint id, IEnumerable sessions = null)
+ private void InternalStop(uint id, IEnumerable? sessions = null)
{
var msg = new StopAudioMessageClient
{
@@ -64,7 +64,7 @@ namespace Robust.Server.GameObjects.EntitySystems
/// The resource path to the OGG Vorbis file to play.
///
/// The predicate that will be used to send the audio to players, or null to send to everyone.
- public AudioSourceServer PlayGlobal(string filename, AudioParams? audioParams = null, Func predicate = null)
+ public AudioSourceServer PlayGlobal(string filename, AudioParams? audioParams = null, Func? predicate = null)
{
var id = CacheIdentifier();
var msg = new PlayAudioGlobalMessage
diff --git a/Robust.Server/GameObjects/EntitySystems/EffectSystem.cs b/Robust.Server/GameObjects/EntitySystems/EffectSystem.cs
index e8c924b55..592cb7f69 100644
--- a/Robust.Server/GameObjects/EntitySystems/EffectSystem.cs
+++ b/Robust.Server/GameObjects/EntitySystems/EffectSystem.cs
@@ -12,9 +12,7 @@ namespace Robust.Server.GameObjects.EntitySystems
///
public class EffectSystem : EntitySystem
{
-#pragma warning disable 649
- [Dependency] private readonly IGameTiming _timing;
-#pragma warning restore 649
+ [Dependency] private readonly IGameTiming _timing = default!;
///
/// Priority queue sorted by how soon the effect will die, we remove messages from the front of the queue during update until caught up
@@ -44,8 +42,23 @@ namespace Robust.Server.GameObjects.EntitySystems
///
public class EffectMessageComparer : IComparer
{
- public int Compare(EffectSystemMessage x, EffectSystemMessage y)
+ public int Compare(EffectSystemMessage? x, EffectSystemMessage? y)
{
+ if (x == null && y == null)
+ {
+ return 0;
+ }
+
+ if (y == null)
+ {
+ return 1;
+ }
+
+ if (x == null)
+ {
+ return -1;
+ }
+
return y.DeathTime.CompareTo(x.DeathTime);
}
}
diff --git a/Robust.Server/GameObjects/EntitySystems/InputSystem.cs b/Robust.Server/GameObjects/EntitySystems/InputSystem.cs
index bff443ce4..a013b7808 100644
--- a/Robust.Server/GameObjects/EntitySystems/InputSystem.cs
+++ b/Robust.Server/GameObjects/EntitySystems/InputSystem.cs
@@ -16,9 +16,7 @@ namespace Robust.Server.GameObjects.EntitySystems
///
public class InputSystem : SharedInputSystem
{
-#pragma warning disable 649
- [Dependency] private readonly IPlayerManager _playerManager;
-#pragma warning restore 649
+ [Dependency] private readonly IPlayerManager _playerManager = default!;
private readonly Dictionary _playerInputs = new Dictionary();
@@ -78,7 +76,7 @@ namespace Robust.Server.GameObjects.EntitySystems
return _lastProcessedInputCmd[session];
}
- private void OnPlayerStatusChanged(object sender, SessionStatusEventArgs args)
+ private void OnPlayerStatusChanged(object? sender, SessionStatusEventArgs args)
{
switch (args.NewStatus)
{
diff --git a/Robust.Server/GameObjects/EntitySystems/PhysicsSystem.cs b/Robust.Server/GameObjects/EntitySystems/PhysicsSystem.cs
index 1ffd5bdf2..a99bd79a6 100644
--- a/Robust.Server/GameObjects/EntitySystems/PhysicsSystem.cs
+++ b/Robust.Server/GameObjects/EntitySystems/PhysicsSystem.cs
@@ -20,17 +20,15 @@ namespace Robust.Server.GameObjects.EntitySystems
[UsedImplicitly]
internal class PhysicsSystem : EntitySystem
{
-#pragma warning disable 649
- [Dependency] private readonly IPauseManager _pauseManager;
- [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager;
- [Dependency] private readonly IMapManager _mapManager;
- [Dependency] private readonly IPhysicsManager _physicsManager;
- [Dependency] private readonly IRobustRandom _random;
-#pragma warning restore 649
+ [Dependency] private readonly IPauseManager _pauseManager = default!;
+ [Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
+ [Dependency] private readonly IMapManager _mapManager = default!;
+ [Dependency] private readonly IPhysicsManager _physicsManager = default!;
+ [Dependency] private readonly IRobustRandom _random = default!;
private const float Epsilon = 1.0e-6f;
- private List _collisionCache = new List();
+ private readonly List _collisionCache = new List();
public PhysicsSystem()
{
@@ -124,10 +122,10 @@ namespace Robust.Server.GameObjects.EntitySystems
foreach (var collision in _collisionCache)
{
// Apply onCollide behavior
- var aBehaviors = (collision.A as CollidableComponent).Owner.GetAllComponents();
+ var aBehaviors = ((CollidableComponent)collision.A).Owner.GetAllComponents();
foreach (var behavior in aBehaviors)
{
- var entity = (collision.B as CollidableComponent).Owner;
+ var entity = ((CollidableComponent)collision.B).Owner;
if (entity.Deleted) continue;
behavior.CollideWith(entity);
if (collisionsWith.ContainsKey(behavior))
@@ -139,10 +137,10 @@ namespace Robust.Server.GameObjects.EntitySystems
collisionsWith[behavior] = 1;
}
}
- var bBehaviors = (collision.B as CollidableComponent).Owner.GetAllComponents();
+ var bBehaviors = ((CollidableComponent)collision.B).Owner.GetAllComponents();
foreach (var behavior in bBehaviors)
{
- var entity = (collision.A as CollidableComponent).Owner;
+ var entity = ((CollidableComponent)collision.A).Owner;
if (entity.Deleted) continue;
behavior.CollideWith(entity);
if (collisionsWith.ContainsKey(behavior))
@@ -270,7 +268,7 @@ namespace Robust.Server.GameObjects.EntitySystems
if (ContainerHelpers.IsInContainer(entity) && physics.LinearVelocity != Vector2.Zero)
{
- entity.Transform.Parent.Owner.SendMessage(entity.Transform, new RelayMovementEntityMessage(entity));
+ entity.Transform.Parent!.Owner.SendMessage(entity.Transform, new RelayMovementEntityMessage(entity));
// This prevents redundant messages from being sent if solveIterations > 1 and also simulates the entity "colliding" against the locker door when it opens.
physics.LinearVelocity = Vector2.Zero;
}
@@ -290,9 +288,9 @@ namespace Robust.Server.GameObjects.EntitySystems
if (penetration > allowance)
{
var correction = collision.Normal * Math.Abs(penetration) * percent;
- if (collision.APhysics != null && !(collision.APhysics as PhysicsComponent).Anchored && !collision.APhysics.Deleted)
+ if (collision.APhysics != null && !((PhysicsComponent)collision.APhysics).Anchored && !collision.APhysics.Deleted)
collision.APhysics.Owner.Transform.WorldPosition -= correction;
- if (collision.BPhysics != null && !(collision.BPhysics as PhysicsComponent).Anchored && !collision.BPhysics.Deleted)
+ if (collision.BPhysics != null && !((PhysicsComponent)collision.BPhysics).Anchored && !collision.BPhysics.Deleted)
collision.BPhysics.Owner.Transform.WorldPosition += correction;
}
}
diff --git a/Robust.Server/GameObjects/ServerEntityManager.cs b/Robust.Server/GameObjects/ServerEntityManager.cs
index 793fb66d2..42e39b9b7 100644
--- a/Robust.Server/GameObjects/ServerEntityManager.cs
+++ b/Robust.Server/GameObjects/ServerEntityManager.cs
@@ -36,13 +36,9 @@ namespace Robust.Server.GameObjects
#region IEntityManager Members
-#pragma warning disable 649
- [Dependency] private readonly IMapManager _mapManager;
-
- [Dependency] private readonly IPauseManager _pauseManager;
-
- [Dependency] private readonly IConfigurationManager _configurationManager;
-#pragma warning restore 649
+ [Dependency] private readonly IMapManager _mapManager = default!;
+ [Dependency] private readonly IPauseManager _pauseManager = default!;
+ [Dependency] private readonly IConfigurationManager _configurationManager = default!;
private float? _maxUpdateRangeCache;
@@ -60,13 +56,13 @@ namespace Robust.Server.GameObjects
}
///
- public override IEntity CreateEntityUninitialized(string prototypeName)
+ public override IEntity CreateEntityUninitialized(string? prototypeName)
{
return CreateEntityServer(prototypeName);
}
///
- public override IEntity CreateEntityUninitialized(string prototypeName, GridCoordinates coordinates)
+ public override IEntity CreateEntityUninitialized(string? prototypeName, GridCoordinates coordinates)
{
var newEntity = CreateEntityServer(prototypeName);
if (coordinates.GridID != GridId.Invalid)
@@ -80,7 +76,7 @@ namespace Robust.Server.GameObjects
}
///
- public override IEntity CreateEntityUninitialized(string prototypeName, MapCoordinates coordinates)
+ public override IEntity CreateEntityUninitialized(string? prototypeName, MapCoordinates coordinates)
{
var newEntity = CreateEntityServer(prototypeName);
newEntity.Transform.AttachParent(_mapManager.GetMapEntity(coordinates.MapId));
@@ -88,7 +84,7 @@ namespace Robust.Server.GameObjects
return newEntity;
}
- private Entity CreateEntityServer(string prototypeName)
+ private Entity CreateEntityServer(string? prototypeName)
{
var entity = CreateEntity(prototypeName);
@@ -116,7 +112,7 @@ namespace Robust.Server.GameObjects
}
///
- public override IEntity SpawnEntity(string protoName, GridCoordinates coordinates)
+ public override IEntity SpawnEntity(string? protoName, GridCoordinates coordinates)
{
if (coordinates.GridID == GridId.Invalid)
throw new InvalidOperationException($"Tried to spawn entity {protoName} onto invalid grid.");
@@ -133,7 +129,7 @@ namespace Robust.Server.GameObjects
}
///
- public override IEntity SpawnEntity(string protoName, MapCoordinates coordinates)
+ public override IEntity SpawnEntity(string? protoName, MapCoordinates coordinates)
{
var entity = CreateEntityUninitialized(protoName, coordinates);
InitializeAndStartEntity((Entity) entity);
@@ -141,7 +137,7 @@ namespace Robust.Server.GameObjects
}
///
- public override IEntity SpawnEntityNoMapInit(string protoName, GridCoordinates coordinates)
+ public override IEntity SpawnEntityNoMapInit(string? protoName, GridCoordinates coordinates)
{
var newEnt = CreateEntityUninitialized(protoName, coordinates);
InitializeAndStartEntity((Entity) newEnt);
@@ -149,7 +145,7 @@ namespace Robust.Server.GameObjects
}
///
- public List GetEntityStates(GameTick fromTick)
+ public List? GetEntityStates(GameTick fromTick)
{
var stateEntities = new List();
foreach (var entity in AllEntities)
@@ -338,7 +334,7 @@ namespace Robust.Server.GameObjects
= new PlayerSeenEntityStatesResources(false);
///
- public List UpdatePlayerSeenEntityStates(GameTick fromTick, IPlayerSession player, float range)
+ public List? UpdatePlayerSeenEntityStates(GameTick fromTick, IPlayerSession player, float range)
{
var playerEnt = player.AttachedEntity;
if (playerEnt == null)
@@ -698,7 +694,7 @@ namespace Robust.Server.GameObjects
_deletionHistory.Add((CurrentTick, e.Uid));
}
- public List GetDeletedEntities(GameTick fromTick)
+ public List? GetDeletedEntities(GameTick fromTick)
{
var list = new List();
foreach (var (tick, id) in _deletionHistory)
@@ -834,7 +830,7 @@ namespace Robust.Server.GameObjects
#endregion IEntityManager Members
- IEntity IServerEntityManagerInternal.AllocEntity(string prototypeName, EntityUid? uid)
+ IEntity IServerEntityManagerInternal.AllocEntity(string? prototypeName, EntityUid? uid)
{
return AllocEntity(prototypeName, uid);
}
@@ -844,7 +840,7 @@ namespace Robust.Server.GameObjects
return new EntityUid(_nextServerEntityUid++);
}
- void IServerEntityManagerInternal.FinishEntityLoad(IEntity entity, IEntityLoadContext context)
+ void IServerEntityManagerInternal.FinishEntityLoad(IEntity entity, IEntityLoadContext? context)
{
LoadEntity((Entity) entity, context);
}
@@ -897,13 +893,13 @@ namespace Robust.Server.GameObjects
{
// Can't be null since it's returned by GetNetComponents
// ReSharper disable once PossibleInvalidOperationException
- changed.Add(ComponentChanged.Added(comp.NetID.Value, comp.Name));
+ changed.Add(ComponentChanged.Added(comp.NetID!.Value, comp.Name));
}
else if (comp.Deleted && comp.LastModifiedTick >= fromTick)
{
// Can't be null since it's returned by GetNetComponents
// ReSharper disable once PossibleInvalidOperationException
- changed.Add(ComponentChanged.Removed(comp.NetID.Value));
+ changed.Add(ComponentChanged.Removed(comp.NetID!.Value));
}
}
diff --git a/Robust.Server/GameObjects/ServerEntityNetworkManager.cs b/Robust.Server/GameObjects/ServerEntityNetworkManager.cs
index d2b215fcc..dfc74dc46 100644
--- a/Robust.Server/GameObjects/ServerEntityNetworkManager.cs
+++ b/Robust.Server/GameObjects/ServerEntityNetworkManager.cs
@@ -21,18 +21,16 @@ namespace Robust.Server.GameObjects
///
public class ServerEntityNetworkManager : IServerEntityNetworkManager, IPostInjectInit
{
-#pragma warning disable 649
- [Dependency] private readonly IServerNetManager _networkManager;
- [Dependency] private readonly IGameTiming _gameTiming;
- [Dependency] private readonly IPlayerManager _playerManager;
- [Dependency] private readonly IConfigurationManager _configurationManager;
-#pragma warning restore 649
+ [Dependency] private readonly IServerNetManager _networkManager = default!;
+ [Dependency] private readonly IGameTiming _gameTiming = default!;
+ [Dependency] private readonly IPlayerManager _playerManager = default!;
+ [Dependency] private readonly IConfigurationManager _configurationManager = default!;
///
- public event EventHandler ReceivedComponentMessage;
+ public event EventHandler? ReceivedComponentMessage;
///
- public event EventHandler