From b62bb01c2b0fc60d3e1cf56dafa437e9068355fd Mon Sep 17 00:00:00 2001 From: wolfy01 <45273698+wolfy01@users.noreply.github.com> Date: Tue, 7 Apr 2020 02:01:41 -0400 Subject: [PATCH] Update Client.js --- src/Client.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Client.js b/src/Client.js index c762e68..4751df9 100644 --- a/src/Client.js +++ b/src/Client.js @@ -1,3 +1,5 @@ +const RateLimit = require('./RateLimit.js').RateLimit; +const RateLimitChain = require('./RateLimit.js').RateLimitChain; const Room = require("./Room.js"); require('node-json-color-stringify'); class Client extends EventEmitter { @@ -14,6 +16,10 @@ class Client extends EventEmitter { this.ip = (req.connection.remoteAddress).replace("::ffff:", ""); this.destroied = false; this.bindEventListeners(); + this.cursQuota = new RateLimit(16); + this.chatQuota = new RateLimitChain(4, 4000); + this.nameQuota = new RateLimitChain(30, 30 * 60000); + this.crowned_chatQuota = new RateLimitChain(10, 2000); require('./Message.js')(this); } isConnected() { @@ -102,4 +108,4 @@ class Client extends EventEmitter { }); } } -module.exports = Client; \ No newline at end of file +module.exports = Client;