From: bones_was_here Date: Tue, 2 Jan 2024 23:35:09 +0000 (+1000) Subject: rcon: support variable expansion in received commands X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=48d83538ef13596d4569d46ae66467b63b945546;p=xonotic%2Fdarkplaces.git rcon: support variable expansion in received commands How to send such a command without the client expanding it is currently left as an exercise for the reader... Signed-off-by: bones_was_here --- diff --git a/netconn.c b/netconn.c index dc629271..7e646825 100644 --- a/netconn.c +++ b/netconn.c @@ -3143,7 +3143,10 @@ static void RCon_Execute(lhnetsocket_t *mysocket, lhnetaddress_t *peeraddress, c if(l) { client_t *host_client_save = host_client; - Cmd_ExecuteString(cmd_local, s, src_local, true); + //Cmd_ExecuteString(cmd_local, s, src_local, true); // no variable expansion + // bones_was_here: prepending allows a loop such as `alias foo "bar; wait; foo"; foo` + // to be broken with an alias or unalias command + Cbuf_InsertText(cmd_local, s); host_client = host_client_save; // in case it is a command that changes host_client (like restart) }