mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
KcpTransport: reconvert mapped ipv4->ipv6 addresses to ipv4 in ServerGetClientAddress (#3460)
* Update KcpTransport.cs "::ffff:127.0.0.1" -> "127.0.0.1" * Update Assets/Mirror/Transports/KCP/KcpTransport.cs --------- Co-authored-by: mischa <16416509+vis2k@users.noreply.github.com>
This commit is contained in:
parent
fb8ae6c228
commit
e9597b70ac
@ -203,7 +203,13 @@ public override void ServerSend(int connectionId, ArraySegment<byte> segment, in
|
||||
public override string ServerGetClientAddress(int connectionId)
|
||||
{
|
||||
IPEndPoint endPoint = server.GetClientEndPoint(connectionId);
|
||||
return endPoint != null ? endPoint.Address.ToString() : "";
|
||||
return endPoint != null
|
||||
// Map to IPv4 if "IsIPv4MappedToIPv6"
|
||||
// "::ffff:127.0.0.1" -> "127.0.0.1"
|
||||
? (endPoint.Address.IsIPv4MappedToIPv6
|
||||
? endPoint.Address.MapToIPv4().ToString()
|
||||
: endPoint.Address.ToString())
|
||||
: "";
|
||||
}
|
||||
public override void ServerStop() => server.Stop();
|
||||
public override void ServerEarlyUpdate()
|
||||
|
Loading…
Reference in New Issue
Block a user