From ef5fc77728203d84868a08b6c5ba5e13f16c2857 Mon Sep 17 00:00:00 2001 From: mischa Date: Tue, 15 Oct 2024 12:45:27 +0200 Subject: [PATCH] NetworkServer.IsConnectionAllowed: log address too --- Assets/Mirror/Core/NetworkServer.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Assets/Mirror/Core/NetworkServer.cs b/Assets/Mirror/Core/NetworkServer.cs index ccb30289c..2c264183b 100644 --- a/Assets/Mirror/Core/NetworkServer.cs +++ b/Assets/Mirror/Core/NetworkServer.cs @@ -658,7 +658,7 @@ static void OnTransportConnected(int connectionId) static void OnTransportConnectedWithAddress(int connectionId, string clientAddress) { - if (IsConnectionAllowed(connectionId)) + if (IsConnectionAllowed(connectionId, clientAddress)) { // create a connection NetworkConnectionToClient conn = new NetworkConnectionToClient(connectionId, clientAddress); @@ -671,7 +671,7 @@ static void OnTransportConnectedWithAddress(int connectionId, string clientAddre } } - static bool IsConnectionAllowed(int connectionId) + static bool IsConnectionAllowed(int connectionId, string address) { // connectionId needs to be != 0 because 0 is reserved for local player // note that some transports like kcp generate connectionId by @@ -685,7 +685,7 @@ static bool IsConnectionAllowed(int connectionId) // connectionId not in use yet? if (connections.ContainsKey(connectionId)) { - Debug.LogError($"Server connectionId {connectionId} already in use...client will be kicked"); + Debug.LogError($"Server connectionId {connectionId}already in use...client with address={address} will be kicked"); return false; } @@ -696,7 +696,7 @@ static bool IsConnectionAllowed(int connectionId) // Transport can't do that) if (connections.Count >= maxConnections) { - Debug.LogError($"Server full, client {connectionId} will be kicked"); + Debug.LogError($"Server full, client {connectionId} with address={address} will be kicked"); return false; }