You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-19 08:36:34 +09:00
- Patch from MonoGame; makes the BroadcastAddress configurable and changes text encoding from ASCII to UTF8, required for Android support
This commit is contained in:
@@ -131,7 +131,13 @@ namespace Lidgren.Network
|
||||
{
|
||||
// TODO: refactor this check outta here
|
||||
if (target.Address == IPAddress.Broadcast)
|
||||
{
|
||||
// Some networks do not allow
|
||||
// a global broadcast so we use the BroadcastAddress from the configuration
|
||||
// this can be resolved to a local broadcast addresss e.g 192.168.x.255
|
||||
target.Address = m_configuration.BroadcastAddress;
|
||||
m_socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast, true);
|
||||
}
|
||||
|
||||
int bytesSent = m_socket.SendTo(data, 0, numBytes, SocketFlags.None, target);
|
||||
if (numBytes != bytesSent)
|
||||
@@ -175,7 +181,7 @@ namespace Lidgren.Network
|
||||
int bytesSent = m_socket.SendTo(m_sendBuffer, 0, numBytes, SocketFlags.None, target);
|
||||
if (numBytes != bytesSent)
|
||||
LogWarning("Failed to send the full " + numBytes + "; only " + bytesSent + " bytes sent in packet!");
|
||||
|
||||
|
||||
m_statistics.PacketSent(numBytes, 1);
|
||||
}
|
||||
catch (SocketException sx)
|
||||
@@ -295,4 +301,4 @@ namespace Lidgren.Network
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user