PGE API 0.4
PR00F's Game Engine full documentation
|
Definition at line 25 of file PgeNetwork.cpp.
Public Member Functions | |
virtual | ~PgeNetworkImpl () |
Calls shutdown(). | |
bool | initialize () override |
Initialize the networking subsystem. | |
bool | shutdown () override |
Stops the networking subsystem. | |
bool | isInitialized () const override |
Gets the state of the networking subsystem. | |
bool | reinitialize () override |
Stop and then initialize the networking subsystem. | |
void | disconnect (const std::string &sExtraDebugText="") override |
Disconnects the initialized networking subsystem. | |
bool | isServer () const override |
Returns whether the initialized network subsystem should be the server instance. | |
void | Update () override |
Handles connection state changes and forwards messages to the application. | |
pge_network::PgeIServerClient * | getServerClientInstance () override |
Returns access to the initialized networking subsystem. | |
pge_network::PgeIClient & | getClient () override |
Returns the client instance. | |
pge_network::PgeIServer & | getServer () override |
Returns the server instance. | |
void | WriteList () const override |
Writes statistics to console. | |
![]() | |
CConsole & | getConsole () const |
Returns access to console preset with logger module name as this class. | |
![]() |
Private Member Functions | |
PgeNetworkImpl (PGEcfgProfiles &cfgProfiles) | |
NULLs members only. | |
PgeNetworkImpl (const PgeNetworkImpl &) | |
PgeNetworkImpl & | operator= (const PgeNetworkImpl &) |
Private Attributes | |
PGEcfgProfiles & | m_cfgProfiles |
pge_network::PgeIServerClient * | m_pServerClient |
pge_network::PgeIClient & | m_pClient |
pge_network::PgeIServer & | m_pServer |
bool | m_bServer |
Friends | |
class | pge_network::PgeNetwork |
Additional Inherited Members | |
![]() | |
static PgeINetwork & | createAndGet (PGEcfgProfiles &cfgProfiles) |
Creates and gets the singleton implementation instance. | |
![]() | |
static const char * | getLoggerModuleName () |
Returns the logger module name of this class. | |
![]() | |
static constexpr char * | CVAR_NET_SERVER = "net_server" |
|
virtual |
Calls shutdown().
Definition at line 70 of file PgeNetwork.cpp.
|
explicitprivate |
NULLs members only.
Definition at line 270 of file PgeNetwork.cpp.
|
private |
Definition at line 281 of file PgeNetwork.cpp.
|
overridevirtual |
Disconnects the initialized networking subsystem.
After a disconnect(), the initialized networking subsystem can be connected again:
sExtraDebugText | An optional text that will be sent to the other side and will be logged to help debugging. |
Implements pge_network::PgeINetwork.
Definition at line 166 of file PgeNetwork.cpp.
|
overridevirtual |
Returns the client instance.
This is always a valid reference, even if getServerClientInstance() returns nullptr. This is because both client and server instances are always created, however neither of them might be initialized. This function is for convenience, since it is similar to: dynamic_cast<pge_network::PgeClient*>(getServerClientInstance())
Implements pge_network::PgeINetwork.
Definition at line 222 of file PgeNetwork.cpp.
|
overridevirtual |
Returns the server instance.
This is always a valid reference, even if getServerClientInstance() returns nullptr. This is because both client and server instances are always created, however neither of them might be initialized. This function is for convenience, since it is similar to: dynamic_cast<pge_network::PgeServer*>(getServerClientInstance())
Implements pge_network::PgeINetwork.
Definition at line 236 of file PgeNetwork.cpp.
|
overridevirtual |
Returns access to the initialized networking subsystem.
This is either the server or the client instance, or none of them.
Implements pge_network::PgeINetwork.
Definition at line 208 of file PgeNetwork.cpp.
|
overridevirtual |
Initialize the networking subsystem.
Either the server or a client instance will be initialized.
Implements pge_network::PgeINetwork.
Definition at line 81 of file PgeNetwork.cpp.
|
overridevirtual |
Gets the state of the networking subsystem.
Implements pge_network::PgeINetwork.
Definition at line 152 of file PgeNetwork.cpp.
|
overridevirtual |
Returns whether the initialized network subsystem should be the server instance.
Note: this has nothing to do with the actual initialization state of the network subsystem, this is just the desired configuration.
Implements pge_network::PgeINetwork.
Definition at line 180 of file PgeNetwork.cpp.
|
private |
Definition at line 291 of file PgeNetwork.cpp.
|
overridevirtual |
Stop and then initialize the networking subsystem.
Useful when we change the value of CVAR_NET_SERVER and want this change to take effect.
Implements pge_network::PgeINetwork.
Definition at line 137 of file PgeNetwork.cpp.
|
overridevirtual |
Stops the networking subsystem.
No effect before initialization. After shutdown, initialize() can be called again.
Implements pge_network::PgeINetwork.
Definition at line 119 of file PgeNetwork.cpp.
|
overridevirtual |
Handles connection state changes and forwards messages to the application.
Application can process these messages by overriding PGE::onPacketReceived().
Implements pge_network::PgeINetwork.
Definition at line 189 of file PgeNetwork.cpp.
|
overridevirtual |
Writes statistics to console.
Implements pge_network::PgeINetwork.
Definition at line 244 of file PgeNetwork.cpp.
|
friend |
Definition at line 60 of file PgeNetwork.cpp.
|
private |
Definition at line 54 of file PgeNetwork.cpp.
|
private |
Definition at line 50 of file PgeNetwork.cpp.
|
private |
Definition at line 52 of file PgeNetwork.cpp.
|
private |
Definition at line 53 of file PgeNetwork.cpp.
|
private |
Definition at line 51 of file PgeNetwork.cpp.