|
| GameProtocol () |
| Constructor.
|
|
virtual bool | notifyEventAsynchronous (Event *event) OVERRIDE |
| Called when a message from a remote GameProtocol is received.
|
|
virtual void | update (int ticks) OVERRIDE |
| Called by the protocol listener, synchronously with the main loop.
|
|
void | sendActions () |
| Synchronous update - will send all commands collected during the last frame (and could optional only send messages every N frames).
|
|
void | controllerAction (int kart_id, PlayerAction action, int value, int val_l, int val_r) |
| Called from the local kart controller when an action (like steering, acceleration, ...) was triggered.
|
|
void | startNewState () |
| Called by the server before assembling a new message containing the full state of the race to be sent to a client.
|
|
void | addState (BareNetworkString *buffer) |
| Called by a server to add data to the current state.
|
|
void | sendState () |
| Called when the last state information has been added and the message can be sent to the clients.
|
|
void | finalizeState (std::vector< std::string > &cur_rewinder) |
| Called by a server to finalize the current state, which add updated names of rewinder using to the beginning of state buffer.
|
|
void | sendItemEventConfirmation (int ticks) |
| Sends a confirmation to the server that all item events up to 'ticks' have been received.
|
|
virtual void | undo (BareNetworkString *buffer) OVERRIDE |
| Called from the RewindManager when rolling back.
|
|
virtual void | rewind (BareNetworkString *buffer) OVERRIDE |
| Called from the RewindManager after a rollback to replay the stored events.
|
|
virtual void | setup () OVERRIDE |
| Called when the protocol is going to start.
|
|
virtual void | asynchronousUpdate () OVERRIDE |
| Called by the protocol listener as often as possible.
|
|
NetworkString * | getState () const |
| Returns the NetworkString in which a state was saved.
|
|
std::unique_lock< std::mutex > | acquireWorldDeletingMutex () const |
|
| Protocol (ProtocolType type) |
| Constructor Sets the basic protocol parameters, as the callback object and the protocol type.
|
|
virtual | ~Protocol () |
| Destructor.
|
|
virtual void | setup ()=0 |
| Called when the protocol is going to start.
|
|
virtual void | update (int ticks)=0 |
| Called by the protocol listener, synchronously with the main loop.
|
|
virtual void | asynchronousUpdate ()=0 |
| Called by the protocol listener as often as possible.
|
|
NetworkString * | getNetworkString (size_t capacity=16) const |
| functions to check incoming data easily
|
|
bool | checkDataSize (Event *event, unsigned int minimum_size) |
| Checks if the message has at least the specified size, and if not prints a warning message including the message content.
|
|
void | sendMessageToPeers (NetworkString *message, bool reliable=true) |
| Sends a message to all validated peers in game, encrypt the message if needed.
|
|
void | sendMessageToPeersInServer (NetworkString *message, bool reliable=true) |
| Sends a message to all validated peers in server, encrypt the message if needed.
|
|
void | sendToServer (NetworkString *message, bool reliable=true) |
| Sends a message from a client to the server.
|
|
virtual void | requestStart () |
| Starts a request in the protocol manager to start this protocol.
|
|
virtual void | requestTerminate () |
| Submits a request to the ProtocolManager to terminate this protocol.
|
|
virtual bool | notifyEvent (Event *event) |
| Notify a protocol matching the Event type of that event.
|
|
virtual bool | notifyEventAsynchronous (Event *event) |
| Notify a protocol matching the Event type of that event.
|
|
ProtocolType | getProtocolType () const |
| Method to get a protocol's type.
|
|
void | setHandleConnections (bool b) |
| Sets if this protocol should receive connection events.
|
|
void | setHandleDisconnections (bool b) |
| Sets if this protocol should receive disconnection events.
|
|
virtual bool | handleConnects () const |
| Return true if this protocol should be informed about connects.
|
|
virtual bool | handleDisconnects () const |
| Return true if this protocol should be informed about disconnects.
|
|
| EventRewinder () |
| Constructor.
|
|
virtual | ~EventRewinder () |
| Destructor.
|
|
virtual void | undo (BareNetworkString *buffer)=0 |
| Called when an event needs to be undone.
|
|
virtual void | rewind (BareNetworkString *buffer)=0 |
| Called when an event needs to be replayed.
|
|
|
void | handleControllerAction (Event *event) |
| Called when a controller event is received - either on the server from a client, or on a client from the server.
|
|
void | handleState (Event *event) |
| Called when a new full state is received form the server.
|
|
void | handleAdjustTime (Event *event) |
|
void | handleItemEventConfirmation (Event *event) |
| Handles an item even confirmation from a client.
|
|
std::tuple< uint8_t, uint16_t, uint16_t, uint16_t > | compressAction (const Action &a) |
|
std::tuple< PlayerAction, int, int, int > | decompressAction (uint8_t w, uint16_t x, uint16_t y, uint16_t z) |
|