From 9b015c1322a3e8be37c476d1be5f4ef68d2b8b9c Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Sat, 10 Jan 2009 22:10:03 +0000 Subject: Made MinGW built OpenFFA game DLL loadable on Win32. Server now disallows ‘map’ command by default if no latched variables were changed. Added ‘sv_allow_map’ cvar to turn this check off. Implemented ‘kickban’ server command. Made address/mask matching code endianess safe. Made ‘dumpuser’ server command more verbose. Display client FPS value in the output of ‘status’ command. Fixed a crash when MVD channel with an active GTV connection was destroyed. Made it possible to re-enable old Q2 brush tracing bug via ‘map_allsolid_bug’ cvar. Added ‘allow_download_textures’ and ‘allow_download_pics’ cvar for fine tuning download options on client and server sides. Changed ‘allow_download’ default value to 0. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/mvd_client.c | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) (limited to 'source/mvd_client.c') diff --git a/source/mvd_client.c b/source/mvd_client.c index 7244a60..3219ddb 100644 --- a/source/mvd_client.c +++ b/source/mvd_client.c @@ -121,14 +121,9 @@ static cvar_t *mvd_password; // ==================================================================== -void MVD_Free( mvd_t *mvd ) { +static void MVD_Free( mvd_t *mvd ) { int i; - // destroy any existing connection - if( mvd->gtv ) { - mvd->gtv->destroy( mvd->gtv ); - } - // stop demo recording if( mvd->demorecording ) { uint16_t msglen = 0; @@ -150,7 +145,7 @@ void MVD_Free( mvd_t *mvd ) { Z_Free( mvd ); } -void MVD_Destroy( mvd_t *mvd ) { +static void MVD_Destroy( mvd_t *mvd ) { mvd_client_t *client, *next; // update channel menus @@ -163,6 +158,12 @@ void MVD_Destroy( mvd_t *mvd ) { MVD_SwitchChannel( client, &mvd_waitingRoom ); } + // destroy any existing GTV connection + if( mvd->gtv ) { + mvd->gtv->mvd = NULL; // don't double destroy + mvd->gtv->destroy( mvd->gtv ); + } + // free all channel data MVD_Free( mvd ); } @@ -607,11 +608,10 @@ static void demo_free_playlist( gtv_t *gtv ) { static void demo_destroy( gtv_t *gtv ) { mvd_t *mvd = gtv->mvd; + // destroy any associated MVD channel if( mvd ) { mvd->gtv = NULL; - if( !mvd->state ) { - MVD_Free( mvd ); - } + MVD_Destroy( mvd ); } if( gtv->demoplayback ) { @@ -1325,9 +1325,9 @@ static void gtv_run( gtv_t *gtv ) { static void gtv_destroy( gtv_t *gtv ) { mvd_t *mvd = gtv->mvd; - // any associated MVD channel is orphaned + // drop any associated MVD channel if( mvd ) { - mvd->gtv = NULL; + mvd->gtv = NULL; // don't double destroy if( !mvd->state ) { // free it here, since it is not yet // added to global channel list @@ -2010,13 +2010,17 @@ void MVD_Shutdown( void ) { gtv_t *gtv, *gtv_next; mvd_t *mvd, *mvd_next; - // kill all connections + // kill all GTV connections LIST_FOR_EACH_SAFE( gtv_t, gtv, gtv_next, &mvd_gtv_list, entry ) { gtv->destroy( gtv ); } - // kill all channels + // kill all MVD channels (including demo GTVs) LIST_FOR_EACH_SAFE( mvd_t, mvd, mvd_next, &mvd_channel_list, entry ) { + if( mvd->gtv ) { + mvd->gtv->mvd = NULL; // don't double destroy + mvd->gtv->destroy( mvd->gtv ); + } MVD_Free( mvd ); } -- cgit v1.2.3