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
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SLNet::TelnetTransport Class Reference

Use TelnetTransport to easily allow windows telnet to connect to your ConsoleServer. More...

`#include <slikenet/TelnetTransport.h>`

Inheritance diagram for SLNet::TelnetTransport:

## Classes

struct | TelnetClient

## Public Member Functions

| TelnetTransport ()
virtual | ~TelnetTransport ()
bool | Start (unsigned short port, bool serverMode)
void | Stop (void)
| Stop the transport provider. You can clear memory and shutdown threads here.
void | Send (SystemAddress systemAddress, const char *data,...)
void | CloseConnection (SystemAddress systemAddress)
Packet * | Receive (void)
void | DeallocatePacket (Packet *packet)
SystemAddress | HasNewIncomingConnection (void)
SystemAddress | HasLostConnection (void)
CommandParserInterface * | GetCommandParser (void)
void | SetSendSuffix (const char *suffix)
void | SetSendPrefix (const char *prefix)
Public Member Functions inherited from SLNet::TransportInterface
| TransportInterface ()
virtual | ~TransportInterface ()

## Protected Member Functions

void | AutoAllocate (void)
bool | ReassembleLine (TelnetTransport::TelnetClient *telnetClient, unsigned char c)

## Protected Attributes

TCPInterface * | tcpInterface
DataStructures::List < TelnetClient * > | remoteClients
char * | sendSuffix
char * | sendPrefix

## Detailed Description

Use TelnetTransport to easily allow windows telnet to connect to your ConsoleServer.

To run Windows telnet, go to your start menu, click run, and in the edit box type "telnet <IP>" where <IP> is the ip address.
of your ConsoleServer (most likely the same IP as your game).
This implementation always echos commands.

Definition at line 41 of file TelnetTransport.h.

## Class Documentation

struct SLNet::TelnetTransport::TelnetClient

Definition at line 62 of file TelnetTransport.h.

Class Members
unsigned | cursorPosition |
char | lastSentTextInput |
SystemAddress | systemAddress |
char | textInput |

## Constructor & Destructor Documentation

SLNet::TelnetTransport::TelnetTransport | ( |  | ) |

virtual SLNet::TelnetTransport::~TelnetTransport | ( |  | ) |

virtual

## Member Function Documentation

void SLNet::TelnetTransport::AutoAllocate | ( | void |  | ) |

protected

void SLNet::TelnetTransport::CloseConnection | ( | SystemAddress | systemAddress | ) |

virtual

Disconnect systemAddress . The binary address and port defines the SystemAddress structure.

Parameters

  [in] | systemAddress | The player/address to disconnect

Implements SLNet::TransportInterface.

void SLNet::TelnetTransport::DeallocatePacket | ( | Packet * | packet | ) |

virtual

Deallocate the Packet structure returned by Receive

Parameters

  [in] | The | packet to deallocate

Implements SLNet::TransportInterface.

CommandParserInterface* SLNet::TelnetTransport::GetCommandParser | ( | void |  | ) |

virtual

Your transport provider can itself have command parsers if the transport layer has user-modifiable features For example, your transport layer may have a password which you want remote users to be able to set or you may want to allow remote users to turn on or off command echo

Returns
  0 if you do not need a command parser - otherwise the desired derivation of CommandParserInterface

Implements SLNet::TransportInterface.

SystemAddress SLNet::TelnetTransport::HasLostConnection | ( | void |  | ) |

virtual

If a system loses the connection, you should queue that event and return the systemAddress/address of that player in this function.

Returns
  The SystemAddress/address of the system

Implements SLNet::TransportInterface.

SystemAddress SLNet::TelnetTransport::HasNewIncomingConnection | ( | void |  | ) |

virtual

If a new system connects to you, you should queue that event and return the systemAddress/address of that player in this function.

Returns
  The SystemAddress/address of the system

Implements SLNet::TransportInterface.

bool SLNet::TelnetTransport::ReassembleLine | ( | TelnetTransport::TelnetClient * | telnetClient,
|  | unsigned char | c
| ) |  |

protected

Packet* SLNet::TelnetTransport::Receive | ( | void |  | ) |

virtual

Return a string. The string should be allocated and written to Packet::data . The byte length should be written to Packet::length . The player/address should be written to Packet::systemAddress If your transport protocol adds special formatting to the data stream you should parse it out before returning it in the packet and thus only return a string in Packet::data

Returns
  The packet structure containing the result of Receive, or 0 if no data is available

Implements SLNet::TransportInterface.

void SLNet::TelnetTransport::Send | ( | SystemAddress | systemAddress,
|  | const char * | data,
|  |  | ...
| ) |  |

virtual

Send a null-terminated string to systemAddress If your transport method requires particular formatting of the outgoing data (e.g. you don't just send strings) you can do it here and parse it out in Receive().

Parameters

  [in] | systemAddress | The player to send the string to
  [in] | data | format specifier - same as RAKNET_DEBUG_PRINTF
  [in] | ... | format specification arguments - same as RAKNET_DEBUG_PRINTF

Implements SLNet::TransportInterface.

void SLNet::TelnetTransport::SetSendPrefix | ( | const char * | prefix | ) |

void SLNet::TelnetTransport::SetSendSuffix | ( | const char * | suffix | ) |

bool SLNet::TelnetTransport::Start | ( | unsigned short | port,
|  | bool | serverMode
| ) |  |

virtual

Start the transport provider on the indicated port.

Parameters

  [in] | port | The port to start the transport provider on
  [in] | serverMode | If true, you should allow incoming connections (I don't actually use this anywhere)

Returns
  Return true on success, false on failure.

Implements SLNet::TransportInterface.

void SLNet::TelnetTransport::Stop | ( | void |  | ) |

virtual

Stop the transport provider. You can clear memory and shutdown threads here.

Implements SLNet::TransportInterface.

## Member Data Documentation

DataStructures::List<TelnetClient*> SLNet::TelnetTransport::remoteClients

protected

Definition at line 75 of file TelnetTransport.h.

char * SLNet::TelnetTransport::sendPrefix

protected

Definition at line 77 of file TelnetTransport.h.

char* SLNet::TelnetTransport::sendSuffix

protected

Definition at line 77 of file TelnetTransport.h.

TCPInterface* SLNet::TelnetTransport::tcpInterface

protected

Definition at line 70 of file TelnetTransport.h.

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

- Source/include/slikenet/TelnetTransport.h