mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
Filter other pilots ghost aircraft when flying in shared cockpit mode
When flying in shared cockpit mode, both pilots log into the network. One as pilot to be visible to ATC and other pilots. The other one as observer. For the observing user, the pilots aircraft needs to be filtered. Filter algorithm is using the same schema as vPilot does. ref T427
This commit is contained in:
committed by
Klaus Basan
parent
420fc40fb2
commit
ee8af9f4c6
@@ -87,9 +87,11 @@ namespace BlackMisc
|
||||
return m_callsign.endsWith("SUP");
|
||||
}
|
||||
|
||||
bool CCallsign::isCopilotCallsign() const
|
||||
bool CCallsign::isMaybeCopilotCallsign(const CCallsign &pilotCallsign) const
|
||||
{
|
||||
return (this->getTypeHint() == Aircraft) && this->isObserverCallsign();
|
||||
return m_callsign.startsWith(pilotCallsign.asString()) &&
|
||||
m_callsign.size() == pilotCallsign.asString().size() + 1 &&
|
||||
m_callsign.at(m_callsign.size() - 1) >= 'A' && m_callsign.at(m_callsign.size() - 1) <= 'Z';
|
||||
}
|
||||
|
||||
QString CCallsign::getIcaoCode() const
|
||||
|
||||
@@ -84,8 +84,10 @@ namespace BlackMisc
|
||||
//! Supervisor?
|
||||
bool isSupervisorCallsign() const;
|
||||
|
||||
//! Pilot OBS callsign, normally a co-pilot
|
||||
bool isCopilotCallsign() const;
|
||||
//! Returns true if this is a co-pilot callsign of pilot. The logic is that the callsign is the same as the pilot one
|
||||
//! but with a single character as suffix.
|
||||
//! e.g Pilot logged in as DLH123, observer logged in as DLH123A
|
||||
bool isMaybeCopilotCallsign(const CCallsign &pilotCallsign) const;
|
||||
|
||||
//! Get callsign (normalized)
|
||||
const QString &asString() const { return m_callsign; }
|
||||
|
||||
Reference in New Issue
Block a user