mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-02 07:05:38 +08:00
ATC stations, style and minor fixes
This commit is contained in:
committed by
Mat Sutcliffe
parent
d29dec81d7
commit
524a9b3793
@@ -471,12 +471,15 @@ namespace BlackCore
|
|||||||
void CAirspaceMonitor::onRealNameReplyReceived(const CCallsign &callsign, const QString &realname)
|
void CAirspaceMonitor::onRealNameReplyReceived(const CCallsign &callsign, const QString &realname)
|
||||||
{
|
{
|
||||||
if (!this->isConnectedAndNotShuttingDown() || realname.isEmpty()) { return; }
|
if (!this->isConnectedAndNotShuttingDown() || realname.isEmpty()) { return; }
|
||||||
int wasAtc = false;
|
if (!sApp || sApp->isShuttingDown() || !sApp->getWebDataServices()) { return; }
|
||||||
|
|
||||||
|
bool wasAtc = false;
|
||||||
|
const QString rn = CUser::beautifyRealName(realname);
|
||||||
|
|
||||||
if (callsign.hasSuffix())
|
if (callsign.hasSuffix())
|
||||||
{
|
{
|
||||||
// very likely and ATC callsign
|
// very likely and ATC callsign
|
||||||
const CPropertyIndexVariantMap vm = CPropertyIndexVariantMap({ CAtcStation::IndexController, CUser::IndexRealName }, realname);
|
const CPropertyIndexVariantMap vm = CPropertyIndexVariantMap({ CAtcStation::IndexController, CUser::IndexRealName }, rn);
|
||||||
const int c1 = this->updateOnlineStation(callsign, vm, false, true);
|
const int c1 = this->updateOnlineStation(callsign, vm, false, true);
|
||||||
const int c2 = this->updateBookedStation(callsign, vm, false, true);
|
const int c2 = this->updateBookedStation(callsign, vm, false, true);
|
||||||
wasAtc = c1 > 0 || c2 > 0;
|
wasAtc = c1 > 0 || c2 > 0;
|
||||||
@@ -484,14 +487,13 @@ namespace BlackCore
|
|||||||
|
|
||||||
if (!wasAtc)
|
if (!wasAtc)
|
||||||
{
|
{
|
||||||
const CPropertyIndexVariantMap vm = CPropertyIndexVariantMap({CSimulatedAircraft::IndexPilot, CUser::IndexRealName}, realname);
|
const CPropertyIndexVariantMap vm = CPropertyIndexVariantMap({CSimulatedAircraft::IndexPilot, CUser::IndexRealName}, rn);
|
||||||
this->updateAircraftInRange(callsign, vm);
|
this->updateAircraftInRange(callsign, vm);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Client
|
// Client
|
||||||
if (!sApp || sApp->isShuttingDown() || !sApp->getWebDataServices()) { return; }
|
|
||||||
const CVoiceCapabilities voiceCaps = sApp->getWebDataServices()->getVoiceCapabilityForCallsign(callsign);
|
const CVoiceCapabilities voiceCaps = sApp->getWebDataServices()->getVoiceCapabilityForCallsign(callsign);
|
||||||
CPropertyIndexVariantMap vm = CPropertyIndexVariantMap({ CClient::IndexUser, CUser::IndexRealName }, realname);
|
CPropertyIndexVariantMap vm = CPropertyIndexVariantMap({ CClient::IndexUser, CUser::IndexRealName }, rn);
|
||||||
vm.addValue({ CClient::IndexVoiceCapabilities }, voiceCaps);
|
vm.addValue({ CClient::IndexVoiceCapabilities }, voiceCaps);
|
||||||
this->updateOrAddClient(callsign, vm, false);
|
this->updateOrAddClient(callsign, vm, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user