This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changeset 21832 for ps


Ignore:
Timestamp:
06/01/18 19:35:00 (7 years ago)
Author:
elexis
Message:

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

Location:
ps/trunk/source/network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/network/NetClient.cpp

    r21520 r21832  
    776776    JSAutoRequest rq(cx);
    777777
    778     if (client->GetCurrState() == NCS_LOADING)
    779         return true;
    780 
    781778    CClientTimeoutMessage* message = (CClientTimeoutMessage*)event->GetParamRef();
    782779    JS::RootedValue msg(cx);
     
    799796    JSContext* cx = client->GetScriptInterface().GetContext();
    800797    JSAutoRequest rq(cx);
    801 
    802     if (client->GetCurrState() == NCS_LOADING)
    803         return true;
    804798
    805799    CClientPerformanceMessage* message = (CClientPerformanceMessage*)event->GetParamRef();
  • ps/trunk/source/network/NetServer.cpp

    r21534 r21832  
    554554void CNetServerWorker::CheckClientConnections()
    555555{
    556     if (m_State == SERVER_STATE_LOADING)
    557         return;
    558 
    559556    // Send messages at most once per second
    560557    std::time_t now = std::time(nullptr);
     
    591588
    592589        // Send to all clients except the affected one
    593         // (since that will show the locally triggered warning instead)
     590        // (since that will show the locally triggered warning instead).
     591        // Also send it to clients that finished the loading screen while
     592        // the game is still waiting for other clients to finish the loading screen.
    594593        if (message)
    595594            for (size_t j = 0; j < m_Sessions.size(); ++j)
    596595            {
    597596                if (i != j && (
    598                     m_Sessions[j]->GetCurrState() == NSS_PREGAME ||
     597                    (m_Sessions[j]->GetCurrState() == NSS_PREGAME && m_State == SERVER_STATE_PREGAME) ||
    599598                    m_Sessions[j]->GetCurrState() == NSS_INGAME))
    600599                {
Note: See TracChangeset for help on using the changeset viewer.