dtNetGM::ServerNetworkComponent Class Reference

#include <servernetworkcomponent.h>

Inheritance diagram for dtNetGM::ServerNetworkComponent:

dtNetGM::NetworkComponent dtGame::GMComponent dtCore::Base

List of all members.

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


Constructor & Destructor Documentation

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.

Parameters:
gameName The game name
gameVersion The game version
logFile The logfile name

dtNetGM::ServerNetworkComponent::~ServerNetworkComponent ( void   )  [protected]


Member Function Documentation

bool dtNetGM::ServerNetworkComponent::SetupServer ( int  portNum  ) 

Start a Server.

Parameters:
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.

Parameters:
The NetworkBridge

Reimplemented from dtNetGM::NetworkComponent.

void dtNetGM::ServerNetworkComponent::ProcessNetClientRequestConnection ( const MachineInfoMessage msg  )  [virtual]

Processes a MessageType::NETCLIENT_REQUEST_CONNECTION Message.

Parameters:
msg The message

Reimplemented from dtNetGM::NetworkComponent.

void dtNetGM::ServerNetworkComponent::ProcessNetClientNotifyDisconnect ( const dtGame::Message msg  )  [virtual]

Processes a MessageType::NETCLIENT_NOTIFY_DISCONNECT Message.

Parameters:
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.

Parameters:
machineInfo The MachineInfo of the new client
rejectionReason Rejection reason which is send to the client if denied
Returns:
boolean indicating if a client should be accepted

void dtNetGM::ServerNetworkComponent::SendInfoClientConnectedMessage ( const dtGame::MachineInfo machineInfo  )  [protected, virtual]

Sends a INFO_CLIENT_CONNECTED messages to the already connected clients.

Parameters:
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.

Parameters:
machineInfo The MachineInfo of the new client


Member Data Documentation

bool dtNetGM::ServerNetworkComponent::mAcceptClients [protected]


http://www.delta3d.org
2.0.0 generated 14 Feb 2008