mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-05 19:45:33 +03:00
Merge pull request #174 from WPMGPRoSToTeMa/fastsprayupload
Added sv_delayed_spray_upload cvar (#173)
This commit is contained in:
commit
42b7f12f27
@ -541,6 +541,7 @@ extern cvar_t sv_version;
|
|||||||
#ifdef REHLDS_FIXES
|
#ifdef REHLDS_FIXES
|
||||||
extern cvar_t sv_echo_unknown_cmd;
|
extern cvar_t sv_echo_unknown_cmd;
|
||||||
extern cvar_t sv_auto_precache_sounds_in_models;
|
extern cvar_t sv_auto_precache_sounds_in_models;
|
||||||
|
extern cvar_t sv_delayed_spray_upload;
|
||||||
#endif
|
#endif
|
||||||
extern int sv_playermodel;
|
extern int sv_playermodel;
|
||||||
|
|
||||||
|
@ -201,6 +201,7 @@ cvar_t sv_allow_dlfile = { "sv_allow_dlfile", "1", 0, 0.0f, NULL };
|
|||||||
cvar_t sv_version = { "sv_version", "", FCVAR_SERVER, 0.0f, NULL };
|
cvar_t sv_version = { "sv_version", "", FCVAR_SERVER, 0.0f, NULL };
|
||||||
cvar_t sv_echo_unknown_cmd = { "sv_echo_unknown_cmd", "0", 0, 0.0f, NULL };
|
cvar_t sv_echo_unknown_cmd = { "sv_echo_unknown_cmd", "0", 0, 0.0f, NULL };
|
||||||
cvar_t sv_auto_precache_sounds_in_models = { "sv_auto_precache_sounds_in_models", "0", 0, 0.0f, nullptr };
|
cvar_t sv_auto_precache_sounds_in_models = { "sv_auto_precache_sounds_in_models", "0", 0, 0.0f, nullptr };
|
||||||
|
cvar_t sv_delayed_spray_upload = { "sv_delayed_spray_upload", "0", 0, 0.0f, nullptr };
|
||||||
#else
|
#else
|
||||||
cvar_t sv_version = {"sv_version", "", 0, 0.0f, NULL};
|
cvar_t sv_version = {"sv_version", "", 0, 0.0f, NULL};
|
||||||
#endif
|
#endif
|
||||||
@ -7758,6 +7759,7 @@ void SV_Init(void)
|
|||||||
Cvar_RegisterVariable(&sv_force_ent_intersection);
|
Cvar_RegisterVariable(&sv_force_ent_intersection);
|
||||||
Cvar_RegisterVariable(&sv_echo_unknown_cmd);
|
Cvar_RegisterVariable(&sv_echo_unknown_cmd);
|
||||||
Cvar_RegisterVariable(&sv_auto_precache_sounds_in_models);
|
Cvar_RegisterVariable(&sv_auto_precache_sounds_in_models);
|
||||||
|
Cvar_RegisterVariable(&sv_delayed_spray_upload);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < MAX_MODELS; i++)
|
for (int i = 0; i < MAX_MODELS; i++)
|
||||||
|
@ -76,8 +76,16 @@ qboolean SV_CheckFile(sizebuf_t *msg, char *filename)
|
|||||||
|
|
||||||
#endif // REHLDS_FIXES
|
#endif // REHLDS_FIXES
|
||||||
|
|
||||||
MSG_WriteByte(msg, svc_stufftext);
|
#ifdef REHLDS_FIXES
|
||||||
MSG_WriteString(msg, va("upload \"!MD5%s\"\n", MD5_Print(p.rgucMD5_hash)));
|
// While client is connecting he always send too small fragments (128 bytes)
|
||||||
|
// But if client is fully connected he send fragments with cl_dlmax size
|
||||||
|
// So, send upload in SV_SendEnts_f
|
||||||
|
if (!sv_delayed_spray_upload.value)
|
||||||
|
#endif // REHLDS_FIXES
|
||||||
|
{
|
||||||
|
MSG_WriteByte(msg, svc_stufftext);
|
||||||
|
MSG_WriteString(msg, va("upload \"!MD5%s\"\n", MD5_Print(p.rgucMD5_hash)));
|
||||||
|
}
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1824,7 +1824,26 @@ void SV_SendEnts_f(void)
|
|||||||
if (host_client->active && host_client->spawned)
|
if (host_client->active && host_client->spawned)
|
||||||
{
|
{
|
||||||
if (host_client->connected)
|
if (host_client->connected)
|
||||||
|
{
|
||||||
host_client->fully_connected = 1;
|
host_client->fully_connected = 1;
|
||||||
|
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
// See SV_CheckFile function
|
||||||
|
if (sv_delayed_spray_upload.value)
|
||||||
|
{
|
||||||
|
resource_t *res = host_client->resourcesneeded.pNext;
|
||||||
|
if (res != &host_client->resourcesneeded)
|
||||||
|
{
|
||||||
|
// TODO: all this is already checked earlier
|
||||||
|
if (res->ucFlags & RES_WASMISSING && res->type == t_decal && res->ucFlags & RES_CUSTOM)
|
||||||
|
{
|
||||||
|
MSG_WriteByte(&host_client->netchan.message, svc_stufftext);
|
||||||
|
MSG_WriteString(&host_client->netchan.message, va("upload !MD5%s\n", MD5_Print(res->rgucMD5_hash)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // REHLDS_FIXES
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user