From ce0f70249b04e44a1c1bf0d4e2ab220f13e1274b Mon Sep 17 00:00:00 2001 From: MrGadget <9826063+MrGadget1024@users.noreply.github.com> Date: Sat, 20 Jul 2024 10:53:06 -0400 Subject: [PATCH] fix(SimpleWebTransport): Implement OnServerConnectedWithAddress --- .../Transports/SimpleWeb/SimpleWeb/Server/SimpleWebServer.cs | 4 ++-- Assets/Mirror/Transports/SimpleWeb/SimpleWebTransport.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Mirror/Transports/SimpleWeb/SimpleWeb/Server/SimpleWebServer.cs b/Assets/Mirror/Transports/SimpleWeb/SimpleWeb/Server/SimpleWebServer.cs index 6ededebc4..944dc0009 100644 --- a/Assets/Mirror/Transports/SimpleWeb/SimpleWeb/Server/SimpleWebServer.cs +++ b/Assets/Mirror/Transports/SimpleWeb/SimpleWeb/Server/SimpleWebServer.cs @@ -6,7 +6,7 @@ namespace Mirror.SimpleWeb { public class SimpleWebServer { - public event Action onConnect; + public event Action onConnect; public event Action onDisconnect; public event Action> onData; public event Action onError; @@ -91,7 +91,7 @@ public void ProcessMessageQueue(MonoBehaviour behaviour) switch (next.type) { case EventType.Connected: - onConnect?.Invoke(next.connId); + onConnect?.Invoke(next.connId, GetClientAddress(next.connId)); break; case EventType.Data: onData?.Invoke(next.connId, next.data.ToSegment()); diff --git a/Assets/Mirror/Transports/SimpleWeb/SimpleWebTransport.cs b/Assets/Mirror/Transports/SimpleWeb/SimpleWebTransport.cs index b37e32289..9f25028d6 100644 --- a/Assets/Mirror/Transports/SimpleWeb/SimpleWebTransport.cs +++ b/Assets/Mirror/Transports/SimpleWeb/SimpleWebTransport.cs @@ -300,7 +300,7 @@ public override void ServerStart() SslConfig config = SslConfigLoader.Load(sslEnabled, sslCertJson, sslProtocols); server = new SimpleWebServer(serverMaxMsgsPerTick, TcpConfig, maxMessageSize, maxHandshakeSize, config); - server.onConnect += OnServerConnected.Invoke; + server.onConnect += OnServerConnectedWithAddress.Invoke; server.onDisconnect += OnServerDisconnected.Invoke; server.onData += (int connId, ArraySegment data) => OnServerDataReceived.Invoke(connId, data, Channels.Reliable);