public async ValueTask SendToAllAsync(IMessageWriter writer, LimboStates states = LimboStates.NotLimbo) { foreach (var connection in GetConnections(x => x.Limbo.HasFlag(states))) { await connection.SendAsync(writer); } }
public static ValueTask SendToAllExceptAsync(this IGame game, IMessageWriter writer, LimboStates states, int?id) { return(id.HasValue ? game.SendToAllExceptAsync(writer, id.Value, states) : game.SendToAllAsync(writer, states)); }
public static ValueTask SendToAllExceptAsync(this IGame game, IMessageWriter writer, LimboStates states, IClient client) { if (client == null) { throw new ArgumentNullException(nameof(client)); } return(game.SendToAllExceptAsync(writer, client.Id, states)); }
public async ValueTask SendToAllExceptAsync(IMessageWriter writer, int senderId, LimboStates states = LimboStates.NotLimbo) { foreach (var connection in GetConnections(x => x.Limbo.HasFlag(states) && x.Client.Id != senderId)) { await connection.SendAsync(writer); } }