diff options
author | Andrey Nazarov <skuller@skuller.net> | 2008-10-14 17:33:21 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2008-10-14 17:33:21 +0000 |
commit | 2ff447b2019b5696375fbc09d87416345418cd9a (patch) | |
tree | 615463d291db654810589e9c923e39546550c5b5 /source/mvd_parse.c | |
parent | 9b25ad2f9f46ea731f6834a96536859e8764ab28 (diff) |
Added `sv_mvd_bufsize', `sv_mvd_disconnect_time', `sv_mvd_suspend_time' cvars.
MVD dummy no longer attempts to reopen the scoreboard while suspended.
Extended maximum MVD/GTV client message size to 256 bytes.
Don't break message order client expects in parse_stream_start().
Support maxclients value change between MVD gamestates.
Added `mvd_suspend_time', `mvd_username', `mvd_password' cvars.
Fixed MVD client retry backoff time.
Diffstat (limited to 'source/mvd_parse.c')
-rw-r--r-- | source/mvd_parse.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/source/mvd_parse.c b/source/mvd_parse.c index ee002e6..bc8c2c1 100644 --- a/source/mvd_parse.c +++ b/source/mvd_parse.c @@ -1030,12 +1030,21 @@ static void MVD_ParseServerData( mvd_t *mvd, int extrabits ) { MVD_Destroyf( mvd, "Invalid maxclients" ); } - if( !mvd->players ) { + // check if maxclients changed + if( index != mvd->maxclients ) { + mvd_client_t *client; + + // free any old players + Z_Free( mvd->players ); + + // allocate new players mvd->players = MVD_Mallocz( sizeof( mvd_player_t ) * index ); mvd->maxclients = index; - } else if( index != mvd->maxclients ) { - // TODO: allow this! - MVD_Destroyf( mvd, "Unexpected maxclients change" ); + + // clear chase targets + LIST_FOR_EACH( mvd_client_t, client, &mvd->clients, entry ) { + client->target = client->oldtarget = NULL; + } } // validate clientNum @@ -1054,7 +1063,7 @@ static void MVD_ParseServerData( mvd_t *mvd, int extrabits ) { mvd->mapname[len - 9] = 0; // cut off ".bsp" // load the world model (we are only interesed in visibility info) - Com_Printf( "[%s] Loading %s...\n", mvd->name, string ); + Com_Printf( "[%s] -=- Loading %s...\n", mvd->name, string ); if( !CM_LoadMap( &mvd->cm, string ) ) { MVD_Destroyf( mvd, "Couldn't load %s: %s", string, BSP_GetError() ); } |