Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include "NativeFeatureIncludes.h"
00009 #if _RAKNET_SUPPORT_LogCommandParser==1
00010
00011 #ifndef __LOG_COMMAND_PARSER
00012 #define __LOG_COMMAND_PARSER
00013
00014 class RakPeerInterface;
00015
00016 #include "CommandParserInterface.h"
00017 #include "Export.h"
00018
00020 class RAK_DLL_EXPORT LogCommandParser : public CommandParserInterface
00021 {
00022 public:
00023 LogCommandParser();
00024 ~LogCommandParser();
00025
00033 bool OnCommand(const char *command, unsigned numParameters, char **parameterList, TransportInterface *transport, SystemAddress systemAddress, const char *originalString);
00034
00038 const char *GetName(void) const;
00039
00043 void SendHelp(TransportInterface *transport, SystemAddress systemAddress);
00044
00046
00048 void AddChannel(const char *channelName);
00049
00054 void WriteLog(const char *channelName, const char *format, ...);
00055
00059 void OnNewIncomingConnection(SystemAddress systemAddress, TransportInterface *transport);
00060
00064 void OnConnectionLost(SystemAddress systemAddress, TransportInterface *transport);
00065
00069 void OnTransportChange(TransportInterface *transport);
00070 protected:
00074 void PrintChannels(SystemAddress systemAddress, TransportInterface *transport) const;
00075
00079 unsigned Unsubscribe(SystemAddress systemAddress, const char *channelName);
00080
00084 unsigned Subscribe(SystemAddress systemAddress, const char *channelName);
00085
00088 unsigned GetChannelIndexFromName(const char *channelName);
00089
00091 struct SystemAddressAndChannel
00092 {
00094 SystemAddress systemAddress;
00095
00097 unsigned channels;
00098 };
00099
00101 DataStructures::List<SystemAddressAndChannel> remoteUsers;
00102
00104 const char *channelNames[32];
00105
00107 TransportInterface *trans;
00108 };
00109
00110 #endif
00111
00112 #endif // _RAKNET_SUPPORT_*