Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include "NativeFeatureIncludes.h"
00009 #if _RAKNET_SUPPORT_RakNetTransport==1
00010
00011 #ifndef __RAKNET_TRANSPORT
00012 #define __RAKNET_TRANSPORT
00013
00014 #include "TransportInterface.h"
00015 #include "DS_Queue.h"
00016 #include "CommandParserInterface.h"
00017 #include "Export.h"
00018
00019 class RakPeerInterface;
00020 class RakNetTransport;
00021 namespace RakNet
00022 {
00023 class BitStream;
00024 }
00025
00027 class RAK_DLL_EXPORT RakNetTransportCommandParser : public CommandParserInterface
00028 {
00029 public:
00030 RakNetTransportCommandParser();
00031 ~RakNetTransportCommandParser();
00032
00040 bool OnCommand(const char *command, unsigned numParameters, char **parameterList, TransportInterface *transport, SystemAddress systemAddress, const char *originalString);
00041
00045 const char* GetName(void) const;
00046
00050 void SendHelp(TransportInterface *transport, SystemAddress systemAddress);
00051 protected:
00052 };
00053
00058 class RAK_DLL_EXPORT RakNetTransport : public TransportInterface
00059 {
00060 public:
00061 RakNetTransport();
00062 virtual ~RakNetTransport();
00063
00068 bool Start(unsigned short port, bool serverMode);
00069
00071 void Stop(void);
00072
00079 void Send( SystemAddress systemAddress, const char *data, ... );
00080
00086 Packet* Receive( void );
00087
00090 void DeallocatePacket( Packet *packet );
00091
00094 void CloseConnection( SystemAddress systemAddress );
00095
00098 SystemAddress HasNewIncomingConnection(void);
00099
00102 SystemAddress HasLostConnection(void);
00103
00108 void SetIncomingPassword(const char *password);
00109
00112 char * GetIncomingPassword(void);
00113
00115 CommandParserInterface* GetCommandParser(void);
00116
00117 protected:
00118 RakPeerInterface *rakPeer;
00119 void AutoAllocate(void);
00120 DataStructures::Queue<SystemAddress> newConnections, lostConnections;
00121 RakNetTransportCommandParser rakNetTransportCommandParser;
00122 };
00123
00124 #endif
00125
00126 #endif // _RAKNET_SUPPORT_*