mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-09 17:08:06 +00:00
linker errors
This commit is contained in:
@@ -7,6 +7,7 @@ set(DCOMMON_SOURCES
|
||||
"Logger.cpp"
|
||||
"Game.cpp"
|
||||
"GeneralUtils.cpp"
|
||||
"JSONUtils.cpp"
|
||||
"LDFFormat.cpp"
|
||||
"Metrics.cpp"
|
||||
"NiPoint3.cpp"
|
||||
|
@@ -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
18
dCommon/JSONUtils.cpp
Normal 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
11
dCommon/JSONUtils.h
Normal 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_
|
Reference in New Issue
Block a user