mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
Optimize login music scanning and warden debug formatting
This commit is contained in:
parent
c26353eda1
commit
52accfde80
3 changed files with 60 additions and 44 deletions
|
|
@ -3512,16 +3512,19 @@ void GameHandler::handleWardenData(network::Packet& packet) {
|
|||
// Decrypt the payload
|
||||
std::vector<uint8_t> decrypted = wardenCrypto_->decrypt(data);
|
||||
|
||||
// Log decrypted data
|
||||
{
|
||||
// Avoid expensive hex formatting when DEBUG logs are disabled.
|
||||
if (core::Logger::getInstance().shouldLog(core::LogLevel::DEBUG)) {
|
||||
std::string hex;
|
||||
size_t logSize = std::min(decrypted.size(), size_t(256));
|
||||
hex.reserve(logSize * 3);
|
||||
for (size_t i = 0; i < logSize; ++i) {
|
||||
char b[4]; snprintf(b, sizeof(b), "%02x ", decrypted[i]); hex += b;
|
||||
char b[4];
|
||||
snprintf(b, sizeof(b), "%02x ", decrypted[i]);
|
||||
hex += b;
|
||||
}
|
||||
if (decrypted.size() > 64)
|
||||
if (decrypted.size() > 64) {
|
||||
hex += "... (" + std::to_string(decrypted.size() - 64) + " more)";
|
||||
}
|
||||
LOG_DEBUG("Warden: Decrypted (", decrypted.size(), " bytes): ", hex);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue