diff options
author | Christopher Schwarz <lakitu7@gmail.com> | 2011-01-16 21:53:23 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:17:51 +0000 |
commit | 376f902cc17fb99aced8dbf8c6721f1d204ac0d6 (patch) | |
tree | 51ec99134bcf6d525bfaf38293ca38308721834f /src | |
parent | bd56cba81dff49a4edf16908a0017668b6812586 (diff) |
* Print pause time in seconds instead of ms when unpaused
* Implement a max pause time of 2 minutes in case an admin lags out or something after pausing
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_admin.c | 7 | ||||
-rw-r--r-- | src/game/g_main.c | 11 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 2229ba25..038c8cdb 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -2880,9 +2880,10 @@ qboolean G_admin_pause( gentity_t *ent ) return qfalse; } - AP( va( "print \"^3pause: ^7%s^7 unpaused the game (Paused for %d msec) \n\"", - ( ent ) ? ent->client->pers.netname : "console",level.pausedTime ) ); - trap_SendServerCommand( -1, "cp \"The game has been unpaused!\"" ); + AP( va( "print \"^3pause: ^7%s^7 unpaused the game (Paused for %d sec) \n\"", + ( ent ) ? ent->client->pers.netname : "console", + (int) ( (float) level.pausedTime / 1000.0f ) ) ); + trap_SendServerCommand( -1, "cp \"The game has been unpaused!\"" ); level.pausedTime = 0; } diff --git a/src/game/g_main.c b/src/game/g_main.c index 01292c66..765dfce4 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -2338,6 +2338,10 @@ void G_RunFrame( int levelTime ) { ptime3000 -= 3000; trap_SendServerCommand( -1, "cp \"The game has been paused. Please wait.\"" ); + + if( level.pausedTime >= 110000 && level.pausedTime <= 119000 ) + trap_SendServerCommand( -1, va( "print \"Server: Game will auto-unpause in %d seconds\n\"", + (int) ( (float) ( 120000 - level.pausedTime ) / 1000.0f ) ) ); } // Prevents clients from getting lagged-out messages @@ -2347,6 +2351,13 @@ void G_RunFrame( int levelTime ) level.clients[ i ].ps.commandTime = levelTime; } + if( level.pausedTime > 120000 ) + { + trap_SendServerCommand( -1, "print \"Server: The game has been unpaused automatically (2 minute max)\n\"" ); + trap_SendServerCommand( -1, "cp \"The game has been unpaused!\"" ); + level.pausedTime = 0; + } + return; } |