2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-01 01:25:38 +03:00

Merge pull request #39 from dreamstalker/_38

Fixed #38
This commit is contained in:
dreamstalker 2015-06-23 20:22:31 +04:00
commit e4134d144a
2 changed files with 21 additions and 1 deletions

View File

@ -4619,6 +4619,12 @@ void SV_UpdateToReliableMessages(void)
SZ_Clear(&g_psv.spectator);
}
//Fix for the "server failed to transmit file 'AY&SY..." bug
//https://github.com/dreamstalker/rehlds/issues/38
#ifdef REHLDS_FIXES
bool svReliableCompressed = false;
#endif
// Send broadcast data
for (i = 0; i < g_psvs.maxclients; i++)
{
@ -4626,6 +4632,19 @@ void SV_UpdateToReliableMessages(void)
if (!client->fakeclient && client->active)
{
//Fix for the "server failed to transmit file 'AY&SY..." bug
//https://github.com/dreamstalker/rehlds/issues/38
#ifdef REHLDS_FIXES
if (!svReliableCompressed && g_psv.reliable_datagram.cursize + client->netchan.message.cursize < client->netchan.message.maxsize)
{
SZ_Write(&client->netchan.message, g_psv.reliable_datagram.data, g_psv.reliable_datagram.cursize);
}
else
{
Netchan_CreateFragments(TRUE, &client->netchan, &g_psv.reliable_datagram);
svReliableCompressed = true;
}
#else
if (g_psv.reliable_datagram.cursize + client->netchan.message.cursize < client->netchan.message.maxsize)
{
SZ_Write(&client->netchan.message, g_psv.reliable_datagram.data, g_psv.reliable_datagram.cursize);
@ -4634,6 +4653,7 @@ void SV_UpdateToReliableMessages(void)
{
Netchan_CreateFragments(TRUE, &client->netchan, &g_psv.reliable_datagram);
}
#endif
if (g_psv.datagram.cursize + client->datagram.cursize < client->datagram.maxsize)
{

View File

@ -1055,7 +1055,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>REHLDS_FLIGHT_REC;REHLDS_OPT_PEDANTIC;REHLDS_SELF;REHLDS_CHECKS;USE_BREAKPAD_HANDLER;DEDICATED;SWDS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>REHLDS_FIXES;REHLDS_FLIGHT_REC;REHLDS_OPT_PEDANTIC;REHLDS_SELF;REHLDS_CHECKS;USE_BREAKPAD_HANDLER;DEDICATED;SWDS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalOptions>/arch:IA32 %(AdditionalOptions)</AdditionalOptions>
<PrecompiledHeader>Use</PrecompiledHeader>