mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-20 12:35:43 +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()
|
void CFSDClient::disconnectFromServer()
|
||||||
{
|
{
|
||||||
this->stopPositionTimers();
|
this->stopPositionTimers();
|
||||||
if (!m_socket.isOpen()) { return; }
|
this->updateConnectionStatus(CConnectionStatus::Disconnecting);
|
||||||
|
|
||||||
updateConnectionStatus(CConnectionStatus::Disconnecting);
|
|
||||||
|
|
||||||
|
// allow also to close if broken
|
||||||
|
if (!m_socket.isOpen())
|
||||||
|
{
|
||||||
if (m_loginMode.isPilot()) { sendDeletePilot(); }
|
if (m_loginMode.isPilot()) { sendDeletePilot(); }
|
||||||
else if (m_loginMode.isObserver()) { sendDeleteAtc(); }
|
else if (m_loginMode.isObserver()) { sendDeleteAtc(); }
|
||||||
|
}
|
||||||
m_socket.close();
|
m_socket.close();
|
||||||
|
|
||||||
updateConnectionStatus(CConnectionStatus::Disconnected);
|
this->updateConnectionStatus(CConnectionStatus::Disconnected);
|
||||||
this->clearState();
|
this->clearState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user