added get private game server info route

This commit is contained in:
Alex 2021-12-28 03:44:20 +02:00
parent b53b89d31a
commit 2f2d01713f
2 changed files with 44 additions and 7 deletions

View File

@ -42,14 +42,37 @@ namespace R5Net {
////// Requests
struct UpdateGameServerMSRequest
struct UpdateGameServerMSRequest
{
NetGameServer gameServer;
NLOHMANN_DEFINE_TYPE_INTRUSIVE(UpdateGameServerMSRequest, gameServer)
};
enum class EResponseStatus
struct GetIsUserBannedMSRequest
{
int oid;
std::string ipAddress;
NLOHMANN_DEFINE_TYPE_INTRUSIVE(GetIsUserBannedMSRequest, oid, ipAddress)
};
struct GetPrivateGameServerInfoMSRequest
{
std::string publicRef;
std::string password;
NLOHMANN_DEFINE_TYPE_INTRUSIVE(GetPrivateGameServerInfoMSRequest, publicRef, password)
};
/// <summary>
/// Responses
/// </summary>
///
///
enum class EResponseStatus
{
NO_REACH,
SUCCESS,
@ -57,11 +80,9 @@ namespace R5Net {
NOT_FOUND,
MS_ERROR
};
/// <summary>
/// Responses
/// </summary>
struct DefaultMSResponse
struct DefaultMSResponse
{
EResponseStatus status = EResponseStatus::NO_REACH;
std::string error;
@ -90,4 +111,19 @@ namespace R5Net {
};
struct GetIsUserBannedMSResponse : DefaultMSResponse
{
bool isBanned;
std::string metaString;
NLOHMANN_DEFINE_TYPE_INTRUSIVE(GetIsUserBannedMSResponse, isBanned, metaString)
};
struct GetPrivateGameServerInfoMSResponse : DefaultMSResponse
{
NetGameServer gameServer;
NLOHMANN_DEFINE_TYPE_INTRUSIVE(GetPrivateGameServerInfoMSResponse, gameServer)
};
}

View File

@ -42,6 +42,7 @@ namespace R5Net
R5NET_POST_ENDPOINT(UpdateMyGameServer, "/api/game_servers/update", UpdateGameServerMSRequest, UpdateGameServerMSResponse)
R5NET_POST_ENDPOINT(GetClientIsBanned, "/api/ban_system/is_user_banned", GetIsUserBannedMSRequest, GetIsUserBannedMSResponse)
R5NET_POST_ENDPOINT(GetPrivateGameServerInfo, "/api/game_servers/game_server_private_info", GetPrivateGameServerInfoMSRequest, GetPrivateGameServerInfoMSResponse)