summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTony J. White <tjw@tjw.org>2009-10-03 11:15:22 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:14:48 +0000
commitc133a4946ccaa0ab54ec48bdf1fed93ef761cf94 (patch)
tree140bdf5cb2ccc8b6c30f3e1948ccf4ace1950c77 /src
parentacf169219a3f51db82750851cf1dad44ff331de5 (diff)
*(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)
Diffstat (limited to 'src')
-rw-r--r--src/game/g_admin.c46
-rw-r--r--src/game/g_admin.h2
2 files changed, 31 insertions, 17 deletions
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