fix(NetworkServer): Suppress obsolete warnings

This commit is contained in:
MrGadget 2024-07-20 12:45:21 -04:00
parent 55cb34e965
commit f70d7619f2

View File

@ -191,7 +191,9 @@ static void Initialize()
static void AddTransportHandlers() static void AddTransportHandlers()
{ {
// += so that other systems can also hook into it (i.e. statistics) // += so that other systems can also hook into it (i.e. statistics)
#pragma warning disable CS0618 // Type or member is obsolete
Transport.active.OnServerConnected += OnTransportConnected; Transport.active.OnServerConnected += OnTransportConnected;
#pragma warning restore CS0618 // Type or member is obsolete
Transport.active.OnServerConnectedWithAddress += OnTransportConnectedWithAddress; Transport.active.OnServerConnectedWithAddress += OnTransportConnectedWithAddress;
Transport.active.OnServerDataReceived += OnTransportData; Transport.active.OnServerDataReceived += OnTransportData;
Transport.active.OnServerDisconnected += OnTransportDisconnected; Transport.active.OnServerDisconnected += OnTransportDisconnected;
@ -264,7 +266,9 @@ public static void Shutdown()
static void RemoveTransportHandlers() static void RemoveTransportHandlers()
{ {
// -= so that other systems can also hook into it (i.e. statistics) // -= so that other systems can also hook into it (i.e. statistics)
#pragma warning disable CS0618 // Type or member is obsolete
Transport.active.OnServerConnected -= OnTransportConnected; Transport.active.OnServerConnected -= OnTransportConnected;
#pragma warning restore CS0618 // Type or member is obsolete
Transport.active.OnServerConnectedWithAddress -= OnTransportConnectedWithAddress; Transport.active.OnServerConnectedWithAddress -= OnTransportConnectedWithAddress;
Transport.active.OnServerDataReceived -= OnTransportData; Transport.active.OnServerDataReceived -= OnTransportData;
Transport.active.OnServerDisconnected -= OnTransportDisconnected; Transport.active.OnServerDisconnected -= OnTransportDisconnected;