summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorChristopher Schwarz <lakitu7@gmail.com>2011-02-04 21:56:26 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:58 +0000
commitb95b73063d858db4567e2621a39ca27ec1aba963 (patch)
tree03a236d81dcf451b0d07e263c2e83b3bef112c89 /src/game
parentb27d1dee274f7a11c654cfdd8cbaa0c183be77f6 (diff)
* (bug 4892) Fix expired bans being listed and shown as not-expired in /showbans (thanks Kharnov)
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_admin.c6
1 files changed, 6 insertions, 0 deletions
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;
}