]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
rcon: return the error message when authentication fails
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 26 Feb 2024 14:55:11 +0000 (00:55 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Mon, 26 Feb 2024 16:06:26 +0000 (02:06 +1000)
Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
netconn.c

index 0bc22f11fc01a2315b5df2ab36edd727c874e770..4ff6a57637f3d9866f92796b1db9e7ade94508f1 100644 (file)
--- a/netconn.c
+++ b/netconn.c
@@ -3132,7 +3132,10 @@ static void RCon_Execute(lhnetsocket_t *mysocket, lhnetaddress_t *peeraddress, c
        }
        else
        {
-               Con_Printf("server denied rcon access to %s\n", host_client ? host_client->name : addressstring2);
+               if (!host_client || !host_client->netconnection || LHNETADDRESS_GetAddressType(&host_client->netconnection->peeraddress) != LHNETADDRESSTYPE_LOOP)
+                       Con_Rcon_Redirect_Init(mysocket, peeraddress, proquakeprotocol);
+               Con_Printf(CON_ERROR "server denied rcon access to %s\n", host_client ? host_client->name : addressstring2);
+               Con_Rcon_Redirect_End();
        }
 }