summaryrefslogtreecommitdiff
path: root/source/mvd_client.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2009-01-10 22:10:03 +0000
committerAndrey Nazarov <skuller@skuller.net>2009-01-10 22:10:03 +0000
commit9b015c1322a3e8be37c476d1be5f4ef68d2b8b9c (patch)
tree9fb9a7dfd9b5154ecf5d871906ec7a548aab077e /source/mvd_client.c
parent7ee7c25e791d374ef960bbfc084b23c579f8a2ed (diff)
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.
Diffstat (limited to 'source/mvd_client.c')
-rw-r--r--source/mvd_client.c32
1 files changed, 18 insertions, 14 deletions
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 );
}