From b95b73063d858db4567e2621a39ca27ec1aba963 Mon Sep 17 00:00:00 2001 From: Christopher Schwarz Date: Fri, 4 Feb 2011 21:56:26 +0000 Subject: * (bug 4892) Fix expired bans being listed and shown as not-expired in /showbans (thanks Kharnov) --- src/game/g_admin.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/game') diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 73af7084..d1e3557c 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -2191,12 +2191,18 @@ qboolean G_admin_listplayers( gentity_t *ent ) static qboolean ban_matchip( void *ban, const void *ip ) { + int expires = ((g_admin_ban_t *)ban)->expires; + if( expires != 0 && expires <= trap_RealTime( NULL ) ) + return qfalse; return G_AddressCompare( &((g_admin_ban_t *)ban)->ip, (addr_t *)ip ) || G_AddressCompare( (addr_t *)ip, &((g_admin_ban_t *)ban)->ip ); } static qboolean ban_matchname( void *ban, const void *name ) { char match[ MAX_NAME_LENGTH ]; + int expires = ((g_admin_ban_t *)ban)->expires; + if( expires != 0 && expires <= trap_RealTime( NULL ) ) + return qfalse; G_SanitiseString( ( (g_admin_ban_t *)ban )->name, match, sizeof( match ) ); return strstr( match, (const char *)name ) != NULL; } -- cgit