|
R-Type
Distributed multiplayer game engine in C++
|
#include <ENetHost.hpp>


Public Member Functions | |
| ENetHostWrapper (size_t maxConnections=1, size_t maxChannels=2, uint32_t incomingBandwidth=0, uint32_t outgoingBandwidth=0) | |
| ENetHostWrapper (const IAddress &address, size_t maxConnections, size_t maxChannels=2, uint32_t incomingBandwidth=0, uint32_t outgoingBandwidth=0) | |
| ~ENetHostWrapper () override | |
| ENetHostWrapper (const ENetHostWrapper &)=delete | |
| ENetHostWrapper & | operator= (const ENetHostWrapper &)=delete |
| IPeer * | connect (const IAddress &address, size_t channelCount, uint32_t data) override |
| Connect to a remote host. | |
| std::optional< HostNetworkEvent > | service (uint32_t timeout) override |
| Service the host, processing network events. | |
| void | broadcast (std::unique_ptr< IPacket > packet, uint8_t channelID) override |
| Broadcast a packet to all connected peers. | |
| void | flush () override |
| Send all queued packets immediately. | |
| size_t | getPeerCount () const override |
| Get the number of connected peers. | |
| const IAddress & | getAddress () const override |
| Get the address this host is bound to. | |
Public Member Functions inherited from IHost | |
| virtual | ~IHost ()=default |
Private Attributes | |
| ENetHost * | _host |
| std::map< ENetPeer *, std::unique_ptr< ENetPeerWrapper > > | _peers |
| std::unique_ptr< ENetAddressWrapper > | _cachedAddress |
Definition at line 18 of file ENetHost.hpp.
|
explicit |
Definition at line 16 of file ENetHost.cpp.
References _host.
| ENetHostWrapper::ENetHostWrapper | ( | const IAddress & | address, |
| size_t | maxConnections, | ||
| size_t | maxChannels = 2, |
||
| uint32_t | incomingBandwidth = 0, |
||
| uint32_t | outgoingBandwidth = 0 |
||
| ) |
Definition at line 27 of file ENetHost.cpp.
References _host.
|
override |
Definition at line 49 of file ENetHost.cpp.
References _host.
|
delete |
|
overridevirtual |
Broadcast a packet to all connected peers.
| packet | The packet to broadcast. |
| channelID | The channel to broadcast on. |
Implements IHost.
Definition at line 127 of file ENetHost.cpp.
References _host.
|
overridevirtual |
Connect to a remote host.
| address | The address to connect to. |
| channelCount | Number of channels to allocate (default: 1). |
| data | User data to send with the connection request. |
Implements IHost.
Definition at line 55 of file ENetHost.cpp.
|
overridevirtual |
Send all queued packets immediately.
Implements IHost.
Definition at line 143 of file ENetHost.cpp.
References _host.
|
overridevirtual |
Get the address this host is bound to.
Implements IHost.
Definition at line 153 of file ENetHost.cpp.
References _cachedAddress, and _host.
|
overridevirtual |
Get the number of connected peers.
Implements IHost.
Definition at line 149 of file ENetHost.cpp.
References _host.
|
delete |
|
overridevirtual |
Service the host, processing network events.
| timeout | Maximum time to wait for events in milliseconds. |
Implements IHost.
Definition at line 75 of file ENetHost.cpp.
References _host, _peers, HostNetworkEvent::channelID, CONNECT, DISCONNECT, HostNetworkEvent::packet, HostNetworkEvent::peer, RECEIVE, and HostNetworkEvent::type.
|
mutableprivate |
Definition at line 44 of file ENetHost.hpp.
Referenced by getAddress().
|
private |
Definition at line 42 of file ENetHost.hpp.
Referenced by broadcast(), connect(), ENetHostWrapper(), ENetHostWrapper(), flush(), getAddress(), getPeerCount(), service(), and ~ENetHostWrapper().
|
private |
Definition at line 43 of file ENetHost.hpp.