mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
* All libraries have been isolated from each other, and build into separate artifacts. * Project has been restructured to support isolating libraries. * CCrashHandler now calls a callback on crash (setup from core/dllmain.cpp, this can be setup in any way for any project. This callback is getting called when the apllication crashes. Useful for flushing buffers before closing handles to logging files for example). * Tier0 'CoreMsgV' function now calls a callback sink, which could be set by the user (currently setup to the SDK's internal logger in core/dllmain.cpp). TODO: * Add a batch file to autogenerate all projects. * Add support for dedicated server. * Add support for client dll. Bugs: * Game crashes on the title screen after the UI script compiler has finished (root cause unknown). * Curl error messages are getting logged twice for the dedicated server due to the removal of all "DEDICATED" preprocessor directives to support isolating projects. This has to be fixed properly!
30 lines
1.3 KiB
C++
30 lines
1.3 KiB
C++
#pragma once
|
|
#include "thirdparty/curl/include/curl/curl.h"
|
|
#include "bansystem.h"
|
|
#include "serverlisting.h"
|
|
|
|
class CPylon
|
|
{
|
|
public:
|
|
vector<NetGameServer_t> GetServerList(string& outMessage) const;
|
|
bool GetServerByToken(NetGameServer_t& slOutServer, string& outMessage, const string& svToken) const;
|
|
bool PostServerHost(string& outMessage, string& svOutToken, const NetGameServer_t& netGameServer) const;
|
|
|
|
bool GetBannedList(const BannedVec_t& inBannedVec, BannedVec_t& outBannedVec) const;
|
|
bool CheckForBan(const string& ipAddress, const uint64_t nucleusId, const string& personaName, string& outReason) const;
|
|
|
|
void ExtractError(const nlohmann::json& resultBody, string& outMessage, CURLINFO status, const char* errorText = nullptr) const;
|
|
void ExtractError(const string& response, string& outMessage, CURLINFO status, const char* messageText = nullptr) const;
|
|
|
|
void LogBody(const nlohmann::json& responseJson) const;
|
|
bool SendRequest(const char* endpoint, const nlohmann::json& requestJson, nlohmann::json& responseJson, string& outMessage, CURLINFO& status, const char* errorText = nullptr) const;
|
|
bool QueryServer(const char* endpoint, const char* request, string& outResponse, string& outMessage, CURLINFO& outStatus) const;
|
|
|
|
bool KeepAlive(const NetGameServer_t& netGameServer);
|
|
|
|
private:
|
|
string m_Token;
|
|
string m_ErrorMsg;
|
|
};
|
|
extern CPylon* g_pMasterServer;
|