1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-06 02:11:06 +09:00

Fixed host port switch detection

This commit is contained in:
lidgren
2011-04-28 06:55:58 +00:00
parent 6104df276f
commit cd7ccd6bae

View File

@@ -496,11 +496,14 @@ namespace Lidgren.Network
// Lets just assume the router decided to use this port instead
//
var hsconn = hs.Value;
m_connectionLookup.Remove(hsconn.RemoteEndpoint);
m_connectionLookup.Remove(hs.Key);
m_handshakes.Remove(hs.Key);
LogDebug("Detected host port change; rerouting connection to " + senderEndpoint);
hsconn.MutateEndpoint(senderEndpoint);
m_connectionLookup.Add(senderEndpoint, hsconn);
m_handshakes.Add(senderEndpoint, hsconn);
hsconn.ReceivedHandshake(now, tp, ptr, payloadByteLength);
return;