25 #ifndef NRG_CLIENT_STATE_H
26 #define NRG_CLIENT_STATE_H
69 void registerEntity(
Entity* e);
75 double getInterpTimer()
const;
78 void startRecordingReplay(
const char* filename);
79 void stopRecordingReplay();
81 std::function<Entity*(ClientSnapshot::Action, uint16_t, uint16_t)> snap_func;
82 Entity* SnapFuncImpl(ClientSnapshot::Action, uint16_t, uint16_t);
83 std::map<uint16_t, Entity*> entities;
84 std::map<uint16_t, Entity*> entity_types;
87 std::unique_ptr<ClientStats> stats;
90 uint8_t server_seq_prev;
91 uint16_t server_ms_prev;
92 uint32_t client_ms, client_ms_prev, interval;
size_t getTimeoutSeconds() const
Returns a time that the state can go without needsUpdate() returning true, after which update() will ...
Definition: nrg_client_state.h:65
Abstract base class for Message.
Definition: nrg_message.h:36
StateResult update(StateConnectionOut &out, StateFlags f)
Called to update the state (or on a timeout) allowing it to optionally send some Packets using out...
Definition: nrg_snapshot.h:102
Contains Message classes and functionality for two-way RPC between Server and Client.
Interface for wrapping ConnectionOut with rate-limiting functionality.
Definition: nrg_state.h:61
bool onRecvPacket(Packet &p, PacketFlags f)
Called when a Packet is recieved and this is the active State, f shows if the packet was out-of-order...
Class for storing data to be sent / received across the network.
Definition: nrg_packet.h:58
bool needsUpdate() const
Called to see if the State would like to be updated.
Represents a connected client on the server.
Definition: nrg_player.h:34
Abstract class to be inherited by users of the library which acts as a container of one or more Field...
Definition: nrg_entity.h:37
Client statistics interface.
Definition: nrg_util.h:66
Holds a queue of Event objects.
Definition: nrg_event.h:92
bool needsUpdate() const
Called to see if the State would like to be updated.
Abstract class that contains functionality required by Entity objects.
Definition: nrg_entity.h:84
Contains functionality for managing the storage and reliable transmission or Messages.
bool onRecvPacket(Packet &p, PacketFlags f)
Called when a Packet is recieved and this is the active State, f shows if the packet was out-of-order...
Class that stores Messages to be sent, and parses received messages from packets, running their callb...
Definition: nrg_message_manager.h:37
The main server-side class of the library.
Definition: nrg_server.h:44
size_t getTimeoutSeconds() const
Returns a time that the state can go without needsUpdate() returning true, after which update() will ...
Definition: nrg_client_state.h:46
Abstract class that represents a protocol followed by the Server and Client.
Definition: nrg_state.h:73
Functionality for recording replay files.
StateResult update(StateConnectionOut &out, StateFlags f)
Called to update the state (or on a timeout) allowing it to optionally send some Packets using out...
Class that writes a replay to a file.
Definition: nrg_replay.h:39
bool init(Client *, Server *, Player *)
Called to (re)initialise this State instance, for Client-side c won't be null, but s and p will...
Definition: nrg_client_state.h:59
The main client-side nrg class.
Definition: nrg_client.h:42
bool init(Client *, Server *, Player *)
Called to (re)initialise this State instance, for Client-side c won't be null, but s and p will...
Definition: nrg_client_state.h:40
Common defines and includes used by all the other nrg header files.
Functionality related to the State abstract class.
Classes to hold a specific snapshot in time of Entity Field values.