Modified lidgren to support IPv6 (code from https://github.com/lidgren/lidgren-network-gen3/pull/33). TODO: test

This commit is contained in:
Joonas Rikkonen
2018-11-24 20:14:59 +02:00
parent f3409f067d
commit f10ba10c63
6 changed files with 46 additions and 29 deletions
+5 -3
View File
@@ -121,8 +121,8 @@ namespace Lidgren.Network
m_connections = new List<NetConnection>();
m_connectionLookup = new Dictionary<NetEndPoint, NetConnection>();
m_handshakes = new Dictionary<NetEndPoint, NetConnection>();
m_senderRemote = (EndPoint)new NetEndPoint(IPAddress.Any, 0);
m_status = NetPeerStatus.NotRunning;
m_senderRemote = (EndPoint)new NetEndPoint(IPAddress.IPv6Any, 0);
m_status = NetPeerStatus.NotRunning;
m_receivedFragmentGroups = new Dictionary<NetConnection, Dictionary<int, ReceivedFragmentGroup>>();
}
@@ -293,7 +293,9 @@ namespace Lidgren.Network
if (remoteEndPoint == null)
throw new ArgumentNullException("remoteEndPoint");
lock (m_connections)
remoteEndPoint = NetUtility.MapToIPv6(remoteEndPoint);
lock (m_connections)
{
if (m_status == NetPeerStatus.NotRunning)
throw new NetException("Must call Start() first");