SLikeNet 0.1.3

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LogCommandParser.h
Go to the documentation of this file.
1 /*
2 * Original work: Copyright (c) 2014, Oculus VR, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * RakNet License.txt file in the licenses directory of this source tree. An additional grant
7 * of patent rights can be found in the RakNet Patents.txt file in the same directory.
8 *
9 *
10 * Modified work: Copyright (c) 2017, SLikeSoft UG (haftungsbeschränkt)
11 *
12 * This source code was modified by SLikeSoft. Modifications are licensed under the MIT-style
13 * license found in the license.txt file in the root directory of this source tree.
14 */
15
19
20 #include "NativeFeatureIncludes.h"
21 #if _RAKNET_SUPPORT_LogCommandParser==1
22
23 #ifndef __LOG_COMMAND_PARSER
24 #define __LOG_COMMAND_PARSER
25
26 #include "CommandParserInterface.h"
27 #include "Export.h"
28
29 namespace SLNet
30 {
32 class RakPeerInterface;
33
35 class RAK_DLL_EXPORT LogCommandParser : public CommandParserInterface
36 {
37 public:
38 // GetInstance() and DestroyInstance(instance*)
39 STATIC_FACTORY_DECLARATIONS(LogCommandParser)
40
41 LogCommandParser();
42 ~LogCommandParser();
43
51 bool OnCommand(const char *command, unsigned numParameters, char **parameterList, TransportInterface *transport, const SystemAddress &systemAddress, const char *originalString);
52
56 const char *GetName(void) const;
57
61 void SendHelp(TransportInterface *transport, const SystemAddress &systemAddress);
62
64 // If you call Log with a channel that is unknown, that channel will automatically be added
66 void AddChannel(const char *channelName);
67
72 void WriteLog(const char *channelName, const char *format, ...);
73
77 void OnNewIncomingConnection(const SystemAddress &systemAddress, TransportInterface *transport);
78
82 void OnConnectionLost(const SystemAddress &systemAddress, TransportInterface *transport);
83
87 void OnTransportChange(TransportInterface *transport);
88 protected:
92 void PrintChannels(const SystemAddress &systemAddress, TransportInterface *transport) const;
93
97 unsigned Unsubscribe(const SystemAddress &systemAddress, const char *channelName);
98
102 unsigned Subscribe(const SystemAddress &systemAddress, const char *channelName);
103
106 unsigned GetChannelIndexFromName(const char *channelName);
107
109 struct SystemAddressAndChannel
110 {
112 SystemAddress systemAddress;
113
115 unsigned channels;
116 };
117
119 DataStructures::List<SystemAddressAndChannel> remoteUsers;
120
122 const char *channelNames[32];
123
125 TransportInterface *trans;
126 };
127
128 } // namespace SLNet
129
130 #endif
131
132 #endif // _RAKNET_SUPPORT_*