Update Client.js

This commit is contained in:
wolfy01 2020-04-07 02:01:41 -04:00 committed by GitHub
parent 8d438a38da
commit b62bb01c2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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;
module.exports = Client;