Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
Skyfire::PacketLogServer Class Reference

#include <PacketLogServer.h>

Classes

struct  SessionLog

Public Member Functions

bool CanLogPacket () const
void CloseSession (void const *sessionKey)
void Configure (std::string const &controlFile, std::string const &outputDir, std::string logsDir="")
void ConfigureLegacyPacketLogFile (std::string const &packetLogFile)
void DisableAllLogging ()
void DisableCharacterLogging (std::string const &characterName)
void EnableCharacterLogging (std::string const &characterName)
void EnableGlobalLogging ()
size_t GetCharacterLoggingCount () const
void Initialize (std::string const &controlFileDefault, std::string const &outputDirDefault)
bool IsGlobalLoggingEnabled () const
void LogBinaryPacket (PacketLogServerDirection direction, uint32 opcode, void const *payload, size_t payloadSize)
void LogMarker (void const *sessionKey, PacketLogServerSessionInfo const &sessionInfo, std::string const &marker)
void LogPacket (void const *sessionKey, PacketLogServerSessionInfo const &sessionInfo, PacketLogServerDirection direction, uint32 opcode, std::string const &opcodeName, void const *payload, size_t payloadSize)
void RefreshSessionInfo (void const *sessionKey, PacketLogServerSessionInfo const &sessionInfo)

Private Member Functions

void CloseAllSessions ()
void CloseCharacterSessions (std::string const &normalizedName)
bool IsControlFileLoggingEnabled () const
FILE * OpenSessionLog (void const *sessionKey, PacketLogServerSessionInfo const &sessionInfo)
 PacketLogServer ()
bool ShouldLogSession (PacketLogServerSessionInfo const &sessionInfo) const
 ~PacketLogServer ()

Private Attributes

FILE * _binaryFile
std::unordered_set< std::string > _characterSessionLogging
std::vector< std::string > _controlFiles
bool _globalSessionLogging
std::string _logsDir
std::mutex _sessionLock
std::string _sessionLogDir
std::unordered_map< void const *, SessionLog_sessionLogs

Friends

class Singleton< PacketLogServer, Mutex >

Detailed Description

Definition at line 40 of file PacketLogServer.h.

Constructor & Destructor Documentation

◆ PacketLogServer()

Skyfire::PacketLogServer::PacketLogServer ( )
private

◆ ~PacketLogServer()

Skyfire::PacketLogServer::~PacketLogServer ( )
private

Definition at line 166 of file PacketLogServer.cpp.

References _binaryFile, _sessionLock, and CloseAllSessions().

Member Function Documentation

◆ CanLogPacket()

bool Skyfire::PacketLogServer::CanLogPacket ( ) const

◆ CloseAllSessions()

void Skyfire::PacketLogServer::CloseAllSessions ( )
private

Definition at line 491 of file PacketLogServer.cpp.

References _sessionLogs.

Referenced by Configure(), DisableAllLogging(), and ~PacketLogServer().

◆ CloseCharacterSessions()

void Skyfire::PacketLogServer::CloseCharacterSessions ( std::string const & normalizedName)
private

Definition at line 500 of file PacketLogServer.cpp.

References _sessionLogs.

Referenced by DisableCharacterLogging().

◆ CloseSession()

void Skyfire::PacketLogServer::CloseSession ( void const * sessionKey)

Definition at line 478 of file PacketLogServer.cpp.

References _sessionLock, and _sessionLogs.

◆ Configure()

void Skyfire::PacketLogServer::Configure ( std::string const & controlFile,
std::string const & outputDir,
std::string logsDir = "" )

◆ ConfigureLegacyPacketLogFile()

void Skyfire::PacketLogServer::ConfigureLegacyPacketLogFile ( std::string const & packetLogFile)

Definition at line 211 of file PacketLogServer.cpp.

References _binaryFile, _logsDir, and _sessionLock.

Referenced by Initialize().

◆ DisableAllLogging()

void Skyfire::PacketLogServer::DisableAllLogging ( )

