From 1968ef9f9b1abad86650d36578704b46f9f55b83 Mon Sep 17 00:00:00 2001 From: MrGadget <9826063+MrGadget1024@users.noreply.github.com> Date: Sat, 20 Jul 2024 13:05:53 -0400 Subject: [PATCH] fix(Transports): Suppress obsolete warnings --- Assets/Mirror/Transports/Encryption/EncryptionTransport.cs | 2 ++ Assets/Mirror/Transports/Latency/LatencySimulation.cs | 2 ++ Assets/Mirror/Transports/Middleware/MiddlewareTransport.cs | 2 ++ Assets/Mirror/Transports/Multiplex/MultiplexTransport.cs | 2 ++ 4 files changed, 8 insertions(+) diff --git a/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs b/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs index 26de24c6f..b9d1b9d12 100644 --- a/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs +++ b/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs @@ -208,7 +208,9 @@ public override void ServerStart() { _credentials = EncryptionCredentials.Generate(); } +#pragma warning disable CS0618 // Type or member is obsolete inner.OnServerConnected = HandleInnerServerConnected; +#pragma warning restore CS0618 // Type or member is obsolete inner.OnServerConnectedWithAddress = HandleInnerServerConnected; inner.OnServerDataReceived = HandleInnerServerDataReceived; inner.OnServerDataSent = (connId, bytes, channel) => OnServerDataSent?.Invoke(connId, bytes, channel); diff --git a/Assets/Mirror/Transports/Latency/LatencySimulation.cs b/Assets/Mirror/Transports/Latency/LatencySimulation.cs index 9db9ec1da..e5dabd012 100644 --- a/Assets/Mirror/Transports/Latency/LatencySimulation.cs +++ b/Assets/Mirror/Transports/Latency/LatencySimulation.cs @@ -241,7 +241,9 @@ public override void ServerSend(int connectionId, ArraySegment segment, in public override void ServerStart() { +#pragma warning disable CS0618 // Type or member is obsolete wrap.OnServerConnected = OnServerConnected; +#pragma warning restore CS0618 // Type or member is obsolete wrap.OnServerConnectedWithAddress = OnServerConnectedWithAddress; wrap.OnServerDataReceived = OnServerDataReceived; wrap.OnServerError = OnServerError; diff --git a/Assets/Mirror/Transports/Middleware/MiddlewareTransport.cs b/Assets/Mirror/Transports/Middleware/MiddlewareTransport.cs index 21d2ac3ef..ee182405b 100644 --- a/Assets/Mirror/Transports/Middleware/MiddlewareTransport.cs +++ b/Assets/Mirror/Transports/Middleware/MiddlewareTransport.cs @@ -42,7 +42,9 @@ public override void ClientConnect(string address) public override bool ServerActive() => inner.ServerActive(); public override void ServerStart() { +#pragma warning disable CS0618 // Type or member is obsolete inner.OnServerConnected = OnServerConnected; +#pragma warning restore CS0618 // Type or member is obsolete inner.OnServerConnectedWithAddress = OnServerConnectedWithAddress; inner.OnServerDataReceived = OnServerDataReceived; inner.OnServerDisconnected = OnServerDisconnected; diff --git a/Assets/Mirror/Transports/Multiplex/MultiplexTransport.cs b/Assets/Mirror/Transports/Multiplex/MultiplexTransport.cs index b4c979d44..65fe710e9 100644 --- a/Assets/Mirror/Transports/Multiplex/MultiplexTransport.cs +++ b/Assets/Mirror/Transports/Multiplex/MultiplexTransport.cs @@ -261,12 +261,14 @@ void AddServerCallbacks() int transportIndex = i; Transport transport = transports[i]; +#pragma warning disable CS0618 // Type or member is obsolete transport.OnServerConnected = (originalConnectionId => { // invoke Multiplex event with multiplexed connectionId int multiplexedId = AddToLookup(originalConnectionId, transportIndex); OnServerConnected.Invoke(multiplexedId); }); +#pragma warning restore CS0618 // Type or member is obsolete transport.OnServerConnectedWithAddress = (originalConnectionId, address) => {