WebSocketServer.CardServer.BroadcastMessage C# (CSharp) Method

BroadcastMessage() public method

Broadcasts a JSON message to all clients. If an origin is specified, the message is not re-broadcast back to the origin.
public BroadcastMessage ( Client origin, string message ) : void
origin Client Optionally, a client origin which the message will not be broadcast back to. Set to null to broadcast to every client.
message string The message to broadcast.
return void
        public void BroadcastMessage(Client origin, string message, params JProperty[] parameters)
        {
            if (origin != null)
            {
                Clients.Where(c => !c.Equals(origin)).ToList().ForEach(c => c.SendMessage(message, parameters));
            }
            else
            {
                Clients.ForEach(c => c.SendMessage(message, parameters));
            }
        }