25 #ifndef NRG_STATE_MANAGER_H
26 #define NRG_STATE_MANAGER_H
28 #include "nrg_packet.h"
62 uint16_t server_creation_time_ms;
63 uint32_t local_creation_time_ms;
65 std::map<uint16_t, std::unique_ptr<MessageBase>> handlers;
66 std::vector<MessageInfo> msg_metadata;
67 Packet *msg_data, buffer, buffer2;
68 uint8_t local_seq, remote_seq;
69 bool up_to_date, waiting_for_response;
Abstract base class for Message.
Definition: nrg_message.h:36
Contains Message classes and functionality for two-way RPC between Server and Client.
Class for storing data to be sent / received across the network.
Definition: nrg_packet.h:58
void addHandler(MessageBase &&m)
Add a Message containing a callback function to be run, passed in m as an R-value reference...
Class that stores Messages to be sent, and parses received messages from packets, running their callb...
Definition: nrg_message_manager.h:37
bool readFromPacket(Packet &p, uint16_t server_ms)
Reads all Messages from Packet p, running associated callback functions with them - The current Serve...
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...
Common defines and includes used by all the other nrg header files.
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...