From 2b7df8af51c762e31571943bad09a23e3e3ef301 Mon Sep 17 00:00:00 2001 From: divverent Date: Tue, 10 Jul 2007 10:29:39 +0000 Subject: [PATCH] make rcon command display a bit nicer for multi-command rcons git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7482 d7cf8633-e32d-0410-b094-e92efae38249 --- netconn.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/netconn.c b/netconn.c index b231c11a..4234d323 100755 --- a/netconn.c +++ b/netconn.c @@ -2096,18 +2096,22 @@ static int NetConn_ServerParsePacket(lhnetsocket_t *mysocket, unsigned char *dat for (i = 0;*s > ' ';s++) if (i < (int)sizeof(password) - 1) password[i++] = *s; + if(*s <= ' ' && s != endpos) // skip leading ugly space + ++s; password[i] = 0; if (password[0] > ' ' && !strcmp(rcon_password.string, password)) { // looks like a legitimate rcon command with the correct password char *s_ptr = s; + Con_Printf("server received rcon command from %s:\n", host_client ? host_client->name : addressstring2); while(s_ptr != endpos) { size_t l = strlen(s_ptr); if(l) - Con_Printf("server received rcon command from %s:\n%s\n", host_client ? host_client->name : addressstring2, s_ptr); + Con_Printf(" %s;", s_ptr); s_ptr += l + 1; } + Con_Printf("\n"); rcon_redirect = true; rcon_redirect_bufferpos = 0; while(s != endpos) -- 2.39.2