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


Public Member Functions | |
| ENetPeerWrapper (ENetPeer *peer) | |
| bool | send (std::unique_ptr< IPacket > packet, uint8_t channelID) override |
| Send a packet to this peer. | |
| void | disconnect (uint32_t data) override |
| Disconnect from this peer. | |
| void | disconnectNow (uint32_t data) override |
| Force an immediate disconnect from this peer. | |
| void | disconnectLater (uint32_t data) override |
| Disconnect from this peer after all queued packets are sent. | |
| PeerState | getState () const override |
| Get the current state of this peer. | |
| const IAddress & | getAddress () const override |
| Get the address of this peer. | |
| uint32_t | getID () const override |
| Get a unique identifier for this peer. | |
| uint32_t | getRoundTripTime () const override |
| Get the round-trip time (ping) to this peer. | |
| void | setData (void *data) override |
| Set application-specific data associated with this peer. | |
| void * | getData () const override |
| Get application-specific data associated with this peer. | |
| ENetPeer * | getNativePeer () const |
Public Member Functions inherited from IPeer | |
| virtual | ~IPeer ()=default |
Private Attributes | |
| ENetPeer * | _peer |
| std::unique_ptr< ENetAddressWrapper > | _cachedAddress |
Definition at line 15 of file ENetPeer.hpp.
|
explicit |
Definition at line 13 of file ENetPeer.cpp.
References _peer.
|
overridevirtual |
Disconnect from this peer.
| data | Optional user data to send with the disconnect notification. |
Implements IPeer.
Definition at line 40 of file ENetPeer.cpp.
References _peer.
|
overridevirtual |
Disconnect from this peer after all queued packets are sent.
| data | Optional user data to send with the disconnect notification. |
Implements IPeer.
Definition at line 52 of file ENetPeer.cpp.
References _peer.
|
overridevirtual |
Force an immediate disconnect from this peer.
| data | Optional user data to send with the disconnect notification. |
Implements IPeer.
Definition at line 46 of file ENetPeer.cpp.
References _peer.
|
overridevirtual |
Get the address of this peer.
Implements IPeer.
Definition at line 94 of file ENetPeer.cpp.
References _cachedAddress, and _peer.
|
overridevirtual |
Get application-specific data associated with this peer.
Implements IPeer.
Definition at line 127 of file ENetPeer.cpp.
References _peer.
|
overridevirtual |
Get a unique identifier for this peer.
Implements IPeer.
Definition at line 107 of file ENetPeer.cpp.
References _peer.
| ENetPeer * ENetPeerWrapper::getNativePeer | ( | ) | const |
Definition at line 59 of file ENetPeer.cpp.
References _peer.
|
overridevirtual |
Get the round-trip time (ping) to this peer.
Implements IPeer.
Definition at line 114 of file ENetPeer.cpp.
References _peer.
|
overridevirtual |
Get the current state of this peer.
Implements IPeer.
Definition at line 63 of file ENetPeer.cpp.
References _peer, ACKNOWLEDGING_CONNECT, ACKNOWLEDGING_DISCONNECT, CONNECTED, CONNECTING, CONNECTION_PENDING, CONNECTION_SUCCEEDED, DISCONNECT_LATER, DISCONNECTED, DISCONNECTING, and ZOMBIE.
|
overridevirtual |
Send a packet to this peer.
| packet | The packet to send. |
| channelID | The channel ID to send the packet on. |
Implements IPeer.
Definition at line 19 of file ENetPeer.cpp.
References _peer.
|
overridevirtual |
Set application-specific data associated with this peer.
| data | Pointer to user data. |
Implements IPeer.
Definition at line 121 of file ENetPeer.cpp.
References _peer.
|
mutableprivate |
Definition at line 35 of file ENetPeer.hpp.
Referenced by getAddress().
|
private |
Definition at line 34 of file ENetPeer.hpp.
Referenced by disconnect(), disconnectLater(), disconnectNow(), ENetPeerWrapper(), getAddress(), getData(), getID(), getNativePeer(), getRoundTripTime(), getState(), send(), and setData().