Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
53d069a
feat: new method for loading models via SimConnect MSFS2024
tzobler Oct 14, 2025
6700f66
fix: Annotations from GitHub build resolved
tzobler Nov 5, 2025
f034d31
feat: Implementation of the msfs2024 model mapping is ready for testing
tzobler Nov 7, 2025
0110146
fix: sortorder modelset
tzobler Nov 10, 2025
dbe7bf6
refactor: Remove TerrainProbe from msfs2024 code
tzobler Nov 11, 2025
a3d6bb8
feat: new lights and number of engines increased to 6
tzobler Nov 13, 2025
87543a1
refactor: remove outdated code for FSC
tzobler Nov 17, 2025
5951f75
Merge branch 'main' into msfs2024_new_ml
tzobler Nov 21, 2025
6b95334
fix: remove unnecessary code
tzobler Nov 21, 2025
cce4a8b
fix: src/gui/components/dbownmodelscomponent.cpp
tzobler Nov 30, 2025
b3fd58d
fix: first changes from the pull request
tzobler Nov 30, 2025
80e8710
fix: Update src/plugins/simulator/msfs2024/CMakeLists.txt
tzobler Dec 1, 2025
7745830
fix: Update src/misc/simulation/settings/simulatorsettings.h
tzobler Dec 1, 2025
7a065fb
fix: Update src/misc/simulation/settings/simulatorsettings.cpp
tzobler Dec 1, 2025
65fce30
fix: Update src/misc/simulation/aircraftmodel.cpp
tzobler Dec 1, 2025
026711d
fix: Update src/swiftdata/swiftdata.h
tzobler Dec 1, 2025
344debc
fix: Update src/core/modelsetbuilder.h
tzobler Dec 1, 2025
104f654
fix: Update src/misc/simulation/msfs2024/aircraftmodelloadermsfs2024.cpp
tzobler Dec 1, 2025
52a727d
fix: Fix errors from pull request
tzobler Nov 21, 2025
959ae91
Merge branch 'msfs2024_new_ml' of https://github.com/swift-project/pi…
tzobler Dec 1, 2025
1fa8972
fix: aircraftmodelloadermsfs2024
tzobler Dec 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ cmake-build-*/
/out/
/dist/
CMakeUserPresets.json
/third_party/externals
/third_party/externals
2 changes: 0 additions & 2 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,6 @@ add_library(core SHARED
fsd/pong.h
fsd/rehost.cpp
fsd/rehost.h
fsd/revbclientparts.cpp
fsd/revbclientparts.h
fsd/serializer.cpp
fsd/serializer.h
fsd/servererror.cpp
Expand Down
8 changes: 8 additions & 0 deletions src/core/aircraftmatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1710,6 +1710,14 @@ namespace swift::core
const QString &livery)
{
Q_UNUSED(livery)
// TODO TZ remove after testing
CLogMessage(this).info(u"CAircraftMatcher::onIcaoCodesReceived CHECK:"
u"callsign %1 "
u"aircraftIcao %2 "
u"airlineIcao %3 "
u"livery %4 ")
<< callsign << aircraftIcao << airlineIcao << livery;

Q_ASSERT_X(sApp && sApp->hasWebDataServices(), Q_FUNC_INFO, "Missing web data services");
if (m_modelSet.isEmpty()) { return; } // ignore empty sets to not create silly stats
if (sessionId.isEmpty()) { return; }
Expand Down
126 changes: 52 additions & 74 deletions src/core/airspacemonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ namespace swift::core
connect(m_fsdClient, &CFSDClient::serverResponseReceived, this, &CAirspaceMonitor::onServerReplyReceived);
connect(m_fsdClient, &CFSDClient::aircraftConfigReceived, this, &CAirspaceMonitor::onAircraftConfigReceived);
connect(m_fsdClient, &CFSDClient::connectionStatusChanged, this, &CAirspaceMonitor::onConnectionStatusChanged);
connect(m_fsdClient, &CFSDClient::revbAircraftConfigReceived, this,
&CAirspaceMonitor::onRevBAircraftConfigReceived);

Q_ASSERT_X(sApp && sApp->hasWebDataServices(), Q_FUNC_INFO, "Missing data reader");

Expand Down Expand Up @@ -546,9 +544,21 @@ namespace swift::core

void CAirspaceMonitor::sendReadyForModelMatching(const CCallsign &callsign, MatchingReadinessFlag rf)
{

if (!this->isConnectedAndNotShuttingDown()) { return; }
Q_ASSERT_X(!callsign.isEmpty(), Q_FUNC_INFO, "missing callsign");

// TODO TZ remove when testing is done
// CLogMessage(this).info(u"CAirspaceMonitor::sendReadyForModelMatching "
// u"callsign %1 Flag %2 ")
// << callsign << rf;

CStatusMessageList reverseLookupMessages;
CCallsign::addLogDetailsToList(&reverseLookupMessages, callsign,
QStringLiteral("CAirspaceMonitor::sendReadyForModelMatching Flag: %1").arg(rf),
CAirspaceMonitor::getLogCategories());
// TODO remove

// set flag and init ts
Readiness &readiness = this->addMatchingReadinessFlag(callsign, rf);

Expand Down Expand Up @@ -668,6 +678,14 @@ namespace swift::core

// normally we should never get here
CLogMessage(this).info(u"Verified '%1' again, has ICAO codes, ready for matching!") << callsign;

// TODO TZ remove when testing is done
CStatusMessageList reverseLookupMessages;
CCallsign::addLogDetailsToList(&reverseLookupMessages, callsign,
QStringLiteral("CAirspaceMonitor::verifyReceivedIcaoData"),
CAirspaceMonitor::getLogCategories());
// end TZ remove

this->sendReadyForModelMatching(callsign, Verified);
}

Expand Down Expand Up @@ -773,6 +791,15 @@ namespace swift::core
const QString &aircraftIcaoDesignator,
const QString &combinedAircraftType, const QString &modelString)
{
// TODO TZ remove when testing is done
CLogMessage(this).info(u"CAirspaceMonitor::onCustomFSInnPacketReceived CHECK:"
u"callsign %1 "
u"airlineIcaoDesignator %2 "
u"aircraftIcaoDesignator %3 "
u"combinedAircraftType %4 "
u"modelString %5 ")
<< callsign << airlineIcaoDesignator << aircraftIcaoDesignator << combinedAircraftType << modelString;

// it can happen this is called before any queries
// ES sends FsInn packets for callsigns such as ACCGER1, which are hard to distinguish
// 1) checking if they are already in the list checks again ATC position which is safe
Expand Down Expand Up @@ -818,7 +845,7 @@ namespace swift::core
usedModelString.clear();
CCallsign::addLogDetailsToList(
pReverseLookupMessages, callsign,
QStringLiteral("FsInn modelstring '%1' ignored because of setuo").arg(modelString));
QStringLiteral("FsInn modelstring '%1' ignored because of setup").arg(modelString));
}
else if (!CAircraftMatcher::isKnownModelString(modelString, callsign, pReverseLookupMessages))
{
Expand Down Expand Up @@ -846,6 +873,15 @@ namespace swift::core
void CAirspaceMonitor::onIcaoCodesReceived(const CCallsign &callsign, const QString &aircraftIcaoDesignator,
const QString &airlineIcaoDesignator, const QString &livery)
{
// TODO TZ remove logmessage when testing is done
CLogMessage(this).info(u"CAirspaceMonitor::onIcaoCodesReceived CHECK:"
u"callsign %1 "
u"aircraftIcaoDesignator %2 "
u"airlineIcaoDesignator %3 "
u"livery %4 ")
<< callsign << aircraftIcaoDesignator << airlineIcaoDesignator << livery;
// End TODO TZ

Q_ASSERT_X(CThreadUtils::isInThisThread(this), Q_FUNC_INFO, "not in main thread");
if (!this->isConnectedAndNotShuttingDown()) { return; }
if (CBuildConfig::isLocalDeveloperDebugBuild())
Expand All @@ -865,13 +901,18 @@ namespace swift::core
CAirspaceMonitor::getLogCategories());

const CClient client = this->getClientOrDefaultForCallsign(callsign);
this->addOrUpdateAircraftInRange(callsign, aircraftIcaoDesignator, airlineIcaoDesignator, livery,
client.getQueriedModelString(), CAircraftModel::TypeQueriedFromNetwork,
pReverseLookupMessages);
this->addReverseLookupMessages(callsign, reverseLookupMessages);
this->sendReadyForModelMatching(callsign, ReceivedIcaoCodes); // ICAO codes received
const CSimulatedAircraft aircraft = this->addOrUpdateAircraftInRange(
callsign, aircraftIcaoDesignator, airlineIcaoDesignator, livery, client.getQueriedModelString(),
CAircraftModel::TypeQueriedFromNetwork, pReverseLookupMessages);

// we do not change manually assigned models
if (aircraft.getModel().getModelType() != CAircraftModel::TypeManuallySet)
{
this->addReverseLookupMessages(callsign, reverseLookupMessages);
this->sendReadyForModelMatching(callsign, ReceivedIcaoCodes); // ICAO codes received

emit this->requestedNewAircraft(callsign, aircraftIcaoDesignator, airlineIcaoDesignator, livery);
emit this->requestedNewAircraft(callsign, aircraftIcaoDesignator, airlineIcaoDesignator, livery);
}
}

