示例#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);
     }
 }