예제 #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);
     }
 }
예제 #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));
 }
예제 #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));
        }
예제 #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);
     }
 }