#include <servernetworkcomponent.h>

Public Member Functions | |
| ServerNetworkComponent (const std::string &gameName, const int gameVersion, const std::string &logFile="") | |
| Construct a ServerNetworkComponent with a game name and version to be used by GNE Calls base class constructor to initialize GNE. | |
| bool | SetupServer (int portNum) |
| Start a Server. | |
| virtual void | OnListenSuccess () |
| callback to signal a connection is successful | |
| virtual void | OnListenFailure (const GNE::Error &error, const GNE::Address &from, const GNE::ConnectionListener::sptr &listener) |
| callback to signal the connection to the socket failed | |
| virtual void | OnDisconnect (NetworkBridge &networkBridge) |
| Function called by a NetworkBridge if a connection disconnects. | |
| virtual void | ProcessNetClientRequestConnection (const MachineInfoMessage &msg) |
| Processes a MessageType::NETCLIENT_REQUEST_CONNECTION Message. | |
| virtual void | ProcessNetClientNotifyDisconnect (const dtGame::Message &msg) |
| Processes a MessageType::NETCLIENT_NOTIFY_DISCONNECT Message. | |
Protected Member Functions | |
| ~ServerNetworkComponent (void) | |
| virtual bool | AcceptClient (const dtGame::MachineInfo &machineInfo, std::string &rejectionReason) |
| Function to accept or deny a client connection request. | |
| virtual void | SendInfoClientConnectedMessage (const dtGame::MachineInfo &machineInfo) |
| Sends a INFO_CLIENT_CONNECTED messages to the already connected clients. | |
| virtual void | SendConnectedClientMessage (const dtGame::MachineInfo &machineInfo) |
| Sends a INFO_CLIENT_CONNECTED messages to the new client, informing the new client of existing connections. | |
Protected Attributes | |
| bool | mAcceptClients |
| dtNetGM::ServerNetworkComponent::ServerNetworkComponent | ( | const std::string & | gameName, | |
| const int | gameVersion, | |||
| const std::string & | logFile = "" | |||
| ) |
Construct a ServerNetworkComponent with a game name and version to be used by GNE Calls base class constructor to initialize GNE.
| gameName | The game name | |
| gameVersion | The game version | |
| logFile | The logfile name |
| dtNetGM::ServerNetworkComponent::~ServerNetworkComponent | ( | void | ) | [protected] |
| bool dtNetGM::ServerNetworkComponent::SetupServer | ( | int | portNum | ) |
Start a Server.
| The | protnumber used by the server |
| void dtNetGM::ServerNetworkComponent::OnListenSuccess | ( | ) | [virtual] |
callback to signal a connection is successful
| void dtNetGM::ServerNetworkComponent::OnListenFailure | ( | const GNE::Error & | error, | |
| const GNE::Address & | from, | |||
| const GNE::ConnectionListener::sptr & | listener | |||
| ) | [virtual] |
callback to signal the connection to the socket failed
| void dtNetGM::ServerNetworkComponent::OnDisconnect | ( | NetworkBridge & | networkBridge | ) | [virtual] |
Function called by a NetworkBridge if a connection disconnects.
| The | NetworkBridge |
Reimplemented from dtNetGM::NetworkComponent.
| void dtNetGM::ServerNetworkComponent::ProcessNetClientRequestConnection | ( | const MachineInfoMessage & | msg | ) | [virtual] |
Processes a MessageType::NETCLIENT_REQUEST_CONNECTION Message.
| msg | The message |
Reimplemented from dtNetGM::NetworkComponent.
| void dtNetGM::ServerNetworkComponent::ProcessNetClientNotifyDisconnect | ( | const dtGame::Message & | msg | ) | [virtual] |
Processes a MessageType::NETCLIENT_NOTIFY_DISCONNECT Message.
| msg | The message |
| bool dtNetGM::ServerNetworkComponent::AcceptClient | ( | const dtGame::MachineInfo & | machineInfo, | |
| std::string & | rejectionReason | |||
| ) | [protected, virtual] |
Function to accept or deny a client connection request.
| machineInfo | The MachineInfo of the new client | |
| rejectionReason | Rejection reason which is send to the client if denied |
| void dtNetGM::ServerNetworkComponent::SendInfoClientConnectedMessage | ( | const dtGame::MachineInfo & | machineInfo | ) | [protected, virtual] |
Sends a INFO_CLIENT_CONNECTED messages to the already connected clients.
| machineInfo | The MachineInfo of the new client |
| void dtNetGM::ServerNetworkComponent::SendConnectedClientMessage | ( | const dtGame::MachineInfo & | machineInfo | ) | [protected, virtual] |
Sends a INFO_CLIENT_CONNECTED messages to the new client, informing the new client of existing connections.
| machineInfo | The MachineInfo of the new client |
bool dtNetGM::ServerNetworkComponent::mAcceptClients [protected] |