Skip to content

PlayerLink::Client::Client

Client Class which is connected to the game and provides an interface to connect to the server. More...

#include <Client.h>

Public Functions

Name
Client(std::string serveraddr, std::string port =DEFAULT_TCP_PORT)
Constructs a Client Instance. Currently only TCP functionality is available.
~Client()
bool login(std::string usrname)
Creates a Session with the server using the provided username.
void logout()
Logs the user out and disconnects the connection from the server.
void addMsgToBuffer(unsigned char * message)
Adds a message to the buffer to be sent to the server.

Detailed Description

class PlayerLink::Client::Client;

Client Class which is connected to the game and provides an interface to connect to the server.

Author: Hanzalah Ravat

Public Functions Documentation

function Client

Client(
    std::string serveraddr,
    std::string port =DEFAULT_TCP_PORT
)

Constructs a Client Instance. Currently only TCP functionality is available.

Parameters:

  • serveraddr The address of the server
  • port The port to use to connect to the server

Return: A Client Type which can be used to access client functions and methods

function ~Client

~Client()

function login

bool login(
    std::string usrname
)

Creates a Session with the server using the provided username.

Parameters:

  • usrName This Users username

Return: 0 if the session runs and exits successfully

function logout

void logout()

Logs the user out and disconnects the connection from the server.

function addMsgToBuffer

void addMsgToBuffer(
    unsigned char * message
)

Adds a message to the buffer to be sent to the server.

Parameters:

  • message The byte array to be sent to the server

Updated on 18 January 2021 at 10:57:12 UTC