]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
moved parse_model_precache and parse_sound_precache to cl.model_names and cl.sound_na...
[xonotic/darkplaces.git] / console.c
index 15fc72353c9db5f45d86c50eb8d9371f2e33eed6..cd11547ddbbb5e7554b8ff45d6a230f7a81157ba 100644 (file)
--- a/console.c
+++ b/console.c
@@ -53,6 +53,11 @@ int con_vislines;
 
 qboolean con_initialized;
 
+// used for server replies to rcon command
+qboolean rcon_redirect = false;
+int rcon_redirect_bufferpos = 0;
+char rcon_redirect_buffer[1400];
+
 
 /*
 ==============================================================================
@@ -561,9 +566,13 @@ void Con_Print(const char *msg)
 
        for (;*msg;msg++)
        {
+               // if this print is in response to an rcon command, add the character
+               // to the rcon redirect buffer
+               if (rcon_redirect && rcon_redirect_bufferpos < (int)sizeof(rcon_redirect_buffer) - 1)
+                       rcon_redirect_buffer[rcon_redirect_bufferpos++] = *msg;
+               // if this is the beginning of a new line, print timestamp
                if (index == 0)
                {
-                       // if this is the beginning of a new line, print timestamp
                        const char *timestamp = timestamps.integer ? Sys_TimeString(timeformat.string) : "";
                        // reset the color
                        // FIXME: 1. perhaps we should use a terminal system 2. use a constant instead of 7!
@@ -1107,7 +1116,7 @@ void Con_CompleteCommandLine (void)
                                if (GetMapList(s, t, sizeof(t)))
                                {
                                        // first move the cursor
-                                       key_linepos += strlen(t) - strlen(s);
+                                       key_linepos += (int)strlen(t) - (int)strlen(s);
 
                                        // and now do the actual work
                                        *s = 0;
@@ -1116,7 +1125,7 @@ void Con_CompleteCommandLine (void)
 
                                        // and fix the cursor
                                        if(key_linepos > (int) strlen(key_lines[edit_line]))
-                                               key_linepos = strlen(key_lines[edit_line]);
+                                               key_linepos = (int) strlen(key_lines[edit_line]);
                                }
                                return;
                        }