X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=cl_parse.c;h=2ca989333a161801a1d283fad4cefce6d1384923;hb=fdc2140da5dc11b2970915454a4202968bed4381;hp=2a4b29e2c95a8a5d7ca949d192b266b83cb014da;hpb=2b065b3efdf9a5aced95aa93aed4db1caf8191bb;p=xonotic%2Fdarkplaces.git diff --git a/cl_parse.c b/cl_parse.c index 2a4b29e2..2ca98933 100644 --- a/cl_parse.c +++ b/cl_parse.c @@ -35,7 +35,7 @@ const char *svc_strings[128] = { "svc_bad", "svc_nop", - "svc_disconnect", + "svc_disconnect", // (DP8) [string] null terminated parting message "svc_updatestat", "svc_version", // [int] server version "svc_setview", // [short] entity number @@ -184,6 +184,8 @@ cvar_t cl_readpicture_force = {CF_CLIENT, "cl_readpicture_force", "0", "when ena #define RIC_GUNSHOTQUAD 2 cvar_t cl_sound_ric_gunshot = {CF_CLIENT, "cl_sound_ric_gunshot", "0", "specifies if and when the related cl_sound_ric and cl_sound_tink sounds apply to TE_GUNSHOT/TE_GUNSHOTQUAD, 0 = no sound, 1 = TE_GUNSHOT, 2 = TE_GUNSHOTQUAD, 3 = TE_GUNSHOT and TE_GUNSHOTQUAD"}; cvar_t cl_sound_r_exp3 = {CF_CLIENT, "cl_sound_r_exp3", "weapons/r_exp3.wav", "sound to play during TE_EXPLOSION and related effects (empty cvar disables sound)"}; +cvar_t snd_cdautopause = {CF_CLIENT | CF_ARCHIVE, "snd_cdautopause", "1", "pause the CD track while the game is paused"}; + cvar_t cl_serverextension_download = {CF_CLIENT, "cl_serverextension_download", "0", "indicates whether the server supports the download command"}; cvar_t cl_joinbeforedownloadsfinish = {CF_CLIENT | CF_ARCHIVE, "cl_joinbeforedownloadsfinish", "1", "if non-zero the game will begin after the map is loaded before other downloads finish"}; cvar_t cl_nettimesyncfactor = {CF_CLIENT | CF_ARCHIVE, "cl_nettimesyncfactor", "0", "rate at which client time adapts to match server time, 1 = instantly, 0.125 = slowly, 0 = not at all (only applied in bound modes 0, 1, 2, 3)"}; @@ -331,10 +333,7 @@ void CL_KeepaliveMessage (qbool readmessages) if(cls.state != ca_dedicated) { if(countdownupdate <= 0) // check if time stepped backwards - { - SCR_UpdateLoadingScreenIfShown(); countdownupdate = 2; - } } } @@ -1688,8 +1687,11 @@ static void CL_ParseServerInfo (void) { SCR_BeginLoadingPlaque(false); S_StopAllSounds(); + // prevent dlcache assets from the previous map from interfering with this one + FS_UnloadPacks_dlcache(); // free q3 shaders so that any newly downloaded shaders will be active - Mod_FreeQ3Shaders(); + // bones_was_here: we free the q3 shaders later in CL_SignonReply + //Mod_FreeQ3Shaders(); } // check memory integrity @@ -3391,8 +3393,10 @@ static void CL_NetworkTimeReceived(double newtime) // update the csqc's server timestamps, critical for proper sync CSQC_UpdateNetworkTimes(cl.mtime[0], cl.mtime[1]); +#ifdef USEODE if (cl.mtime[0] > cl.mtime[1]) World_Physics_Frame(&cl.world, cl.mtime[0] - cl.mtime[1], cl.movevars_gravity); +#endif // only lerp entities that also get an update in this frame, when lerp excess is used if(cl_lerpexcess.value > 0) @@ -3529,7 +3533,7 @@ void CL_ParseServerMessage(void) if (cls.demonum != -1) CL_NextDemo(); else - CL_Disconnect(); + CL_DisconnectEx(true, "Server disconnected"); break; case qw_svc_print: @@ -3791,9 +3795,9 @@ void CL_ParseServerMessage(void) case qw_svc_setpause: cl.paused = MSG_ReadByte(&cl_message) != 0; - if (cl.paused) + if (cl.paused && snd_cdautopause.integer) CDAudio_Pause (); - else + else if (bgmvolume.value > 0.0f) CDAudio_Resume (); S_PauseGameSounds (cl.paused); break; @@ -3909,7 +3913,7 @@ void CL_ParseServerMessage(void) if (cls.demonum != -1) CL_NextDemo(); else - CL_Disconnect(); + CL_DisconnectEx(true, cls.protocol == PROTOCOL_DARKPLACES8 ? MSG_ReadString(&cl_message, cl_readstring, sizeof(cl_readstring)) : "Server disconnected"); break; case svc_print: @@ -4118,9 +4122,9 @@ void CL_ParseServerMessage(void) case svc_setpause: cl.paused = MSG_ReadByte(&cl_message) != 0; - if (cl.paused) + if (cl.paused && snd_cdautopause.integer) CDAudio_Pause (); - else + else if (bgmvolume.value > 0.0f) CDAudio_Resume (); S_PauseGameSounds (cl.paused); break; @@ -4322,6 +4326,7 @@ void CL_Parse_Init(void) Cvar_RegisterVariable(&cl_sound_ric3); Cvar_RegisterVariable(&cl_sound_ric_gunshot); Cvar_RegisterVariable(&cl_sound_r_exp3); + Cvar_RegisterVariable(&snd_cdautopause); Cvar_RegisterVariable(&cl_joinbeforedownloadsfinish);