From fd7072f74ce183c840dd65d8983dfa159374c7c0 Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Mon, 10 Jun 2013 20:30:48 +0100 Subject: Rate limit getchallenge --- src/server/server.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/server/server.h') diff --git a/src/server/server.h b/src/server/server.h index f562a245..2989eb4e 100644 --- a/src/server/server.h +++ b/src/server/server.h @@ -290,6 +290,28 @@ extern cvar_t *sv_voip; // // sv_main.c // +typedef struct leakyBucket_s leakyBucket_t; +struct leakyBucket_s { + netadrtype_t type; + + union { + byte _4[4]; + byte _6[16]; + } ipv; + + int lastTime; + signed char burst; + + long hash; + + leakyBucket_t *prev, *next; +}; + +extern leakyBucket_t outboundLeakyBucket; + +qboolean SVC_RateLimit( leakyBucket_t *bucket, int burst, int period ); +qboolean SVC_RateLimitAddress( netadr_t from, int burst, int period ); + void SV_FinalMessage (char *message); void QDECL SV_SendServerCommand( client_t *cl, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); -- cgit