redo it with mongoose

add all previous POC api endpoints
This commit is contained in:
Aaron Kimbre
2025-01-02 16:11:45 -06:00
parent 070bec697c
commit e86f4e011b
18 changed files with 23916 additions and 935 deletions

View File

@@ -13,6 +13,23 @@
#include "dConfig.h"
#include "MessageType/Chat.h"
using json = nlohmann::json;
const json PlayerData::to_json() const {
json data;
data["id"] = this->playerID;
data["name"] = this->playerName;
data["gm_level"] = this->gmLevel;
data["muted"] = this->GetIsMuted();
json zoneID;
zoneID["map_id"] = std::to_string(this->zoneID.GetMapID());
zoneID["instance_id"] = std::to_string(this->zoneID.GetInstanceID());
zoneID["clone_id"] = std::to_string(this->zoneID.GetCloneID());
data["zone_id"] = zoneID;
return data;
}
void PlayerContainer::Initialize() {
m_MaxNumberOfBestFriends =
GeneralUtils::TryParse<uint32_t>(Game::config->GetValue("max_number_of_best_friends")).value_or(m_MaxNumberOfBestFriends);