Use RakNetTransport if you need a secure connection between the client and the console server. More...
#include <RakNetTransport.h>
Inherits TransportInterface.
Public Member Functions | |
RakNetTransport () | |
virtual | ~RakNetTransport () |
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,...) |
Packet * | Receive (void) |
void | DeallocatePacket (Packet *packet) |
void | CloseConnection (SystemAddress systemAddress) |
SystemAddress | HasNewIncomingConnection (void) |
SystemAddress | HasLostConnection (void) |
void | SetIncomingPassword (const char *password) |
char * | GetIncomingPassword (void) |
CommandParserInterface * | GetCommandParser (void) |
Returns RakNetTransportCommandParser so the console admin can change the password. | |
Protected Member Functions | |
void | AutoAllocate (void) |
Protected Attributes | |
RakPeerInterface * | rakPeer |
DataStructures::Queue < SystemAddress > | newConnections |
DataStructures::Queue < SystemAddress > | lostConnections |
RakNetTransportCommandParser | rakNetTransportCommandParser |
Use RakNetTransport if you need a secure connection between the client and the console server.
RakNetTransport automatically initializes security for the system. Use the project CommandConsoleClient to connect To the ConsoleServer if you use RakNetTransport
Definition at line 58 of file RakNetTransport.h.
RakNetTransport::RakNetTransport | ( | ) |
Definition at line 63 of file RakNetTransport.cpp.
RakNetTransport::~RakNetTransport | ( | ) | [virtual] |
void RakNetTransport::AutoAllocate | ( | void | ) | [protected] |
Definition at line 172 of file RakNetTransport.cpp.
void RakNetTransport::CloseConnection | ( | SystemAddress | systemAddress | ) | [virtual] |
Disconnect systemAddress . The binary address and port defines the SystemAddress structure.
[in] | systemAddress | The player/address to disconnect |
Implements TransportInterface.
Definition at line 111 of file RakNetTransport.cpp.
void RakNetTransport::DeallocatePacket | ( | Packet * | packet | ) | [virtual] |
Deallocate the Packet structure returned by Receive
[in] | The | packet to deallocate |
Implements TransportInterface.
Definition at line 166 of file RakNetTransport.cpp.
CommandParserInterface * RakNetTransport::GetCommandParser | ( | void | ) | [virtual] |
Returns RakNetTransportCommandParser so the console admin can change the password.
Implements TransportInterface.
Definition at line 177 of file RakNetTransport.cpp.
char * RakNetTransport::GetIncomingPassword | ( | void | ) |
Returns the password set by SetIncomingPassword().
Definition at line 158 of file RakNetTransport.cpp.
SystemAddress RakNetTransport::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 TransportInterface.
Definition at line 145 of file RakNetTransport.cpp.
SystemAddress RakNetTransport::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 TransportInterface.
Definition at line 139 of file RakNetTransport.cpp.
Packet * RakNetTransport::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 TransportInterface.
Definition at line 115 of file RakNetTransport.cpp.
void RakNetTransport::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 TransportInterface.
Definition at line 93 of file RakNetTransport.cpp.
void RakNetTransport::SetIncomingPassword | ( | const char * | password | ) |
Sets the password which incoming connections must match. While not required, it is highly recommended you set this in a real game environment or anyone can login and control your server. Don't set it to a fixed value, but instead require that the server admin sets it when you start the application server
[in] | password | Null-terminated string to use as a password. |
Definition at line 151 of file RakNetTransport.cpp.
bool RakNetTransport::Start | ( | unsigned short | port, | |
bool | serverMode | |||
) | [virtual] |
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 TransportInterface.
Definition at line 72 of file RakNetTransport.cpp.
void RakNetTransport::Stop | ( | void | ) | [virtual] |
Stop the transport provider. You can clear memory and shutdown threads here.
Implements TransportInterface.
Definition at line 86 of file RakNetTransport.cpp.
Definition at line 120 of file RakNetTransport.h.
Definition at line 120 of file RakNetTransport.h.
Definition at line 121 of file RakNetTransport.h.
RakPeerInterface* RakNetTransport::rakPeer [protected] |
Definition at line 118 of file RakNetTransport.h.