![]() |
Leviathan
0.8.0.0
Leviathan game engine
|
Class that encapsulates common networking functionality required by server programs. More...
#include <NetworkMasterServerInterface.h>
Public Member Functions | |
DLLEXPORT | NetworkMasterServerInterface () |
DLLEXPORT | ~NetworkMasterServerInterface () |
virtual DLLEXPORT void | HandleRequestPacket (std::shared_ptr< NetworkRequest > request, Connection &connection) override |
Called by ConnectionInfo to handle incoming packets. More... | |
virtual DLLEXPORT void | HandleResponseOnlyPacket (std::shared_ptr< NetworkResponse > message, Connection &connection) override |
Called by ConnectionInfo when it receives a response without a matching request object. More... | |
DLLEXPORT void | TickIt () override |
Should be used to update various network interfaces. More... | |
virtual DLLEXPORT void | CloseDown () override |
Call this before shutting down the server to kick all players properly. More... | |
virtual DLLEXPORT std::vector< std::shared_ptr< Connection > > & | GetClientConnections () override |
If this is a server returns all the clients. More... | |
![]() | |
DLLEXPORT | NetworkInterface (NETWORKED_TYPE type) |
virtual DLLEXPORT | ~NetworkInterface () |
virtual DLLEXPORT bool | PreHandleResponse (std::shared_ptr< NetworkResponse > response, SentNetworkThing *originalrequest, Connection &connection) |
Called by ConnectionInfo to verify that a response is good. More... | |
virtual DLLEXPORT bool | CanConnectionTerminate (Connection &connection) |
Called by Connection just before terminating an inactive connection. More... | |
DLLEXPORT void | VerifyType (NETWORKED_TYPE type) const |
Asserts if types don't match. More... | |
NetworkHandler * | GetOwner () |
Additional Inherited Members | |
![]() | |
virtual bool | _CustomHandleRequestPacket (std::shared_ptr< NetworkRequest > request, Connection &connection) |
virtual bool | _CustomHandleResponseOnlyPacket (std::shared_ptr< NetworkResponse > message, Connection &connection) |
DLLEXPORT bool | _HandleDefaultRequest (std::shared_ptr< NetworkRequest > request, Connection &connectiontosendresult) |
Utility function for subclasses to call for default handling. More... | |
DLLEXPORT bool | _HandleDefaultResponseOnly (std::shared_ptr< NetworkResponse > message, Connection &connection) |
Utility function for subclasses to call for default handling of non-request responses. More... | |
DLLEXPORT void | SetOwner (NetworkHandler *owner) |
![]() | |
NETWORKED_TYPE | OurNetworkType |
NetworkHandler * | Owner = nullptr |
Class that encapsulates common networking functionality required by server programs.
More specific version of NetworkInterface and should be included additionally in server network interface classes.
Definition at line 21 of file NetworkMasterServerInterface.h.
DLLEXPORT Leviathan::NetworkMasterServerInterface::NetworkMasterServerInterface | ( | ) |
Definition at line 11 of file NetworkMasterServerInterface.cpp.
DLLEXPORT Leviathan::NetworkMasterServerInterface::~NetworkMasterServerInterface | ( | ) |
Definition at line 17 of file NetworkMasterServerInterface.cpp.
|
overridevirtual |
Call this before shutting down the server to kick all players properly.
Implements Leviathan::NetworkInterface.
Definition at line 61 of file NetworkMasterServerInterface.cpp.
|
overridevirtual |
If this is a server returns all the clients.
Implements Leviathan::NetworkInterface.
Definition at line 66 of file NetworkMasterServerInterface.cpp.
|
overridevirtual |
Called by ConnectionInfo to handle incoming packets.
This function is responsible for interpreting the packet data and generating a response. If the response could take a long time to generate it is recommended to queue a task to the ThreadingManager.
Implements Leviathan::NetworkInterface.
Definition at line 21 of file NetworkMasterServerInterface.cpp.
|
overridevirtual |
Called by ConnectionInfo when it receives a response without a matching request object.
This is called when the host on the connection sends a response without a matching request. Usually the other program instance wants us to do something without expecting a response, for example they could want us to add a new message to our inbox without expecting a response (other than an ack which is automatically sent) from us. The function can optionally ignore keepalive acks (to reduce spam between clients) by setting dontmarkasreceived as true. This function shouldn't throw any exceptions.
Implements Leviathan::NetworkInterface.
Definition at line 39 of file NetworkMasterServerInterface.cpp.
|
overridevirtual |
Should be used to update various network interfaces.
Implements Leviathan::NetworkInterface.
Definition at line 57 of file NetworkMasterServerInterface.cpp.