CAircraftModel CAirspaceMonitor::reverseLookupModelWithFlightplanData(
Expand Down Expand Up @@ -1178,8 +1219,8 @@ namespace swift::core
const CSimulatedAircraft aircraft = this->getAircraftInRangeForCallsign(callsign);
if (aircraft.hasValidCallsign())
{
// only if we do not have a DB model yet
if (!aircraft.getModel().hasValidDbKey())
// we do not change manually assigned models (msfs2024)
if (!aircraft.getModel().hasValidDbKey() && aircraft.getModelType() != CAircraftModel::TypeManuallySet)
{
CAircraftModel model = this->reverseLookupModelWithFlightplanData(callsign, aircraftIcao, airlineIcao,
livery, modelString, modelType, log);
Expand Down Expand Up @@ -1439,69 +1480,6 @@ namespace swift::core
this->updateAircraftInRange(callsign, vm);
}

void CAirspaceMonitor::onRevBAircraftConfigReceived(const CCallsign &callsign, const QString &config,
qint64 currentOffsetMs)
{

Q_ASSERT(CThreadUtils::isInThisThread(this));
SWIFT_AUDIT_X(!callsign.isEmpty(), Q_FUNC_INFO, "Need callsign");
if (callsign.isEmpty()) { return; }

unsigned long pp = 0;
bool ok {};
pp = config.toULong(&ok, 10);

bool gear = (pp & 1U);
bool landLight = (pp & 2U);
bool navLight = (pp & 4U);
bool strobeLight = (pp & 8U);
bool beaconLight = (pp & 16U);
bool taxiLight = (pp & 32U);
bool engine1Running = (pp & 64U);
bool engine2Running = (pp & 128U);
bool engine3Running = (pp & 256U);
bool engine4Running = (pp & 512U);

// CLogMessage(this).info(u"taxiLight %1 landLight %2 beaconLight %3 strobeLight %4 gear %5") << taxiLight <<
// landLight << beaconLight << strobeLight << gear; CLogMessage(this).info(u"engine1Running %1 engine2Running %2
// engine3Running %3 engine4Running %4") << engine1Running << engine2Running << engine3Running <<
// engine4Running;

CAircraftParts aircraftparts;
aircraftparts.setGearDown(gear);

CAircraftLights lights;
lights.setStrobeOn(strobeLight);
lights.setLandingOn(landLight);
lights.setTaxiOn(taxiLight);
lights.setBeaconOn(beaconLight);
lights.setNavOn(navLight);
aircraftparts.setLights(lights);

CAircraftEngineList engines;
engines.initEngines(4, false);
engines.setEngineOn(1, engine1Running);
engines.setEngineOn(2, engine2Running);
engines.setEngineOn(3, engine3Running);
engines.setEngineOn(4, engine4Running);
aircraftparts.setEngines(engines);

// make sure in any case right time and correct details
aircraftparts.setCurrentUtcTime();
aircraftparts.setTimeOffsetMs(currentOffsetMs);
aircraftparts.setPartsDetails(CAircraftParts::FSDAircraftParts);

// store parts
this->storeAircraftParts(callsign, aircraftparts, true);

// 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);
}

void CAirspaceMonitor::onAircraftConfigReceived(const CCallsign &callsign, const QJsonObject &jsonObject,
qint64 currentOffsetMs)
{
Expand Down
2 changes: 0 additions & 2 deletions src/core/airspacemonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,6 @@ namespace swift::core
const QString &aircraftIcao, const QString &airlineIcao);
void onConnectionStatusChanged(swift::misc::network::CConnectionStatus oldStatus,
swift::misc::network::CConnectionStatus newStatus);
void onRevBAircraftConfigReceived(const swift::misc::aviation::CCallsign &callsign, const QString &config,
qint64 currentOffsetMs);
};
} // namespace swift::core

