Shadowrun: Awakened 29 September 2011 - Build 871
LogCommandParser.h
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 #include "CommandParserInterface.h"
00015 #include "Export.h"
00016 
00017 namespace RakNet
00018 {
00020 class RakPeerInterface;
00021 
00023 class RAK_DLL_EXPORT LogCommandParser : public CommandParserInterface
00024 {
00025 public:
00026     // GetInstance() and DestroyInstance(instance*)
00027     STATIC_FACTORY_DECLARATIONS(LogCommandParser)
00028 
00029     LogCommandParser();
00030     ~LogCommandParser();
00031 
00039     bool OnCommand(const char *command, unsigned numParameters, char **parameterList, TransportInterface *transport, const SystemAddress &systemAddress, const char *originalString);
00040 
00044     const char *GetName(void) const;
00045 
00049     void SendHelp(TransportInterface *transport, const SystemAddress &systemAddress);
00050 
00052     // If you call Log with a channel that is unknown, that channel will automatically be added
00054     void AddChannel(const char *channelName);
00055 
00060     void WriteLog(const char *channelName, const char *format, ...);
00061 
00065     void OnNewIncomingConnection(const SystemAddress &systemAddress, TransportInterface *transport);
00066 
00070     void OnConnectionLost(const SystemAddress &systemAddress, TransportInterface *transport);
00071 
00075     void OnTransportChange(TransportInterface *transport);
00076 protected:
00080     void PrintChannels(const SystemAddress &systemAddress, TransportInterface *transport) const;
00081 
00085     unsigned Unsubscribe(const SystemAddress &systemAddress, const char *channelName);
00086 
00090     unsigned Subscribe(const SystemAddress &systemAddress, const char *channelName);
00091 
00094     unsigned GetChannelIndexFromName(const char *channelName);
00095 
00097     struct SystemAddressAndChannel
00098     {
00100         SystemAddress systemAddress;
00101 
00103         unsigned channels;
00104     };
00105 
00107     DataStructures::List<SystemAddressAndChannel> remoteUsers;
00108 
00110     const char *channelNames[32];
00111 
00113     TransportInterface *trans;
00114 };
00115 
00116 } // namespace RakNet
00117 
00118 #endif
00119 
00120 #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