mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
refs #395, improvements for snapshot / restricted aircraft handling
* fixed isCurrentThreadCreatingThread and renamed to isCurrentThreadObjectThread (this check was never working), added 2 more thread checks * changed remove aircraft function to return number of returned aircraft (like with the containers this allows to avoid unnecessary signals) * removed unused function ps_recalculateRenderedAircraft() / SimulatorCommon * using Queued airspaceAircraftSnapshot signal for binding (functor connect does not provide connection type) * extened ASSERTs to check threads * simulator: initial situation function with return value (success?) * simulator: avoid unneccessary copy and provide correct rendered flag in add aircraft function
This commit is contained in:
@@ -133,13 +133,17 @@ namespace BlackSimPlugin
|
||||
return true;
|
||||
}
|
||||
|
||||
void CSimulatorFs9::physicallyRemoveAllRemoteAircraft()
|
||||
int CSimulatorFs9::physicallyRemoveAllRemoteAircraft()
|
||||
{
|
||||
if (this->m_hashFs9Clients.isEmpty()) { return 0; }
|
||||
QList<CCallsign> callsigns(this->m_hashFs9Clients.keys());
|
||||
int r = 0;
|
||||
for (const CCallsign &cs : callsigns)
|
||||
{
|
||||
physicallyRemoveRemoteAircraft(cs);
|
||||
if (physicallyRemoveRemoteAircraft(cs)) { r++; }
|
||||
}
|
||||
return r;
|
||||
|
||||
}
|
||||
|
||||
CCallsignSet CSimulatorFs9::physicallyRenderedAircraft() const
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace BlackSimPlugin
|
||||
virtual bool physicallyRemoveRemoteAircraft(const BlackMisc::Aviation::CCallsign &callsign) override;
|
||||
|
||||
//! \copydoc BlackCore::ISimulator::physicallyRemoveAllRemoteAircraft
|
||||
virtual void physicallyRemoveAllRemoteAircraft() override;
|
||||
virtual int physicallyRemoveAllRemoteAircraft() override;
|
||||
|
||||
//! \copydoc ISimulator::physicallyRenderedAircraft
|
||||
virtual BlackMisc::Aviation::CCallsignSet physicallyRenderedAircraft() const override;
|
||||
|
||||
Reference in New Issue
Block a user