Expand Down
1 change: 1 addition & 0 deletions src/core/context/contextnetworkimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,7 @@ namespace swift::core::context
if (c)
{
const CSimulatedAircraft aircraft(this->getAircraftInRangeForCallsign(callsign));

Q_ASSERT_X(!aircraft.getCallsign().isEmpty(), Q_FUNC_INFO, "missing callsign");
emit this->changedRemoteAircraftModel(aircraft, originator); // update aircraft model
}
Expand Down
4 changes: 4 additions & 0 deletions src/core/db/databaseutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace swift::core::db
dbModelModified.updateMissingParts(model);
dbModelModified.setDistributorOrder(distributorOrder);
dbModelModified.setSimulator(dbModel.getSimulator()); // DB simulator settings have priority
dbModelModified.setModelLivery(model.getModelLivery()); // keep local livery settings msfs2024
return dbModelModified;
}

Expand All @@ -88,6 +89,7 @@ namespace swift::core::db
{
if (modified) { *modified = true; }
consolidatedModel.setLivery(dbLivery);
consolidatedModel.setModelLivery(model.getModelLivery()); // keep local livery settings msfs2024
}
}
if (!consolidatedModel.getAircraftIcaoCode().hasValidDbKey() && consolidatedModel.hasAircraftDesignator())
Expand All @@ -99,6 +101,7 @@ namespace swift::core::db
{
if (modified) { *modified = true; }
consolidatedModel.setAircraftIcaoCode(dbIcao);
consolidatedModel.setModelLivery(model.getModelLivery()); // keep local livery settings msfs2024
}
}

