From ce2644cead347252a7b20a961291adf680c6050f Mon Sep 17 00:00:00 2001 From: lidgren Date: Mon, 29 Oct 2012 16:01:48 +0000 Subject: [PATCH] - Handle NatIntroduction message even if connection already exists --- Lidgren.Network/NetConnection.cs | 4 ++++ Lidgren.Network/NetNatIntroduction.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Lidgren.Network/NetConnection.cs b/Lidgren.Network/NetConnection.cs index 311481f..82087b1 100644 --- a/Lidgren.Network/NetConnection.cs +++ b/Lidgren.Network/NetConnection.cs @@ -409,6 +409,10 @@ namespace Lidgren.Network int size = emsg.ReadInt32(); HandleExpandMTUSuccess(now, size); break; + case NetMessageType.NatIntroduction: + // Unusual situation where server is actually already known, but got a nat introduction - oh well, lets handle it as usual + m_peer.HandleNatIntroduction(ptr); + break; default: m_peer.LogWarning("Connection received unhandled library message: " + tp); break; diff --git a/Lidgren.Network/NetNatIntroduction.cs b/Lidgren.Network/NetNatIntroduction.cs index bfe1e59..fea590d 100644 --- a/Lidgren.Network/NetNatIntroduction.cs +++ b/Lidgren.Network/NetNatIntroduction.cs @@ -38,7 +38,7 @@ namespace Lidgren.Network /// /// Called when host/client receives a NatIntroduction message from a master server /// - private void HandleNatIntroduction(int ptr) + internal void HandleNatIntroduction(int ptr) { VerifyNetworkThread();