Kawe Mazidjatari 66f31916d1 Pylon logic imporvements
* Removed duplicate json parsing that was part of a PR that required a small refactor.
* Only check if response buffer is empty when we are going to parse the error message (this helps finding bugs in master server, since failure to parse has an exception handler).
* Log private server token and error messages to dedicated server console.
2023-02-04 19:18:18 +01:00

23 lines
830 B
C++

#pragma once
#include "thirdparty/curl/include/curl/curl.h"
#include "serverlisting.h"
class CPylon
{
public:
vector<NetGameServer_t> GetServerList(string& svOutMessage) const;
bool GetServerByToken(NetGameServer_t& slOutServer, string& svOutMessage, const string& svToken) const;
bool PostServerHost(string& svOutMessage, string& svOutToken, const NetGameServer_t& netGameServer) const;
bool CheckForBan(const string& svIpAddress, const uint64_t nNucleusID, string& svOutReason) const;
bool QueryMasterServer(const string& svHostName, const string& svApi, const string& svRequest, string& svResponse, string& svOutMessage, CURLINFO& status) const;
#ifdef DEDICATED
bool KeepAlive(const NetGameServer_t& netGameServer);
private:
string m_Token;
string m_ErrorMsg;
#endif // DEDICATED
};
extern CPylon* g_pMasterServer;