forked from Hri7566/mpp-server-dev2
Update Client.js
This commit is contained in:
parent
8d438a38da
commit
b62bb01c2b
|
@ -1,3 +1,5 @@
|
||||||
|
const RateLimit = require('./RateLimit.js').RateLimit;
|
||||||
|
const RateLimitChain = require('./RateLimit.js').RateLimitChain;
|
||||||
const Room = require("./Room.js");
|
const Room = require("./Room.js");
|
||||||
require('node-json-color-stringify');
|
require('node-json-color-stringify');
|
||||||
class Client extends EventEmitter {
|
class Client extends EventEmitter {
|
||||||
|
@ -14,6 +16,10 @@ class Client extends EventEmitter {
|
||||||
this.ip = (req.connection.remoteAddress).replace("::ffff:", "");
|
this.ip = (req.connection.remoteAddress).replace("::ffff:", "");
|
||||||
this.destroied = false;
|
this.destroied = false;
|
||||||
this.bindEventListeners();
|
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);
|
require('./Message.js')(this);
|
||||||
}
|
}
|
||||||
isConnected() {
|
isConnected() {
|
||||||
|
|
Loading…
Reference in New Issue