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

Fixed null ref exception. Fixed problem with wrong ip address.

This commit is contained in:
Badartefact
2019-06-14 12:13:14 +03:00
parent d577f874a9
commit 37cd6ac2c3
2 changed files with 8 additions and 3 deletions

View File

@@ -154,8 +154,13 @@ namespace Lidgren.Network
m_socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true);
}
else if(m_configuration.DualStack && m_configuration.LocalAddress.AddressFamily == AddressFamily.InterNetworkV6)
NetUtility.CopyEndpoint(target, targetCopy); //Maps to IPv6 for Dual Mode
NetUtility.CopyEndpoint(target, targetCopy); //Maps to IPv6 for Dual Mode
else
{
targetCopy.Port = target.Port;
targetCopy.Address = target.Address;
}
int bytesSent = m_socket.SendTo(data, 0, numBytes, SocketFlags.None, targetCopy);
if (numBytes != bytesSent)
LogWarning("Failed to send the full " + numBytes + "; only " + bytesSent + " bytes sent in packet!");