From 14df22ff9ab62fe6815e5c3cbebd8b00eeb05b7f Mon Sep 17 00:00:00 2001 From: chrisnobrega Date: Thu, 30 Aug 2018 22:59:04 -0400 Subject: [PATCH] Fixed NetServer missing SendToAll with sequence channel parameter --- Lidgren.Network/NetServer.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Lidgren.Network/NetServer.cs b/Lidgren.Network/NetServer.cs index 99a198f..85c37ed 100644 --- a/Lidgren.Network/NetServer.cs +++ b/Lidgren.Network/NetServer.cs @@ -35,6 +35,25 @@ namespace Lidgren.Network SendMessage(msg, all, method, 0); } + /// + /// Send a message to all connections + /// + /// The message to send + /// How to deliver the message + /// Which sequence channel to use for the message + public void SendToAll(NetOutgoingMessage msg, NetDeliveryMethod method, int sequenceChannel) + { + // Modifying m_connections will modify the list of the connections of the NetPeer. Do only reads here + var all = m_connections; + if (all.Count <= 0) { + if (msg.m_isSent == false) + Recycle(msg); + return; + } + + SendMessage(msg, all, method, sequenceChannel); + } + /// /// Send a message to all connections except one ///