Runways and Gates now with new read/write
This commit is contained in:
@@ -117,6 +117,5 @@ elseif(WIN32)
|
||||
endif()
|
||||
|
||||
target_link_libraries(germanairlinesva_xplugin PRIVATE
|
||||
simdata
|
||||
ixwebsocket
|
||||
)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
#include "constants.h"
|
||||
#include "logbook/logbook.h"
|
||||
#include "recording/recording.h"
|
||||
#include "simdata.h"
|
||||
#include "simulatorDatabase.hpp"
|
||||
#include "simdata/simdataXP.h"
|
||||
#include "simdata/simulatorDatabase.hpp"
|
||||
#include "util.hpp"
|
||||
#include "websocket.h"
|
||||
|
||||
|
||||
+10
-9
@@ -12,8 +12,8 @@ std::atomic<bool> wantsExit;
|
||||
|
||||
std::map<std::string, std::string> configuration;
|
||||
std::map<std::string,
|
||||
std::pair<std::vector<germanairlinesva_simdata::Gate>,
|
||||
std::vector<germanairlinesva_simdata::Runway>>>
|
||||
std::pair<std::vector<germanairlinesva::file::simdata::Gate>,
|
||||
std::vector<germanairlinesva::file::simdata::Runway>>>
|
||||
airports;
|
||||
germanairlinesva_websocket::Websocket *connector;
|
||||
int xplaneVersion;
|
||||
@@ -130,19 +130,20 @@ PLUGIN_API int XPluginStart(char *outName, char *outSig, char *outDesc)
|
||||
toLog("WebSocket started");
|
||||
|
||||
char hash[2 * MD5LEN + 1] = "";
|
||||
if (germanairlinesva_util::generateMD5(XPLANE_CUSTOM_SCENERY, hash, toLog) ==
|
||||
if (germanairlinesva::util::generateMD5(XPLANE_CUSTOM_SCENERY, hash, toLog) ==
|
||||
0) {
|
||||
|
||||
if (strcmp(configuration["scenery"].c_str(), hash) != 0 ||
|
||||
!germanairlinesva_util::fileExists(
|
||||
!germanairlinesva::util::fileExists(
|
||||
XPLANE_PLUGIN_DIRECTORY SIMDATABASE)) {
|
||||
scan(xplaneVersion < 12000 ? XPLANE11_BASE_SCENERY
|
||||
: XPLANE12_BASE_SCENERY,
|
||||
XPLANE_CUSTOM_SCENERY,
|
||||
XPLANE_PLUGIN_DIRECTORY "log.txt",
|
||||
airports);
|
||||
germanairlinesva_simdata::toFile(airports,
|
||||
XPLANE_PLUGIN_DIRECTORY SIMDATABASE);
|
||||
germanairlinesva::file::simdata::toFile(
|
||||
airports,
|
||||
XPLANE_PLUGIN_DIRECTORY SIMDATABASE);
|
||||
|
||||
configuration["scenery"] = hash;
|
||||
germanairlinesva::file::config::writeConfig(
|
||||
@@ -150,7 +151,7 @@ PLUGIN_API int XPluginStart(char *outName, char *outSig, char *outDesc)
|
||||
XPLANE_PLUGIN_DIRECTORY CONFIG);
|
||||
toLog("Sim Database updated");
|
||||
} else {
|
||||
airports = germanairlinesva_simdata::fromFile(
|
||||
airports = germanairlinesva::file::simdata::fromFile(
|
||||
XPLANE_PLUGIN_DIRECTORY SIMDATABASE);
|
||||
toLog("Sim Database loaded");
|
||||
}
|
||||
@@ -279,7 +280,7 @@ float flightLoop(float elapsedMe, float elapsedSim, int counter, void *refcon)
|
||||
|
||||
void serverWorker()
|
||||
{
|
||||
germanairlinesva_util::setThreadName("GAServerWorker");
|
||||
germanairlinesva::util::setThreadName("GAServerWorker");
|
||||
|
||||
while (!wantsExit) {
|
||||
struct germanairlinesva_websocket::data copy;
|
||||
@@ -297,7 +298,7 @@ void serverWorker()
|
||||
|
||||
void recordingWorker()
|
||||
{
|
||||
germanairlinesva_util::setThreadName("GARecordingWorker");
|
||||
germanairlinesva::util::setThreadName("GARecordingWorker");
|
||||
|
||||
germanairlinesva::file::recording::RecordingEntry lastPath;
|
||||
std::uint32_t segment = 0;
|
||||
|
||||
Reference in New Issue
Block a user