LibNRG  0.0.1
Networking for Real-time Games library
 All Classes Files Functions Variables Friends
nrg::MessageManager Class Reference

Class that stores Messages to be sent, and parses received messages from packets, running their callback functions.

#include <nrg_message_manager.h>

Public Member Functions

 MessageManager ()
 Default Constructor.
 
void writeToPacket (Packet &p, uint16_t server_ms)
 Writes any queued Messages into the Packet p - The current Server time must be provided in server_ms.
 
bool readFromPacket (Packet &p, uint16_t server_ms)
 Reads all Messages from Packet p, running associated callback functions with them - The current Server time must be provided in server_ms.
 
void addHandler (MessageBase &&m)
 Add a Message containing a callback function to be run, passed in m as an R-value reference.
 
void addHandler (const MessageBase &m)
 Add a Message containing a callback function to be run, passed in m by const reference.
 
void addMessage (const MessageBase &m, uint16_t server_ms)
 Add a Message m to be sent over the network - The current Server time must be provided in server_ms.
 

The documentation for this class was generated from the following file: