diff --git a/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs b/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs index 5d9d9bb9a..26de24c6f 100644 --- a/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs +++ b/Assets/Mirror/Transports/Encryption/EncryptionTransport.cs @@ -76,7 +76,9 @@ private void HandleInnerServerDataReceived(int connId, ArraySegment data, } } - private void HandleInnerServerConnected(int connId) + private void HandleInnerServerConnected(int connId) => HandleInnerServerConnected(connId, inner.ServerGetClientAddress(connId)); + + private void HandleInnerServerConnected(int connId, string clientRemoteAddress) { Debug.Log($"[EncryptionTransport] New connection #{connId}"); EncryptedConnection ec = null; @@ -89,7 +91,8 @@ private void HandleInnerServerConnected(int connId) { Debug.Log($"[EncryptionTransport] Connection #{connId} is ready"); ServerRemoveFromPending(ec); - OnServerConnected?.Invoke(connId); + //OnServerConnected?.Invoke(connId); + OnServerConnectedWithAddress?.Invoke(connId, clientRemoteAddress); }, (type, msg) => { @@ -206,6 +209,7 @@ public override void ServerStart() _credentials = EncryptionCredentials.Generate(); } inner.OnServerConnected = HandleInnerServerConnected; + inner.OnServerConnectedWithAddress = HandleInnerServerConnected; inner.OnServerDataReceived = HandleInnerServerDataReceived; inner.OnServerDataSent = (connId, bytes, channel) => OnServerDataSent?.Invoke(connId, bytes, channel); inner.OnServerError = HandleInnerServerError;