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

Handle ConnectResponse despite connection being in place; to handle dropped handshake messages

This commit is contained in:
lidgren
2014-02-22 09:52:40 +00:00
parent ffc5239b4c
commit 865a7600f2
2 changed files with 63 additions and 36 deletions

View File

@@ -379,6 +379,26 @@ namespace Lidgren.Network
switch (tp)
{
case NetMessageType.Connect:
m_peer.LogDebug("Received handshake message (" + tp + ") despite connection being in place");
break;
case NetMessageType.ConnectResponse:
// handshake message must have been lost
HandleConnectResponse(now, tp, ptr, payloadLength);
break;
case NetMessageType.ConnectionEstablished:
// do nothing, all's well
break;
case NetMessageType.LibraryError:
#if DEBUG
throw new NetException("LibraryError received by ReceivedLibraryMessage; this usually indicates a malformed message");
#else
break;
#endif
case NetMessageType.Disconnect:
NetIncomingMessage msg = m_peer.SetupReadHelperMessage(ptr, payloadLength);
ExecuteDisconnect(msg.ReadString(), false);