![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
Use TelnetTransport to easily allow windows telnet to connect to your ConsoleServer. More...
#include <TelnetTransport.h>
Inheritance diagram for RakNet::TelnetTransport:Classes | |
| struct | TelnetClient |
Public Member Functions | |
| void | CloseConnection (SystemAddress systemAddress) |
| void | DeallocatePacket (Packet *packet) |
| CommandParserInterface * | GetCommandParser (void) |
| SystemAddress | HasLostConnection (void) |
| SystemAddress | HasNewIncomingConnection (void) |
| Packet * | Receive (void) |
| void | Send (SystemAddress systemAddress, const char *data,...) |
| void | SetSendPrefix (const char *prefix) |
| void | SetSendSuffix (const char *suffix) |
| bool | Start (unsigned short port, bool serverMode) |
| void | Stop (void) |
| Stop the transport provider. You can clear memory and shutdown threads here. | |
| TelnetTransport () | |
| virtual | ~TelnetTransport () |
Static Public Member Functions | |
| static void | DestroyInstance (TelnetTransport *i) |
| static TelnetTransport * | GetInstance (void) |
Protected Member Functions | |
| void | AutoAllocate (void) |
| bool | ReassembleLine (TelnetTransport::TelnetClient *telnetClient, unsigned char c) |
Protected Attributes | |
| DataStructures::List < TelnetClient * > | remoteClients |
| char * | sendPrefix |
| char * | sendSuffix |
| TCPInterface * | tcpInterface |
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 28 of file TelnetTransport.h.
| RakNet::TelnetTransport::TelnetTransport | ( | ) |
| virtual RakNet::TelnetTransport::~TelnetTransport | ( | ) | [virtual] |
| void RakNet::TelnetTransport::AutoAllocate | ( | void | ) | [protected] |
| void RakNet::TelnetTransport::CloseConnection | ( | SystemAddress | systemAddress | ) | [virtual] |
Disconnect systemAddress . The binary address and port defines the SystemAddress structure.
| [in] | systemAddress | The player/address to disconnect |
Implements RakNet::TransportInterface.
| void RakNet::TelnetTransport::DeallocatePacket | ( | Packet * | packet | ) | [virtual] |
Deallocate the Packet structure returned by Receive
| [in] | The | packet to deallocate |
Implements RakNet::TransportInterface.
| static void RakNet::TelnetTransport::DestroyInstance | ( | TelnetTransport * | i | ) | [static] |
| CommandParserInterface* RakNet::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
Implements RakNet::TransportInterface.
| static TelnetTransport* RakNet::TelnetTransport::GetInstance | ( | void | ) | [static] |
| SystemAddress RakNet::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.
Implements RakNet::TransportInterface.
| SystemAddress RakNet::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.
Implements RakNet::TransportInterface.
| bool RakNet::TelnetTransport::ReassembleLine | ( | TelnetTransport::TelnetClient * | telnetClient, |
| unsigned char | c | ||
| ) | [protected] |
| Packet* RakNet::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
Implements RakNet::TransportInterface.
| void RakNet::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().
| [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 RakNet::TransportInterface.
| void RakNet::TelnetTransport::SetSendPrefix | ( | const char * | prefix | ) |
| void RakNet::TelnetTransport::SetSendSuffix | ( | const char * | suffix | ) |
Start the transport provider on the indicated port.
| [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) |
Implements RakNet::TransportInterface.
| void RakNet::TelnetTransport::Stop | ( | void | ) | [virtual] |
Implements RakNet::TransportInterface.
Definition at line 62 of file TelnetTransport.h.
char * RakNet::TelnetTransport::sendPrefix [protected] |
Definition at line 64 of file TelnetTransport.h.
char* RakNet::TelnetTransport::sendSuffix [protected] |
Definition at line 64 of file TelnetTransport.h.
TCPInterface* RakNet::TelnetTransport::tcpInterface [protected] |
Definition at line 57 of file TelnetTransport.h.
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.