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

Added NetPeer.ThrowOrLog

Changed a bunch of exceptions for consistency and safety
Enabled AutoExpandMTU for SpeedSample
This commit is contained in:
lidgren
2014-07-31 13:16:09 +00:00
parent 85a3b28bbf
commit 04593ef00f
10 changed files with 71 additions and 39 deletions

View File

@@ -323,7 +323,7 @@ namespace Lidgren.Network
chan = CreateSenderChannel(tp);
if (msg.GetEncodedSize() > m_currentMTU)
throw new NetException("Message too large! Fragmentation failure?");
m_peer.ThrowOrLog("Message too large! Fragmentation failure?");
var retval = chan.Enqueue(msg);
if (retval == NetSendResult.Sent && m_peerConfiguration.m_autoFlushSendQueue == false)
@@ -394,11 +394,8 @@ namespace Lidgren.Network
break;
case NetMessageType.LibraryError:
#if DEBUG
throw new NetException("LibraryError received by ReceivedLibraryMessage; this usually indicates a malformed message");
#else
m_peer.ThrowOrLog("LibraryError received by ReceivedLibraryMessage; this usually indicates a malformed message");
break;
#endif
case NetMessageType.Disconnect:
NetIncomingMessage msg = m_peer.SetupReadHelperMessage(ptr, payloadLength);