Kawe Mazidjatari e2f06a8a68 Massive performance improvements
Inline every signature defined in the SDK (previously each translation unit had its own copy of the signature and function prototype). DLL init is near instant now (85% speed improvements).
2022-04-09 02:18:57 +02:00

28 lines
779 B
C++

#pragma once
#include "serverlisting.h"
namespace R5Net
{
class Client
{
public:
Client(std::string serverString) : m_HttpClient(serverString.c_str())
{
m_HttpClient.set_connection_timeout(10);
}
std::vector<ServerListing> GetServersList(std::string& svOutMessage);
bool PostServerHost(std::string& svOutMessage, std::string& svOutToken, const ServerListing& slServerListing);
bool GetServerByToken(ServerListing& slOutServer, std::string& svOutMessage, const std::string svToken);
bool GetClientIsBanned(std::string svIpAddress, int64_t nOriginID, std::string& svOutErrCl);
std::string GetSDKVersion();
Client* pR5net = nullptr;
Client* GetR5Net() { return pR5net; }
private:
httplib::Client m_HttpClient;
};
}
extern R5Net::Client* g_pR5net;