address feedback

This commit is contained in:
Aaron Kimbre 2024-04-25 22:27:28 -05:00
parent c3ea448be0
commit 9192dca4e6
6 changed files with 23 additions and 15 deletions

View File

@ -1,7 +1,7 @@
#include <cstdint>
#include <nlohmann/json.hpp>
#include "ChatWebApi.h"
#include <cstdint>
#include "dCommonVars.h"
#include "eConnectionType.h"
#include "eChatMessageType.h"
@ -9,8 +9,8 @@
#include "dServer.h"
#include "PlayerContainer.h"
#include "dConfig.h"
using json = nlohmann::json;
#include "httplib.h"
#include "json.h"
namespace {
httplib::Server m_APIServer;
@ -86,8 +86,6 @@ void ChatWebApi::Listen(const uint32_t port) {
};
void ChatWebApi::Stop(){
if (Game::config->GetValue("enable_chat_web_api") == "1") {
LOG("Stopping Chat Web API server...");
m_APIServer.stop();
}
}

View File

@ -1,4 +1,4 @@
#include "httplib.h"
#include <cstdint>
namespace ChatWebApi {
void Listen(const uint32_t port);

View File

@ -1,7 +1,8 @@
#include "PlayerContainer.h"
#include <iostream>
#include <algorithm>
#include "PlayerContainer.h"
#include "dNetCommon.h"
#include "Game.h"
#include "Logger.h"
@ -14,7 +15,6 @@
#include "dConfig.h"
#include "eChatMessageType.h"
const json PlayerData::to_json() const {
json data;
data["id"] = this->playerID;

View File

@ -6,9 +6,7 @@
#include "Game.h"
#include "dServer.h"
#include <unordered_map>
#include <nlohmann/json.hpp>
using json = nlohmann::json;
#include "json.h"
enum class eGameMasterLevel : uint8_t;

10
dCommon/json.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef __JSON__H__
#define __JSON__H__
#include "nlohmann/json.hpp"
namespace {
using json = nlohmann::json;
}
#endif // !__JSON__H__

View File

@ -48,6 +48,7 @@ paths:
get:
tags:
- user
summary: Get all online Players
responses:
"200":
description: Successful operation
@ -64,6 +65,7 @@ paths:
get:
tags:
- user
summary: Get all active Teams
responses:
"200":
description: Successful operation