From 2510f4968c28943d989f073af49e4d088388708b Mon Sep 17 00:00:00 2001 From: Kilian Hofmann Date: Tue, 6 Sep 2022 16:41:34 +0200 Subject: [PATCH] Version Global AP --- xplugin/main.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/xplugin/main.cpp b/xplugin/main.cpp index ac777e5..8f5446e 100644 --- a/xplugin/main.cpp +++ b/xplugin/main.cpp @@ -11,8 +11,12 @@ std::thread recordingThread; std::atomic wantsExit; std::map configuration; - +std::map, + std::vector>> + airports; germanairlinesva_websocket::Websocket *connector; +int xplaneVersion; /* Datarefs */ XPLMDataRef pauseIndicator; @@ -52,6 +56,9 @@ Path p; PLUGIN_API int XPluginStart(char *outName, char *outSig, char *outDesc) { XPLMEnableFeature("XPLM_USE_NATIVE_PATHS", 1); + XPLMGetVersions(&xplaneVersion, NULL, NULL); + + toLog("Plugin using X-Plane Version " + std::to_string(xplaneVersion)); wantsExit.store(false); @@ -126,10 +133,6 @@ PLUGIN_API int XPluginStart(char *outName, char *outSig, char *outDesc) if (germanairlinesva_util::generateMD5("Custom Scenery/scenery_packs.ini", hash, toLog) == 0) { - std::map, - std::vector>> - airports; if (strcmp(configuration["scenery"].c_str(), hash) != 0 || !germanairlinesva_util::fileExists( @@ -163,7 +166,7 @@ PLUGIN_API int XPluginStart(char *outName, char *outSig, char *outDesc) } } - // Thread for sending data to web socket + // Thread for sending data to websocket serverThread = std::thread(&serverWorker); recordingThread = std::thread(&recordingWorker); toLog("Workers started");