Expand All @@ -108,6 +111,7 @@ namespace swift::core::db
{
if (modified) { *modified = true; }
consolidatedModel.setDistributor(dbDistributor);
consolidatedModel.setModelLivery(model.getModelLivery()); // keep local livery settings msfs2024
}
consolidatedModel.updateLocalFileNames(model);
consolidatedModel.setDistributorOrder(distributorOrder);
Expand Down
33 changes: 1 addition & 32 deletions src/core/fsd/fsdclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include "core/fsd/planeinformationfsinn.h"
#include "core/fsd/pong.h"
#include "core/fsd/rehost.h"
#include "core/fsd/revbclientparts.h"
#include "core/fsd/serializer.h"
#include "core/fsd/servererror.h"
#include "core/fsd/textmessage.h"
Expand Down Expand Up @@ -1078,16 +1077,6 @@ namespace swift::core::fsd

// Euroscope
m_messageTypeMapping["SIMDATA"] = MessageType::EuroscopeSimData;

// IVAO only
// Ref: https://github.com/DemonRem/X-IvAP/blob/1b0a14880532a0f5c8fe84be44e462c6892a5596/src/XIvAp/FSDprotocol.h
m_messageTypeMapping["!R"] = MessageType::RegistrationInfo;
m_messageTypeMapping["-MD"] = MessageType::RevBClientParts;
m_messageTypeMapping["-PD"] = MessageType::RevBPilotDescription; // not handled, to avoid error messages

