Add ratelimit for reset votes

This commit is contained in:
elijahr2411
2023-02-12 18:15:12 -05:00
parent 5f603a88d9
commit 7b66f7c8a3
2 changed files with 4 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ export class User {
LoginRateLimit : RateLimiter;
RenameRateLimit : RateLimiter;
TurnRateLimit : RateLimiter;
VoteRateLimit : RateLimiter;
constructor(ws : WebSocket, ip : IPData, config : IConfig, username? : string, node? : string) {
this.IP = ip;
this.connectedToNode = false;
@@ -48,6 +49,8 @@ export class User {
this.LoginRateLimit.on('limit', () => this.closeConnection());
this.TurnRateLimit = new RateLimiter(5, 3);
this.TurnRateLimit.on('limit', () => this.closeConnection());
this.VoteRateLimit = new RateLimiter(3, 3);
this.VoteRateLimit.on('limit', () => this.closeConnection());
}
assignGuestName(existingUsers : string[]) : string {
var username;