mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-22 23:05:36 +08:00
[AFV] Ref T730, allow to disconnect even if socket is down
This commit is contained in:
@@ -222,16 +222,17 @@ namespace BlackCore
|
||||
void CFSDClient::disconnectFromServer()
|
||||
{
|
||||
this->stopPositionTimers();
|
||||
if (!m_socket.isOpen()) { return; }
|
||||
|
||||
updateConnectionStatus(CConnectionStatus::Disconnecting);
|
||||
|
||||
if (m_loginMode.isPilot()) { sendDeletePilot(); }
|
||||
else if (m_loginMode.isObserver()) { sendDeleteAtc(); }
|
||||
this->updateConnectionStatus(CConnectionStatus::Disconnecting);
|
||||
|
||||
// allow also to close if broken
|
||||
if (!m_socket.isOpen())
|
||||
{
|
||||
if (m_loginMode.isPilot()) { sendDeletePilot(); }
|
||||
else if (m_loginMode.isObserver()) { sendDeleteAtc(); }
|
||||
}
|
||||
m_socket.close();
|
||||
|
||||
updateConnectionStatus(CConnectionStatus::Disconnected);
|
||||
this->updateConnectionStatus(CConnectionStatus::Disconnected);
|
||||
this->clearState();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user