forked from Hri7566/mpp-server-dev2
quotas
This commit is contained in:
parent
7303d7d7c0
commit
033f8d3c2a
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue