28#include "utils/leak_check.hpp"
57 EVENT_CHANNEL_COUNT = 3
Class representing an event that need to pass trough the system. This is used to remove ENet dependen...
Definition: event.hpp:73
NetworkString * m_data
Copy of the data passed by the event.
Definition: event.hpp:78
uint64_t m_arrival_time
Arrivial time of the event, for timeouts.
Definition: event.hpp:87
EVENT_TYPE m_type
Type of the event.
Definition: event.hpp:81
EVENT_TYPE getType() const
Returns the type of this event.
Definition: event.hpp:98
std::shared_ptr< STKPeer > m_peer
Pointer to the peer that triggered that event.
Definition: event.hpp:84
const NetworkString & data() const
Get a const reference to the received data.
Definition: event.hpp:109
NetworkString & data()
Get a non-const reference to the received data.
Definition: event.hpp:114
bool isSynchronous() const
Determines if this event should be delivered synchronous or not.
Definition: event.hpp:118
PeerDisconnectInfo m_pdi
For disconnection event, a bit more info is provided.
Definition: event.hpp:90
std::shared_ptr< STKPeer > getPeerSP() const
Returns the peer of this event (shared pointer).
Definition: event.hpp:101
uint64_t getArrivalTime() const
Returns the arrival time of this event.
Definition: event.hpp:122
STKPeer * getPeer() const
Returns the peer of this event.
Definition: event.hpp:104
A new implementation of NetworkString, which has a fixed format: Byte 0: The type of the message,...
Definition: network_string.hpp:422
bool isSynchronous() const
Returns if this message is synchronous or not.
Definition: network_string.hpp:470
Represents a peer. This class is used to interface the ENetPeer structure.
Definition: stk_peer.hpp:76
EVENT_CHANNEL
Represents a list of channels stk used.
Definition: event.hpp:53
@ EVENT_CHANNEL_UNENCRYPTED
Unencrypted channel.
Definition: event.hpp:55
@ EVENT_CHANNEL_NORMAL
Normal channel (encrypted if supported)
Definition: event.hpp:54
@ EVENT_CHANNEL_DATA_TRANSFER
Data transfer channel (like game replay)
Definition: event.hpp:56
EVENT_TYPE
Represents a network event type.
Definition: event.hpp:42
@ EVENT_TYPE_CONNECTED
A peer is connected.
Definition: event.hpp:43
@ EVENT_TYPE_DISCONNECTED
A peer is disconnected.
Definition: event.hpp:44
@ EVENT_TYPE_MESSAGE
A message between server and client protocols.
Definition: event.hpp:45
Defines functions to easily manipulate 8-bit network destinated strings.
PeerDisconnectInfo
Definition: stk_peer.hpp:48
Declares the general types that are used by the network.