#include <PacketLog.h>
std::once_flag _initializeFlag
Definition: PacketLog.h:41
FILE * _file
Definition: PacketLog.h:51
void Initialize()
Definition: PacketLog.cpp:79
arena_t NULL
Definition: jemalloc_internal.h:624
PacketLog::~PacketLog |
( |
| ) |
|
|
private |
FILE * _file
Definition: PacketLog.h:51
arena_t NULL
Definition: jemalloc_internal.h:624
bool PacketLog::CanLogPacket |
( |
| ) |
const |
|
inline |
FILE * _file
Definition: PacketLog.h:51
arena_t NULL
Definition: jemalloc_internal.h:624
void PacketLog::Initialize |
( |
void |
| ) |
|
81 std::string logsDir =
sConfigMgr->GetStringDefault(
"LogsDir",
"");
84 if ((logsDir.at(logsDir.length() - 1) !=
'/') && (logsDir.at(logsDir.length() - 1) !=
'\\'))
85 logsDir.push_back(
'/');
87 std::string logname =
sConfigMgr->GetStringDefault(
"PacketLogFile",
"");
90 _file = fopen((logsDir + logname).c_str(),
"wb");
104 fwrite(&header,
sizeof(header), 1,
_file);
FILE * _file
Definition: PacketLog.h:51
Realm realm
Definition: World.cpp:3485
uint32 getMSTime()
Definition: Timer.h:24
#define sConfigMgr
Definition: Config.h:61
arena_t NULL
Definition: jemalloc_internal.h:624
bool CanLogPacket() const
Definition: PacketLog.h:47
uint32 Build
Definition: Realm.h:87
static PacketLog * instance()
Definition: PacketLog.cpp:73
Definition: PacketLog.h:35
121 auto bytes = addr.to_v4().to_bytes();
124 else if (addr.is_v6())
126 auto bytes = addr.to_v6().to_bytes();
132 header.
Opcode = packet.GetOpcode();
134 fwrite(&header,
sizeof(header), 1,
_file);
136 fwrite(packet.contents(), 1, packet.size(),
_file);
FILE * _file
Definition: PacketLog.h:51
uint32 getMSTime()
Definition: Timer.h:24
uint32_t uint32
Definition: Define.h:150
Definition: PacketLog.h:29
std::mutex _logPacketLock
Definition: PacketLog.h:40
std::once_flag PacketLog::_initializeFlag |
|
private |
std::mutex PacketLog::_logPacketLock |
|
private |
The documentation for this class was generated from the following files: