mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-30 11:55:35 +08:00
refs #324 Remove timeout implementation from MSFS plugins
This commit is contained in:
@@ -94,12 +94,6 @@ namespace BlackSimPlugin
|
||||
|
||||
QMutexLocker locker(&m_mutexInterpolator);
|
||||
|
||||
if (m_interpolator.getTimeOfLastReceivedSituation().secsTo(QDateTime::currentDateTimeUtc()) > 15)
|
||||
{
|
||||
emit clientTimedOut(m_callsign);
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_interpolator.hasEnoughAircraftSituations())
|
||||
{
|
||||
CAircraftSituation situation = m_interpolator.getCurrentSituation();
|
||||
|
||||
@@ -65,9 +65,6 @@ namespace BlackSimPlugin
|
||||
|
||||
signals:
|
||||
|
||||
//! Client timed out
|
||||
void clientTimedOut(const QString &callsign);
|
||||
|
||||
//! Client status changed
|
||||
void statusChanged(const QString &callsign, BlackSimPlugin::Fs9::CFs9Client::ClientStatus);
|
||||
|
||||
|
||||
@@ -126,7 +126,6 @@ namespace BlackSimPlugin
|
||||
client->moveToThread(clientThread);
|
||||
|
||||
connect(clientThread, &QThread::started, client, &CFs9Client::init);
|
||||
connect(client, &CFs9Client::clientTimedOut, this, &CSimulatorFs9::ps_removeAircraft);
|
||||
connect(client, &CFs9Client::statusChanged, this, &CSimulatorFs9::ps_changeClientStatus);
|
||||
m_fs9ClientThreads.insert(client, clientThread);
|
||||
m_hashFs9Clients.insert(callsign, client);
|
||||
@@ -155,7 +154,12 @@ namespace BlackSimPlugin
|
||||
|
||||
void CSimulatorFs9::removeRemoteAircraft(const CCallsign &callsign)
|
||||
{
|
||||
ps_removeAircraft(callsign.toQString());
|
||||
if(!m_hashFs9Clients.contains(callsign)) return;
|
||||
|
||||
CFs9Client *fs9Client = m_hashFs9Clients.value(callsign);
|
||||
|
||||
// Send an async disconnect signal. When finished we will clean up
|
||||
QMetaObject::invokeMethod(fs9Client, "disconnectFrom");
|
||||
}
|
||||
|
||||
bool CSimulatorFs9::updateOwnSimulatorCockpit(const CAircraft &ownAircraft)
|
||||
@@ -342,16 +346,6 @@ namespace BlackSimPlugin
|
||||
}
|
||||
}
|
||||
|
||||
void CSimulatorFs9::ps_removeAircraft(const QString &callsign)
|
||||
{
|
||||
if(!m_hashFs9Clients.contains(callsign)) return;
|
||||
|
||||
CFs9Client *fs9Client = m_hashFs9Clients.value(callsign);
|
||||
|
||||
// Send an async disconnect signal. When finished we will clean up
|
||||
QMetaObject::invokeMethod(fs9Client, "disconnectFrom");
|
||||
}
|
||||
|
||||
void CSimulatorFs9::updateOwnAircraftFromSim(const CAircraft &ownAircraft)
|
||||
{
|
||||
m_ownAircraft.setCom1System(ownAircraft.getCom1System());
|
||||
|
||||
@@ -140,9 +140,6 @@ namespace BlackSimPlugin
|
||||
|
||||
void ps_changeClientStatus(const QString &callsign, BlackSimPlugin::Fs9::CFs9Client::ClientStatus status);
|
||||
|
||||
//! Remove client by callsign QString
|
||||
void ps_removeAircraft(const QString &callsign);
|
||||
|
||||
private:
|
||||
|
||||
//! Called when data about our own aircraft are received
|
||||
|
||||
@@ -482,12 +482,6 @@ namespace BlackSimPlugin
|
||||
{
|
||||
foreach(CSimConnectObject simObj, m_simConnectObjects)
|
||||
{
|
||||
if (simObj.getInterpolator()->getTimeOfLastReceivedSituation().secsTo(QDateTime::currentDateTimeUtc()) > 15)
|
||||
{
|
||||
removeRemoteAircraft(simObj);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (simObj.getInterpolator()->hasEnoughAircraftSituations())
|
||||
{
|
||||
SIMCONNECT_DATA_INITPOSITION position;
|
||||
|
||||
Reference in New Issue
Block a user