From 75aea75974336cc763d936aac735eb8c110e2cb7 Mon Sep 17 00:00:00 2001 From: Christopher Schwarz Date: Sat, 3 Oct 2009 12:32:29 +0000 Subject: * (bug 3354) Add /clientlist cgame command for listing connected clients (DevHC) * Remove ADMF_SEESFULLLISTPLAYERS and return !listplayers to the old default value of always listing everything. Servers can now freely disallow !listplayers from non-admins, who can use /clientlist (or the GUI) to obtain the info they need. --- src/cgame/cg_consolecmds.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/cgame') diff --git a/src/cgame/cg_consolecmds.c b/src/cgame/cg_consolecmds.c index e1354f37..4b408cf1 100644 --- a/src/cgame/cg_consolecmds.c +++ b/src/cgame/cg_consolecmds.c @@ -173,6 +173,41 @@ static void CG_TellAttacker_f( void ) trap_SendClientCommand( command ); } +void CG_ClientList_f( void ) +{ + clientInfo_t *ci; + int i; + int count = 0; + + for( i = 0; i < MAX_CLIENTS; i++ ) + { + ci = &cgs.clientinfo[ i ]; + if( !ci->infoValid ) + continue; + + switch( ci->team ) + { + case TEAM_ALIENS: + Com_Printf( "%2d ^1A ^7%s^7\n", i, ci->name ); + break; + + case TEAM_HUMANS: + Com_Printf( "%2d ^4H ^7%s^7\n", i, ci->name ); + break; + + default: + case TEAM_NONE: + case NUM_TEAMS: + Com_Printf( "%2d ^3S ^7%s^7\n", i, ci->name ); + break; + } + + count++; + } + + Com_Printf( "Listed %2d clients\n", count ); +} + static void CG_UIMenu_f( void ) { trap_SendConsoleCommand( va( "menu %s\n", CG_Argv( 1 ) ) ); @@ -203,6 +238,7 @@ static consoleCommand_t commands[ ] = { "destroyTestPS", CG_DestroyTestPS_f }, { "testTS", CG_TestTS_f }, { "destroyTestTS", CG_DestroyTestTS_f }, + { "clientlist", CG_ClientList_f }, }; -- cgit