Namespaces and formatting
This commit is contained in:
@@ -100,7 +100,7 @@ class SimConnect
|
||||
bool pausedMenu;
|
||||
bool paused;
|
||||
std::mutex mutex;
|
||||
struct germanairlinesva::websocket::data simData;
|
||||
struct germanairlinesva::gaconnector::websocket::data simData;
|
||||
std::shared_ptr<germanairlinesva::file::config::Config> configuration;
|
||||
std::function<void(const std::string)> toLog;
|
||||
|
||||
@@ -117,7 +117,7 @@ class SimConnect
|
||||
~SimConnect();
|
||||
bool isConnected() const;
|
||||
const std::string getVersion() const;
|
||||
void getData(struct germanairlinesva::websocket::data *data);
|
||||
void getData(struct germanairlinesva::gaconnector::websocket::data *data);
|
||||
void getStates() const;
|
||||
void handleMessage();
|
||||
};
|
||||
|
||||
+1
-1
@@ -16,11 +16,11 @@
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "_simconnect.h"
|
||||
#include "config/config.hpp"
|
||||
#include "constants.h"
|
||||
#include "logbook/logbook.hpp"
|
||||
#include "recording/recording.hpp"
|
||||
#include "_simconnect.h"
|
||||
#include "simdata/simDatabase.hpp"
|
||||
|
||||
WINBOOL addNotifyIcon(HWND hWnd);
|
||||
|
||||
+15
-13
@@ -12,10 +12,10 @@ std::atomic<bool> wantsExit;
|
||||
|
||||
std::shared_ptr<germanairlinesva::file::config::Config> configuration;
|
||||
std::unique_ptr<germanairlinesva::file::simdata::SimDatabase> database;
|
||||
std::unique_ptr<germanairlinesva::websocket::Websocket> connector;
|
||||
std::unique_ptr<germanairlinesva::gaconnector::websocket::Websocket> connector;
|
||||
std::unique_ptr<SimConnect> simConnect;
|
||||
|
||||
struct germanairlinesva::websocket::data toSend;
|
||||
struct germanairlinesva::gaconnector::websocket::data toSend;
|
||||
germanairlinesva::file::recording::Recording p;
|
||||
|
||||
// The Window Procedure
|
||||
@@ -127,10 +127,11 @@ int WINAPI WinMain(HINSTANCE hInstance,
|
||||
configuration = std::make_unique<germanairlinesva::file::config::Config>();
|
||||
toLog("Config loaded");
|
||||
|
||||
connector = std::make_unique<germanairlinesva::websocket::Websocket>(
|
||||
"wss://ws.hofmannnet.myhome-server.de:8000",
|
||||
configuration->getUser(),
|
||||
toLog);
|
||||
connector =
|
||||
std::make_unique<germanairlinesva::gaconnector::websocket::Websocket>(
|
||||
"wss://ws.hofmannnet.myhome-server.de:8000",
|
||||
configuration->getUser(),
|
||||
toLog);
|
||||
toLog("WebSocket started");
|
||||
|
||||
#ifndef MSFS
|
||||
@@ -153,7 +154,8 @@ int WINAPI WinMain(HINSTANCE hInstance,
|
||||
CoTaskMemFree(folder);
|
||||
|
||||
char hash[2 * MD5LEN + 1] = "";
|
||||
if (germanairlinesva::util::generateMD5(path.c_str(), hash, toLog) == 0) {
|
||||
if (germanairlinesva::utilities::generateMD5(path.c_str(), hash, toLog) ==
|
||||
0) {
|
||||
database = std::make_unique<germanairlinesva::file::simdata::SimDatabase>(
|
||||
FSX_VERSION,
|
||||
hash,
|
||||
@@ -324,13 +326,13 @@ void end(HWND hWnd)
|
||||
|
||||
void serverWorker()
|
||||
{
|
||||
germanairlinesva::util::setThreadName("GAServerWorker");
|
||||
germanairlinesva::utilities::setThreadName("GAServerWorker");
|
||||
|
||||
while (!wantsExit) {
|
||||
simConnect->getStates();
|
||||
|
||||
struct germanairlinesva::websocket::data *copy =
|
||||
new germanairlinesva::websocket::data();
|
||||
struct germanairlinesva::gaconnector::websocket::data *copy =
|
||||
new germanairlinesva::gaconnector::websocket::data();
|
||||
{
|
||||
const std::lock_guard<std::mutex> lock(mutex);
|
||||
|
||||
@@ -347,7 +349,7 @@ void serverWorker()
|
||||
|
||||
void recordingWorker()
|
||||
{
|
||||
germanairlinesva::util::setThreadName("GARecordingWorker");
|
||||
germanairlinesva::utilities::setThreadName("GARecordingWorker");
|
||||
|
||||
germanairlinesva::file::recording::RecordingEntry lastPath;
|
||||
std::uint32_t segment = 0;
|
||||
@@ -356,8 +358,8 @@ void recordingWorker()
|
||||
auto rwys = ap.second;
|
||||
|
||||
while (!wantsExit) {
|
||||
struct germanairlinesva::websocket::data *copy =
|
||||
new germanairlinesva::websocket::data();
|
||||
struct germanairlinesva::gaconnector::websocket::data *copy =
|
||||
new germanairlinesva::gaconnector::websocket::data();
|
||||
{
|
||||
const std::lock_guard<std::mutex> lock(mutex);
|
||||
|
||||
|
||||
+2
-1
@@ -323,7 +323,8 @@ const std::string SimConnect::getVersion() const
|
||||
}
|
||||
}
|
||||
|
||||
void SimConnect::getData(struct germanairlinesva::websocket::data *data)
|
||||
void SimConnect::getData(
|
||||
struct germanairlinesva::gaconnector::websocket::data *data)
|
||||
{
|
||||
const std::lock_guard<std::mutex> lock(this->mutex);
|
||||
memcpy(data, &this->simData, sizeof(this->simData));
|
||||
|
||||
Reference in New Issue
Block a user