Exemplo n.º 1
0
 public async ValueTask SendToAllAsync(IMessageWriter writer, LimboStates states = LimboStates.NotLimbo)
 {
     foreach (var connection in GetConnections(x => x.Limbo.HasFlag(states)))
     {
         await connection.SendAsync(writer);
     }
 }
Exemplo n.º 2
0
 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));
 }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 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);
     }
 }