◆ DisableCharacterLogging()

void Skyfire::PacketLogServer::DisableCharacterLogging ( std::string const & characterName)

◆ EnableCharacterLogging()

void Skyfire::PacketLogServer::EnableCharacterLogging ( std::string const & characterName)

Definition at line 264 of file PacketLogServer.cpp.

References _characterSessionLogging, and _sessionLock.

◆ EnableGlobalLogging()

void Skyfire::PacketLogServer::EnableGlobalLogging ( )

Definition at line 243 of file PacketLogServer.cpp.

References _globalSessionLogging, and _sessionLock.

◆ GetCharacterLoggingCount()

size_t Skyfire::PacketLogServer::GetCharacterLoggingCount ( ) const

Definition at line 286 of file PacketLogServer.cpp.

References _characterSessionLogging, and _sessionLock.

◆ Initialize()

void Skyfire::PacketLogServer::Initialize ( std::string const & controlFileDefault,
std::string const & outputDirDefault )

Definition at line 177 of file PacketLogServer.cpp.

References Configure(), ConfigureLegacyPacketLogFile(), and sConfigMgr.

◆ IsControlFileLoggingEnabled()

bool Skyfire::PacketLogServer::IsControlFileLoggingEnabled ( ) const
private

Definition at line 231 of file PacketLogServer.cpp.

References _controlFiles.

Referenced by CanLogPacket(), DisableCharacterLogging(), and ShouldLogSession().

◆ IsGlobalLoggingEnabled()

bool Skyfire::PacketLogServer::IsGlobalLoggingEnabled ( ) const

Definition at line 280 of file PacketLogServer.cpp.

References _globalSessionLogging, and _sessionLock.

◆ LogBinaryPacket()

void Skyfire::PacketLogServer::LogBinaryPacket ( PacketLogServerDirection direction,
uint32 opcode,
void const * payload,
size_t payloadSize )

◆ LogMarker()

void Skyfire::PacketLogServer::LogMarker ( void const * sessionKey,
PacketLogServerSessionInfo const & sessionInfo,
std::string const & marker )

◆ LogPacket()

void Skyfire::PacketLogServer::LogPacket ( void const * sessionKey,
PacketLogServerSessionInfo const & sessionInfo,
PacketLogServerDirection direction,
uint32 opcode,
std::string const & opcodeName,
void const * payload,
size_t payloadSize )

◆ OpenSessionLog()

◆ RefreshSessionInfo()

◆ ShouldLogSession()

bool Skyfire::PacketLogServer::ShouldLogSession ( PacketLogServerSessionInfo const & sessionInfo) const
private

◆ Singleton< PacketLogServer, Mutex >

friend class Singleton< PacketLogServer, Mutex >
friend

Definition at line 37 of file PacketLogServer.h.

Member Data Documentation

◆ _binaryFile

FILE* Skyfire::PacketLogServer::_binaryFile
private

◆ _characterSessionLogging

std::unordered_set<std::string> Skyfire::PacketLogServer::_characterSessionLogging
private

◆ _controlFiles

std::vector<std::string> Skyfire::PacketLogServer::_controlFiles
private

◆ _globalSessionLogging

bool Skyfire::PacketLogServer::_globalSessionLogging
private

◆ _logsDir

std::string Skyfire::PacketLogServer::_logsDir
private

Definition at line 84 of file PacketLogServer.h.

Referenced by Configure(), ConfigureLegacyPacketLogFile(), and PacketLogServer().

◆ _sessionLock

◆ _sessionLogDir

std::string Skyfire::PacketLogServer::_sessionLogDir
private

Definition at line 87 of file PacketLogServer.h.

Referenced by Configure(), OpenSessionLog(), PacketLogServer(), and RefreshSessionInfo().

◆ _sessionLogs

std::unordered_map<void const*, SessionLog> Skyfire::PacketLogServer::_sessionLogs
private

The documentation for this class was generated from the following files: