From 219716897f191ccba136b8b2489ff3a9f3c35a2e Mon Sep 17 00:00:00 2001 From: Rene Stoeckel Date: Fri, 16 Dec 2005 21:17:51 +0000 Subject: bugfixes in remote command execution --- src/jake2/server/SV_MAIN.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/jake2/server') diff --git a/src/jake2/server/SV_MAIN.java b/src/jake2/server/SV_MAIN.java index 679ab73..f11a231 100644 --- a/src/jake2/server/SV_MAIN.java +++ b/src/jake2/server/SV_MAIN.java @@ -19,7 +19,7 @@ */ // Created on 13.01.2004 by RST. -// $Id: SV_MAIN.java,v 1.11 2005-07-01 14:20:55 hzi Exp $ +// $Id: SV_MAIN.java,v 1.12 2005-12-16 21:17:51 salomo Exp $ package jake2.server; import jake2.Defines; @@ -436,20 +436,17 @@ public class SV_MAIN { return 1; } - /* - * =============== SVC_RemoteCommand - * + /** * A client issued an rcon command. Shift down the remaining args Redirect - * all printfs =============== + * all printfs fromt hte server to the client. */ public static void SVC_RemoteCommand() { int i; - //char remaining[1024]; String remaining; i = Rcon_Validate(); - String msg = new String(Globals.net_message.data, 4, -1); + String msg = Lib.CtoJava(Globals.net_message.data, 4, 1024); if (i == 0) Com.Printf("Bad rcon from " + NET.AdrToString(Globals.net_from) @@ -460,8 +457,8 @@ public class SV_MAIN { Com.BeginRedirect(Defines.RD_PACKET, SV_SEND.sv_outputbuf, Defines.SV_OUTPUTBUF_LENGTH, new Com.RD_Flusher() { - public void rd_flush(int target, byte[] buffer) { - SV_SEND.SV_FlushRedirect(target, buffer); + public void rd_flush(int target, StringBuffer buffer) { + SV_SEND.SV_FlushRedirect(target, buffer.toString().getBytes()); } }); -- cgit v1.2.3