]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
make rcon command display a bit nicer for multi-command rcons
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 10 Jul 2007 10:29:39 +0000 (10:29 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 10 Jul 2007 10:29:39 +0000 (10:29 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7482 d7cf8633-e32d-0410-b094-e92efae38249

netconn.c

index b231c11ad98b5a8d2b772f6655abd4a87f2879c6..4234d323f32576c1b3026e459b2f15c30520dc0e 100755 (executable)
--- 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)