SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
SLNet::RakNetCommandParser Class Reference

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

`#include <slikenet/commandparser.h>`

Inheritance diagram for SLNet::RakNetCommandParser:

## Public Member Functions

| RakNetCommandParser ()
| ~RakNetCommandParser ()
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 (SLNet::RakPeerInterface *rakPeer)
Public Member Functions inherited from SLNet::CommandParserInterface
| CommandParserInterface ()
virtual | ~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 bool | GetRegisteredCommand (const char *command, RegisteredCommand *rc)
virtual void | SendCommandList (TransportInterface *transport, const SystemAddress &systemAddress)
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 (char *res, const char *command, TransportInterface *transport, const SystemAddress &systemAddress)
virtual void | ReturnResult (SystemAddress res, const char *command, TransportInterface *transport, const SystemAddress &systemAddress)
virtual void | ReturnResult (int res, const char *command, TransportInterface *transport, const SystemAddress &systemAddress)
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

RakPeerInterface * | peer
| Which instance of RakPeer we are working on. Set from SetRakPeerInterface()
Protected Attributes inherited from SLNet::CommandParserInterface
DataStructures::OrderedList < const char *, RegisteredCommand, RegisteredCommandComp > | commandList

## Additional Inherited Members

Static Public Member Functions inherited from SLNet::CommandParserInterface
static void | ParseConsoleString (char *str, const char delineator, unsigned char delineatorToggle, unsigned *numParameters, char **parameterList, unsigned parameterListLength)
Static Public Attributes inherited from SLNet::CommandParserInterface
static const unsigned char | VARIABLE_NUMBER_OF_PARAMETERS =255

## Detailed Description

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

Definition at line 34 of file commandparser.h.

## Constructor & Destructor Documentation

SLNet::RakNetCommandParser::RakNetCommandParser | ( |  | ) |

SLNet::RakNetCommandParser::~RakNetCommandParser | ( |  | ) |

## Member Function Documentation

const char* SLNet::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 SLNet::CommandParserInterface.

bool SLNet::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] | command | The command to process
  [in] | numParameters | How many parameters were passed along with the command
  [in] | parameterList | The list of parameters. parameterList[0] is the first parameter and so on.
  [in] | transport | The transport interface we can use to write to
  [in] | systemAddress | The player that sent this command.
  [in] | originalString | The string that was actually sent over the network, in case you want to do your own parsing

Implements SLNet::CommandParserInterface.

void SLNet::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] | transport | The transport interface we can use to write to
  [in] | systemAddress | The player that requested help.

Implements SLNet::CommandParserInterface.

void SLNet::RakNetCommandParser::SetRakPeerInterface | ( | SLNet::RakPeerInterface * | rakPeer | ) |

Records the instance of RakPeer to perform the desired commands on

Parameters

  [in] | rakPeer | The RakPeer instance, or a derived class (e.g. RakPeer or RakPeer)

## Member Data Documentation

RakPeerInterface* SLNet::RakNetCommandParser::peer

protected

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

Definition at line 68 of file commandparser.h.

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

- Source/include/slikenet/commandparser.h