diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/mvd_client.c | 2 | ||||
-rw-r--r-- | source/mvd_game.c | 2 | ||||
-rw-r--r-- | source/mvd_local.h | 1 | ||||
-rw-r--r-- | source/mvd_parse.c | 9 | ||||
-rw-r--r-- | source/protocol.h | 2 | ||||
-rw-r--r-- | source/q_msg.c | 6 | ||||
-rw-r--r-- | source/q_shared.c | 2 | ||||
-rw-r--r-- | source/sv_http.c | 6 | ||||
-rw-r--r-- | source/sv_main.c | 5 |
9 files changed, 25 insertions, 10 deletions
diff --git a/source/mvd_client.c b/source/mvd_client.c index a23671d..964a511 100644 --- a/source/mvd_client.c +++ b/source/mvd_client.c @@ -292,7 +292,7 @@ void MVD_RejectStream( const char *error, const char *reason ) { SV_HttpPrintf( "HTTP/1.0 %s\r\n" - "Content-Type: text/html\r\n" + "Content-Type: text/html; charset=us-ascii\r\n" "Cache-Control: no-cache\r\n" "\r\n", error ); diff --git a/source/mvd_game.c b/source/mvd_game.c index 2b6245c..dbda980 100644 --- a/source/mvd_game.c +++ b/source/mvd_game.c @@ -616,7 +616,7 @@ static void MVD_GameInit( void ) { gameFeatures = GAME_FEATURE_CLIENTNUM|GAME_FEATURE_PROPERINUSE; } -static void MVD_GameShutdown( void ) { +void MVD_GameShutdown( void ) { mvd_t *mvd, *next; Com_Printf( "----- MVD_GameShutdown -----\n" ); diff --git a/source/mvd_local.h b/source/mvd_local.h index 2f493a6..3bb3d1b 100644 --- a/source/mvd_local.h +++ b/source/mvd_local.h @@ -203,4 +203,5 @@ extern game_export_t mvd_ge; void MVD_UpdateClient( udpClient_t *client ); void MVD_SwitchChannel( udpClient_t *client, mvd_t *mvd ); +void MVD_GameShutdown( void ); diff --git a/source/mvd_parse.c b/source/mvd_parse.c index ebf3e9a..dd24697 100644 --- a/source/mvd_parse.c +++ b/source/mvd_parse.c @@ -865,7 +865,14 @@ static void MVD_ParseServerData( mvd_t *mvd ) { strcpy( mvd->mapname, string + 5 ); // skip "maps/" mvd->mapname[length - 9] = 0; // cut off ".bsp" - // load the world model (we are only interesed in visibility info) + // check if map exists so CM_LoadMap does not kill + // entire server if it does not + if( FS_LoadFile( string, NULL ) == -1 ) { + MVD_Destroy( mvd, "Couldn't find map: %s", string ); + } + + // load the world model (we are only interesed in + // visibility info, do not load brushes and such) Com_Printf( "Loading %s...\n", string ); CM_LoadMap( &mvd->cm, string, CM_LOAD_VISONLY, &checksum ); diff --git a/source/protocol.h b/source/protocol.h index b69401b..f379df5 100644 --- a/source/protocol.h +++ b/source/protocol.h @@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define PROTOCOL_VERSION_MVD 37 // not used for UDP connections #define PROTOCOL_VERSION_R1Q2_MINOR 1903 // r1q2-b6377 -#define PROTOCOL_VERSION_Q2PRO_MINOR 1010 // q2pro r158 +#define PROTOCOL_VERSION_Q2PRO_MINOR 1011 // q2pro r161 #define PROTOCOL_VERSION_MVD_MINOR 2008 // q2pro r160 //========================================= diff --git a/source/q_msg.c b/source/q_msg.c index a395ee6..c977f25 100644 --- a/source/q_msg.c +++ b/source/q_msg.c @@ -396,7 +396,8 @@ int MSG_WriteDeltaUsercmd_Enhanced( const usercmd_t *from, const usercmd_t *cmd } if( bits & CM_BUTTONS ) { - MSG_WriteBits( cmd->buttons, 8 ); + int buttons = ( cmd->buttons & 3 ) | ( cmd->buttons >> 5 ); + MSG_WriteBits( buttons, 3 ); } if( bits & CM_IMPULSE ) { MSG_WriteBits( cmd->msec, 8 ); @@ -1721,7 +1722,8 @@ void MSG_ReadDeltaUsercmd_Enhanced( const usercmd_t *from, usercmd_t *to ) { // read buttons if( bits & CM_BUTTONS ) { - to->buttons = MSG_ReadBits( 8 ); + int buttons = MSG_ReadBits( 3 ); + to->buttons = ( buttons & 3 ) | ( ( buttons & 4 ) << 5 ); } // read time to run command diff --git a/source/q_shared.c b/source/q_shared.c index 8e12ecf..3077913 100644 --- a/source/q_shared.c +++ b/source/q_shared.c @@ -835,7 +835,7 @@ void COM_DefaultExtension( char *path, const char *extension, int pathSize ) { } void COM_AppendExtension( char *path, const char *extension, int pathSize ) { - if( !Q_stricmp( COM_FileExtension( path ), extension ) ) { + if( Q_stricmp( COM_FileExtension( path ), extension ) ) { Q_strcat( path, pathSize, extension ); } } diff --git a/source/sv_http.c b/source/sv_http.c index a7f566d..f05b79e 100644 --- a/source/sv_http.c +++ b/source/sv_http.c @@ -27,7 +27,7 @@ tcpClient_t *http_client; void SV_HttpHeader( const char *title ) { SV_HttpPrintf( - "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">" + "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 3.2//EN\">" "<html><head><title>%s</title></head><body>", title ); } @@ -48,7 +48,7 @@ void SV_HttpReject( const char *error, const char *reason ) { SV_HttpPrintf( "%s", http_header ); } if( reason && http_client->method != HTTP_METHOD_HEAD ) { - SV_HttpPrintf( "Content-Type: text/html\r\n" ); + SV_HttpPrintf( "Content-Type: text/html; charset=us-ascii\r\n" ); } SV_HttpPrintf( "\r\n" ); @@ -84,7 +84,7 @@ static void uri_status( const char *uri ) { } SV_HttpPrintf( - "Content-Type: text/html\r\n" + "Content-Type: text/html; charset=us-ascii\r\n" // "Content-Encoding: deflate\r\n" "\r\n" ); diff --git a/source/sv_main.c b/source/sv_main.c index b49453c..e85757a 100644 --- a/source/sv_main.c +++ b/source/sv_main.c @@ -1303,6 +1303,10 @@ static qboolean SV_CheckPaused( void ) { client_t *client; sv_paused->integer = 0; + if( sv.state == ss_broadcast ) { + cl_paused->integer = 0; + return qfalse; // never pause in MVD client mode + } if( cl_paused->integer ) { FOR_EACH_CLIENT( client ) { if( client->state != cs_spawned ) { @@ -1778,6 +1782,7 @@ void SV_Shutdown( const char *finalmsg, killtype_t type ) { Cvar_Set( "sv_paused", "0" ); if( !svs.initialized ) { + MVD_GameShutdown(); // make sure MVD client is down return; } |