Files
.github
cmake
dAuthServer
dChatFilter
dChatServer
dCommon
dDatabase
dECS
dGame
dMasterServer
dNavigation
dNet
dPhysics
dScripts
dServer
dWorldServer
dZoneManager
docs
migrations
resources
tests
thirdparty
MD5
SQLite
cpp-httplib
cpplinq
libbcrypt
mariadb-connector-cpp
raknet
Lib
Source
AsynchronousFileIO.cpp
AsynchronousFileIO.h
AutoRPC.cpp
AutoRPC.h
AutopatcherPatchContext.h
AutopatcherRepositoryInterface.h
BigTypes.h
BitStream.cpp
BitStream.h
BitStream_NoTemplate.cpp
BitStream_NoTemplate.h
CheckSum.cpp
CheckSum.h
ClientContextStruct.h
CommandParserInterface.cpp
CommandParserInterface.h
ConnectionGraph.cpp
ConnectionGraph.h
ConsoleServer.cpp
ConsoleServer.h
DS_BPlusTree.h
DS_BinarySearchTree.h
DS_BytePool.cpp
DS_BytePool.h
DS_ByteQueue.cpp
DS_ByteQueue.h
DS_Heap.h
DS_HuffmanEncodingTree.cpp
DS_HuffmanEncodingTree.h
DS_HuffmanEncodingTreeFactory.h
DS_HuffmanEncodingTreeNode.h
DS_LinkedList.h
DS_List.h
DS_Map.h
DS_MemoryPool.h
DS_OrderedChannelHeap.h
DS_OrderedList.h
DS_Queue.h
DS_QueueLinkedList.h
DS_RangeList.h
DS_Table.cpp
DS_Table.h
DS_Tree.h
DS_WeightedGraph.h
DataBlockEncryptor.cpp
DataBlockEncryptor.h
DataCompressor.cpp
DataCompressor.h
DirectoryDeltaTransfer.cpp
DirectoryDeltaTransfer.h
EmailSender.cpp
EmailSender.h
EncodeClassName.cpp
EpochTimeToString.cpp
EpochTimeToString.h
Export.h
ExtendedOverlappedPool.cpp
ExtendedOverlappedPool.h
FileList.cpp
FileList.h
FileListTransfer.cpp
FileListTransfer.h
FileListTransferCBInterface.h
FileOperations.cpp
FileOperations.h
FormatString.cpp
FormatString.h
FullyConnectedMesh.cpp
FullyConnectedMesh.h
FunctionThread.cpp
FunctionThread.h
Gen_RPC8.cpp
Gen_RPC8.h
GetTime.cpp
GetTime.h
GridSectorizer.cpp
GridSectorizer.h
HTTPConnection.cpp
HTTPConnection.h
InlineFunctor.cpp
InlineFunctor.h
InternalPacket.h
Itoa.cpp
Itoa.h
Kbhit.h
LightweightDatabaseClient.cpp
LightweightDatabaseClient.h
LightweightDatabaseCommon.cpp
LightweightDatabaseCommon.h
LightweightDatabaseServer.cpp
LightweightDatabaseServer.h
LinuxStrings.cpp
LinuxStrings.h
LogCommandParser.cpp
LogCommandParser.h
MTUSize.h
Makefile.am
MessageFilter.cpp
MessageFilter.h
MessageIdentifiers.h
NatPunchthrough.cpp
NatPunchthrough.h
NetworkIDManager.cpp
NetworkIDManager.h
NetworkIDObject.cpp
NetworkIDObject.h
PacketConsoleLogger.cpp
PacketConsoleLogger.h
PacketFileLogger.cpp
PacketFileLogger.h
PacketLogger.cpp
PacketLogger.h
PacketPool.h
PacketPriority.h
PluginInterface.cpp
PluginInterface.h
RPCMap.cpp
RPCMap.h
RPCNode.h
RSACrypt.h
RakAssert.h
RakMemoryOverride.cpp
RakMemoryOverride.h
RakNet.vcproj
RakNet3.0.vcproj
RakNetCommandParser.cpp
RakNetCommandParser.h
RakNetDefines.h
RakNetStatistics.cpp
RakNetStatistics.h
RakNetTransport.cpp
RakNetTransport.h
RakNetTypes.cpp
RakNetTypes.h
RakNetVersion.h
RakNet_vc8.vcproj
RakNetworkFactory.cpp
RakNetworkFactory.h
RakPeer.cpp
RakPeer.h
RakPeerInterface.h
RakSleep.cpp
RakSleep.h
RakString.cpp
RakString.h
RakThread.cpp
RakThread.h
Rand.cpp
Rand.h
ReadyEvent.cpp
ReadyEvent.h
RefCountedObj.h
ReliabilityLayer.cpp
ReliabilityLayer.h
Replica.h
ReplicaEnums.h
ReplicaManager.cpp
ReplicaManager.h
ReplicaManager2.cpp
ReplicaManager2.h
Rijndael-Boxes.h
Rijndael.h
Router.cpp
Router.h
RouterInterface.h
SHA1.cpp
SHA1.h
SimpleMutex.cpp
SimpleMutex.h
SimpleTCPServer.h
SingleProducerConsumer.h
SocketLayer.cpp
SocketLayer.h
StringCompressor.cpp
StringCompressor.h
StringTable.cpp
StringTable.h
SuperFastHash.cpp
SuperFastHash.h
SystemAddressList.cpp
SystemAddressList.h
TCPInterface.cpp
TCPInterface.h
TableSerializer.cpp
TableSerializer.h
TelnetTransport.cpp
TelnetTransport.h
ThreadPool.h
ThreadsafePacketLogger.cpp
ThreadsafePacketLogger.h
TransportInterface.h
Types.h
_FindFirst.cpp
_FindFirst.h
rijndael.cpp
CMakeLists.txt
version.txt
recastnavigation
tinyxml2
CMakeLists.txt
vanity
.dockerignore
.editorconfig
.env.example
.git-blame-ignore-revs
.gitattributes
.gitignore
.gitmodules
CMakeLists.txt
CMakePresets.json
CMakeVariables.txt
CONTRIBUTING.md
Dockerfile
LICENSE
README.md
SECURITY.md
build.sh
docker-compose.yml
entrypoint.sh
logo.png
systemd.example
versions.txt
DarkflameServer/thirdparty/raknet/Source/LogCommandParser.h
2021-12-05 18:54:36 +01:00

