PGE API 0.4
PR00F's Game Engine full documentation
|
Definition at line 20 of file PgeServer.cpp.
Public Member Functions | |
virtual | ~PgeServerImpl () |
Calls shutdown(). | |
bool | initialize () override |
Initialize the server subsystem. | |
bool | shutdown () override |
This stops the server subsystem. | |
bool | isInitialized () const override |
Gets the state of the server subsystem. | |
void | disconnect (const std::string &sExtraDebugText="") override |
Terminates the active connections of the server instance and stops listening. | |
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 &pkt, const pge_network::PgeNetworkConnectionHandle &connHandle=pge_network::ServerConnHandle) 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 | startListening (const std::string &sAppVersion="") override |
Starts listening to incoming PgeClient connections. | |
void | sendToAllClientsExcept (const pge_network::PgePacket &pkt, const pge_network::PgeNetworkConnectionHandle &exceptConnHandle=0) override |
Sends the given packet to all client instances except the optionally specified client. | |
void | sendToAll (const pge_network::PgePacket &pkt) override |
Sends the given packet to all known network instances, including the server itself (self). | |
void | setDebugNickname (const pge_network::PgeNetworkConnectionHandle &connHandle, const std::string &sNickname) override |
Sets a debug helper name associated to the given connection handle. | |
int | getPing (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate) override |
float | getQualityLocal (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate) override |
float | getQualityRemote (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate) override |
float | getRxByteRate (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate) override |
float | getTxByteRate (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate) override |
int64_t | getPendingUnreliableBytes (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate) override |
int64_t | getPendingReliableBytes (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate) override |
int64_t | getSentButUnAckedReliableBytes (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate) override |
int64_t | getInternalQueueTimeUSecs (const pge_network::PgeNetworkConnectionHandle &connHandle, bool bForceUpdate) override |
std::string | getDetailedConnectionStatus (const pge_network::PgeNetworkConnectionHandle &connHandle) const override |
![]() | |
CConsole & | getConsole () const |
Returns access to console preset with logger module name as this class. | |
![]() | |
![]() |
Private Member Functions | |
PgeServerImpl (PGEcfgProfiles &cfgProfiles) | |
PgeServerImpl (const PgeServerImpl &) | |
PgeServerImpl & | operator= (const PgeServerImpl &) |
Private Attributes | |
PGEcfgProfiles & | m_cfgProfiles |
PgeGnsServer & | m_gnsServer |
Friends | |
class | pge_network::PgeServer |
Additional Inherited Members | |
![]() | |
static PgeIServer & | createAndGet (PGEcfgProfiles &cfgProfiles) |
Creates and gets the singleton implementation instance. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
|
virtual |
Calls shutdown().
Definition at line 131 of file PgeServer.cpp.
|
explicitprivate |
Definition at line 394 of file PgeServer.cpp.
|
private |
Definition at line 402 of file PgeServer.cpp.
|
overridevirtual |
Terminates the active connections of the server instance and stops listening.
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 173 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 216 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 211 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServer.
Definition at line 382 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 293 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 273 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 243 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 258 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServer.
Definition at line 377 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 278 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 201 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServer.
Definition at line 367 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServer.
Definition at line 362 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServer.
Definition at line 337 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServer.
Definition at line 342 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServer.
Definition at line 347 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 283 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServer.
Definition at line 352 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 263 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 233 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 248 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServer.
Definition at line 372 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 288 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServer.
Definition at line 357 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 268 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 238 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 253 of file PgeServer.cpp.
|
overridevirtual |
Initialize the server subsystem.
Implements pge_network::PgeIServerClient.
Definition at line 141 of file PgeServer.cpp.
|
overridevirtual |
Gets the state of the server subsystem.
Implements pge_network::PgeIServerClient.
Definition at line 163 of file PgeServer.cpp.
|
private |
Definition at line 408 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 196 of file PgeServer.cpp.
|
overridevirtual |
Moves incoming packets from the underlying network layer to PGE network layer as PgePackets.
Implements pge_network::PgeIServerClient.
Definition at line 187 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 206 of file PgeServer.cpp.
|
overridevirtual |
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 221 of file PgeServer.cpp.
|
overridevirtual |
Sends the given packet to all known network instances, including the server itself (self).
Basically equals to: send(pkt); sendToAllClientsExcept(pkt);
pkt | The packet to be sent. |
Implements pge_network::PgeIServer.
Definition at line 326 of file PgeServer.cpp.
|
overridevirtual |
Sends the given packet to all client instances except the optionally specified client.
This function is never able to send to server, not even injecting, hence the name contains "Clients".
pkt | The packet to be sent. |
exceptConnHandle | The server-side connection of handle of a client to which we DO NOT want to send the packet. Since this function never sends to server, we use pge_network::ServerConnHandle as default, in such case the packet is sent to all clients. Even if you specify a real server-side connection handle of a client, this packet will never be sent to server, that is why function name contains "Clients". |
Implements pge_network::PgeIServer.
Definition at line 321 of file PgeServer.cpp.
|
overridevirtual |
Sets a debug helper name associated to the given connection handle.
Useful because it makes reading debug log easier when not only connection handle but also this debug helper name is also logged. Can be anything, for example it can be the same name as the player name on higher application level associated to this connection.
connHandle | The connection for which we want to set the debug helper name. Cannot be ServerConnHandle. |
sNickname | The debug helper name we want to see associated to the specified connection in the debug logs. |
Implements pge_network::PgeIServer.
Definition at line 332 of file PgeServer.cpp.
|
overridevirtual |
This stops the server subsystem.
No effect before initialization. After shutdown, initialize() and startListening() can be called again.
Implements pge_network::PgeIServerClient.
Definition at line 154 of file PgeServer.cpp.
|
overridevirtual |
Starts listening to incoming PgeClient connections.
If the function is successful, any call to the derived isListening() is expected to return true. Note: you can stop listening by invoking the derived disconnect() or shutdown() which are implemented already in hidden class.
sAppVersion | Server application version. We should fill it in if we expect connecting clients to have this same application version. |
Implements pge_network::PgeIServer.
Definition at line 316 of file PgeServer.cpp.
|
overridevirtual |
Implements pge_network::PgeIServerClient.
Definition at line 178 of file PgeServer.cpp.
|
overridevirtual |
Writes statistics to console.
Implements pge_network::PgeIServerClient.
Definition at line 298 of file PgeServer.cpp.
|
friend |
Definition at line 121 of file PgeServer.cpp.
|
private |
Definition at line 114 of file PgeServer.cpp.
|
private |
Definition at line 115 of file PgeServer.cpp.