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 21837 for ps


Ignore:
Timestamp:
06/05/18 16:52:41 (7 years ago)
Author:
elexis
Message:

Fix network FSM errors when a client closes the game during the loading screen or rejoin synchronization stage, fixes #4594, refs 3199.

Fix comments claiming to ensure reliability when in reality there is only a small likelihood of the message being received.

Broken by rP14732 / refs #2420 which was a preparation for rP14772 / refs #2373, which hence didn't actually work and was circumvented by rP15106 without clarification.
Might have caused #3643.
Differential Revision: https://code.wildfiregames.com/D1557
Reviewed By: Imarok

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

Legend:

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

    r21832 r21837  
    182182void CNetClient::DestroyConnection()
    183183{
    184     // Send network messages from the current frame before connection is destroyed.
     184    // Attempt to send network messages from the current frame before connection is destroyed.
    185185    if (m_ClientTurnManager)
    186186    {
    187         m_ClientTurnManager->OnDestroyConnection(); // End sending of commands for scheduled turn.
    188         Flush(); // Make sure the messages are sent.
     187        m_ClientTurnManager->OnDestroyConnection();
     188        Flush();
    189189    }
    190190    SAFE_DELETE(m_Session);
  • ps/trunk/source/network/NetClientTurnManager.cpp

    r21830 r21837  
    9696void CNetClientTurnManager::OnDestroyConnection()
    9797{
    98     NotifyFinishedOwnCommands(m_CurrentTurn + COMMAND_DELAY);
     98    // Attempt to flush messages before leaving.
     99    // Notice the sending is not reliable and rarely makes it to the Server.
     100    if (m_NetClient.GetCurrState() == NCS_INGAME)
     101        NotifyFinishedOwnCommands(m_CurrentTurn + COMMAND_DELAY);
    99102}
    100103
Note: See TracChangeset for help on using the changeset viewer.