1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-13 21:56:29 +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

@@ -65,9 +65,18 @@ namespace Lidgren.Network
internal static int GetMTU(IList<NetConnection> recipients)
{
int count = recipients.Count;
NetException.Assert(count > 0);
int mtu = int.MaxValue;
if (count < 1)
{
#if DEBUG
throw new NetException("GetMTU called with no recipients");
#else
// we don't have access to the particular peer, so just use default MTU
return NetPeerConfiguration.kDefaultMTU;
#endif
}
for(int i=0;i<count;i++)
{
var conn = recipients[i];