From c133a4946ccaa0ab54ec48bdf1fed93ef761cf94 Mon Sep 17 00:00:00 2001 From: "Tony J. White" Date: Sat, 3 Oct 2009 11:15:22 +0000 Subject: *(bug 3280) Changed the default behaviour of !listplayers. The fields representing guid stub, admin level and A.K.A. are now omitted unless the player running !listplayers has the new $ flag set. To restore the old behaviour, set the $ flag on all your existing [level] definitions in admin.dat. (Lakitu7) --- misc/manual.lyx | 22 ++++++++++++++++++++-- src/game/g_admin.c | 46 +++++++++++++++++++++++++++++----------------- src/game/g_admin.h | 2 ++ 3 files changed, 51 insertions(+), 19 deletions(-) diff --git a/misc/manual.lyx b/misc/manual.lyx index f7d0e1e4..593b6d50 100644 --- a/misc/manual.lyx +++ b/misc/manual.lyx @@ -7892,7 +7892,7 @@ The following table shows the flags for RIGHTS: \begin_inset Tabular - + @@ -8108,7 +8108,25 @@ no ! commands can be used on a player with this flag \layout Standard -does not show up as an admin in the output of listplayers +does not show up as an admin in the output of !listplayers +\end_inset + + + + +\begin_inset Text + +\layout Standard + +$ +\end_inset + + +\begin_inset Text + +\layout Standard + +sees additional player info in the output of !listplayers \end_inset diff --git a/src/game/g_admin.c b/src/game/g_admin.c index cffefc54..3c3107db 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -578,11 +578,11 @@ static void admin_default_levels( void ) Q_strncpyz( g_admin_levels[ 3 ]->name, "^2Junior Admin", sizeof( l->name ) ); - Q_strncpyz( g_admin_levels[ 3 ]->flags, "iahCpPkm", sizeof( l->flags ) ); + Q_strncpyz( g_admin_levels[ 3 ]->flags, "iahCpPkm$", sizeof( l->flags ) ); Q_strncpyz( g_admin_levels[ 4 ]->name, "^3Senior Admin", sizeof( l->name ) ); - Q_strncpyz( g_admin_levels[ 4 ]->flags, "iahCpPkmBbe", sizeof( l->flags ) ); + Q_strncpyz( g_admin_levels[ 4 ]->flags, "iahCpPkmBbe$", sizeof( l->flags ) ); Q_strncpyz( g_admin_levels[ 5 ]->name, "^1Server Operator", sizeof( l->name ) ); @@ -2341,21 +2341,33 @@ qboolean G_admin_listplayers( gentity_t *ent, int skiparg ) } } - - ADMBP( va( "%2i %s%s^7 %-2i %s^7 (*%s) ^1%1s%1s^7 %s^7 %s%s^7%s\n", - i, - c, - t, - l, - ( *lname ) ? lname2 : "", - guid_stub, - muted, - denied, - p->pers.netname, - ( *n ) ? "(a.k.a. " : "", - n, - ( *n ) ? ")" : "" - ) ); + + if( G_admin_permission(ent, ADMF_SEESFULLLISTPLAYERS ) ) + { + ADMBP( va( "%2i %s%s^7 %-2i %s^7 (*%s) ^1%1s%1s^7 %s^7 %s%s^7%s\n", + i, + c, + t, + l, + ( *lname ) ? lname2 : "", + guid_stub, + muted, + denied, + p->pers.netname, + ( *n ) ? "(a.k.a. " : "", + n, + ( *n ) ? ")" : "" ) ); + } + else + { + ADMBP( va( "%2i %s%s^7 ^1%1s%1s^7 %s^7\n", + i, + c, + t, + muted, + denied, + p->pers.netname ) ); + } } ADMBP_end(); return qtrue; diff --git a/src/game/g_admin.h b/src/game/g_admin.h index c4bf3928..4e24681d 100644 --- a/src/game/g_admin.h +++ b/src/game/g_admin.h @@ -55,6 +55,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * 0 - inactivity rules do not apply to them * ! - admin commands cannot be used on them * @ - does not show up as an admin in !listplayers + * $ - sees all information in !listplayers */ #define ADMF_IMMUNITY '1' #define ADMF_NOCENSORFLOOD '2' /* TODO */ @@ -69,6 +70,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define ADMF_IMMUTABLE '!' #define ADMF_INCOGNITO '@' +#define ADMF_SEESFULLLISTPLAYERS '$' #define MAX_ADMIN_LISTITEMS 20 #define MAX_ADMIN_SHOWBANS 10 -- cgit