From cf1234d63e48d4124bd9bd03ebb91b314f409e10 Mon Sep 17 00:00:00 2001 From: "M. Kristall" Date: Wed, 28 Oct 2009 19:22:57 +0000 Subject: * Server- and client-side tab completion for commands handled by the game module * Admin commands are just like all other commands now: no more ! ("!map" was renamed to "changemap" since "map" already exists) * Text in the chat ui beginning with / or \ is treated as a command unless ui_chatCommands = 0 (default 1) --- src/cgame/cg_servercmds.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/cgame') diff --git a/src/cgame/cg_servercmds.c b/src/cgame/cg_servercmds.c index a706d1f5..260ea5d4 100644 --- a/src/cgame/cg_servercmds.c +++ b/src/cgame/cg_servercmds.c @@ -1293,10 +1293,26 @@ static void CG_PTRConfirm_f( void ) trap_SendConsoleCommand( "menu ptrc_popmenu\n" ); } +static void CG_GameCmds_f( void ) +{ + int i; + int c = trap_Argc( ); + + /* + There is no corresponding trap_RemoveCommand because a server could send + something like + cmds quit + which would result in trap_RemoveCommand( "quit" ), which would be really bad + */ + for( i = 1; i < c; i++ ) + trap_AddCommand( CG_Argv( i ) ); +} + static consoleCommand_t svcommands[ ] = { { "chat", CG_Chat_f }, { "clientLevelShot", CG_ClientLevelShot_f }, + { "cmds", CG_GameCmds_f }, { "cp", CG_CenterPrint_f }, { "cs", CG_ConfigStringModified }, { "map_restart", CG_MapRestart }, -- cgit