2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-03-31 22:59:06 +03:00

Fix setting delay to zero when connection active breaking server logic.

This commit is contained in:
Garey Akhmetshin 2021-02-15 16:06:47 +05:00
parent 0178d74f42
commit da9a5b05ab

View File

@ -360,15 +360,12 @@ void Proxy::RunFrame(double time)
m_System->RemoveModule((ISystemModule*)oldWorld); m_System->RemoveModule((ISystemModule*)oldWorld);
} }
else else
{
#endif #endif
{
if (m_Server->IsConnected()) { if (m_Server->IsConnected()) {
m_Server->Reconnect(); m_Server->Reconnect();
} }
#ifdef HLTV_FIXES
} }
#endif
m_IsReconnectRequested = true; m_IsReconnectRequested = true;
} }
} }
@ -2559,11 +2556,17 @@ void Proxy::SetDelay(float seconds)
{ {
m_ClientDelay = 0; m_ClientDelay = 0;
m_World->SetBufferSize(10); m_World->SetBufferSize(10);
#ifdef HLTV_FIXES
m_Server->SetDelayReconnect(false);
#endif
} }
else else
{ {
m_World->SetBufferSize(seconds + seconds); m_World->SetBufferSize(seconds + seconds);
m_ClientWorldTime = m_World->GetTime() - m_ClientDelay; m_ClientWorldTime = m_World->GetTime() - m_ClientDelay;
#ifdef HLTV_FIXES
m_Server->SetDelayReconnect(true);
#endif
} }
m_Server->SetUserInfo("hdelay", COM_VarArgs("%u", (int)m_ClientDelay)); m_Server->SetUserInfo("hdelay", COM_VarArgs("%u", (int)m_ClientDelay));