Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
PacketLog.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5#ifndef SKYFIRE_PACKETLOG_H
6#define SKYFIRE_PACKETLOG_H
7
8#include "Common.h"
9#include "PacketLogServer.h"
10#include "Platform/Singleton.h"
11#include <string>
12
18
19class WorldPacket;
20
22
24{
25 friend class Skyfire::Singleton<PacketLog, Skyfire::Mutex>;
26
27private:
28 PacketLog();
29 ~PacketLog();
30
31public:
32 void Initialize();
33 bool CanLogPacket() const;
35 void DisableAllLogging();
36 void EnableCharacterLogging(std::string const& characterName);
37 void DisableCharacterLogging(std::string const& characterName);
38 bool IsGlobalLoggingEnabled() const;
39 size_t GetCharacterLoggingCount() const;
40 void LogPacket(WorldPacket const& packet, Direction direction);
41 void LogPacket(void const* sessionKey, PacketLogSessionInfo const& sessionInfo, WorldPacket const& packet, Direction direction);
42 void LogMarker(void const* sessionKey, PacketLogSessionInfo const& sessionInfo, std::string const& marker);
43 void RefreshSessionInfo(void const* sessionKey, PacketLogSessionInfo const& sessionInfo);
44 void CloseSession(void const* sessionKey);
45};
46
47#define sPacketLog Skyfire::Singleton<PacketLog, Skyfire::Mutex>::instance()
48#endif
Skyfire::PacketLogServerSessionInfo PacketLogSessionInfo
Definition PacketLog.h:21
Direction
Definition PacketLog.h:14
@ SERVER_TO_CLIENT
Definition PacketLog.h:16
@ CLIENT_TO_SERVER
Definition PacketLog.h:15
void LogPacket(WorldPacket const &packet, Direction direction)
Definition PacketLog.cpp:37
void DisableCharacterLogging(std::string const &characterName)
Definition PacketLog.cpp:59
void RefreshSessionInfo(void const *sessionKey, PacketLogSessionInfo const &sessionInfo)
Definition PacketLog.cpp:89
bool CanLogPacket() const
Definition PacketLog.cpp:32
void CloseSession(void const *sessionKey)
Definition PacketLog.cpp:94
size_t GetCharacterLoggingCount() const
Definition PacketLog.cpp:69
void EnableGlobalLogging()
Definition PacketLog.cpp:44
void EnableCharacterLogging(std::string const &characterName)
Definition PacketLog.cpp:54
bool IsGlobalLoggingEnabled() const
Definition PacketLog.cpp:64
void LogMarker(void const *sessionKey, PacketLogSessionInfo const &sessionInfo, std::string const &marker)
Definition PacketLog.cpp:84
void DisableAllLogging()
Definition PacketLog.cpp:49
void Initialize()
Definition PacketLog.cpp:27