mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 12:55:33 +08:00
Query real names for ATC stations again,
so we learn about changed "persons" (i.e. real name) see https://discordapp.com/channels/539048679160676382/632279098244333581/655740912336633868
This commit is contained in:
committed by
Mat Sutcliffe
parent
524a9b3793
commit
b3ad7ccdd9
@@ -115,9 +115,11 @@ namespace BlackCore
|
||||
connect(m_analyzer, &CAirspaceAnalyzer::timeoutAircraft, this, &CAirspaceMonitor::onPilotDisconnected, Qt::QueuedConnection);
|
||||
connect(m_analyzer, &CAirspaceAnalyzer::timeoutAtc, this, &CAirspaceMonitor::onAtcControllerDisconnected, Qt::QueuedConnection);
|
||||
|
||||
// timer
|
||||
connect(&m_processTimer, &QTimer::timeout, this, &CAirspaceMonitor::process);
|
||||
m_processTimer.start(ProcessIntervalMs);
|
||||
// timers
|
||||
connect(&m_fastProcessTimer, &QTimer::timeout, this, &CAirspaceMonitor::fastProcessing);
|
||||
connect(&m_slowProcessTimer, &QTimer::timeout, this, &CAirspaceMonitor::slowProcessing);
|
||||
m_fastProcessTimer.start(FastProcessIntervalMs);
|
||||
m_slowProcessTimer.start(SlowProcessIntervalMs);
|
||||
|
||||
// dot command
|
||||
CAirspaceMonitor::registerHelp();
|
||||
@@ -417,14 +419,20 @@ namespace BlackCore
|
||||
return false;
|
||||
}
|
||||
|
||||
void CAirspaceMonitor::process()
|
||||
void CAirspaceMonitor::fastProcessing()
|
||||
{
|
||||
if (this->isConnectedAndNotShuttingDown())
|
||||
{
|
||||
// only send one
|
||||
const bool send = this->sendNextStaggeredAtisQuery();
|
||||
if (!send) { this->sendNextStaggeredPilotDataQuery(); }
|
||||
}
|
||||
if (!this->isConnectedAndNotShuttingDown()) { return; }
|
||||
|
||||
// only send one query
|
||||
const bool send = this->sendNextStaggeredAtisQuery();
|
||||
if (!send) { this->sendNextStaggeredPilotDataQuery(); }
|
||||
|
||||
}
|
||||
|
||||
void CAirspaceMonitor::slowProcessing()
|
||||
{
|
||||
if (!this->isConnectedAndNotShuttingDown()) { return; }
|
||||
this->queryAllOnlineAtcStations();
|
||||
}
|
||||
|
||||
void CAirspaceMonitor::clear()
|
||||
@@ -1299,7 +1307,11 @@ namespace BlackCore
|
||||
const CLength maxRange(isVatsim ? 125 : -1, CLengthUnit::NM());
|
||||
this->setMaxRange(maxRange);
|
||||
}
|
||||
if (newStatus.isDisconnected()) { clear(); }
|
||||
|
||||
if (newStatus.isDisconnected())
|
||||
{
|
||||
this->clear();
|
||||
}
|
||||
}
|
||||
|
||||
void CAirspaceMonitor::onPilotDisconnected(const CCallsign &callsign)
|
||||
@@ -1438,6 +1450,18 @@ namespace BlackCore
|
||||
m_fsdClient->sendClientQueryServer(callsign);
|
||||
}
|
||||
|
||||
void CAirspaceMonitor::queryAllOnlineAtcStations()
|
||||
{
|
||||
if (!this->isConnectedAndNotShuttingDown()) { return; }
|
||||
const CAtcStationList onlineStations = this->getAtcStationsOnlineRecalculated();
|
||||
for (const CAtcStation &station : onlineStations)
|
||||
{
|
||||
const CCallsign cs = station.getCallsign();
|
||||
if (cs.isEmpty()) { continue; }
|
||||
m_fsdClient->sendClientQueryRealName(cs);
|
||||
}
|
||||
}
|
||||
|
||||
bool CAirspaceMonitor::sendNextStaggeredAtisQuery()
|
||||
{
|
||||
if (m_queryAtis.isEmpty()) { return false; }
|
||||
|
||||
@@ -294,12 +294,19 @@ namespace BlackCore
|
||||
int m_maxDistanceNM = 125; //!< position range / FSD range
|
||||
int m_maxDistanceNMHysteresis = qRound(1.1 * m_maxDistanceNM);
|
||||
|
||||
// Processing interval
|
||||
static constexpr int ProcessIntervalMs = 50; // in ms
|
||||
QTimer m_processTimer;
|
||||
// Processing for queries etc. (fast)
|
||||
static constexpr int FastProcessIntervalMs = 50; //!< interval in ms
|
||||
QTimer m_fastProcessTimer; //!< process timer for fast updates
|
||||
|
||||
//! Processing by timer
|
||||
void process();
|
||||
void fastProcessing();
|
||||
|
||||
// Processing for validations etc. (slow)
|
||||
static constexpr int SlowProcessIntervalMs = 125 * 1000; //!< interval in ms
|
||||
QTimer m_slowProcessTimer; //!< process timer for slow updates
|
||||
|
||||
//! Slow processing
|
||||
void slowProcessing();
|
||||
|
||||
// model matching times
|
||||
static constexpr qint64 MMCheckAgainMs = 2000;
|
||||
@@ -321,6 +328,9 @@ namespace BlackCore
|
||||
//! Network queries for ATC
|
||||
void sendInitialAtcQueries(const BlackMisc::Aviation::CCallsign &callsign);
|
||||
|
||||
//! Query all online ATC stations
|
||||
void queryAllOnlineAtcStations();
|
||||
|
||||
//! Network queries for ATIS
|
||||
bool sendNextStaggeredAtisQuery();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user