mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-05-09 16:11:17 +00:00

* Add invite initial response msg re-do team leave logic to send more accurate messages Players are still able to leave the team with the same results as before, however now the correct messages are sent to team chats (no fixes for local teams). * chore: move team logic to separate container Makes it easier to follow team logic when you're not bouncing between 3 classes in 3 files. Consolidates all team logic to 1 namespace in TeamContainer. No logic changes were done, only renaming and fixing errors from the moving. TeamData should be replaced with unique_ptrs at some point so the Shutdown method can be removed from TeamContainer.
24 lines
719 B
C++
24 lines
719 B
C++
#ifndef __JSONUTILS_H__
|
|
#define __JSONUTILS_H__
|
|
|
|
#include "json_fwd.hpp"
|
|
#include "PlayerContainer.h"
|
|
#include "TeamContainer.h"
|
|
|
|
/* Remember, to_json needs to be in the same namespace as the class its located in */
|
|
|
|
void to_json(nlohmann::json& data, const PlayerData& playerData);
|
|
void to_json(nlohmann::json& data, const PlayerContainer& playerContainer);
|
|
void to_json(nlohmann::json& data, const TeamData& teamData);
|
|
|
|
namespace TeamContainer {
|
|
void to_json(nlohmann::json& data, const TeamContainer::Data& teamData);
|
|
};
|
|
|
|
namespace JSONUtils {
|
|
// check required data for reqeust
|
|
std::string CheckRequiredData(const nlohmann::json& data, const std::vector<std::string>& requiredData);
|
|
}
|
|
|
|
#endif // __JSONUTILS_H__
|