desktop/urbanterror/sv_main.c.patch

43 lines
1.6 KiB
Diff
Raw Normal View History

Index: trunk/code/server/sv_main.c
===================================================================
--- trunk/code/server/sv_main.c (revision 1525)
+++ trunk/code/server/sv_main.c (working copy)
@@ -466,20 +466,24 @@
// TTimo - https://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=534
time = Com_Milliseconds();
- if ( (unsigned)( time - lasttime ) < 500u ) {
- return;
- }
- lasttime = time;
+ if ( !strlen( sv_rconPassword->string ) ||
+ strcmp (Cmd_Argv(1), sv_rconPassword->string) ) {
+ // MaJ - If the rconpassword is bad and one just happned recently, don't spam the log file, just die.
+ if ( (unsigned)( time - lasttime ) < 500u ) {
+ return;
+ }
+ valid = qfalse;
+ Com_Printf ("Bad rcon from %s:\n%s\n", NET_AdrToString (from), Cmd_Argv(2) );
+ } else {
+ // MaJ - If the rconpassword is good, allow it much sooner than a bad one.
+ if ( (unsigned)( time - lasttime ) < 100u ) {
+ return;
+ }
+ valid = qtrue;
+ Com_Printf ("Rcon from %s:\n%s\n", NET_AdrToString (from), Cmd_Argv(2) );
+ }
+ lasttime = time;
- if ( !strlen( sv_rconPassword->string ) ||
- strcmp (Cmd_Argv(1), sv_rconPassword->string) ) {
- valid = qfalse;
- Com_Printf ("Bad rcon from %s:\n%s\n", NET_AdrToString (from), Cmd_Argv(2) );
- } else {
- valid = qtrue;
- Com_Printf ("Rcon from %s:\n%s\n", NET_AdrToString (from), Cmd_Argv(2) );
- }
-
// start redirecting all print outputs to the packet
svs.redirectAddress = from;
Com_BeginRedirect (sv_outputbuf, SV_OUTPUTBUF_LENGTH, SV_FlushRedirect);