[quake3-commits] r2236 - in trunk: . code/server

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Apr 5 18:43:32 EDT 2012


Author: ztm
Date: 2012-04-05 18:43:32 -0400 (Thu, 05 Apr 2012)
New Revision: 2236

Modified:
   trunk/README
   trunk/code/server/sv_ccmds.c
Log:
#5453 - Tell command for server.

Modified: trunk/README
===================================================================
--- trunk/README	2012-04-05 21:29:51 UTC (rev 2235)
+++ trunk/README	2012-04-05 22:43:32 UTC (rev 2236)
@@ -298,7 +298,9 @@
 
   which <filename/path>   - print out the path on disk to a loaded item
 
+  tell <client num> <msg> - send message to a single client (new to server)
 
+
 --------------------------------------------------------- README for Users -----
 
 Using shared libraries instead of qvm

Modified: trunk/code/server/sv_ccmds.c
===================================================================
--- trunk/code/server/sv_ccmds.c	2012-04-05 21:29:51 UTC (rev 2235)
+++ trunk/code/server/sv_ccmds.c	2012-04-05 22:43:32 UTC (rev 2236)
@@ -1164,7 +1164,46 @@
 	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 <client number> <text>\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);
+}
+
+
 /*
 ==================
 SV_Heartbeat_f
@@ -1299,6 +1338,7 @@
 	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);



More information about the quake3-commits mailing list