90 enet_host_destroy(host);
struct _ENetHost ENetHost
Definition: NetClient.h:50
struct _ENetPeer ENetPeer
Definition: NetHost.h:33
NetDisconnectReason
Reasons sent by server to clients in disconnection messages.
Definition: NetHost.h:65
@ NDR_INCORRECT_PROTOCOL_VERSION
Definition: NetHost.h:69
@ NDR_BANNED
Definition: NetHost.h:73
@ NDR_SERVER_LOADING
Definition: NetHost.h:70
@ NDR_STUN_PORT_FAILED
Definition: NetHost.h:81
@ NDR_SERVER_ALREADY_IN_GAME
Definition: NetHost.h:71
@ NDR_INCORRECT_READY_TURN_COMMANDS
Definition: NetHost.h:78
@ NDR_CONNECTION_REQUEST_TIMED_OUT
Definition: NetHost.h:67
@ NDR_KICKED
Definition: NetHost.h:72
@ NDR_GUID_FAILED
Definition: NetHost.h:77
@ NDR_SERVER_FULL
Definition: NetHost.h:75
@ NDR_INCORRECT_SOFTWARE_VERSION
Definition: NetHost.h:83
@ NDR_STUN_ENDPOINT_FAILED
Definition: NetHost.h:82
@ NDR_SERVER_REFUSED
Definition: NetHost.h:80
@ NDR_INCORRECT_READY_TURN_SIMULATED
Definition: NetHost.h:79
@ NDR_LOBBY_AUTH_FAILED
Definition: NetHost.h:76
@ NDR_PLAYERNAME_IN_USE
Definition: NetHost.h:74
@ NDR_SERVER_SHUTDOWN
Definition: NetHost.h:68
@ NDR_UNKNOWN
Definition: NetHost.h:66
std::map< CStr, PlayerAssignment > PlayerAssignmentMap
Definition: NetHost.h:56
struct _ENetPacket ENetPacket
Definition: NetHost.h:34
Definition: NetHost.h:104
static ENetPacket * CreatePacket(const CNetMessage *message)
Construct an ENet packet by serialising the given message.
Definition: NetHost.cpp:54
static void Deinitialize()
Deinitialize ENet.
Definition: NetHost.cpp:81
static void Initialize()
Initialize ENet.
Definition: NetHost.cpp:75
static bool SendMessage(const CNetMessage *message, ENetPeer *peer, const char *peerName)
Transmit a message to the given peer.
Definition: NetHost.cpp:30
static const int DEFAULT_CHANNEL
Definition: NetHost.h:106
The base class for all network messages exchanged within the game.
Definition: NetMessage.h:42
void operator()(ENetHost *host) const noexcept
Definition: NetHost.h:88
void operator()(ENetPeer *peer) const noexcept
Definition: NetHost.h:96
std::int32_t m_PlayerID
The player that the given host controls, or -1 if none (observer)
Definition: NetHost.h:50
bool m_Enabled
Whether the player is currently connected and active.
Definition: NetHost.h:44
std::uint8_t m_Status
Status - Ready or not: 0 for not ready, 1 for ready, 2 to stay ready.
Definition: NetHost.h:53
CStrW m_Name
Player name.
Definition: NetHost.h:47