linker errors

This commit is contained in:
Aaron Kimbre
2025-01-26 00:44:17 -06:00
parent eeb7b68a3b
commit 848c930292
17 changed files with 424 additions and 351 deletions

View File

@@ -7,6 +7,7 @@ set(DCOMMON_SOURCES
"Logger.cpp"
"Game.cpp"
"GeneralUtils.cpp"
"JSONUtils.cpp"
"LDFFormat.cpp"
"Metrics.cpp"
"NiPoint3.cpp"

View File

@@ -15,7 +15,6 @@ struct SystemAddress;
class EntityManager;
class dZoneManager;
class PlayerContainer;
class ChatWebAPI;
namespace Game {
using signal_t = volatile std::sig_atomic_t;
@@ -33,8 +32,6 @@ namespace Game {
extern dZoneManager* zoneManager;
extern PlayerContainer playerContainer;
extern std::string projectVersion;
extern ChatWebAPI chatwebapi;
inline bool ShouldShutdown() {
return lastSignal != 0;

18
dCommon/JSONUtils.cpp Normal file
View File

@@ -0,0 +1,18 @@
#include "JSONUtils.h"
#include "json.hpp"
using json = nlohmann::json;
std::string JSONUtils::CheckRequiredData(const json& data, const std::vector<std::string>& requiredData) {
json check;
check["error"] = json::array();
for (const auto& required : requiredData) {
if (!data.contains(required)) {
check["error"].push_back("Missing Parameter: " + required);
} else if (data[required] == "") {
check["error"].push_back("Empty Parameter: " + required);
}
}
return check["error"].empty() ? "" : check.dump();
}

11
dCommon/JSONUtils.h Normal file
View File

@@ -0,0 +1,11 @@
#ifndef _JSONUTILS_H_
#define _JSONUTILS_H_
#include "json_fwd.hpp"
namespace JSONUtils {
// check required data for reqeust
std::string CheckRequiredData(const nlohmann::json& data, const std::vector<std::string>& requiredData);
}
#endif // _JSONUTILS_H_