]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - console.c
allow control over User-Agent:
[xonotic/darkplaces.git] / console.c
index 14175b07ad4c37cd84ea4e0202c438c43365c098..831c30a9f35a8dbfdff36f1e52ad53590e74ef25 100644 (file)
--- a/console.c
+++ b/console.c
@@ -905,13 +905,16 @@ void Con_Rcon_Redirect_Init(lhnetsocket_t *sock, lhnetaddress_t *dest, qboolean
 
 static void Con_Rcon_Redirect_Flush(void)
 {
-       rcon_redirect_buffer[rcon_redirect_bufferpos] = 0;
-       if (rcon_redirect_proquakeprotocol)
+       if(rcon_redirect_sock)
        {
-               // update the length in the packet header
-               StoreBigLong((unsigned char *)rcon_redirect_buffer, NETFLAG_CTL | (rcon_redirect_bufferpos & NETFLAG_LENGTH_MASK));
+               rcon_redirect_buffer[rcon_redirect_bufferpos] = 0;
+               if (rcon_redirect_proquakeprotocol)
+               {
+                       // update the length in the packet header
+                       StoreBigLong((unsigned char *)rcon_redirect_buffer, NETFLAG_CTL | (rcon_redirect_bufferpos & NETFLAG_LENGTH_MASK));
+               }
+               NetConn_Write(rcon_redirect_sock, rcon_redirect_buffer, rcon_redirect_bufferpos, rcon_redirect_dest);
        }
-       NetConn_Write(rcon_redirect_sock, rcon_redirect_buffer, rcon_redirect_bufferpos, rcon_redirect_dest);
        memcpy(rcon_redirect_buffer, "\377\377\377\377n", 5); // QW rcon print
        rcon_redirect_bufferpos = 5;
        rcon_redirect_proquakeprotocol = false;