PGE API 0.4
PR00F's Game Engine full documentation
|
PGE Network Client and Server Common Interface class. More...
PGE Network Client and Server Common Interface class.
Let the application be either client or server, it is supposed to access functionality through this common interface.
Definition at line 32 of file PgeIServerClient.h.
#include <PgeIServerClient.h>
Public Member Functions | |
virtual bool | initialize ()=0 |
Initialize the network instance. | |
virtual bool | shutdown ()=0 |
This stops the network instance. | |
virtual bool | isInitialized () const =0 |
Gets the state of the network instance. | |
virtual void | disconnect (const std::string &sExtraDebugText="")=0 |
Terminates the active connection of the network instance. | |
virtual void | Update ()=0 |
virtual bool | pollIncomingMessages ()=0 |
Moves incoming packets from the underlying network layer to PGE network layer as PgePackets. | |
virtual void | pollConnectionStateChanges ()=0 |
virtual std::size_t | getPacketQueueSize () const =0 |
virtual pge_network::PgePacket | popFrontPacket () noexcept(false)=0 |
virtual std::set< pge_network::PgePktId > & | getAllowListedPgeMessages ()=0 |
virtual std::set< pge_network::MsgApp::TMsgId > & | getAllowListedAppMessages ()=0 |
virtual void | send (const pge_network::PgePacket &pkt, const pge_network::PgeNetworkConnectionHandle &connHandle=pge_network::ServerConnHandle)=0 |
Sends the given packet to the network instance specified. | |
virtual uint32_t | getRxPacketCount () const =0 |
virtual uint32_t | getTxPacketCount () const =0 |
virtual uint32_t | getInjectPacketCount () const =0 |
virtual uint32_t | getRxPacketPerSecondCount () const =0 |
virtual uint32_t | getTxPacketPerSecondCount () const =0 |
virtual uint32_t | getInjectPacketPerSecondCount () const =0 |
virtual const std::map< pge_network::MsgApp::TMsgId, uint32_t > & | getRxMsgCount () const =0 |
virtual const std::map< pge_network::MsgApp::TMsgId, uint32_t > & | getTxMsgCount () const =0 |
virtual const std::map< pge_network::MsgApp::TMsgId, uint32_t > & | getInjectMsgCount () const =0 |
virtual std::map< pge_network::MsgApp::TMsgId, std::string > & | getMsgAppId2StringMap ()=0 |
virtual uint32_t | getRxByteCount () const =0 |
virtual uint32_t | getTxByteCount () const =0 |
virtual uint32_t | getInjectByteCount () const =0 |
virtual void | WriteList () const =0 |
Writes statistics to console. | |
|
pure virtual |
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. |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Initialize the network instance.
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Gets the state of the network instance.
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Moves incoming packets from the underlying network layer to PGE network layer as PgePackets.
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
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. |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
This stops the network instance.
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.
|
pure virtual |
Writes statistics to console.
Implemented in pge_network::PgeClientStub, pge_network::PgeServerStub, PgeClientImpl, and PgeServerImpl.