Shadowrun: Awakened 29 September 2011 - Build 871
TelnetTransport.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 #include "NativeFeatureIncludes.h"
00009 #if _RAKNET_SUPPORT_TelnetTransport==1 && _RAKNET_SUPPORT_TCPInterface==1
00010 
00011 #ifndef __TELNET_TRANSPORT
00012 #define __TELNET_TRANSPORT
00013 
00014 #include "TransportInterface.h"
00015 #include "DS_List.h"
00016 #include "Export.h"
00017 
00018 namespace RakNet
00019 {
00021 class TCPInterface;
00022 struct TelnetClient;
00023 
00028 class RAK_DLL_EXPORT TelnetTransport : public TransportInterface
00029 {
00030 public:
00031     // GetInstance() and DestroyInstance(instance*)
00032     STATIC_FACTORY_DECLARATIONS(TelnetTransport)
00033 
00034     TelnetTransport();
00035     virtual ~TelnetTransport();
00036     bool Start(unsigned short port, bool serverMode);
00037     void Stop(void);
00038     void Send( SystemAddress systemAddress, const char *data, ... );
00039     void CloseConnection( SystemAddress systemAddress );
00040     Packet* Receive( void );
00041     void DeallocatePacket( Packet *packet );
00042     SystemAddress HasNewIncomingConnection(void);
00043     SystemAddress HasLostConnection(void);
00044     CommandParserInterface* GetCommandParser(void);
00045     void SetSendSuffix(const char *suffix);
00046     void SetSendPrefix(const char *prefix);
00047 protected:
00048 
00049     struct TelnetClient
00050     {
00051         SystemAddress systemAddress;
00052         char textInput[REMOTE_MAX_TEXT_INPUT];
00053         char lastSentTextInput[REMOTE_MAX_TEXT_INPUT];
00054         unsigned cursorPosition;
00055     };
00056 
00057     TCPInterface *tcpInterface;
00058     void AutoAllocate(void);
00059     bool ReassembleLine(TelnetTransport::TelnetClient* telnetClient, unsigned char c);
00060 
00061     // Crap this sucks but because windows telnet won't send line at a time, I have to reconstruct the lines at the server per player
00062     DataStructures::List<TelnetClient*> remoteClients;
00063 
00064     char *sendSuffix, *sendPrefix;
00065 
00066 };
00067 
00068 } // namespace RakNet
00069 
00070 #endif
00071 
00072 #endif // _RAKNET_SUPPORT_*

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net