|
Project SkyFire Core
SkyFire 5.4.8 server core API documentation
|
#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 > |
Definition at line 40 of file PacketLogServer.h.
|
private |
Definition at line 161 of file PacketLogServer.cpp.
References _binaryFile, _characterSessionLogging, _controlFiles, _globalSessionLogging, _logsDir, _sessionLogDir, and _sessionLogs.
|
private |
Definition at line 166 of file PacketLogServer.cpp.
References _binaryFile, _sessionLock, and CloseAllSessions().
| bool Skyfire::PacketLogServer::CanLogPacket | ( | ) | const |
Definition at line 225 of file PacketLogServer.cpp.
References _binaryFile, _characterSessionLogging, _globalSessionLogging, _sessionLock, and IsControlFileLoggingEnabled().
|
private |
Definition at line 491 of file PacketLogServer.cpp.
References _sessionLogs.
Referenced by Configure(), DisableAllLogging(), and ~PacketLogServer().
|
private |
Definition at line 500 of file PacketLogServer.cpp.
References _sessionLogs.
Referenced by DisableCharacterLogging().
| void Skyfire::PacketLogServer::CloseSession | ( | void const * | sessionKey | ) |
Definition at line 478 of file PacketLogServer.cpp.
References _sessionLock, and _sessionLogs.
| void Skyfire::PacketLogServer::Configure | ( | std::string const & | controlFile, |
| std::string const & | outputDir, | ||
| std::string | logsDir = "" ) |
Definition at line 187 of file PacketLogServer.cpp.
References _characterSessionLogging, _controlFiles, _globalSessionLogging, _logsDir, _sessionLock, _sessionLogDir, and CloseAllSessions().
Referenced by Initialize().
| void Skyfire::PacketLogServer::ConfigureLegacyPacketLogFile | ( | std::string const & | packetLogFile | ) |
Definition at line 211 of file PacketLogServer.cpp.
References _binaryFile, _logsDir, and _sessionLock.
Referenced by Initialize().
| void Skyfire::PacketLogServer::DisableAllLogging | ( | ) |
Definition at line 249 of file PacketLogServer.cpp.
References _characterSessionLogging, _controlFiles, _globalSessionLogging, _sessionLock, and CloseAllSessions().
| void Skyfire::PacketLogServer::DisableCharacterLogging | ( | std::string const & | characterName | ) |
Definition at line 270 of file PacketLogServer.cpp.
References _characterSessionLogging, _globalSessionLogging, _sessionLock, CloseCharacterSessions(), and IsControlFileLoggingEnabled().
| void Skyfire::PacketLogServer::EnableCharacterLogging | ( | std::string const & | characterName | ) |
Definition at line 264 of file PacketLogServer.cpp.
References _characterSessionLogging, and _sessionLock.
| void Skyfire::PacketLogServer::EnableGlobalLogging | ( | ) |
Definition at line 243 of file PacketLogServer.cpp.
References _globalSessionLogging, and _sessionLock.
| size_t Skyfire::PacketLogServer::GetCharacterLoggingCount | ( | ) | const |
Definition at line 286 of file PacketLogServer.cpp.
References _characterSessionLogging, and _sessionLock.
| 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.
|
private |
Definition at line 231 of file PacketLogServer.cpp.
References _controlFiles.
Referenced by CanLogPacket(), DisableCharacterLogging(), and ShouldLogSession().
| bool Skyfire::PacketLogServer::IsGlobalLoggingEnabled | ( | ) | const |
Definition at line 280 of file PacketLogServer.cpp.
References _globalSessionLogging, and _sessionLock.
| void Skyfire::PacketLogServer::LogBinaryPacket | ( | PacketLogServerDirection | direction, |
| uint32 | opcode, | ||
| void const * | payload, | ||
| size_t | payloadSize ) |
Definition at line 383 of file PacketLogServer.cpp.
References _binaryFile, _sessionLock, ByteBuffer::append(), ByteBuffer::contents(), Skyfire::PACKET_LOG_CLIENT_TO_SERVER, and ByteBuffer::size().
| void Skyfire::PacketLogServer::LogMarker | ( | void const * | sessionKey, |
| PacketLogServerSessionInfo const & | sessionInfo, | ||
| std::string const & | marker ) |
Definition at line 402 of file PacketLogServer.cpp.
References _sessionLock, _sessionLogs, Skyfire::PacketLogServer::SessionLog::info, OpenSessionLog(), Skyfire::PacketLogServer::SessionLog::sequence, and ShouldLogSession().
| void Skyfire::PacketLogServer::LogPacket | ( | void const * | sessionKey, |
| PacketLogServerSessionInfo const & | sessionInfo, | ||
| PacketLogServerDirection | direction, | ||
| uint32 | opcode, | ||
| std::string const & | opcodeName, | ||
| void const * | payload, | ||
| size_t | payloadSize ) |
Definition at line 341 of file PacketLogServer.cpp.
References _sessionLock, _sessionLogs, Skyfire::PacketLogServer::SessionLog::info, OpenSessionLog(), Skyfire::PACKET_LOG_CLIENT_TO_SERVER, Skyfire::PacketLogServer::SessionLog::sequence, and ShouldLogSession().
|
private |
Definition at line 304 of file PacketLogServer.cpp.
References _sessionLogDir, _sessionLogs, Skyfire::PacketLogServerSessionInfo::AccountId, Skyfire::PacketLogServerSessionInfo::AccountName, Skyfire::PacketLogServerSessionInfo::CharacterName, Skyfire::PacketLogServer::SessionLog::file, Skyfire::PacketLogServer::SessionLog::info, Skyfire::PacketLogServer::SessionLog::path, Skyfire::PacketLogServerSessionInfo::RealmId, Skyfire::PacketLogServerSessionInfo::RemoteAddress, Skyfire::PacketLogServer::SessionLog::sequence, and Skyfire::PacketLogServerSessionInfo::SessionName.
Referenced by LogMarker(), and LogPacket().
| void Skyfire::PacketLogServer::RefreshSessionInfo | ( | void const * | sessionKey, |
| PacketLogServerSessionInfo const & | sessionInfo ) |
Definition at line 432 of file PacketLogServer.cpp.
References _sessionLock, _sessionLogDir, _sessionLogs, Skyfire::PacketLogServerSessionInfo::AccountId, Skyfire::PacketLogServerSessionInfo::AccountName, Skyfire::PacketLogServerSessionInfo::CharacterName, Skyfire::PacketLogServer::SessionLog::file, Skyfire::PacketLogServer::SessionLog::info, Skyfire::PacketLogServer::SessionLog::path, Skyfire::PacketLogServerSessionInfo::RealmId, Skyfire::PacketLogServer::SessionLog::sequence, and Skyfire::PacketLogServerSessionInfo::SessionName.
|
private |
Definition at line 292 of file PacketLogServer.cpp.
References _characterSessionLogging, _globalSessionLogging, and IsControlFileLoggingEnabled().
Referenced by LogMarker(), and LogPacket().
|
friend |
Definition at line 37 of file PacketLogServer.h.
|
private |
Definition at line 85 of file PacketLogServer.h.
Referenced by CanLogPacket(), ConfigureLegacyPacketLogFile(), LogBinaryPacket(), PacketLogServer(), and ~PacketLogServer().
|
private |
Definition at line 89 of file PacketLogServer.h.
Referenced by CanLogPacket(), Configure(), DisableAllLogging(), DisableCharacterLogging(), EnableCharacterLogging(), GetCharacterLoggingCount(), PacketLogServer(), and ShouldLogSession().
|
private |
Definition at line 86 of file PacketLogServer.h.
Referenced by Configure(), DisableAllLogging(), IsControlFileLoggingEnabled(), and PacketLogServer().
|
private |
Definition at line 88 of file PacketLogServer.h.
Referenced by CanLogPacket(), Configure(), DisableAllLogging(), DisableCharacterLogging(), EnableGlobalLogging(), IsGlobalLoggingEnabled(), PacketLogServer(), and ShouldLogSession().
|
private |
Definition at line 84 of file PacketLogServer.h.
Referenced by Configure(), ConfigureLegacyPacketLogFile(), and PacketLogServer().
|
mutableprivate |
Definition at line 90 of file PacketLogServer.h.
Referenced by CanLogPacket(), CloseSession(), Configure(), ConfigureLegacyPacketLogFile(), DisableAllLogging(), DisableCharacterLogging(), EnableCharacterLogging(), EnableGlobalLogging(), GetCharacterLoggingCount(), IsGlobalLoggingEnabled(), LogBinaryPacket(), LogMarker(), LogPacket(), RefreshSessionInfo(), and ~PacketLogServer().
|
private |
Definition at line 87 of file PacketLogServer.h.
Referenced by Configure(), OpenSessionLog(), PacketLogServer(), and RefreshSessionInfo().
|
private |
Definition at line 91 of file PacketLogServer.h.
Referenced by CloseAllSessions(), CloseCharacterSessions(), CloseSession(), LogMarker(), LogPacket(), OpenSessionLog(), PacketLogServer(), and RefreshSessionInfo().