5 #include <net/socket.h>
20 std::string challenge;
22 std::string authtoken;
23 std::shared_ptr<Client> client;
46 Client(
int socket,
struct sockaddr_in address);
143 void requestBm(
const GameSpy::Parameter& parameter);
209 void _LogTransaction(
const std::string& direction,
const std::string& response)
const;
254 static void SendBuddyMessage(
int profileid,
int target_profileid,
const std::string& bm,
const std::string& message);
Represents a GPCM client.
void requestChallenge()
Sends a challenge to the client.
void requestInviteTo(const GameSpy::Parameter ¶meter)
Process an invite request from the client.
void requestGetProfile(const GameSpy::Parameter ¶meter)
Process a get-profile request from the client.
void requestAuthAdd(const GameSpy::Parameter ¶meter)
Process an auth-add request from the client.
void Disconnect()
Disconnects the client.
void Listen()
Listens for incoming messages from the GPCM client.
void _LogTransaction(const std::string &direction, const std::string &response) const
Log a transaction with direction and response.
~Client()
Destroys the GPCM client.
void requestRevoke(const GameSpy::Parameter ¶meter)
Process a revoke request from the client.
void requestPlayerInvite(const GameSpy::Parameter ¶meter)
Process a player-invite request from the client.
void _SyncFriends()
Synchronizes friends with the client.
static GPCM::Session findSessionByProfileId(int profileid)
Finds a session by profile ID.
static void SendBuddyMessage(int profileid, int target_profileid, const std::string &bm, const std::string &message)
Sends a buddy message from one profile ID to another.
Client(int socket, struct sockaddr_in address)
Constructs a new GPCM client.
static void Heartbeat()
Heartbeat function to manage client connections.
void requestStatus(const GameSpy::Parameter ¶meter)
Process a status request from the client.
void requestBm(const GameSpy::Parameter ¶meter)
Process a BM request from the client.
void requestDeleteBuddy(const GameSpy::Parameter ¶meter)
Process a delete-buddy request from the client.
void requestLogout(const GameSpy::Parameter ¶meter)
Process a logout request from the client.
std::vector< int > _sync_friends
void onRequest(const std::string &msg)
Event handler for incoming messages from the client.
static GPCM::Session findSessionByAuthtoken(const std::string &authtoken)
Finds a session by authentication token.
void requestAddBuddy(const GameSpy::Parameter ¶meter)
Process an add-buddy request from the client.
void requestLogin(const GameSpy::Parameter ¶meter)
Process a login request from the client.
void _SendNewStatus() const
Sends a new status to the client.
GPCM::Session GetSession() const
Get the session information of the client.
A base class representing a network socket.
Represents a session with a GPCM client.