From 259822fc247139a089cfd8b42de8a0717e89e100 Mon Sep 17 00:00:00 2001 From: Callum Date: Wed, 6 Dec 2017 13:39:56 +1030 Subject: [PATCH] Fix sending broadcast packets The `==` operator for IPAddress compares references not values, so `target.Address` will always not equal `ba`. Switching to `IPAddress.Equals` fixes this and allows broadcast packets to be sent on Linux. --- Lidgren.Network/NetPeer.LatencySimulation.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lidgren.Network/NetPeer.LatencySimulation.cs b/Lidgren.Network/NetPeer.LatencySimulation.cs index 083e395..49b11b4 100644 --- a/Lidgren.Network/NetPeer.LatencySimulation.cs +++ b/Lidgren.Network/NetPeer.LatencySimulation.cs @@ -141,7 +141,7 @@ namespace Lidgren.Network ba = NetUtility.GetCachedBroadcastAddress(); // TODO: refactor this check outta here - if (target.Address == ba) + if (target.Address.Equals(ba)) { // Some networks do not allow // a global broadcast so we use the BroadcastAddress from the configuration @@ -308,4 +308,4 @@ namespace Lidgren.Network } #endif } -} \ No newline at end of file +}