118 lines
5.7 KiB
C++

/// \file
/// \brief Contains LogCommandParser , Used to send logs to connected consoles
///
/// This file is part of RakNet Copyright 2003 Kevin Jenkins.
///
/// Usage of RakNet is subject to the appropriate license agreement.
/// Creative Commons Licensees are subject to the
/// license found at
/// http://creativecommons.org/licenses/by-nc/2.5/
/// Single application licensees are subject to the license found at
/// http://www.jenkinssoftware.com/SingleApplicationLicense.html
/// Custom license users are subject to the terms therein.
/// GPL license users are subject to the GNU General Public
/// License as published by the Free
/// Software Foundation; either version 2 of the License, or (at your
/// option) any later version.
#ifndef __LOG_COMMAND_PARSER
#define __LOG_COMMAND_PARSER
class RakPeerInterface;
#include "CommandParserInterface.h"
#include "Export.h"
/// \brief Adds the ability to send logging output to a remote console
class RAK_DLL_EXPORT LogCommandParser : public CommandParserInterface
{
public:
LogCommandParser();
~LogCommandParser();
/// Given \a command with parameters \a parameterList , do whatever processing you wish.
/// \param[in] command The command to process
/// \param[in] numParameters How many parameters were passed along with the command
/// \param[in] parameterList The list of parameters. parameterList[0] is the first parameter and so on.
/// \param[in] transport The transport interface we can use to write to
/// \param[in] systemAddress The player that sent this command.
/// \param[in] originalString The string that was actually sent over the network, in case you want to do your own parsing
bool OnCommand(const char *command, unsigned numParameters, char **parameterList, TransportInterface *transport, SystemAddress systemAddress, const char *originalString);
/// You are responsible for overriding this function and returning a static string, which will identifier your parser.
/// This should return a static string
/// \return The name that you return.
const char *GetName(void) const;
/// A callback for when you are expected to send a brief description of your parser to \a systemAddress
/// \param[in] transport The transport interface we can use to write to
/// \param[in] systemAddress The player that requested help.
void SendHelp(TransportInterface *transport, SystemAddress systemAddress);
/// All logs must be associated with a channel. This is a filter so that remote clients only get logs for a system they care about.
// If you call Log with a channel that is unknown, that channel will automatically be added
/// \param[in] channelName A persistent string naming the channel. Don't deallocate this string.
void AddChannel(const char *channelName);
/// Write a log to a channel.
/// Logs are not buffered, so only remote consoles connected and subscribing at the time you write will get the output.
/// \param[in] format Same as printf()
/// \param[in] ... Same as printf()
void WriteLog(const char *channelName, const char *format, ...);
/// A callback for when \a systemAddress has connected to us.
/// \param[in] systemAddress The player that has connected.
/// \param[in] transport The transport interface that sent us this information. Can be used to send messages to this or other players.
void OnNewIncomingConnection(SystemAddress systemAddress, TransportInterface *transport);
/// A callback for when \a systemAddress has disconnected, either gracefully or forcefully
/// \param[in] systemAddress The player that has disconnected.
/// \param[in] transport The transport interface that sent us this information.
void OnConnectionLost(SystemAddress systemAddress, TransportInterface *transport);
/// This is called every time transport interface is registered. If you want to save a copy of the TransportInterface pointer
/// This is the place to do it
/// \param[in] transport The new TransportInterface
void OnTransportChange(TransportInterface *transport);
protected:
/// Sends the currently active channels to the user
/// \param[in] systemAddress The player to send to
/// \param[in] transport The transport interface to use to send the channels
void PrintChannels(SystemAddress systemAddress, TransportInterface *transport) const;
/// Unsubscribe a user from a channel (or from all channels)
/// \param[in] systemAddress The player to unsubscribe to
/// \param[in] channelName If 0, then unsubscribe from all channels. Otherwise unsubscribe from the named channel
unsigned Unsubscribe(SystemAddress systemAddress, const char *channelName);
/// Subscribe a user to a channel (or to all channels)
/// \param[in] systemAddress The player to subscribe to
/// \param[in] channelName If 0, then subscribe from all channels. Otherwise subscribe to the named channel
unsigned Subscribe(SystemAddress systemAddress, const char *channelName);
/// Given the name of a channel, return the index into channelNames where it is located
/// \param[in] channelName The name of the channel
unsigned GetChannelIndexFromName(const char *channelName);
/// One of these structures is created per player
struct SystemAddressAndChannel
{
/// The ID of the player
SystemAddress systemAddress;
/// Bitwise representations of the channels subscribed to. If bit 0 is set, then we subscribe to channelNames[0] and so on.
unsigned channels;
};
/// The list of remote users. Added to when users subscribe, removed when they disconnect or unsubscribe
DataStructures::List<SystemAddressAndChannel> remoteUsers;
/// Names of the channels at each bit, or 0 for an unused channel
const char *channelNames[32];
/// This is so I can save the current transport provider, solely so I can use it without having the user pass it to Log
TransportInterface *trans;
};
#endif