Report network timeouts and lag warnings to clients that finished the loading screen but are waiting for other clients to finish it.
This allows the host to distinguish clients that are just slower than everyone else with the loading screen from clients who have most likely disconnected or crashed already and may be considered to be kicked. This is especially important for D1513, because that increases the timeout tolerance to a minute or longer. Fixes #5193 Differential Revision: https://code.wildfiregames.com/D1546 Reviewed By: causative This was SVN commit r21832.
This commit is contained in:
parent
4fbe399e07
commit
06e2e77349
@ -775,9 +775,6 @@ bool CNetClient::OnClientTimeout(void *context, CFsmEvent* event)
|
||||
JSContext* cx = client->GetScriptInterface().GetContext();
|
||||
JSAutoRequest rq(cx);
|
||||
|
||||
if (client->GetCurrState() == NCS_LOADING)
|
||||
return true;
|
||||
|
||||
CClientTimeoutMessage* message = (CClientTimeoutMessage*)event->GetParamRef();
|
||||
JS::RootedValue msg(cx);
|
||||
|
||||
@ -799,9 +796,6 @@ bool CNetClient::OnClientPerformance(void *context, CFsmEvent* event)
|
||||
JSContext* cx = client->GetScriptInterface().GetContext();
|
||||
JSAutoRequest rq(cx);
|
||||
|
||||
if (client->GetCurrState() == NCS_LOADING)
|
||||
return true;
|
||||
|
||||
CClientPerformanceMessage* message = (CClientPerformanceMessage*)event->GetParamRef();
|
||||
|
||||
// Display warnings for other clients with bad ping
|
||||
|
@ -553,9 +553,6 @@ bool CNetServerWorker::RunStep()
|
||||
|
||||
void CNetServerWorker::CheckClientConnections()
|
||||
{
|
||||
if (m_State == SERVER_STATE_LOADING)
|
||||
return;
|
||||
|
||||
// Send messages at most once per second
|
||||
std::time_t now = std::time(nullptr);
|
||||
if (now <= m_LastConnectionCheck)
|
||||
@ -590,12 +587,14 @@ void CNetServerWorker::CheckClientConnections()
|
||||
}
|
||||
|
||||
// Send to all clients except the affected one
|
||||
// (since that will show the locally triggered warning instead)
|
||||
// (since that will show the locally triggered warning instead).
|
||||
// Also send it to clients that finished the loading screen while
|
||||
// the game is still waiting for other clients to finish the loading screen.
|
||||
if (message)
|
||||
for (size_t j = 0; j < m_Sessions.size(); ++j)
|
||||
{
|
||||
if (i != j && (
|
||||
m_Sessions[j]->GetCurrState() == NSS_PREGAME ||
|
||||
(m_Sessions[j]->GetCurrState() == NSS_PREGAME && m_State == SERVER_STATE_PREGAME) ||
|
||||
m_Sessions[j]->GetCurrState() == NSS_INGAME))
|
||||
{
|
||||
m_Sessions[j]->SendMessage(message);
|
||||
|
Loading…
Reference in New Issue
Block a user