Ref T632, mix fixes

* avoid empty callsign CClient object (harmless, but stupid)
* better validations in client provider
* check aircraft config packets (really broadcasts)
This commit is contained in:
Klaus Basan
2019-04-24 13:38:00 +02:00
parent eb89273104
commit a1490fd4e0
3 changed files with 29 additions and 5 deletions

View File

@@ -1070,9 +1070,12 @@ namespace BlackCore
{
Q_ASSERT(CThreadUtils::isCurrentThreadObjectThread(this));
this->storeAircraftParts(callsign, jsonObject, currentOffsetMs);
BLACK_AUDIT_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign");
if (callsign.isEmpty()) { return; }
// update client capability
CClient client = this->getClientOrDefaultForCallsign(callsign);
client.setUserCallsign(callsign); // make valid by setting a callsign
if (client.hasCapability(CClient::FsdWithAircraftConfig)) { return; }
client.addCapability(CClient::FsdWithAircraftConfig);
this->setOtherClient(client);