mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-07 15:25:58 +00:00
allow 3 send winner msgs, in case a client reconnects
This commit is contained in:
@@ -42,9 +42,11 @@ describe("ClientMsgRateLimiter", () => {
|
||||
expect(limiter.check(CLIENT_A, "winner", 50000)).toBe("ok");
|
||||
});
|
||||
|
||||
it("kicks on second winner message", () => {
|
||||
it("allows up to 3 winner messages", () => {
|
||||
const limiter = new ClientMsgRateLimiter();
|
||||
limiter.check(CLIENT_A, "winner", 50000);
|
||||
expect(limiter.check(CLIENT_A, "winner", 50000)).toBe("ok");
|
||||
expect(limiter.check(CLIENT_A, "winner", 50000)).toBe("ok");
|
||||
expect(limiter.check(CLIENT_A, "winner", 50000)).toBe("ok");
|
||||
expect(limiter.check(CLIENT_A, "winner", 50000)).toBe("kick");
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user