From 81deb2e3a31d61f033f583e0fa6624fa39809c3c Mon Sep 17 00:00:00 2001 From: divverent Date: Sat, 3 Oct 2009 11:06:49 +0000 Subject: [PATCH] fix two bugs in srcon/rcon_secure 2. It now WORKS. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9287 d7cf8633-e32d-0410-b094-e92efae38249 --- host_cmd.c | 4 ++-- netconn.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/host_cmd.c b/host_cmd.c index 5b45a09d..21ddd7aa 100644 --- a/host_cmd.c +++ b/host_cmd.c @@ -2459,8 +2459,8 @@ void Host_Rcon_f (void) // credit: taken from QuakeWorld NetConn_WriteString(mysocket, "\377\377\377\377getchallenge", &to); // otherwise we'll request the challenge later strlcpy(cls.rcon_commands[cls.rcon_ringpos], Cmd_Args(), sizeof(cls.rcon_commands[cls.rcon_ringpos])); cls.rcon_addresses[cls.rcon_ringpos] = to; - cls.rcon_ringpos = (cls.rcon_ringpos) % 64; - cls.rcon_timeout[i] = realtime + rcon_secure_challengetimeout.value; + cls.rcon_timeout[cls.rcon_ringpos] = realtime + rcon_secure_challengetimeout.value; + cls.rcon_ringpos = (cls.rcon_ringpos + 1) % MAX_RCONS; } else if(rcon_secure.integer) { diff --git a/netconn.c b/netconn.c index a66e2f32..32269068 100755 --- a/netconn.c +++ b/netconn.c @@ -1579,7 +1579,7 @@ static int NetConn_ClientParsePacket(lhnetsocket_t *mysocket, unsigned char *dat int i, j; for (j = 0;j < MAX_RCONS;j++) { - i = (cls.rcon_ringpos + j + 1) % MAX_RCONS; + i = (cls.rcon_ringpos + j) % MAX_RCONS; if(cls.rcon_commands[i][0]) if (!LHNETADDRESS_Compare(peeraddress, &cls.rcon_addresses[i])) break; -- 2.39.2