From 48d83538ef13596d4569d46ae66467b63b945546 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Wed, 3 Jan 2024 09:35:09 +1000 Subject: [PATCH] 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 --- netconn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) } -- 2.39.2