PGE API 0.4
PR00F's Game Engine full documentation
|
The primary interface to stubbed client networking functionality. More...
The primary interface to stubbed client networking functionality.
Definition at line 25 of file PgeClientStub.h.
#include <PgeClientStub.h>
Public Member Functions | |
PgeClientStub (PGEcfgProfiles &cfgProfiles) | |
PgeClientStub (const PgeClientStub &)=delete | |
PgeClientStub & | operator= (const PgeClientStub &)=delete |
PgeClientStub (PgeClientStub &&)=delete | |
PgeClientStub && | operator= (PgeClientStub &&)=delete |
virtual | ~PgeClientStub () |
bool | initialize () override |
Initialize the network instance. | |
bool | shutdown () override |
This stops the network instance. | |
bool | isInitialized () const override |
Gets the state of the network instance. | |
void | disconnect (const std::string &) override |
Terminates the active connection of the network instance. | |
void | Update () override |
bool | pollIncomingMessages () override |
Moves incoming packets from the underlying network layer to PGE network layer as PgePackets. | |
void | pollConnectionStateChanges () override |
std::size_t | getPacketQueueSize () const override |
pge_network::PgePacket | popFrontPacket () noexcept(false) override |
std::set< pge_network::PgePktId > & | getAllowListedPgeMessages () override |
std::set< pge_network::MsgApp::TMsgId > & | getAllowListedAppMessages () override |
void | send (const pge_network::PgePacket &, const pge_network::PgeNetworkConnectionHandle &) override |
Sends the given packet to the network instance specified. | |
uint32_t | getRxPacketCount () const override |
uint32_t | getTxPacketCount () const override |
uint32_t | getInjectPacketCount () const override |
uint32_t | getRxPacketPerSecondCount () const override |
uint32_t | getTxPacketPerSecondCount () const override |
uint32_t | getInjectPacketPerSecondCount () const override |
const std::map< pge_network::MsgApp::TMsgId, uint32_t > & | getRxMsgCount () const override |
const std::map< pge_network::MsgApp::TMsgId, uint32_t > & | getTxMsgCount () const override |
const std::map< pge_network::MsgApp::TMsgId, uint32_t > & | getInjectMsgCount () const override |
std::map< pge_network::MsgApp::TMsgId, std::string > & | getMsgAppId2StringMap () override |
uint32_t | getRxByteCount () const override |
uint32_t | getTxByteCount () const override |
uint32_t | getInjectByteCount () const override |
void | WriteList () const override |
Writes statistics to console. | |
bool | connectToServer (const std::string &, const std::string &) override |
Opens a connection to a server instance. | |
const pge_network::PgeNetworkConnectionHandle & | getConnectionHandle () const override |
Returns client's handle to the connection opened towards the server. | |
const pge_network::PgeNetworkConnectionHandle & | getConnectionHandleServerSide () const override |
Returns server's handle to the connection opened towards this client. | |
const char * | getServerAddress () const override |
int | getPing (bool) override |
float | getQualityLocal (bool) override |
float | getQualityRemote (bool) override |
float | getRxByteRate (bool) override |
float | getTxByteRate (bool) override |
int64_t | getPendingUnreliableBytes (bool) override |
int64_t | getPendingReliableBytes (bool) override |
int64_t | getSentButUnAckedReliableBytes (bool) override |
int64_t | getInternalQueueTimeUSecs (bool) override |
std::string | getDetailedConnectionStatus () const override |
![]() | |
![]() |
Additional Inherited Members | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
|
inline |
Definition at line 29 of file PgeClientStub.h.
|
delete |
|
delete |
|
inlinevirtual |
Definition at line 40 of file PgeClientStub.h.
|
inlineoverridevirtual |
Opens a connection to a server instance.
If the function is successful, any call to the derived isInitialized() and isConnected() is expected to return true. Note: you can disconnect from server by invoking the derived disconnect() or shutdown() which are implemented already in hidden class.
sServerAddress | IPv4 or IPv6 address of PgeServer we want to connect to. |
sAppVersion | Client application version. If server expects a specific client version, we should fill it here. |
Implements pge_network::PgeIClient.
Definition at line 105 of file PgeClientStub.h.
|
inlineoverridevirtual |
Terminates the active connection of the network instance.
In case of server instance, this terminates the active connections of the server instance and stops listening. It also sends as many MsgUserDisconnectedFromServer to all clients as the number of clients, so all clients will be notified about all other clients disconnecting. A MsgUserDisconnectedFromServer will be injected into the message queue with the server's connection handle, so at application level the handleUserDisconnected() is expected to be invoked with connHandleServerSide = pge_network::ServerConnHandle.
In case of client instance, this disconnects the client from the server. If client was connected at time of calling this function, a MsgUserDisconnectedFromServer will be injected into the message queue with the server's connection handle, so at application level the handleUserDisconnected() is expected to be invoked with connHandleServerSide = pge_network::ServerConnHandle, for which the client is expected to remove all other players as well since they are/were also connecting to the same server and not available anymore from this client's perspective.
sExtraDebugText | An optional text that will be sent to the other side and will be logged to help debugging. |
Implements pge_network::PgeIServerClient.
Definition at line 50 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 72 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 67 of file PgeClientStub.h.
|
inlineoverridevirtual |
Returns client's handle to the connection opened towards the server.
Implements pge_network::PgeIClient.
Definition at line 110 of file PgeClientStub.h.
|
inlineoverridevirtual |
Returns server's handle to the connection opened towards this client.
Implements pge_network::PgeIClient.
Definition at line 115 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIClient.
Definition at line 170 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 97 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 91 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 83 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 87 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIClient.
Definition at line 165 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 93 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 57 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIClient.
Definition at line 155 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIClient.
Definition at line 150 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIClient.
Definition at line 125 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIClient.
Definition at line 130 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIClient.
Definition at line 135 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 95 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIClient.
Definition at line 140 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 89 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 81 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 85 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIClient.
Definition at line 160 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIClient.
Definition at line 120 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 96 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIClient.
Definition at line 145 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 90 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 82 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 86 of file PgeClientStub.h.
|
inlineoverridevirtual |
Initialize the network instance.
Implements pge_network::PgeIServerClient.
Definition at line 47 of file PgeClientStub.h.
|
inlineoverridevirtual |
Gets the state of the network instance.
Implements pge_network::PgeIServerClient.
Definition at line 49 of file PgeClientStub.h.
|
delete |
|
delete |
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 55 of file PgeClientStub.h.
|
inlineoverridevirtual |
Moves incoming packets from the underlying network layer to PGE network layer as PgePackets.
Implements pge_network::PgeIServerClient.
Definition at line 54 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 62 of file PgeClientStub.h.
|
inlineoverridevirtual |
Sends the given packet to the network instance specified.
pkt | The packet to be sent. |
connHandle | The addressed network instance, that can be either a server or client instance. The default parameter means the addressed instance is the server instance. If server is specified and current instance is the server, the packet will be injected to self instead of actually sending it to the lower network level. |
Implements pge_network::PgeIServerClient.
Definition at line 77 of file PgeClientStub.h.
|
inlineoverridevirtual |
This stops the network instance.
Implements pge_network::PgeIServerClient.
Definition at line 48 of file PgeClientStub.h.
|
inlineoverridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 52 of file PgeClientStub.h.
|
inlineoverridevirtual |
Writes statistics to console.
Implements pge_network::PgeIServerClient.
Definition at line 99 of file PgeClientStub.h.
|
private |
Definition at line 181 of file PgeClientStub.h.
|
private |
Definition at line 182 of file PgeClientStub.h.
|
private |
Definition at line 183 of file PgeClientStub.h.