// IVAO parts
// https://discordapp.com/channels/539048679160676382/695961646992195644/707915838845485187
// https://github.com/swift-project/pilotclient/wiki/Knowledgebase-Simulation:-IVAO-parts
}

void CFSDClient::handleAtcDataUpdate(const QStringList &tokens)
Expand Down Expand Up @@ -1620,23 +1609,6 @@ namespace swift::core::fsd
if (serverError.isFatalError()) { disconnectFromServer(); }
}

void CFSDClient::handleRevBClientPartsPacket(const QStringList &tokens)
{
CLogMessage(this).debug(u"handleRevBClientPartsPacket");

const RevBClientParts RevBClientParts = RevBClientParts::fromTokens(tokens);
const CCallsign callsign(RevBClientParts.sender(), CCallsign::Aircraft);

const bool inRange = isAircraftInRange(callsign);

if (!inRange) { return; } // sort out all broadcasts we DO NOT NEED
if (!getSetupForServer().receiveAircraftParts()) { return; }

const qint64 offsetTimeMs = currentOffsetTime(callsign);
emit revbAircraftConfigReceived(RevBClientParts.sender(), RevBClientParts.m_partsval1, offsetTimeMs);
CLogMessage(this).debug(u"Set Config at %1 ") << offsetTimeMs;
}

void CFSDClient::handleRehost(const QStringList &tokens)
{
const Rehost rehost = Rehost::fromTokens(tokens);
Expand Down Expand Up @@ -2283,9 +2255,7 @@ namespace swift::core::fsd
case MessageType::AddPilot:
case MessageType::ServerHeartbeat:
case MessageType::ProController:
case MessageType::ClientIdentification:
case MessageType::RegistrationInfo:
case MessageType::RevBPilotDescription: break;
case MessageType::ClientIdentification: break;

// handled ones
case MessageType::AtcDataUpdate: handleAtcDataUpdate(tokens); break;
Expand All @@ -2308,7 +2278,6 @@ namespace swift::core::fsd
case MessageType::ServerError: handleServerError(tokens); break;
case MessageType::TextMessage: handleTextMessage(tokens); break;
case MessageType::PilotClientCom: handleCustomPilotPacket(tokens); break;
case MessageType::RevBClientParts: handleRevBClientPartsPacket(tokens); break;
case MessageType::VisualPilotDataUpdate:
case MessageType::VisualPilotDataPeriodic:
case MessageType::VisualPilotDataStopped: handleVisualPilotDataUpdate(tokens, messageType); break;
Expand Down
3 changes: 1 addition & 2 deletions src/core/fsd/fsdclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ namespace swift::core::fsd
void planeInformationFsinnReceived(const swift::misc::aviation::CCallsign &callsign,
const QString &airlineIcaoDesignator, const QString &aircraftDesignator,
const QString &combinedAircraftType, const QString &modelString);
void revbAircraftConfigReceived(const QString &sender, const QString &config, qint64 currentOffsetTimeMs);

void muteRequestReceived(bool mute);

//! @}
Expand Down Expand Up @@ -474,7 +474,6 @@ namespace swift::core::fsd
#ifdef SWIFT_VATSIM_SUPPORT
void handleFsdIdentification(const QStringList &tokens);
#endif
void handleRevBClientPartsPacket(const QStringList &tokens);
void handleRehost(const QStringList &tokens);
void handleMute(const QStringList &tokens);

Expand Down
3 changes: 0 additions & 3 deletions src/core/fsd/messagebase.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@ enum class MessageType
Pong,
ServerError,
ServerHeartbeat,
RegistrationInfo, // IVAO only
TextMessage,
PilotClientCom,
RevBClientParts, // IVAO only
RevBPilotDescription, // -PD IVAO only not handled in swift
Rehost,
Mute,
};
Expand Down
Loading
Loading