RakNet  4.0
Public Member Functions | Protected Attributes | List of all members
RakNet::RakNetCommandParser Class Reference

This allows a console client to call most of the functions in RakPeer. More...

#include <RakNetCommandParser.h>

Inheritance diagram for RakNet::RakNetCommandParser:
RakNet::CommandParserInterface

Public Member Functions

bool OnCommand (const char *command, unsigned numParameters, char **parameterList, TransportInterface *transport, const SystemAddress &systemAddress, const char *originalString)
 
const char * GetName (void) const
 
void SendHelp (TransportInterface *transport, const SystemAddress &systemAddress)
 
void SetRakPeerInterface (RakNet::RakPeerInterface *rakPeer)
 
- Public Member Functions inherited from RakNet::CommandParserInterface
virtual void OnNewIncomingConnection (const SystemAddress &systemAddress, TransportInterface *transport)
 A callback for when systemAddress has connected to us.
 
virtual void OnConnectionLost (const SystemAddress &systemAddress, TransportInterface *transport)
 A callback for when systemAddress has disconnected, either gracefully or forcefully.
 
virtual void OnTransportChange (TransportInterface *transport)
 This is called every time transport interface is registered.
 
virtual void RegisterCommand (unsigned char parameterCount, const char *command, const char *commandHelp)
 
virtual void ReturnResult (bool res, const char *command, TransportInterface *transport, const SystemAddress &systemAddress)
 Just writes a string to the remote system based on the result ( res ) of your operation.
 
virtual void ReturnResult (const char *command, TransportInterface *transport, const SystemAddress &systemAddress)
 Just writes a string to the remote system when you are calling a function that has no return value.
 

Protected Attributes

RakPeerInterfacepeer
 Which instance of RakPeer we are working on. Set from SetRakPeerInterface()
 

Detailed Description

This allows a console client to call most of the functions in RakPeer.

Member Function Documentation

const char* RakNet::RakNetCommandParser::GetName ( void  ) const
virtual

You are responsible for overriding this function and returning a static string, which will identifier your parser. This should return a static string

Returns
The name that you return.

Implements RakNet::CommandParserInterface.

bool RakNet::RakNetCommandParser::OnCommand ( const char *  command,
unsigned  numParameters,
char **  parameterList,
TransportInterface transport,
const SystemAddress systemAddress,
const char *  originalString 
)
virtual

Given command with parameters parameterList , do whatever processing you wish.

Parameters
[in]commandThe command to process
[in]numParametersHow many parameters were passed along with the command
[in]parameterListThe list of parameters. parameterList[0] is the first parameter and so on.
[in]transportThe transport interface we can use to write to
[in]systemAddressThe player that sent this command.
[in]originalStringThe string that was actually sent over the network, in case you want to do your own parsing

Implements RakNet::CommandParserInterface.

void RakNet::RakNetCommandParser::SendHelp ( TransportInterface transport,
const SystemAddress systemAddress 
)
virtual

A callback for when you are expected to send a brief description of your parser to systemAddress

Parameters
[in]transportThe transport interface we can use to write to
[in]systemAddressThe player that requested help.

Implements RakNet::CommandParserInterface.

void RakNet::RakNetCommandParser::SetRakPeerInterface ( RakNet::RakPeerInterface rakPeer)

Records the instance of RakPeer to perform the desired commands on

Parameters
[in]rakPeerThe RakPeer instance, or a derived class (e.g. RakPeer or RakPeer)

The documentation for this class was generated from the following file: