From ede9c03def51a704633cb3b0536337f58232b2ad Mon Sep 17 00:00:00 2001 From: Richard Allen Date: Thu, 4 Oct 2012 13:57:59 +0000 Subject: [PATCH] IOQ3 commit 2236 --- reaction/README | 2 ++ reaction/code/server/sv_ccmds.c | 40 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/reaction/README b/reaction/README index e8d4c936..0a2f360e 100644 --- a/reaction/README +++ b/reaction/README @@ -298,6 +298,8 @@ New commands which - print out the path on disk to a loaded item + tell - send message to a single client (new to server) + --------------------------------------------------------- README for Users ----- diff --git a/reaction/code/server/sv_ccmds.c b/reaction/code/server/sv_ccmds.c index 8ddb94dc..5f5400b6 100644 --- a/reaction/code/server/sv_ccmds.c +++ b/reaction/code/server/sv_ccmds.c @@ -1164,6 +1164,45 @@ static void SV_ConSay_f(void) { SV_SendServerCommand(NULL, "chat \"%s\"", text); } +/* +================== +SV_ConTell_f +================== +*/ +static void SV_ConTell_f(void) { + char *p; + char text[1024]; + client_t *cl; + + // make sure server is running + if ( !com_sv_running->integer ) { + Com_Printf( "Server is not running.\n" ); + return; + } + + if ( Cmd_Argc() < 3 ) { + Com_Printf ("Usage: tell \n"); + return; + } + + cl = SV_GetPlayerByNum(); + if ( !cl ) { + return; + } + + strcpy (text, "console_tell: "); + p = Cmd_ArgsFrom(2); + + if ( *p == '"' ) { + p++; + p[strlen(p)-1] = 0; + } + + strcat(text, p); + + SV_SendServerCommand(cl, "chat \"%s\"", text); +} + /* ================== @@ -1299,6 +1338,7 @@ void SV_AddOperatorCommands( void ) { Cmd_AddCommand ("killserver", SV_KillServer_f); if( com_dedicated->integer ) { Cmd_AddCommand ("say", SV_ConSay_f); + Cmd_AddCommand ("tell", SV_ConTell_f); } Cmd_AddCommand("rehashbans", SV_RehashBans_f);