WebSocketServer.CardServer.BroadcastError C# (CSharp) Method

BroadcastError() public method

Broadcasts an error message to all clients. If an origin is specified, the message is not re-broadcast back to the origin.
public BroadcastError ( Client origin, string source, string message, bool sendBack = false ) : void
origin Client Optionally, a client origin which the error will not be broadcast back to. Set to null to broadcast to every client.
source string The source of the error.
message string The error message to broadcast.
sendBack bool Whether or not to send the error back to the origin client or not.
return void
        public void BroadcastError(Client origin, string source, string message, bool sendBack = false)
        {
            if (origin != null && !sendBack)
            {
                Clients.Where(c => !c.Equals(origin)).ToList().ForEach(c => c.SendError(source, message));
            }
            else
            {
                Clients.ForEach(c => c.SendError(source, message));
            }
        }