1 #ifndef GAMESTATS_CLIENT_H
2 #define GAMESTATS_CLIENT_H
4 #include <net/socket.h>
24 Client(
int socket,
struct sockaddr_in address);
57 void onRequest(
const std::string& request);
78 void requestAuth(
const GameSpy::Parameter& parameter);
110 void _LogTransaction(
const std::string& direction,
const std::string& response)
const;
140 static std::vector<unsigned char>
Encrypt(
const std::string& response);
151 static std::string
Decrypt(
const std::vector<unsigned char>& request);
Represents a client for game statistics.
~Client()
Destructor for Game Statistics Client.
void requestUpdateGame(const GameSpy::Parameter ¶meter)
Request to update an existing game with provided parameters.
void onRequest(const std::string &request)
Handle incoming requests from the client.
void Listen()
Start listening for client requests.
static std::vector< unsigned char > Encrypt(const std::string &response)
Encrypts a response message.
void Disconnect()
Disconnect the client.
static void Heartbeat()
Heartbeat function to manage client connections.
void requestAuth(const GameSpy::Parameter ¶meter)
Request authentication with provided parameters.
void _LogTransaction(const std::string &direction, const std::string &response) const
Log a transaction with direction and response.
void requestNewGame(const GameSpy::Parameter ¶meter)
Request to create a new game with provided parameters.
static std::string Decrypt(const std::vector< unsigned char > &request)
Decrypts a request message.
void requestChallenge()
Request a challenge from the client.
Client(int socket, struct sockaddr_in address)
Constructor for Game Statistics Client.
bool _GetKeyAndPlayerIndex(const std::string &input, std::string &key, int &player_index)
Get the key and the player index from string input.
A base class representing a network socket.