mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
KcpTransport: reuse IPEndPoint.PrettyAddress extension
This commit is contained in:
parent
ba219f7e41
commit
23b700d287
@ -208,14 +208,7 @@ public override void ServerSend(int connectionId, ArraySegment<byte> 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()
|
||||
|
Loading…
Reference in New Issue
Block a user