From 23b700d2873caa0f3348948e472bae232728dd6a Mon Sep 17 00:00:00 2001 From: mischa Date: Thu, 16 May 2024 17:05:53 +0700 Subject: [PATCH] KcpTransport: reuse IPEndPoint.PrettyAddress extension --- Assets/Mirror/Transports/KCP/KcpTransport.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Assets/Mirror/Transports/KCP/KcpTransport.cs b/Assets/Mirror/Transports/KCP/KcpTransport.cs index 033bb29aa..bec9c1381 100644 --- a/Assets/Mirror/Transports/KCP/KcpTransport.cs +++ b/Assets/Mirror/Transports/KCP/KcpTransport.cs @@ -208,14 +208,7 @@ public override void ServerSend(int connectionId, ArraySegment segment, in public override string ServerGetClientAddress(int connectionId) { IPEndPoint endPoint = server.GetClientEndPoint(connectionId); - if (endPoint == null) return ""; - - // Map to IPv4 if "IsIPv4MappedToIPv6" for readability - // "::ffff:127.0.0.1" -> "127.0.0.1" - return - endPoint.Address.IsIPv4MappedToIPv6 - ? endPoint.Address.MapToIPv4().ToString() - : endPoint.Address.ToString(); + return endPoint.PrettyAddress(); } public override void ServerStop() => server.Stop(); public override void ServerEarlyUpdate()