feat: INetworkCommunicatorServer.SendToClients extension method added
This commit is contained in:
13
Engine.Systems/Network/Extensions/CommunicatorExtensions.cs
Normal file
13
Engine.Systems/Network/Extensions/CommunicatorExtensions.cs
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Engine.Systems.Network;
|
||||||
|
|
||||||
|
public static class CommunicatorExtensions
|
||||||
|
{
|
||||||
|
public static void SendToClients<T>(this INetworkCommunicatorServer server, IEnumerable<IConnection> connections, T packet, PacketDelivery packetDelivery = PacketDelivery.ReliableInOrder) where T : class, new()
|
||||||
|
{
|
||||||
|
foreach (IConnection connection in connections)
|
||||||
|
server.SendToClient(connection, packet, packetDelivery);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user