Esempio n. 1
0
        public void DestroyGuildBucket(GuildBucket type, ulong guildId)
        {
            //Assume this object is locked
            RequestQueueBucket bucket;

            _guildBuckets[(int)type].TryRemove(guildId, out bucket);
        }
Esempio n. 2
0
 public Task SendGatewayAsync(GatewayOpCode opCode, object payload,
                              GuildBucket bucket, ulong guildId, RequestOptions options = null)
 => SendGatewayInternalAsync(opCode, payload, BucketGroup.Guild, (int)bucket, guildId, options);
Esempio n. 3
0
 public static Bucket GetBucketInfo(GuildBucket bucket) => _guildLimits[bucket];
Esempio n. 4
0
 private RequestQueueBucket GetGuildBucket(GuildBucket type, ulong guildId)
 {
     return(_guildBuckets[(int)type].GetOrAdd(guildId, _ => CreateBucket(_guildLimits[type])));
 }
Esempio n. 5
0
 public Task <TResponse> SendRpcAsync <TResponse>(string cmd, object payload, GuildBucket bucket, ulong guildId,
                                                  Optional <string> evt = default(Optional <string>), bool ignoreState = false, RequestOptions options = null)
     where TResponse : class
 => SendRpcAsyncInternal <TResponse>(cmd, payload, BucketGroup.Guild, (int)bucket, guildId, evt, ignoreState, options);