This commit is contained in:
wolfy01 2020-04-07 02:42:12 -04:00 committed by GitHub
parent 7303d7d7c0
commit 033f8d3c2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 5 deletions

View File

@ -1,3 +1,5 @@
const config = require('./db/config');
const quotas = config.quotas;
const RateLimit = require('./RateLimit.js').RateLimit; const RateLimit = require('./RateLimit.js').RateLimit;
const RateLimitChain = require('./RateLimit.js').RateLimitChain; const RateLimitChain = require('./RateLimit.js').RateLimitChain;
const Room = require("./Room.js"); const Room = require("./Room.js");
@ -17,11 +19,12 @@ class Client extends EventEmitter {
this.destroied = false; this.destroied = false;
this.bindEventListeners(); this.bindEventListeners();
this.quotas = { this.quotas = {
chat: new RateLimitChain(4, 4000), chat: new RateLimitChain(quotas.chat.amount, quotas.chat.time),
name: new RateLimitChain(30, 30 * 60000), name: new RateLimitChain(quotas.name.amount, quotas.name.time),
cursor: new RateLimit(16), room: new RateLimit(quotas.room.time),
kickban: new RateLimitChain(2, 1000), cursor: new RateLimit(quotas.cursor.time),
crowned_chat: new RateLimitChain(10, 2000) kickban: new RateLimitChain(quotas.kickban.amount, quotas.kickban.time),
crowned_chat: new RateLimitChain(quotas.crowned_chat.amount, quotas.crowned_chat.time)
} }
require('./Message.js')(this); require('./Message.js')(this);
} }