|
| | Client (const std::string &game_name, uint32_t game_version, InputBase &input) |
| | Standard Client constructor. More...
|
| |
| | Client (const std::string &game_name, uint32_t game_version) |
| | No-Input Client constructor. More...
|
| |
|
bool | connect (const NetAddress &server_addr) |
| | Sets the address of the Server to connect to, and calls Socket::connect on it.
|
| |
|
bool | isConnected () const |
| | Returns whether or not this Client is connected or not.
|
| |
|
const NetAddress * | getConnectedAddress () const |
| | Returns the NetAddress this Client is connected to, or nullptr if not connected.
|
| |
|
void | registerEntity (Entity *e) |
| | Registers a subclass of Entity with this Client, must be called once for each user-defined Entity before connecting.
|
| |
|
template<class M , class F > |
| void | addMessageHandler (F &&f) |
| | Adds a function f, that will be called when the Client receives a Message of type M.
|
| |
|
void | sendMessage (const MessageBase &m) |
| | Queues the the user-defined Message m to be sent to the connected Server.
|
| |
|
bool | update () |
| | Sends and Recieves any queued Packets and updates the contained State classes, returns false on error.
|
| |
|
bool | pollEvent (Event &e) |
| | Places the next Event from the Client's EventQueue into e, returning true if this happened, or false if there were no more events.
|
| |
|
const ClientStats & | getStats () const |
| | Returns a ClientStats reference, which contains statistics about this Client's connection.
|
| |
|
void | startRecordingReplay (const char *filename) |
| | Starts recording received packets into a file called filename.
|
| |
|
void | stopRecordingReplay () |
| | Stops recording received packets into a file called filename.
|
| |
|
| ~Client () |
| | Standard destructor.
|
| |
|
|
uint32_t | getPacketRateLimit (void) |
| | Gets a limit on how many full Packets the Client will send per second.
|
| |
|
void | setPacketRateLimit (uint32_t packets_per_sec) |
| | Sets a limit on how many full Packets the Client will send per second.
|
| |
|
|
void * | getUserPointer () const |
| | Get a user-defined pointer to be associated with this Client instance.
|
| |
|
void | setUserPointer (void *p) |
| | Set a user-defined pointer to be associated with this Client instance.
|
| |
|
|
InputBase * | getInput () |
| |
|
EventQueue & | getEventQueue () |
| |
|
UDPSocket & | getSock () |
| |
|
const std::string & | getGameName () |
| |
|
const uint32_t | getGameVersion () |
| |
|
const int | getPlayerID () |
| |