mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 09:33:51 +00:00
refactor: replace C-style casts with static_cast and extract toLowerInPlace
Replace ~300 C-style casts ((int), (float), (uint32_t), etc.) with static_cast across 15 source files. Extract toLowerInPlace() helper in lua_engine.cpp to replace 72 identical tolower loop patterns.
This commit is contained in:
parent
d646a0451d
commit
05f2bedf88
15 changed files with 385 additions and 381 deletions
|
|
@ -1569,7 +1569,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
uint8_t result = packet.readUInt8();
|
||||
lastCharDeleteResult_ = result;
|
||||
bool success = (result == 0x00 || result == 0x47);
|
||||
LOG_INFO("SMSG_CHAR_DELETE result: ", (int)result, success ? " (success)" : " (failed)");
|
||||
LOG_INFO("SMSG_CHAR_DELETE result: ", static_cast<int>(result), success ? " (success)" : " (failed)");
|
||||
requestCharacterList();
|
||||
if (charDeleteCallback_) charDeleteCallback_(success);
|
||||
};
|
||||
|
|
@ -1680,7 +1680,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
std::string ignName = packet.readString();
|
||||
if (!ignName.empty() && ignGuid != 0) ignoreCache[ignName] = ignGuid;
|
||||
}
|
||||
LOG_DEBUG("SMSG_IGNORE_LIST: loaded ", (int)ignCount, " ignored players");
|
||||
LOG_DEBUG("SMSG_IGNORE_LIST: loaded ", static_cast<int>(ignCount), " ignored players");
|
||||
};
|
||||
dispatchTable_[Opcode::MSG_RANDOM_ROLL] = [this](network::Packet& packet) { if (state == WorldState::IN_WORLD) handleRandomRoll(packet); };
|
||||
|
||||
|
|
@ -2038,7 +2038,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
pendingLootRoll_.voteMask = voteMask;
|
||||
pendingLootRoll_.rollStartedAt = std::chrono::steady_clock::now();
|
||||
LOG_INFO("SMSG_LOOT_START_ROLL: item=", itemId, " (", pendingLootRoll_.itemName,
|
||||
") slot=", slot, " voteMask=0x", std::hex, (int)voteMask, std::dec);
|
||||
") slot=", slot, " voteMask=0x", std::hex, static_cast<int>(voteMask), std::dec);
|
||||
fireAddonEvent("START_LOOT_ROLL", {std::to_string(slot), std::to_string(countdown)});
|
||||
};
|
||||
|
||||
|
|
@ -3986,7 +3986,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
if (packet.getSize() - packet.getReadPos() < 8) return;
|
||||
uint32_t duration = packet.readUInt32();
|
||||
uint32_t spellId = packet.readUInt32();
|
||||
LOG_DEBUG("SMSG_TOTEM_CREATED: slot=", (int)slot,
|
||||
LOG_DEBUG("SMSG_TOTEM_CREATED: slot=", static_cast<int>(slot),
|
||||
" spellId=", spellId, " duration=", duration, "ms");
|
||||
if (slot < NUM_TOTEM_SLOTS) {
|
||||
activeTotemSlots_[slot].spellId = spellId;
|
||||
|
|
@ -4410,7 +4410,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
sfx->playError();
|
||||
}
|
||||
LOG_WARNING("SMSG_SELL_ITEM error: ", (int)result, " (", msg, ")");
|
||||
LOG_WARNING("SMSG_SELL_ITEM error: ", static_cast<int>(result), " (", msg, ")");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
@ -4420,7 +4420,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
if ((packet.getSize() - packet.getReadPos()) >= 1) {
|
||||
uint8_t error = packet.readUInt8();
|
||||
if (error != 0) {
|
||||
LOG_WARNING("SMSG_INVENTORY_CHANGE_FAILURE: error=", (int)error);
|
||||
LOG_WARNING("SMSG_INVENTORY_CHANGE_FAILURE: error=", static_cast<int>(error));
|
||||
// After error byte: item_guid1(8) + item_guid2(8) + bag_slot(1) = 17 bytes
|
||||
uint32_t requiredLevel = 0;
|
||||
if (packet.getSize() - packet.getReadPos() >= 17) {
|
||||
|
|
@ -5470,7 +5470,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
}
|
||||
}
|
||||
LOG_DEBUG("MSG_INSPECT_ARENA_TEAMS: guid=0x", std::hex, inspGuid, std::dec,
|
||||
" teams=", (int)teamCount);
|
||||
" teams=", static_cast<int>(teamCount));
|
||||
};
|
||||
// auctionId(u32) + action(u32) + error(u32) + itemEntry(u32) + randomPropertyId(u32) + ...
|
||||
// action: 0=sold/won, 1=expired, 2=bid placed on your auction
|
||||
|
|
@ -5816,7 +5816,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
zoneId, levelMin, levelMax);
|
||||
addSystemChatMessage(buf);
|
||||
LOG_INFO("SMSG_MEETINGSTONE_SETQUEUE: zone=", zoneId,
|
||||
" levels=", (int)levelMin, "-", (int)levelMax);
|
||||
" levels=", static_cast<int>(levelMin), "-", static_cast<int>(levelMax));
|
||||
}
|
||||
packet.setReadPos(packet.getSize());
|
||||
};
|
||||
|
|
@ -5865,7 +5865,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
const char* msg = (reason < 4) ? kMeetingstoneErrors[reason]
|
||||
: "Meeting Stone: Could not join group.";
|
||||
addSystemChatMessage(msg);
|
||||
LOG_INFO("SMSG_MEETINGSTONE_JOINFAILED: reason=", (int)reason);
|
||||
LOG_INFO("SMSG_MEETINGSTONE_JOINFAILED: reason=", static_cast<int>(reason));
|
||||
}
|
||||
};
|
||||
// Player was removed from the meeting stone queue (left, or group disbanded)
|
||||
|
|
@ -5949,7 +5949,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
// Status 1 = no open ticket (default/no ticket)
|
||||
gmTicketActive_ = false;
|
||||
gmTicketText_.clear();
|
||||
LOG_DEBUG("SMSG_GMTICKET_GETTICKET: no open ticket (status=", (int)gmStatus, ")");
|
||||
LOG_DEBUG("SMSG_GMTICKET_GETTICKET: no open ticket (status=", static_cast<int>(gmStatus), ")");
|
||||
}
|
||||
packet.setReadPos(packet.getSize());
|
||||
};
|
||||
|
|
@ -7002,8 +7002,8 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
if (modeGuid == petGuid_) {
|
||||
petCommand_ = static_cast<uint8_t>(mode & 0xFF);
|
||||
petReact_ = static_cast<uint8_t>((mode >> 8) & 0xFF);
|
||||
LOG_DEBUG("SMSG_PET_MODE: command=", (int)petCommand_,
|
||||
" react=", (int)petReact_);
|
||||
LOG_DEBUG("SMSG_PET_MODE: command=", static_cast<int>(petCommand_),
|
||||
" react=", static_cast<int>(petReact_));
|
||||
}
|
||||
}
|
||||
packet.setReadPos(packet.getSize());
|
||||
|
|
@ -7054,7 +7054,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
uint8_t reason = (packet.getSize() - packet.getReadPos() >= 1)
|
||||
? packet.readUInt8() : 0;
|
||||
LOG_DEBUG("SMSG_PET_CAST_FAILED: spell=", spellId,
|
||||
" reason=", (int)reason);
|
||||
" reason=", static_cast<int>(reason));
|
||||
if (reason != 0) {
|
||||
const char* reasonStr = getSpellCastResultString(reason);
|
||||
const std::string& sName = getSpellName(spellId);
|
||||
|
|
@ -7354,7 +7354,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
addSystemChatMessage(isSafe ? "You are in the battlefield zone (safe area)."
|
||||
: "You have entered the battlefield!");
|
||||
if (onQueue) addSystemChatMessage("You are in the battlefield queue.");
|
||||
LOG_INFO("SMSG_BATTLEFIELD_MGR_ENTERED: isSafe=", (int)isSafe, " onQueue=", (int)onQueue);
|
||||
LOG_INFO("SMSG_BATTLEFIELD_MGR_ENTERED: isSafe=", static_cast<int>(isSafe), " onQueue=", static_cast<int>(onQueue));
|
||||
}
|
||||
packet.setReadPos(packet.getSize());
|
||||
};
|
||||
|
|
@ -7404,8 +7404,8 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
: "Battlefield queue request failed.";
|
||||
addSystemChatMessage(std::string("Battlefield: ") + msg);
|
||||
}
|
||||
LOG_INFO("SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE: accepted=", (int)accepted,
|
||||
" result=", (int)result);
|
||||
LOG_INFO("SMSG_BATTLEFIELD_MGR_QUEUE_REQUEST_RESPONSE: accepted=", static_cast<int>(accepted),
|
||||
" result=", static_cast<int>(result));
|
||||
packet.setReadPos(packet.getSize());
|
||||
};
|
||||
// uint64 battlefieldGuid + uint8 remove
|
||||
|
|
@ -7418,7 +7418,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
if (remove) {
|
||||
addSystemChatMessage("You will be removed from the battlefield shortly.");
|
||||
}
|
||||
LOG_INFO("SMSG_BATTLEFIELD_MGR_EJECT_PENDING: remove=", (int)remove);
|
||||
LOG_INFO("SMSG_BATTLEFIELD_MGR_EJECT_PENDING: remove=", static_cast<int>(remove));
|
||||
}
|
||||
packet.setReadPos(packet.getSize());
|
||||
};
|
||||
|
|
@ -7439,7 +7439,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
: "You have been ejected from the battlefield.";
|
||||
addSystemChatMessage(msg);
|
||||
if (relocated) addSystemChatMessage("You have been relocated outside the battlefield.");
|
||||
LOG_INFO("SMSG_BATTLEFIELD_MGR_EJECTED: reason=", reason, " relocated=", (int)relocated);
|
||||
LOG_INFO("SMSG_BATTLEFIELD_MGR_EJECTED: reason=", reason, " relocated=", static_cast<int>(relocated));
|
||||
}
|
||||
bfMgrActive_ = false;
|
||||
bfMgrInvitePending_ = false;
|
||||
|
|
@ -8370,7 +8370,7 @@ void GameHandler::handleCharEnum(network::Packet& packet) {
|
|||
LOG_INFO(" GUID: 0x", std::hex, character.guid, std::dec);
|
||||
LOG_INFO(" ", getRaceName(character.race), " ",
|
||||
getClassName(character.characterClass));
|
||||
LOG_INFO(" Level ", (int)character.level);
|
||||
LOG_INFO(" Level ", static_cast<int>(character.level));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -8528,7 +8528,7 @@ void GameHandler::handleCharLoginFailed(network::Packet& packet) {
|
|||
};
|
||||
const char* msg = (reason < 9) ? reasonNames[reason] : "Unknown reason";
|
||||
|
||||
LOG_ERROR("SMSG_CHARACTER_LOGIN_FAILED: reason=", (int)reason, " (", msg, ")");
|
||||
LOG_ERROR("SMSG_CHARACTER_LOGIN_FAILED: reason=", static_cast<int>(reason), " (", msg, ")");
|
||||
|
||||
// Allow the player to re-select a character
|
||||
setState(WorldState::CHAR_LIST_RECEIVED);
|
||||
|
|
@ -8540,7 +8540,7 @@ void GameHandler::handleCharLoginFailed(network::Packet& packet) {
|
|||
|
||||
void GameHandler::selectCharacter(uint64_t characterGuid) {
|
||||
if (state != WorldState::CHAR_LIST_RECEIVED) {
|
||||
LOG_WARNING("Cannot select character in state: ", (int)state);
|
||||
LOG_WARNING("Cannot select character in state: ", static_cast<int>(state));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -8557,7 +8557,7 @@ void GameHandler::selectCharacter(uint64_t characterGuid) {
|
|||
for (const auto& character : characters) {
|
||||
if (character.guid == characterGuid) {
|
||||
LOG_INFO("Character: ", character.name);
|
||||
LOG_INFO("Level ", (int)character.level, " ",
|
||||
LOG_INFO("Level ", static_cast<int>(character.level), " ",
|
||||
getRaceName(character.race), " ",
|
||||
getClassName(character.characterClass));
|
||||
playerRace_ = character.race;
|
||||
|
|
@ -9382,7 +9382,7 @@ void GameHandler::handleWardenData(network::Packet& packet) {
|
|||
pos += 4;
|
||||
uint8_t readLen = decrypted[pos++];
|
||||
LOG_WARNING("Warden: MEM offset=0x", [&]{char s[12];snprintf(s,12,"%08x",offset);return std::string(s);}(),
|
||||
" len=", (int)readLen,
|
||||
" len=", static_cast<int>(readLen),
|
||||
(strIdx ? " module=\"" + moduleName + "\"" : ""));
|
||||
if (offset == 0x00CF0BC8 && readLen == 4 && wardenMemory_ && wardenMemory_->isLoaded()) {
|
||||
uint32_t now = static_cast<uint32_t>(
|
||||
|
|
@ -9401,9 +9401,9 @@ void GameHandler::handleWardenData(network::Packet& packet) {
|
|||
else if (offset >= 0x827000 && offset < 0x883000) region = ".data(raw)";
|
||||
else if (offset >= 0x883000 && offset < 0xD06000) region = ".data(BSS)";
|
||||
bool allZero = true;
|
||||
for (int i = 0; i < (int)readLen; i++) { if (memBuf[i] != 0) { allZero = false; break; } }
|
||||
for (int i = 0; i < static_cast<int>(readLen); i++) { if (memBuf[i] != 0) { allZero = false; break; } }
|
||||
std::string hexDump;
|
||||
for (int i = 0; i < (int)readLen; i++) { char hx[4]; snprintf(hx,4,"%02x ",memBuf[i]); hexDump += hx; }
|
||||
for (int i = 0; i < static_cast<int>(readLen); i++) { char hx[4]; snprintf(hx,4,"%02x ",memBuf[i]); hexDump += hx; }
|
||||
LOG_WARNING("Warden: MEM_CHECK served: [", hexDump, "] region=", region,
|
||||
(allZero && offset >= 0x883000 ? " \xe2\x98\x85""BSS_ZERO\xe2\x98\x85" : ""));
|
||||
if (offset == 0x7FFE026C && readLen == 12)
|
||||
|
|
@ -9463,7 +9463,7 @@ void GameHandler::handleWardenData(network::Packet& packet) {
|
|||
uint8_t pageResult = found ? 0x4A : 0x00;
|
||||
LOG_WARNING("Warden: ", pageName, " offset=0x",
|
||||
[&]{char s[12];snprintf(s,12,"%08x",off);return std::string(s);}(),
|
||||
" patLen=", (int)patLen, " found=", found ? "yes" : "no",
|
||||
" patLen=", static_cast<int>(patLen), " found=", found ? "yes" : "no",
|
||||
turtleFallback ? " (turtle-fallback)" : "");
|
||||
pos += kPageSize;
|
||||
resultData.push_back(pageResult);
|
||||
|
|
@ -9737,7 +9737,7 @@ void GameHandler::handleWardenData(network::Packet& packet) {
|
|||
pos += 4;
|
||||
uint8_t readLen = decrypted[pos++];
|
||||
LOG_WARNING("Warden: (sync) MEM offset=0x", [&]{char s[12];snprintf(s,12,"%08x",offset);return std::string(s);}(),
|
||||
" len=", (int)readLen,
|
||||
" len=", static_cast<int>(readLen),
|
||||
moduleName.empty() ? "" : (" module=\"" + moduleName + "\""));
|
||||
|
||||
// Lazy-load WoW.exe PE image on first MEM_CHECK
|
||||
|
|
@ -9831,7 +9831,7 @@ void GameHandler::handleWardenData(network::Packet& packet) {
|
|||
uint8_t len2 = (decrypted.data()+pos)[28];
|
||||
LOG_WARNING("Warden: (sync) PAGE_A offset=0x",
|
||||
[&]{char s[12];snprintf(s,12,"%08x",off2);return std::string(s);}(),
|
||||
" patLen=", (int)len2,
|
||||
" patLen=", static_cast<int>(len2),
|
||||
" result=0x", [&]{char s[4];snprintf(s,4,"%02x",pageResult);return std::string(s);}());
|
||||
} else {
|
||||
LOG_WARNING("Warden: (sync) PAGE_A (short ", consume, "b) result=0x",
|
||||
|
|
@ -10073,8 +10073,8 @@ void GameHandler::handleWardenData(network::Packet& packet) {
|
|||
break;
|
||||
|
||||
default:
|
||||
LOG_DEBUG("Warden: Unknown opcode 0x", std::hex, (int)wardenOpcode, std::dec,
|
||||
" (state=", (int)wardenState_, ", size=", decrypted.size(), ")");
|
||||
LOG_DEBUG("Warden: Unknown opcode 0x", std::hex, static_cast<int>(wardenOpcode), std::dec,
|
||||
" (state=", static_cast<int>(wardenState_), ", size=", decrypted.size(), ")");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -10338,7 +10338,7 @@ uint32_t GameHandler::nextMovementTimestampMs() {
|
|||
|
||||
void GameHandler::sendMovement(Opcode opcode) {
|
||||
if (state != WorldState::IN_WORLD) {
|
||||
LOG_WARNING("Cannot send movement in state: ", (int)state);
|
||||
LOG_WARNING("Cannot send movement in state: ", static_cast<int>(state));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -11661,7 +11661,7 @@ void GameHandler::applyUpdateObjectBlock(const UpdateBlock& block, bool& newItem
|
|||
uint8_t newForm = static_cast<uint8_t>((val >> 24) & 0xFF);
|
||||
if (newForm != shapeshiftFormId_) {
|
||||
shapeshiftFormId_ = newForm;
|
||||
LOG_INFO("Shapeshift form changed: ", (int)newForm);
|
||||
LOG_INFO("Shapeshift form changed: ", static_cast<int>(newForm));
|
||||
if (addonEventCallback_) {
|
||||
fireAddonEvent("UPDATE_SHAPESHIFT_FORM", {});
|
||||
fireAddonEvent("UPDATE_SHAPESHIFT_FORMS", {});
|
||||
|
|
@ -12474,7 +12474,7 @@ void GameHandler::handleDestroyObject(network::Packet& packet) {
|
|||
|
||||
void GameHandler::sendChatMessage(ChatType type, const std::string& message, const std::string& target) {
|
||||
if (state != WorldState::IN_WORLD) {
|
||||
LOG_WARNING("Cannot send chat in state: ", (int)state);
|
||||
LOG_WARNING("Cannot send chat in state: ", static_cast<int>(state));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -13324,7 +13324,7 @@ void GameHandler::setStandState(uint8_t standState) {
|
|||
|
||||
auto packet = StandStateChangePacket::build(standState);
|
||||
socket->send(packet);
|
||||
LOG_INFO("Changed stand state to: ", (int)standState);
|
||||
LOG_INFO("Changed stand state to: ", static_cast<int>(standState));
|
||||
}
|
||||
|
||||
void GameHandler::toggleHelm() {
|
||||
|
|
@ -14226,8 +14226,8 @@ void GameHandler::handleNameQueryResponse(network::Packet& packet) {
|
|||
pendingNameQueries.erase(data.guid);
|
||||
|
||||
LOG_INFO("Name query response: guid=0x", std::hex, data.guid, std::dec,
|
||||
" found=", (int)data.found, " name='", data.name, "'",
|
||||
" race=", (int)data.race, " class=", (int)data.classId);
|
||||
" found=", static_cast<int>(data.found), " name='", data.name, "'",
|
||||
" race=", static_cast<int>(data.race), " class=", static_cast<int>(data.classId));
|
||||
|
||||
if (data.isValid()) {
|
||||
playerNameCache[data.guid] = data.name;
|
||||
|
|
@ -14549,7 +14549,7 @@ void GameHandler::handleInspectResults(network::Packet& packet) {
|
|||
}
|
||||
|
||||
LOG_INFO("SMSG_TALENTS_INFO type=0: unspent=", unspentTalents,
|
||||
" groups=", (int)talentGroupCount, " active=", (int)activeTalentGroup,
|
||||
" groups=", static_cast<int>(talentGroupCount), " active=", static_cast<int>(activeTalentGroup),
|
||||
" learned=", learnedTalents_[activeTalentGroup].size());
|
||||
return;
|
||||
}
|
||||
|
|
@ -14645,7 +14645,7 @@ void GameHandler::handleInspectResults(network::Packet& packet) {
|
|||
}
|
||||
|
||||
LOG_INFO("Inspect results for ", playerName, ": ", totalTalents, " talents, ",
|
||||
unspentTalents, " unspent, ", (int)talentGroupCount, " specs");
|
||||
unspentTalents, " unspent, ", static_cast<int>(talentGroupCount), " specs");
|
||||
if (addonEventCallback_) {
|
||||
char guidBuf[32];
|
||||
snprintf(guidBuf, sizeof(guidBuf), "0x%016llX", (unsigned long long)guid);
|
||||
|
|
@ -17079,7 +17079,7 @@ void GameHandler::handleArenaTeamEvent(network::Packet& packet) {
|
|||
break;
|
||||
}
|
||||
addSystemChatMessage(msg);
|
||||
LOG_INFO("Arena team event: ", (int)event, " ", param1, " ", param2);
|
||||
LOG_INFO("Arena team event: ", static_cast<int>(event), " ", param1, " ", param2);
|
||||
}
|
||||
|
||||
void GameHandler::handleArenaTeamStats(network::Packet& packet) {
|
||||
|
|
@ -17217,14 +17217,14 @@ void GameHandler::handlePvpLogData(network::Packet& packet) {
|
|||
|
||||
if (bgScoreboard_.isArena) {
|
||||
LOG_INFO("Arena log: ", bgScoreboard_.players.size(), " players, hasWinner=",
|
||||
bgScoreboard_.hasWinner, " winner=", (int)bgScoreboard_.winner,
|
||||
bgScoreboard_.hasWinner, " winner=", static_cast<int>(bgScoreboard_.winner),
|
||||
" team0='", bgScoreboard_.arenaTeams[0].teamName,
|
||||
"' ratingChange=", (int32_t)bgScoreboard_.arenaTeams[0].ratingChange,
|
||||
" team1='", bgScoreboard_.arenaTeams[1].teamName,
|
||||
"' ratingChange=", (int32_t)bgScoreboard_.arenaTeams[1].ratingChange);
|
||||
} else {
|
||||
LOG_INFO("PvP log: ", bgScoreboard_.players.size(), " players, hasWinner=",
|
||||
bgScoreboard_.hasWinner, " winner=", (int)bgScoreboard_.winner);
|
||||
bgScoreboard_.hasWinner, " winner=", static_cast<int>(bgScoreboard_.winner));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -18339,7 +18339,7 @@ void GameHandler::handlePetSpells(network::Packet& packet) {
|
|||
|
||||
done:
|
||||
LOG_INFO("SMSG_PET_SPELLS: petGuid=0x", std::hex, petGuid_, std::dec,
|
||||
" react=", (int)petReact_, " command=", (int)petCommand_,
|
||||
" react=", static_cast<int>(petReact_), " command=", static_cast<int>(petCommand_),
|
||||
" spells=", petSpellList_.size());
|
||||
if (addonEventCallback_) {
|
||||
fireAddonEvent("UNIT_PET", {"player"});
|
||||
|
|
@ -18376,7 +18376,7 @@ void GameHandler::togglePetSpellAutocast(uint32_t spellId) {
|
|||
petAutocastSpells_.insert(spellId);
|
||||
else
|
||||
petAutocastSpells_.erase(spellId);
|
||||
LOG_DEBUG("togglePetSpellAutocast: spellId=", spellId, " autocast=", (int)newState);
|
||||
LOG_DEBUG("togglePetSpellAutocast: spellId=", spellId, " autocast=", static_cast<int>(newState));
|
||||
}
|
||||
|
||||
void GameHandler::renamePet(const std::string& newName) {
|
||||
|
|
@ -18451,7 +18451,7 @@ void GameHandler::handleListStabledPets(network::Packet& packet) {
|
|||
|
||||
stableWindowOpen_ = true;
|
||||
LOG_INFO("MSG_LIST_STABLED_PETS: stableMasterGuid=0x", std::hex, stableMasterGuid_, std::dec,
|
||||
" petCount=", (int)petCount, " numSlots=", (int)stableNumSlots_);
|
||||
" petCount=", static_cast<int>(petCount), " numSlots=", static_cast<int>(stableNumSlots_));
|
||||
for (const auto& p : stabledPets_) {
|
||||
LOG_DEBUG(" Pet: number=", p.petNumber, " entry=", p.entry,
|
||||
" level=", p.level, " name='", p.name, "' displayId=", p.displayId,
|
||||
|
|
@ -19008,8 +19008,8 @@ void GameHandler::handleLearnedSpell(network::Packet& packet) {
|
|||
// Found the talent! Update the rank for the active spec
|
||||
uint8_t newRank = rank + 1; // rank is 0-indexed in array, but stored as 1-indexed
|
||||
learnedTalents_[activeTalentSpec_][talentId] = newRank;
|
||||
LOG_INFO("Talent learned: id=", talentId, " rank=", (int)newRank,
|
||||
" (spell ", spellId, ") in spec ", (int)activeTalentSpec_);
|
||||
LOG_INFO("Talent learned: id=", talentId, " rank=", static_cast<int>(newRank),
|
||||
" (spell ", spellId, ") in spec ", static_cast<int>(activeTalentSpec_));
|
||||
isTalentSpell = true;
|
||||
if (addonEventCallback_) {
|
||||
fireAddonEvent("CHARACTER_POINTS_CHANGED", {});
|
||||
|
|
@ -19203,7 +19203,7 @@ void GameHandler::handleTalentsInfo(network::Packet& packet) {
|
|||
static_cast<uint8_t>(unspentTalents > 255 ? 255 : unspentTalents);
|
||||
|
||||
LOG_INFO("handleTalentsInfo: unspent=", unspentTalents,
|
||||
" groups=", (int)talentGroupCount, " active=", (int)activeTalentGroup,
|
||||
" groups=", static_cast<int>(talentGroupCount), " active=", static_cast<int>(activeTalentGroup),
|
||||
" learned=", learnedTalents_[activeTalentGroup].size());
|
||||
|
||||
// Fire talent-related events for addons
|
||||
|
|
@ -19236,12 +19236,12 @@ void GameHandler::learnTalent(uint32_t talentId, uint32_t requestedRank) {
|
|||
|
||||
void GameHandler::switchTalentSpec(uint8_t newSpec) {
|
||||
if (newSpec > 1) {
|
||||
LOG_WARNING("Invalid talent spec: ", (int)newSpec);
|
||||
LOG_WARNING("Invalid talent spec: ", static_cast<int>(newSpec));
|
||||
return;
|
||||
}
|
||||
|
||||
if (newSpec == activeTalentSpec_) {
|
||||
LOG_INFO("Already on spec ", (int)newSpec);
|
||||
LOG_INFO("Already on spec ", static_cast<int>(newSpec));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -19253,12 +19253,12 @@ void GameHandler::switchTalentSpec(uint8_t newSpec) {
|
|||
if (state == WorldState::IN_WORLD && socket) {
|
||||
auto pkt = ActivateTalentGroupPacket::build(static_cast<uint32_t>(newSpec));
|
||||
socket->send(pkt);
|
||||
LOG_INFO("Sent CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE: group=", (int)newSpec);
|
||||
LOG_INFO("Sent CMSG_SET_ACTIVE_TALENT_GROUP_OBSOLETE: group=", static_cast<int>(newSpec));
|
||||
}
|
||||
activeTalentSpec_ = newSpec;
|
||||
|
||||
LOG_INFO("Switched to talent spec ", (int)newSpec,
|
||||
" (unspent=", (int)unspentTalentPoints_[newSpec],
|
||||
LOG_INFO("Switched to talent spec ", static_cast<int>(newSpec),
|
||||
" (unspent=", static_cast<int>(unspentTalentPoints_[newSpec]),
|
||||
", learned=", learnedTalents_[newSpec].size(), ")");
|
||||
|
||||
std::string msg = "Switched to spec " + std::to_string(newSpec + 1);
|
||||
|
|
@ -20433,7 +20433,7 @@ void GameHandler::selectGossipOption(uint32_t optionId) {
|
|||
|
||||
for (const auto& opt : currentGossip.options) {
|
||||
if (opt.id != optionId) continue;
|
||||
LOG_INFO(" matched option: id=", opt.id, " icon=", (int)opt.icon, " text='", opt.text, "'");
|
||||
LOG_INFO(" matched option: id=", opt.id, " icon=", static_cast<int>(opt.icon), " text='", opt.text, "'");
|
||||
|
||||
// Icon-based NPC interaction fallbacks
|
||||
// Some servers need the specific activate packet in addition to gossip select
|
||||
|
|
@ -20474,7 +20474,7 @@ void GameHandler::selectGossipOption(uint32_t optionId) {
|
|||
auto pkt = ListInventoryPacket::build(currentGossip.npcGuid);
|
||||
socket->send(pkt);
|
||||
LOG_INFO("Sent CMSG_LIST_INVENTORY (gossip) to npc=0x", std::hex, currentGossip.npcGuid, std::dec,
|
||||
" vendor=", (int)isVendor, " repair=", (int)isArmorer);
|
||||
" vendor=", static_cast<int>(isVendor), " repair=", static_cast<int>(isArmorer));
|
||||
}
|
||||
|
||||
if (textLower.find("make this inn your home") != std::string::npos ||
|
||||
|
|
@ -20895,7 +20895,7 @@ void GameHandler::applyPackedKillCountsFromFields(QuestLogEntry& quest) {
|
|||
if (counts[i] == 0 && quest.killCounts.count(entryKey)) continue;
|
||||
quest.killCounts[entryKey] = {counts[i], obj.required};
|
||||
LOG_DEBUG("Quest ", quest.questId, " objective[", i, "]: npcOrGo=",
|
||||
obj.npcOrGoId, " count=", (int)counts[i], "/", obj.required);
|
||||
obj.npcOrGoId, " count=", static_cast<int>(counts[i]), "/", obj.required);
|
||||
}
|
||||
|
||||
// Apply item objective counts (only available in WotLK stride+3 positions 4-5).
|
||||
|
|
@ -21450,8 +21450,8 @@ void GameHandler::unequipToBackpack(EquipSlot equipSlot) {
|
|||
uint8_t dstBag = 0xFF;
|
||||
uint8_t dstSlot = static_cast<uint8_t>(23 + freeSlot);
|
||||
|
||||
LOG_INFO("UnequipToBackpack: equipSlot=", (int)srcSlot,
|
||||
" -> backpackIndex=", freeSlot, " (dstSlot=", (int)dstSlot, ")");
|
||||
LOG_INFO("UnequipToBackpack: equipSlot=", static_cast<int>(srcSlot),
|
||||
" -> backpackIndex=", freeSlot, " (dstSlot=", static_cast<int>(dstSlot), ")");
|
||||
|
||||
auto packet = SwapItemPacket::build(dstBag, dstSlot, srcBag, srcSlot);
|
||||
socket->send(packet);
|
||||
|
|
@ -21459,8 +21459,8 @@ void GameHandler::unequipToBackpack(EquipSlot equipSlot) {
|
|||
|
||||
void GameHandler::swapContainerItems(uint8_t srcBag, uint8_t srcSlot, uint8_t dstBag, uint8_t dstSlot) {
|
||||
if (!socket || !socket->isConnected()) return;
|
||||
LOG_INFO("swapContainerItems: src(bag=", (int)srcBag, " slot=", (int)srcSlot,
|
||||
") -> dst(bag=", (int)dstBag, " slot=", (int)dstSlot, ")");
|
||||
LOG_INFO("swapContainerItems: src(bag=", static_cast<int>(srcBag), " slot=", static_cast<int>(srcSlot),
|
||||
") -> dst(bag=", static_cast<int>(dstBag), " slot=", static_cast<int>(dstSlot), ")");
|
||||
auto packet = SwapItemPacket::build(dstBag, dstSlot, srcBag, srcSlot);
|
||||
socket->send(packet);
|
||||
}
|
||||
|
|
@ -21485,8 +21485,8 @@ void GameHandler::swapBagSlots(int srcBagIndex, int dstBagIndex) {
|
|||
if (socket && socket->isConnected()) {
|
||||
uint8_t srcSlot = static_cast<uint8_t>(19 + srcBagIndex);
|
||||
uint8_t dstSlot = static_cast<uint8_t>(19 + dstBagIndex);
|
||||
LOG_INFO("swapBagSlots: bag ", srcBagIndex, " (slot ", (int)srcSlot,
|
||||
") <-> bag ", dstBagIndex, " (slot ", (int)dstSlot, ")");
|
||||
LOG_INFO("swapBagSlots: bag ", srcBagIndex, " (slot ", static_cast<int>(srcSlot),
|
||||
") <-> bag ", dstBagIndex, " (slot ", static_cast<int>(dstSlot), ")");
|
||||
auto packet = SwapItemPacket::build(255, dstSlot, 255, srcSlot);
|
||||
socket->send(packet);
|
||||
}
|
||||
|
|
@ -21503,8 +21503,8 @@ void GameHandler::destroyItem(uint8_t bag, uint8_t slot, uint8_t count) {
|
|||
packet.writeUInt8(bag);
|
||||
packet.writeUInt8(slot);
|
||||
packet.writeUInt32(static_cast<uint32_t>(count));
|
||||
LOG_DEBUG("Destroy item request: bag=", (int)bag, " slot=", (int)slot,
|
||||
" count=", (int)count, " wire=0x", std::hex, kCmsgDestroyItem, std::dec);
|
||||
LOG_DEBUG("Destroy item request: bag=", static_cast<int>(bag), " slot=", static_cast<int>(slot),
|
||||
" count=", static_cast<int>(count), " wire=0x", std::hex, kCmsgDestroyItem, std::dec);
|
||||
socket->send(packet);
|
||||
}
|
||||
|
||||
|
|
@ -21517,8 +21517,8 @@ void GameHandler::splitItem(uint8_t srcBag, uint8_t srcSlot, uint8_t count) {
|
|||
if (freeBp >= 0) {
|
||||
uint8_t dstBag = 0xFF;
|
||||
uint8_t dstSlot = static_cast<uint8_t>(23 + freeBp);
|
||||
LOG_INFO("splitItem: src(bag=", (int)srcBag, " slot=", (int)srcSlot,
|
||||
") count=", (int)count, " -> dst(bag=0xFF slot=", (int)dstSlot, ")");
|
||||
LOG_INFO("splitItem: src(bag=", static_cast<int>(srcBag), " slot=", static_cast<int>(srcSlot),
|
||||
") count=", static_cast<int>(count), " -> dst(bag=0xFF slot=", static_cast<int>(dstSlot), ")");
|
||||
auto packet = SplitItemPacket::build(srcBag, srcSlot, dstBag, dstSlot, count);
|
||||
socket->send(packet);
|
||||
return;
|
||||
|
|
@ -21530,9 +21530,9 @@ void GameHandler::splitItem(uint8_t srcBag, uint8_t srcSlot, uint8_t count) {
|
|||
if (inventory.getBagSlot(b, s).empty()) {
|
||||
uint8_t dstBag = static_cast<uint8_t>(19 + b);
|
||||
uint8_t dstSlot = static_cast<uint8_t>(s);
|
||||
LOG_INFO("splitItem: src(bag=", (int)srcBag, " slot=", (int)srcSlot,
|
||||
") count=", (int)count, " -> dst(bag=", (int)dstBag,
|
||||
" slot=", (int)dstSlot, ")");
|
||||
LOG_INFO("splitItem: src(bag=", static_cast<int>(srcBag), " slot=", static_cast<int>(srcSlot),
|
||||
") count=", static_cast<int>(count), " -> dst(bag=", static_cast<int>(dstBag),
|
||||
" slot=", static_cast<int>(dstSlot), ")");
|
||||
auto packet = SplitItemPacket::build(srcBag, srcSlot, dstBag, dstSlot, count);
|
||||
socket->send(packet);
|
||||
return;
|
||||
|
|
@ -21615,7 +21615,7 @@ void GameHandler::useItemInBag(int bagIndex, int slotIndex) {
|
|||
auto packet = packetParsers_
|
||||
? packetParsers_->buildUseItem(wowBag, static_cast<uint8_t>(slotIndex), itemGuid, useSpellId)
|
||||
: UseItemPacket::build(wowBag, static_cast<uint8_t>(slotIndex), itemGuid, useSpellId);
|
||||
LOG_INFO("useItemInBag: sending CMSG_USE_ITEM, bag=", (int)wowBag, " slot=", slotIndex,
|
||||
LOG_INFO("useItemInBag: sending CMSG_USE_ITEM, bag=", static_cast<int>(wowBag), " slot=", slotIndex,
|
||||
" packetSize=", packet.getSize());
|
||||
socket->send(packet);
|
||||
} else if (itemGuid == 0) {
|
||||
|
|
@ -21640,7 +21640,7 @@ void GameHandler::openItemInBag(int bagIndex, int slotIndex) {
|
|||
if (state != WorldState::IN_WORLD || !socket) return;
|
||||
uint8_t wowBag = static_cast<uint8_t>(19 + bagIndex);
|
||||
auto packet = OpenItemPacket::build(wowBag, static_cast<uint8_t>(slotIndex));
|
||||
LOG_INFO("openItemInBag: CMSG_OPEN_ITEM bag=", (int)wowBag, " slot=", slotIndex);
|
||||
LOG_INFO("openItemInBag: CMSG_OPEN_ITEM bag=", static_cast<int>(wowBag), " slot=", slotIndex);
|
||||
socket->send(packet);
|
||||
}
|
||||
|
||||
|
|
@ -22101,8 +22101,8 @@ void GameHandler::handleTrainerList(network::Packet& packet) {
|
|||
" 25312=", knownSpells.count(25312u));
|
||||
for (size_t i = 0; i < std::min(size_t(5), currentTrainerList_.spells.size()); ++i) {
|
||||
const auto& s = currentTrainerList_.spells[i];
|
||||
LOG_DEBUG(" Spell[", i, "]: id=", s.spellId, " state=", (int)s.state,
|
||||
" cost=", s.spellCost, " reqLvl=", (int)s.reqLevel,
|
||||
LOG_DEBUG(" Spell[", i, "]: id=", s.spellId, " state=", static_cast<int>(s.state),
|
||||
" cost=", s.spellCost, " reqLvl=", static_cast<int>(s.reqLevel),
|
||||
" chain=(", s.chainNode1, ",", s.chainNode2, ",", s.chainNode3, ")");
|
||||
}
|
||||
|
||||
|
|
@ -22115,7 +22115,7 @@ void GameHandler::handleTrainerList(network::Packet& packet) {
|
|||
}
|
||||
|
||||
void GameHandler::trainSpell(uint32_t spellId) {
|
||||
LOG_INFO("trainSpell called: spellId=", spellId, " state=", (int)state, " socket=", (socket ? "yes" : "no"));
|
||||
LOG_INFO("trainSpell called: spellId=", spellId, " state=", static_cast<int>(state), " socket=", (socket ? "yes" : "no"));
|
||||
if (state != WorldState::IN_WORLD || !socket) {
|
||||
LOG_WARNING("trainSpell: Not in world or no socket connection");
|
||||
return;
|
||||
|
|
@ -23780,7 +23780,7 @@ void GameHandler::handleFriendList(network::Packet& packet) {
|
|||
auto rem = [&]() { return packet.getSize() - packet.getReadPos(); };
|
||||
if (rem() < 1) return;
|
||||
uint8_t count = packet.readUInt8();
|
||||
LOG_INFO("SMSG_FRIEND_LIST: ", (int)count, " entries");
|
||||
LOG_INFO("SMSG_FRIEND_LIST: ", static_cast<int>(count), " entries");
|
||||
|
||||
// Rebuild friend contacts (keep ignores from previous contact_ entries)
|
||||
contacts_.erase(std::remove_if(contacts_.begin(), contacts_.end(),
|
||||
|
|
@ -23802,10 +23802,10 @@ void GameHandler::handleFriendList(network::Packet& packet) {
|
|||
if (nit != playerNameCache.end()) {
|
||||
name = nit->second;
|
||||
friendsCache[name] = guid;
|
||||
LOG_INFO(" Friend: ", name, " status=", (int)status);
|
||||
LOG_INFO(" Friend: ", name, " status=", static_cast<int>(status));
|
||||
} else {
|
||||
LOG_INFO(" Friend guid=0x", std::hex, guid, std::dec,
|
||||
" status=", (int)status, " (name pending)");
|
||||
" status=", static_cast<int>(status), " (name pending)");
|
||||
queryPlayerName(guid);
|
||||
}
|
||||
ContactEntry entry;
|
||||
|
|
@ -23965,11 +23965,11 @@ void GameHandler::handleFriendStatus(network::Packet& packet) {
|
|||
addSystemChatMessage(playerName + " is ignoring you.");
|
||||
break;
|
||||
default:
|
||||
LOG_INFO("Friend status: ", (int)data.status, " for ", playerName);
|
||||
LOG_INFO("Friend status: ", static_cast<int>(data.status), " for ", playerName);
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_INFO("Friend status update: ", playerName, " status=", (int)data.status);
|
||||
LOG_INFO("Friend status update: ", playerName, " status=", static_cast<int>(data.status));
|
||||
fireAddonEvent("FRIENDLIST_UPDATE", {});
|
||||
}
|
||||
|
||||
|
|
@ -24023,7 +24023,7 @@ void GameHandler::handleLogoutResponse(network::Packet& packet) {
|
|||
addSystemChatMessage("Logging out in 20 seconds...");
|
||||
logoutCountdown_ = 20.0f;
|
||||
}
|
||||
LOG_INFO("Logout response: success, instant=", (int)data.instant);
|
||||
LOG_INFO("Logout response: success, instant=", static_cast<int>(data.instant));
|
||||
fireAddonEvent("PLAYER_LOGOUT", {});
|
||||
} else {
|
||||
// Failure
|
||||
|
|
@ -24052,7 +24052,7 @@ uint32_t GameHandler::generateClientSeed() {
|
|||
|
||||
void GameHandler::setState(WorldState newState) {
|
||||
if (state != newState) {
|
||||
LOG_DEBUG("World state: ", (int)state, " -> ", (int)newState);
|
||||
LOG_DEBUG("World state: ", static_cast<int>(state), " -> ", static_cast<int>(newState));
|
||||
state = newState;
|
||||
}
|
||||
}
|
||||
|
|
@ -25007,7 +25007,7 @@ void GameHandler::handleGuildBankList(network::Packet& packet) {
|
|||
if (item.itemEntry != 0) ensureItemInfo(item.itemEntry);
|
||||
}
|
||||
|
||||
LOG_INFO("SMSG_GUILD_BANK_LIST: tab=", (int)data.tabId,
|
||||
LOG_INFO("SMSG_GUILD_BANK_LIST: tab=", static_cast<int>(data.tabId),
|
||||
" items=", data.tabItems.size(),
|
||||
" tabs=", data.tabs.size(),
|
||||
" money=", data.money);
|
||||
|
|
@ -25114,7 +25114,7 @@ void GameHandler::handleAuctionHello(network::Packet& packet) {
|
|||
auctionOwnerResults_ = AuctionListResult{};
|
||||
auctionBidderResults_ = AuctionListResult{};
|
||||
LOG_INFO("MSG_AUCTION_HELLO: auctioneer=0x", std::hex, data.auctioneerGuid, std::dec,
|
||||
" house=", data.auctionHouseId, " enabled=", (int)data.enabled);
|
||||
" house=", data.auctionHouseId, " enabled=", static_cast<int>(data.enabled));
|
||||
}
|
||||
|
||||
void GameHandler::handleAuctionListResult(network::Packet& packet) {
|
||||
|
|
@ -25216,7 +25216,7 @@ void GameHandler::handleItemTextQueryResponse(network::Packet& packet) {
|
|||
itemText_ = packet.readString();
|
||||
itemTextOpen_= !itemText_.empty();
|
||||
}
|
||||
LOG_DEBUG("SMSG_ITEM_TEXT_QUERY_RESPONSE: isEmpty=", (int)isEmpty,
|
||||
LOG_DEBUG("SMSG_ITEM_TEXT_QUERY_RESPONSE: isEmpty=", static_cast<int>(isEmpty),
|
||||
" len=", itemText_.size());
|
||||
}
|
||||
|
||||
|
|
@ -25547,7 +25547,7 @@ void GameHandler::handleTradeStatusExtended(network::Packet& packet) {
|
|||
if (s.occupied && s.itemId != 0) queryItemInfo(s.itemId, 0);
|
||||
}
|
||||
|
||||
LOG_DEBUG("SMSG_TRADE_STATUS_EXTENDED: isSelf=", (int)isSelf,
|
||||
LOG_DEBUG("SMSG_TRADE_STATUS_EXTENDED: isSelf=", static_cast<int>(isSelf),
|
||||
" myGold=", myTradeGold_, " peerGold=", peerTradeGold_);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ bool ClassicPacketParsers::parseMovementBlock(network::Packet& packet, UpdateBlo
|
|||
uint8_t updateFlags = packet.readUInt8();
|
||||
block.updateFlags = static_cast<uint16_t>(updateFlags);
|
||||
|
||||
LOG_DEBUG(" [Classic] UpdateFlags: 0x", std::hex, (int)updateFlags, std::dec);
|
||||
LOG_DEBUG(" [Classic] UpdateFlags: 0x", std::hex, static_cast<int>(updateFlags), std::dec);
|
||||
|
||||
const uint8_t UPDATEFLAG_TRANSPORT = 0x02;
|
||||
const uint8_t UPDATEFLAG_MELEE_ATTACKING = 0x04;
|
||||
|
|
@ -613,13 +613,13 @@ bool ClassicPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& da
|
|||
}
|
||||
const uint8_t rawHitCount = packet.readUInt8();
|
||||
if (rawHitCount > 128) {
|
||||
LOG_WARNING("[Classic] Spell go: hitCount capped (requested=", (int)rawHitCount, ")");
|
||||
LOG_WARNING("[Classic] Spell go: hitCount capped (requested=", static_cast<int>(rawHitCount), ")");
|
||||
}
|
||||
if (rem() < static_cast<size_t>(rawHitCount) + 1u) {
|
||||
static uint32_t badHitCountTrunc = 0;
|
||||
++badHitCountTrunc;
|
||||
if (badHitCountTrunc <= 10 || (badHitCountTrunc % 100) == 0) {
|
||||
LOG_WARNING("[Classic] Spell go: invalid hitCount/remaining (hits=", (int)rawHitCount,
|
||||
LOG_WARNING("[Classic] Spell go: invalid hitCount/remaining (hits=", static_cast<int>(rawHitCount),
|
||||
" remaining=", rem(), " occurrence=", badHitCountTrunc, ")");
|
||||
}
|
||||
traceFailure("invalid_hit_count", packet.getReadPos(), rawHitCount);
|
||||
|
|
@ -654,7 +654,7 @@ bool ClassicPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& da
|
|||
};
|
||||
|
||||
if (!parseHitList(false) && !parseHitList(true)) {
|
||||
LOG_WARNING("[Classic] Spell go: truncated hit targets at index 0/", (int)rawHitCount);
|
||||
LOG_WARNING("[Classic] Spell go: truncated hit targets at index 0/", static_cast<int>(rawHitCount));
|
||||
traceFailure("truncated_hit_target", packet.getReadPos(), rawHitCount);
|
||||
packet.setReadPos(startPos);
|
||||
return false;
|
||||
|
|
@ -673,7 +673,7 @@ bool ClassicPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& da
|
|||
}
|
||||
const uint8_t rawMissCount = packet.readUInt8();
|
||||
if (rawMissCount > 128) {
|
||||
LOG_WARNING("[Classic] Spell go: missCount capped (requested=", (int)rawMissCount, ")");
|
||||
LOG_WARNING("[Classic] Spell go: missCount capped (requested=", static_cast<int>(rawMissCount), ")");
|
||||
traceFailure("miss_count_capped", packet.getReadPos() - 1, rawMissCount);
|
||||
}
|
||||
if (rem() < static_cast<size_t>(rawMissCount) * 2u) {
|
||||
|
|
@ -695,7 +695,7 @@ bool ClassicPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& da
|
|||
static uint32_t badMissCountTrunc = 0;
|
||||
++badMissCountTrunc;
|
||||
if (badMissCountTrunc <= 10 || (badMissCountTrunc % 100) == 0) {
|
||||
LOG_WARNING("[Classic] Spell go: invalid missCount/remaining (misses=", (int)rawMissCount,
|
||||
LOG_WARNING("[Classic] Spell go: invalid missCount/remaining (misses=", static_cast<int>(rawMissCount),
|
||||
" remaining=", rem(), " occurrence=", badMissCountTrunc, ")");
|
||||
}
|
||||
traceFailure("invalid_miss_count", packet.getReadPos(), rawMissCount);
|
||||
|
|
@ -727,7 +727,7 @@ bool ClassicPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& da
|
|||
packet.setReadPos(missEntryPos);
|
||||
if (!parseMissEntry(m, true)) {
|
||||
LOG_WARNING("[Classic] Spell go: truncated miss targets at index ", i,
|
||||
"/", (int)rawMissCount);
|
||||
"/", static_cast<int>(rawMissCount));
|
||||
traceFailure("truncated_miss_target", packet.getReadPos(), i);
|
||||
truncatedMissTargets = true;
|
||||
break;
|
||||
|
|
@ -735,7 +735,7 @@ bool ClassicPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& da
|
|||
}
|
||||
if (rem() < 1) {
|
||||
LOG_WARNING("[Classic] Spell go: missing missType at miss index ", i,
|
||||
"/", (int)rawMissCount);
|
||||
"/", static_cast<int>(rawMissCount));
|
||||
traceFailure("missing_miss_type", packet.getReadPos(), i);
|
||||
truncatedMissTargets = true;
|
||||
break;
|
||||
|
|
@ -744,7 +744,7 @@ bool ClassicPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& da
|
|||
if (m.missType == 11) {
|
||||
if (rem() < 1) {
|
||||
LOG_WARNING("[Classic] Spell go: truncated reflect payload at miss index ", i,
|
||||
"/", (int)rawMissCount);
|
||||
"/", static_cast<int>(rawMissCount));
|
||||
traceFailure("truncated_reflect", packet.getReadPos(), i);
|
||||
truncatedMissTargets = true;
|
||||
break;
|
||||
|
|
@ -774,8 +774,8 @@ bool ClassicPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& da
|
|||
// any subsequent fields (e.g. castFlags extras) are not misaligned.
|
||||
skipClassicSpellCastTargets(packet, &data.targetGuid);
|
||||
|
||||
LOG_DEBUG("[Classic] Spell go: spell=", data.spellId, " hits=", (int)data.hitCount,
|
||||
" misses=", (int)data.missCount);
|
||||
LOG_DEBUG("[Classic] Spell go: spell=", data.spellId, " hits=", static_cast<int>(data.hitCount),
|
||||
" misses=", static_cast<int>(data.missCount));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1011,8 +1011,8 @@ bool ClassicPacketParsers::parseNameQueryResponse(network::Packet& packet, NameQ
|
|||
data.found = 0;
|
||||
|
||||
LOG_DEBUG("[Classic] Name query response: ", data.name,
|
||||
" (race=", (int)data.race, " gender=", (int)data.gender,
|
||||
" class=", (int)data.classId, ")");
|
||||
" (race=", static_cast<int>(data.race), " gender=", static_cast<int>(data.gender),
|
||||
" class=", static_cast<int>(data.classId), ")");
|
||||
return !data.name.empty();
|
||||
}
|
||||
|
||||
|
|
@ -1028,7 +1028,7 @@ bool ClassicPacketParsers::parseCastFailed(network::Packet& packet, CastFailedDa
|
|||
// WotLK enum starts at 0=SUCCESS, 1=AFFECTING_COMBAT.
|
||||
// Shift +1 to align with WotLK result strings.
|
||||
data.result = vanillaResult + 1;
|
||||
LOG_DEBUG("[Classic] Cast failed: spell=", data.spellId, " vanillaResult=", (int)vanillaResult);
|
||||
LOG_DEBUG("[Classic] Cast failed: spell=", data.spellId, " vanillaResult=", static_cast<int>(vanillaResult));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1044,7 +1044,7 @@ bool ClassicPacketParsers::parseCastResult(network::Packet& packet, uint32_t& sp
|
|||
uint8_t vanillaResult = packet.readUInt8();
|
||||
// Shift +1: Vanilla result 0=AFFECTING_COMBAT maps to WotLK result 1=AFFECTING_COMBAT
|
||||
result = vanillaResult + 1;
|
||||
LOG_DEBUG("[Classic] Cast result: spell=", spellId, " vanillaResult=", (int)vanillaResult);
|
||||
LOG_DEBUG("[Classic] Cast result: spell=", spellId, " vanillaResult=", static_cast<int>(vanillaResult));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1068,12 +1068,12 @@ bool ClassicPacketParsers::parseCharEnum(network::Packet& packet, CharEnumRespon
|
|||
// Cap count to prevent excessive memory allocation
|
||||
constexpr uint8_t kMaxCharacters = 32;
|
||||
if (count > kMaxCharacters) {
|
||||
LOG_WARNING("[Classic] Character count ", (int)count, " exceeds max ", (int)kMaxCharacters,
|
||||
LOG_WARNING("[Classic] Character count ", static_cast<int>(count), " exceeds max ", static_cast<int>(kMaxCharacters),
|
||||
", capping");
|
||||
count = kMaxCharacters;
|
||||
}
|
||||
|
||||
LOG_INFO("[Classic] Parsing SMSG_CHAR_ENUM: ", (int)count, " characters");
|
||||
LOG_INFO("[Classic] Parsing SMSG_CHAR_ENUM: ", static_cast<int>(count), " characters");
|
||||
|
||||
response.characters.clear();
|
||||
response.characters.reserve(count);
|
||||
|
|
@ -1085,7 +1085,7 @@ bool ClassicPacketParsers::parseCharEnum(network::Packet& packet, CharEnumRespon
|
|||
// + flags(4) + firstLogin(1) + pet(12) + equipment(20*5)
|
||||
constexpr size_t kMinCharacterSize = 8 + 1 + 1 + 1 + 1 + 4 + 1 + 1 + 4 + 4 + 12 + 4 + 4 + 1 + 12 + 100;
|
||||
if (packet.getReadPos() + kMinCharacterSize > packet.getSize()) {
|
||||
LOG_WARNING("[Classic] Character enum packet truncated at character ", (int)(i + 1),
|
||||
LOG_WARNING("[Classic] Character enum packet truncated at character ", static_cast<int>(i + 1),
|
||||
", pos=", packet.getReadPos(), " needed=", kMinCharacterSize,
|
||||
" size=", packet.getSize());
|
||||
break;
|
||||
|
|
@ -1142,9 +1142,9 @@ bool ClassicPacketParsers::parseCharEnum(network::Packet& packet, CharEnumRespon
|
|||
character.equipment.push_back(item);
|
||||
}
|
||||
|
||||
LOG_DEBUG(" Character ", (int)(i + 1), ": ", character.name,
|
||||
LOG_DEBUG(" Character ", static_cast<int>(i + 1), ": ", character.name,
|
||||
" (", getRaceName(character.race), " ", getClassName(character.characterClass),
|
||||
" level ", (int)character.level, " zone ", character.zoneId, ")");
|
||||
" level ", static_cast<int>(character.level), " zone ", character.zoneId, ")");
|
||||
|
||||
response.characters.push_back(character);
|
||||
}
|
||||
|
|
@ -1563,7 +1563,7 @@ bool ClassicPacketParsers::parseMailList(network::Packet& packet,
|
|||
if (remaining < 1) return false;
|
||||
|
||||
uint8_t count = packet.readUInt8();
|
||||
LOG_INFO("SMSG_MAIL_LIST_RESULT (Classic): count=", (int)count);
|
||||
LOG_INFO("SMSG_MAIL_LIST_RESULT (Classic): count=", static_cast<int>(count));
|
||||
|
||||
inbox.clear();
|
||||
inbox.reserve(count);
|
||||
|
|
@ -1932,7 +1932,7 @@ bool TurtlePacketParsers::parseMovementBlock(network::Packet& packet, UpdateBloc
|
|||
uint8_t updateFlags = packet.readUInt8();
|
||||
block.updateFlags = static_cast<uint16_t>(updateFlags);
|
||||
|
||||
LOG_DEBUG(" [Turtle] UpdateFlags: 0x", std::hex, (int)updateFlags, std::dec);
|
||||
LOG_DEBUG(" [Turtle] UpdateFlags: 0x", std::hex, static_cast<int>(updateFlags), std::dec);
|
||||
|
||||
const uint8_t UPDATEFLAG_TRANSPORT = 0x02;
|
||||
const uint8_t UPDATEFLAG_MELEE_ATTACKING = 0x04;
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ bool TbcPacketParsers::parseMovementBlock(network::Packet& packet, UpdateBlock&
|
|||
uint8_t updateFlags = packet.readUInt8();
|
||||
block.updateFlags = static_cast<uint16_t>(updateFlags);
|
||||
|
||||
LOG_DEBUG(" [TBC] UpdateFlags: 0x", std::hex, (int)updateFlags, std::dec);
|
||||
LOG_DEBUG(" [TBC] UpdateFlags: 0x", std::hex, static_cast<int>(updateFlags), std::dec);
|
||||
|
||||
// TBC UpdateFlag bit values (same as lower byte of WotLK):
|
||||
// 0x01 = SELF
|
||||
|
|
@ -317,12 +317,12 @@ bool TbcPacketParsers::parseCharEnum(network::Packet& packet, CharEnumResponse&
|
|||
// Cap count to prevent excessive memory allocation
|
||||
constexpr uint8_t kMaxCharacters = 32;
|
||||
if (count > kMaxCharacters) {
|
||||
LOG_WARNING("[TBC] Character count ", (int)count, " exceeds max ", (int)kMaxCharacters,
|
||||
LOG_WARNING("[TBC] Character count ", static_cast<int>(count), " exceeds max ", static_cast<int>(kMaxCharacters),
|
||||
", capping");
|
||||
count = kMaxCharacters;
|
||||
}
|
||||
|
||||
LOG_INFO("[TBC] Parsing SMSG_CHAR_ENUM: ", (int)count, " characters");
|
||||
LOG_INFO("[TBC] Parsing SMSG_CHAR_ENUM: ", static_cast<int>(count), " characters");
|
||||
|
||||
response.characters.clear();
|
||||
response.characters.reserve(count);
|
||||
|
|
@ -334,7 +334,7 @@ bool TbcPacketParsers::parseCharEnum(network::Packet& packet, CharEnumResponse&
|
|||
// + flags(4) + firstLogin(1) + pet(12) + equipment(20*9)
|
||||
constexpr size_t kMinCharacterSize = 8 + 1 + 1 + 1 + 1 + 4 + 1 + 1 + 4 + 4 + 12 + 4 + 4 + 1 + 12 + 180;
|
||||
if (packet.getReadPos() + kMinCharacterSize > packet.getSize()) {
|
||||
LOG_WARNING("[TBC] Character enum packet truncated at character ", (int)(i + 1),
|
||||
LOG_WARNING("[TBC] Character enum packet truncated at character ", static_cast<int>(i + 1),
|
||||
", pos=", packet.getReadPos(), " needed=", kMinCharacterSize,
|
||||
" size=", packet.getSize());
|
||||
break;
|
||||
|
|
@ -391,9 +391,9 @@ bool TbcPacketParsers::parseCharEnum(network::Packet& packet, CharEnumResponse&
|
|||
character.equipment.push_back(item);
|
||||
}
|
||||
|
||||
LOG_DEBUG(" Character ", (int)(i + 1), ": ", character.name,
|
||||
LOG_DEBUG(" Character ", static_cast<int>(i + 1), ": ", character.name,
|
||||
" (", getRaceName(character.race), " ", getClassName(character.characterClass),
|
||||
" level ", (int)character.level, " zone ", character.zoneId, ")");
|
||||
" level ", static_cast<int>(character.level), " zone ", character.zoneId, ")");
|
||||
|
||||
response.characters.push_back(character);
|
||||
}
|
||||
|
|
@ -710,7 +710,7 @@ bool TbcPacketParsers::parseMonsterMove(network::Packet& packet, MonsterMoveData
|
|||
}
|
||||
|
||||
LOG_DEBUG("[TBC] MonsterMove: guid=0x", std::hex, data.guid, std::dec,
|
||||
" type=", (int)data.moveType, " dur=", data.duration, "ms",
|
||||
" type=", static_cast<int>(data.moveType), " dur=", data.duration, "ms",
|
||||
" dest=(", data.destX, ",", data.destY, ",", data.destZ, ")");
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1162,7 +1162,7 @@ bool TbcPacketParsers::parseMailList(network::Packet& packet, std::vector<MailMe
|
|||
if (remaining < 1) return false;
|
||||
|
||||
uint8_t count = packet.readUInt8();
|
||||
LOG_INFO("SMSG_MAIL_LIST_RESULT (TBC): count=", (int)count);
|
||||
LOG_INFO("SMSG_MAIL_LIST_RESULT (TBC): count=", static_cast<int>(count));
|
||||
|
||||
inbox.clear();
|
||||
inbox.reserve(count);
|
||||
|
|
@ -1361,7 +1361,7 @@ bool TbcPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& data)
|
|||
|
||||
const uint8_t rawHitCount = packet.readUInt8();
|
||||
if (rawHitCount > 128) {
|
||||
LOG_WARNING("[TBC] Spell go: hitCount capped (requested=", (int)rawHitCount, ")");
|
||||
LOG_WARNING("[TBC] Spell go: hitCount capped (requested=", static_cast<int>(rawHitCount), ")");
|
||||
}
|
||||
const uint8_t storedHitLimit = std::min<uint8_t>(rawHitCount, 128);
|
||||
data.hitTargets.reserve(storedHitLimit);
|
||||
|
|
@ -1369,7 +1369,7 @@ bool TbcPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& data)
|
|||
for (uint16_t i = 0; i < rawHitCount; ++i) {
|
||||
if (packet.getReadPos() + 8 > packet.getSize()) {
|
||||
LOG_WARNING("[TBC] Spell go: truncated hit targets at index ", i,
|
||||
"/", (int)rawHitCount);
|
||||
"/", static_cast<int>(rawHitCount));
|
||||
truncatedTargets = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1392,14 +1392,14 @@ bool TbcPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& data)
|
|||
|
||||
const uint8_t rawMissCount = packet.readUInt8();
|
||||
if (rawMissCount > 128) {
|
||||
LOG_WARNING("[TBC] Spell go: missCount capped (requested=", (int)rawMissCount, ")");
|
||||
LOG_WARNING("[TBC] Spell go: missCount capped (requested=", static_cast<int>(rawMissCount), ")");
|
||||
}
|
||||
const uint8_t storedMissLimit = std::min<uint8_t>(rawMissCount, 128);
|
||||
data.missTargets.reserve(storedMissLimit);
|
||||
for (uint16_t i = 0; i < rawMissCount; ++i) {
|
||||
if (packet.getReadPos() + 9 > packet.getSize()) {
|
||||
LOG_WARNING("[TBC] Spell go: truncated miss targets at index ", i,
|
||||
"/", (int)rawMissCount);
|
||||
"/", static_cast<int>(rawMissCount));
|
||||
truncatedTargets = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1409,7 +1409,7 @@ bool TbcPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& data)
|
|||
if (m.missType == 11) { // SPELL_MISS_REFLECT
|
||||
if (packet.getReadPos() + 1 > packet.getSize()) {
|
||||
LOG_WARNING("[TBC] Spell go: truncated reflect payload at miss index ", i,
|
||||
"/", (int)rawMissCount);
|
||||
"/", static_cast<int>(rawMissCount));
|
||||
truncatedTargets = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -1429,8 +1429,8 @@ bool TbcPacketParsers::parseSpellGo(network::Packet& packet, SpellGoData& data)
|
|||
// any subsequent fields are not misaligned for ground-targeted AoE spells.
|
||||
skipTbcSpellCastTargets(packet, &data.targetGuid);
|
||||
|
||||
LOG_DEBUG("[TBC] Spell go: spell=", data.spellId, " hits=", (int)data.hitCount,
|
||||
" misses=", (int)data.missCount);
|
||||
LOG_DEBUG("[TBC] Spell go: spell=", data.spellId, " hits=", static_cast<int>(data.hitCount),
|
||||
" misses=", static_cast<int>(data.missCount));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1463,7 +1463,7 @@ bool TbcPacketParsers::parseCastFailed(network::Packet& packet, CastFailedData&
|
|||
data.castCount = 0; // not present in TBC
|
||||
data.spellId = packet.readUInt32();
|
||||
data.result = packet.readUInt8(); // same enum as WotLK
|
||||
LOG_DEBUG("[TBC] Cast failed: spell=", data.spellId, " result=", (int)data.result);
|
||||
LOG_DEBUG("[TBC] Cast failed: spell=", data.spellId, " result=", static_cast<int>(data.result));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -403,7 +403,7 @@ glm::vec3 TransportManager::evalTimedCatmullRom(const TransportPath& path, uint3
|
|||
uint32_t t1Ms = path.points[p1Idx].tMs;
|
||||
uint32_t t2Ms = path.points[p2Idx].tMs;
|
||||
uint32_t segmentDurationMs = (t2Ms > t1Ms) ? (t2Ms - t1Ms) : 1;
|
||||
float t = (float)(pathTimeMs - t1Ms) / (float)segmentDurationMs;
|
||||
float t = (float)(pathTimeMs - t1Ms) / static_cast<float>(segmentDurationMs);
|
||||
t = glm::clamp(t, 0.0f, 1.0f);
|
||||
|
||||
// Catmull-Rom spline formula
|
||||
|
|
@ -480,7 +480,7 @@ glm::quat TransportManager::orientationFromTangent(const TransportPath& path, ui
|
|||
uint32_t t1Ms = path.points[p1Idx].tMs;
|
||||
uint32_t t2Ms = path.points[p2Idx].tMs;
|
||||
uint32_t segmentDurationMs = (t2Ms > t1Ms) ? (t2Ms - t1Ms) : 1;
|
||||
float t = (float)(pathTimeMs - t1Ms) / (float)segmentDurationMs;
|
||||
float t = (float)(pathTimeMs - t1Ms) / static_cast<float>(segmentDurationMs);
|
||||
t = glm::clamp(t, 0.0f, 1.0f);
|
||||
|
||||
// Tangent of Catmull-Rom spline (derivative)
|
||||
|
|
|
|||
|
|
@ -460,7 +460,7 @@ bool CharEnumParser::parse(network::Packet& packet, CharEnumResponse& response)
|
|||
// Read character count
|
||||
uint8_t count = packet.readUInt8();
|
||||
|
||||
LOG_INFO("Parsing SMSG_CHAR_ENUM: ", (int)count, " characters");
|
||||
LOG_INFO("Parsing SMSG_CHAR_ENUM: ", static_cast<int>(count), " characters");
|
||||
|
||||
response.characters.clear();
|
||||
response.characters.reserve(count);
|
||||
|
|
@ -475,7 +475,7 @@ bool CharEnumParser::parse(network::Packet& packet, CharEnumResponse& response)
|
|||
// petDisplayModel(4) + petLevel(4) + petFamily(4) + 23items*(dispModel(4)+invType(1)+enchant(4)) = 207 bytes
|
||||
const size_t minCharacterSize = 8 + 1 + 1 + 1 + 1 + 4 + 1 + 1 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 1 + 4 + 4 + 4 + (23 * 9);
|
||||
if (packet.getReadPos() + minCharacterSize > packet.getSize()) {
|
||||
LOG_WARNING("CharEnumParser: truncated character at index ", (int)i);
|
||||
LOG_WARNING("CharEnumParser: truncated character at index ", static_cast<int>(i));
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -484,14 +484,14 @@ bool CharEnumParser::parse(network::Packet& packet, CharEnumResponse& response)
|
|||
|
||||
// Read name (null-terminated string) - validate before reading
|
||||
if (packet.getReadPos() >= packet.getSize()) {
|
||||
LOG_WARNING("CharEnumParser: no bytes for name at index ", (int)i);
|
||||
LOG_WARNING("CharEnumParser: no bytes for name at index ", static_cast<int>(i));
|
||||
break;
|
||||
}
|
||||
character.name = packet.readString();
|
||||
|
||||
// Validate remaining bytes before reading fixed-size fields
|
||||
if (packet.getReadPos() + 1 > packet.getSize()) {
|
||||
LOG_WARNING("CharEnumParser: truncated before race/class/gender at index ", (int)i);
|
||||
LOG_WARNING("CharEnumParser: truncated before race/class/gender at index ", static_cast<int>(i));
|
||||
character.race = Race::HUMAN;
|
||||
character.characterClass = Class::WARRIOR;
|
||||
character.gender = Gender::MALE;
|
||||
|
|
@ -595,9 +595,9 @@ bool CharEnumParser::parse(network::Packet& packet, CharEnumResponse& response)
|
|||
character.equipment.push_back(item);
|
||||
}
|
||||
|
||||
LOG_DEBUG(" Character ", (int)(i + 1), ": ", character.name,
|
||||
LOG_DEBUG(" Character ", static_cast<int>(i + 1), ": ", character.name,
|
||||
" (", getRaceName(character.race), " ", getClassName(character.characterClass),
|
||||
" level ", (int)character.level, " zone ", character.zoneId, ")");
|
||||
" level ", static_cast<int>(character.level), " zone ", character.zoneId, ")");
|
||||
|
||||
response.characters.push_back(character);
|
||||
}
|
||||
|
|
@ -672,7 +672,7 @@ bool AccountDataTimesParser::parse(network::Packet& packet, AccountDataTimesData
|
|||
|
||||
LOG_DEBUG("Parsed SMSG_ACCOUNT_DATA_TIMES:");
|
||||
LOG_DEBUG(" Server time: ", data.serverTime);
|
||||
LOG_DEBUG(" Unknown: ", (int)data.unknown);
|
||||
LOG_DEBUG(" Unknown: ", static_cast<int>(data.unknown));
|
||||
LOG_DEBUG(" Mask: 0x", std::hex, mask, std::dec, " slotsInPacket=", slotWords);
|
||||
|
||||
for (size_t i = 0; i < slotWords; ++i) {
|
||||
|
|
@ -1255,8 +1255,8 @@ bool UpdateObjectParser::parseUpdateFields(network::Packet& packet, UpdateBlock&
|
|||
? ((block.objectType == ObjectType::PLAYER) ? 55 : 10)
|
||||
: 55; // VALUES: allow PLAYER-sized masks
|
||||
if (blockCount > maxExpectedBlocks) {
|
||||
LOG_WARNING("UpdateObjectParser: suspicious maskBlockCount=", (int)blockCount,
|
||||
" for objectType=", (int)block.objectType,
|
||||
LOG_WARNING("UpdateObjectParser: suspicious maskBlockCount=", static_cast<int>(blockCount),
|
||||
" for objectType=", static_cast<int>(block.objectType),
|
||||
" guid=0x", std::hex, block.guid, std::dec,
|
||||
" updateFlags=0x", std::hex, block.updateFlags, std::dec,
|
||||
" moveFlags=0x", std::hex, block.moveFlags, std::dec,
|
||||
|
|
@ -1265,7 +1265,7 @@ bool UpdateObjectParser::parseUpdateFields(network::Packet& packet, UpdateBlock&
|
|||
|
||||
uint32_t fieldsCapacity = blockCount * 32;
|
||||
LOG_DEBUG(" UPDATE MASK PARSE:");
|
||||
LOG_DEBUG(" maskBlockCount = ", (int)blockCount);
|
||||
LOG_DEBUG(" maskBlockCount = ", static_cast<int>(blockCount));
|
||||
LOG_DEBUG(" fieldsCapacity (blocks * 32) = ", fieldsCapacity);
|
||||
|
||||
// Read update mask into a reused scratch buffer to avoid per-block allocations.
|
||||
|
|
@ -1349,7 +1349,7 @@ bool UpdateObjectParser::parseUpdateBlock(network::Packet& packet, UpdateBlock&
|
|||
uint8_t updateTypeVal = packet.readUInt8();
|
||||
block.updateType = static_cast<UpdateType>(updateTypeVal);
|
||||
|
||||
LOG_DEBUG("Update block: type=", (int)updateTypeVal);
|
||||
LOG_DEBUG("Update block: type=", static_cast<int>(updateTypeVal));
|
||||
|
||||
switch (block.updateType) {
|
||||
case UpdateType::VALUES: {
|
||||
|
|
@ -1381,7 +1381,7 @@ bool UpdateObjectParser::parseUpdateBlock(network::Packet& packet, UpdateBlock&
|
|||
if (packet.getReadPos() >= packet.getSize()) return false;
|
||||
uint8_t objectTypeVal = packet.readUInt8();
|
||||
block.objectType = static_cast<ObjectType>(objectTypeVal);
|
||||
LOG_DEBUG(" Object type: ", (int)objectTypeVal);
|
||||
LOG_DEBUG(" Object type: ", static_cast<int>(objectTypeVal));
|
||||
|
||||
// Parse movement if present
|
||||
bool hasMovement = parseMovementBlock(packet, block);
|
||||
|
|
@ -1406,7 +1406,7 @@ bool UpdateObjectParser::parseUpdateBlock(network::Packet& packet, UpdateBlock&
|
|||
}
|
||||
|
||||
default:
|
||||
LOG_WARNING("Unknown update type: ", (int)updateTypeVal);
|
||||
LOG_WARNING("Unknown update type: ", static_cast<int>(updateTypeVal));
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -1737,7 +1737,7 @@ bool MessageChatParser::parse(network::Packet& packet, MessageChatData& data) {
|
|||
LOG_DEBUG(" Channel: ", data.channelName);
|
||||
}
|
||||
LOG_DEBUG(" Message: ", data.message);
|
||||
LOG_DEBUG(" Chat tag: 0x", std::hex, (int)data.chatTag, std::dec);
|
||||
LOG_DEBUG(" Chat tag: 0x", std::hex, static_cast<int>(data.chatTag), std::dec);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -2004,7 +2004,7 @@ bool FriendStatusParser::parse(network::Packet& packet, FriendStatusData& data)
|
|||
}
|
||||
}
|
||||
}
|
||||
LOG_DEBUG("Parsed SMSG_FRIEND_STATUS: status=", (int)data.status, " guid=0x", std::hex, data.guid, std::dec);
|
||||
LOG_DEBUG("Parsed SMSG_FRIEND_STATUS: status=", static_cast<int>(data.status), " guid=0x", std::hex, data.guid, std::dec);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -2047,7 +2047,7 @@ bool LogoutResponseParser::parse(network::Packet& packet, LogoutResponseData& da
|
|||
|
||||
data.result = packet.readUInt32();
|
||||
data.instant = packet.readUInt8();
|
||||
LOG_DEBUG("Parsed SMSG_LOGOUT_RESPONSE: result=", data.result, " instant=", (int)data.instant);
|
||||
LOG_DEBUG("Parsed SMSG_LOGOUT_RESPONSE: result=", data.result, " instant=", static_cast<int>(data.instant));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -2058,7 +2058,7 @@ bool LogoutResponseParser::parse(network::Packet& packet, LogoutResponseData& da
|
|||
network::Packet StandStateChangePacket::build(uint8_t state) {
|
||||
network::Packet packet(wireOpcode(Opcode::CMSG_STANDSTATECHANGE));
|
||||
packet.writeUInt32(state);
|
||||
LOG_DEBUG("Built CMSG_STANDSTATECHANGE: state=", (int)state);
|
||||
LOG_DEBUG("Built CMSG_STANDSTATECHANGE: state=", static_cast<int>(state));
|
||||
return packet;
|
||||
}
|
||||
|
||||
|
|
@ -2083,8 +2083,8 @@ network::Packet SetActionButtonPacket::build(uint8_t button, uint8_t type, uint3
|
|||
packet.writeUInt16(static_cast<uint16_t>(id));
|
||||
packet.writeUInt8(classicType);
|
||||
packet.writeUInt8(0); // misc
|
||||
LOG_DEBUG("Built CMSG_SET_ACTION_BUTTON (Classic): button=", (int)button,
|
||||
" id=", id, " type=", (int)classicType);
|
||||
LOG_DEBUG("Built CMSG_SET_ACTION_BUTTON (Classic): button=", static_cast<int>(button),
|
||||
" id=", id, " type=", static_cast<int>(classicType));
|
||||
} else {
|
||||
// TBC/WotLK: type in bits 24–31, id in bits 0–23; packed=0 clears slot
|
||||
uint8_t packedType = 0x00; // spell
|
||||
|
|
@ -2092,7 +2092,7 @@ network::Packet SetActionButtonPacket::build(uint8_t button, uint8_t type, uint3
|
|||
if (type == 3 /* MACRO */) packedType = 0x40;
|
||||
uint32_t packed = (id == 0) ? 0 : (static_cast<uint32_t>(packedType) << 24) | (id & 0x00FFFFFF);
|
||||
packet.writeUInt32(packed);
|
||||
LOG_DEBUG("Built CMSG_SET_ACTION_BUTTON (TBC/WotLK): button=", (int)button,
|
||||
LOG_DEBUG("Built CMSG_SET_ACTION_BUTTON (TBC/WotLK): button=", static_cast<int>(button),
|
||||
" packed=0x", std::hex, packed, std::dec);
|
||||
}
|
||||
return packet;
|
||||
|
|
@ -2510,7 +2510,7 @@ bool GuildEventParser::parse(network::Packet& packet, GuildEventData& data) {
|
|||
if ((packet.getSize() - packet.getReadPos()) >= 8) {
|
||||
data.guid = packet.readUInt64();
|
||||
}
|
||||
LOG_INFO("Parsed SMSG_GUILD_EVENT: type=", (int)data.eventType, " strings=", (int)data.numStrings);
|
||||
LOG_INFO("Parsed SMSG_GUILD_EVENT: type=", static_cast<int>(data.eventType), " strings=", static_cast<int>(data.numStrings));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -2591,7 +2591,7 @@ network::Packet RaidTargetUpdatePacket::build(uint8_t targetIndex, uint64_t targ
|
|||
network::Packet packet(wireOpcode(Opcode::MSG_RAID_TARGET_UPDATE));
|
||||
packet.writeUInt8(targetIndex);
|
||||
packet.writeUInt64(targetGuid);
|
||||
LOG_DEBUG("Built MSG_RAID_TARGET_UPDATE, index: ", (uint32_t)targetIndex, ", guid: 0x", std::hex, targetGuid, std::dec);
|
||||
LOG_DEBUG("Built MSG_RAID_TARGET_UPDATE, index: ", static_cast<uint32_t>(targetIndex), ", guid: 0x", std::hex, targetGuid, std::dec);
|
||||
return packet;
|
||||
}
|
||||
|
||||
|
|
@ -2636,14 +2636,14 @@ network::Packet SetTradeItemPacket::build(uint8_t tradeSlot, uint8_t bag, uint8_
|
|||
packet.writeUInt8(tradeSlot);
|
||||
packet.writeUInt8(bag);
|
||||
packet.writeUInt8(bagSlot);
|
||||
LOG_DEBUG("Built CMSG_SET_TRADE_ITEM slot=", (int)tradeSlot, " bag=", (int)bag, " bagSlot=", (int)bagSlot);
|
||||
LOG_DEBUG("Built CMSG_SET_TRADE_ITEM slot=", static_cast<int>(tradeSlot), " bag=", static_cast<int>(bag), " bagSlot=", static_cast<int>(bagSlot));
|
||||
return packet;
|
||||
}
|
||||
|
||||
network::Packet ClearTradeItemPacket::build(uint8_t tradeSlot) {
|
||||
network::Packet packet(wireOpcode(Opcode::CMSG_CLEAR_TRADE_ITEM));
|
||||
packet.writeUInt8(tradeSlot);
|
||||
LOG_DEBUG("Built CMSG_CLEAR_TRADE_ITEM slot=", (int)tradeSlot);
|
||||
LOG_DEBUG("Built CMSG_CLEAR_TRADE_ITEM slot=", static_cast<int>(tradeSlot));
|
||||
return packet;
|
||||
}
|
||||
|
||||
|
|
@ -2768,8 +2768,8 @@ bool NameQueryResponseParser::parse(network::Packet& packet, NameQueryResponseDa
|
|||
data.gender = packet.readUInt8();
|
||||
data.classId = packet.readUInt8();
|
||||
|
||||
LOG_DEBUG("Name query response: ", data.name, " (race=", (int)data.race,
|
||||
" class=", (int)data.classId, ")");
|
||||
LOG_DEBUG("Name query response: ", data.name, " (race=", static_cast<int>(data.race),
|
||||
" class=", static_cast<int>(data.classId), ")");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -3284,7 +3284,7 @@ bool MonsterMoveParser::parse(network::Packet& packet, MonsterMoveData& data) {
|
|||
}
|
||||
|
||||
LOG_DEBUG("MonsterMove: guid=0x", std::hex, data.guid, std::dec,
|
||||
" type=", (int)data.moveType, " dur=", data.duration, "ms",
|
||||
" type=", static_cast<int>(data.moveType), " dur=", data.duration, "ms",
|
||||
" dest=(", data.destX, ",", data.destY, ",", data.destZ, ")");
|
||||
|
||||
return true;
|
||||
|
|
@ -3387,7 +3387,7 @@ bool MonsterMoveParser::parseVanilla(network::Packet& packet, MonsterMoveData& d
|
|||
}
|
||||
|
||||
LOG_DEBUG("MonsterMove(turtle): guid=0x", std::hex, data.guid, std::dec,
|
||||
" type=", (int)data.moveType, " dur=", data.duration, "ms",
|
||||
" type=", static_cast<int>(data.moveType), " dur=", data.duration, "ms",
|
||||
" dest=(", data.destX, ",", data.destY, ",", data.destZ, ")");
|
||||
|
||||
return true;
|
||||
|
|
@ -3785,7 +3785,7 @@ bool CastFailedParser::parse(network::Packet& packet, CastFailedData& data) {
|
|||
data.castCount = packet.readUInt8();
|
||||
data.spellId = packet.readUInt32();
|
||||
data.result = packet.readUInt8();
|
||||
LOG_INFO("Cast failed: spell=", data.spellId, " result=", (int)data.result);
|
||||
LOG_INFO("Cast failed: spell=", data.spellId, " result=", static_cast<int>(data.result));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -3902,7 +3902,7 @@ bool SpellGoParser::parse(network::Packet& packet, SpellGoData& data) {
|
|||
|
||||
const uint8_t rawHitCount = packet.readUInt8();
|
||||
if (rawHitCount > 128) {
|
||||
LOG_WARNING("Spell go: hitCount capped (requested=", (int)rawHitCount, ")");
|
||||
LOG_WARNING("Spell go: hitCount capped (requested=", static_cast<int>(rawHitCount), ")");
|
||||
}
|
||||
const uint8_t storedHitLimit = std::min<uint8_t>(rawHitCount, 128);
|
||||
|
||||
|
|
@ -3912,7 +3912,7 @@ bool SpellGoParser::parse(network::Packet& packet, SpellGoData& data) {
|
|||
for (uint16_t i = 0; i < rawHitCount; ++i) {
|
||||
// WotLK 3.3.5a hit targets are full uint64 GUIDs (not PackedGuid).
|
||||
if (packet.getSize() - packet.getReadPos() < 8) {
|
||||
LOG_WARNING("Spell go: truncated hit targets at index ", i, "/", (int)rawHitCount);
|
||||
LOG_WARNING("Spell go: truncated hit targets at index ", i, "/", static_cast<int>(rawHitCount));
|
||||
truncatedTargets = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -3949,15 +3949,15 @@ bool SpellGoParser::parse(network::Packet& packet, SpellGoData& data) {
|
|||
if (i == missCountPos - 1) hexCtx += "[";
|
||||
if (i == missCountPos) hexCtx += "] ";
|
||||
}
|
||||
LOG_WARNING("Spell go: suspect missCount=", (int)rawMissCount,
|
||||
" spell=", data.spellId, " hits=", (int)data.hitCount,
|
||||
LOG_WARNING("Spell go: suspect missCount=", static_cast<int>(rawMissCount),
|
||||
" spell=", data.spellId, " hits=", static_cast<int>(data.hitCount),
|
||||
" castFlags=0x", std::hex, data.castFlags, std::dec,
|
||||
" missCountPos=", missCountPos, " pktSize=", packet.getSize(),
|
||||
" ctx=", hexCtx);
|
||||
}
|
||||
if (rawMissCount > 128) {
|
||||
LOG_WARNING("Spell go: missCount capped (requested=", (int)rawMissCount,
|
||||
") spell=", data.spellId, " hits=", (int)data.hitCount,
|
||||
LOG_WARNING("Spell go: missCount capped (requested=", static_cast<int>(rawMissCount),
|
||||
") spell=", data.spellId, " hits=", static_cast<int>(data.hitCount),
|
||||
" remaining=", packet.getSize() - packet.getReadPos());
|
||||
}
|
||||
const uint8_t storedMissLimit = std::min<uint8_t>(rawMissCount, 128);
|
||||
|
|
@ -3967,8 +3967,8 @@ bool SpellGoParser::parse(network::Packet& packet, SpellGoData& data) {
|
|||
// WotLK 3.3.5a miss targets are full uint64 GUIDs + uint8 missType.
|
||||
// REFLECT additionally appends uint8 reflectResult.
|
||||
if (packet.getSize() - packet.getReadPos() < 9) { // 8 GUID + 1 missType
|
||||
LOG_WARNING("Spell go: truncated miss targets at index ", i, "/", (int)rawMissCount,
|
||||
" spell=", data.spellId, " hits=", (int)data.hitCount);
|
||||
LOG_WARNING("Spell go: truncated miss targets at index ", i, "/", static_cast<int>(rawMissCount),
|
||||
" spell=", data.spellId, " hits=", static_cast<int>(data.hitCount));
|
||||
truncatedTargets = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -3977,7 +3977,7 @@ bool SpellGoParser::parse(network::Packet& packet, SpellGoData& data) {
|
|||
m.missType = packet.readUInt8();
|
||||
if (m.missType == 11) { // SPELL_MISS_REFLECT
|
||||
if (packet.getSize() - packet.getReadPos() < 1) {
|
||||
LOG_WARNING("Spell go: truncated reflect payload at miss index ", i, "/", (int)rawMissCount);
|
||||
LOG_WARNING("Spell go: truncated reflect payload at miss index ", i, "/", static_cast<int>(rawMissCount));
|
||||
truncatedTargets = true;
|
||||
break;
|
||||
}
|
||||
|
|
@ -3993,7 +3993,7 @@ bool SpellGoParser::parse(network::Packet& packet, SpellGoData& data) {
|
|||
// rather than discarding the entire spell. The server already applied effects;
|
||||
// we just need the hit list for UI feedback (combat text, health bars).
|
||||
if (truncatedTargets) {
|
||||
LOG_DEBUG("Spell go: salvaging ", (int)data.hitCount, " hits despite miss truncation");
|
||||
LOG_DEBUG("Spell go: salvaging ", static_cast<int>(data.hitCount), " hits despite miss truncation");
|
||||
packet.setReadPos(packet.getSize()); // consume remaining bytes
|
||||
return true;
|
||||
}
|
||||
|
|
@ -4042,8 +4042,8 @@ bool SpellGoParser::parse(network::Packet& packet, SpellGoData& data) {
|
|||
}
|
||||
}
|
||||
|
||||
LOG_DEBUG("Spell go: spell=", data.spellId, " hits=", (int)data.hitCount,
|
||||
" misses=", (int)data.missCount);
|
||||
LOG_DEBUG("Spell go: spell=", data.spellId, " hits=", static_cast<int>(data.hitCount),
|
||||
" misses=", static_cast<int>(data.missCount));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -4182,7 +4182,7 @@ bool GroupInviteResponseParser::parse(network::Packet& packet, GroupInviteRespon
|
|||
data.canAccept = packet.readUInt8();
|
||||
// Note: inviterName is a string, which is always safe to read even if empty
|
||||
data.inviterName = packet.readString();
|
||||
LOG_INFO("Group invite from: ", data.inviterName, " (canAccept=", (int)data.canAccept, ")");
|
||||
LOG_INFO("Group invite from: ", data.inviterName, " (canAccept=", static_cast<int>(data.canAccept), ")");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -4294,7 +4294,7 @@ bool PartyCommandResultParser::parse(network::Packet& packet, PartyCommandResult
|
|||
}
|
||||
|
||||
data.result = static_cast<PartyResult>(packet.readUInt32());
|
||||
LOG_DEBUG("Party command result: ", (int)data.result);
|
||||
LOG_DEBUG("Party command result: ", static_cast<int>(data.result));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -4409,7 +4409,7 @@ bool LootResponseParser::parse(network::Packet& packet, LootResponseData& data,
|
|||
// Short failure packet — no gold/item data follows.
|
||||
avail = packet.getSize() - packet.getReadPos();
|
||||
if (avail < 5) {
|
||||
LOG_DEBUG("LootResponseParser: lootType=", (int)data.lootType, " (empty/failure response)");
|
||||
LOG_DEBUG("LootResponseParser: lootType=", static_cast<int>(data.lootType), " (empty/failure response)");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -4458,7 +4458,7 @@ bool LootResponseParser::parse(network::Packet& packet, LootResponseData& data,
|
|||
}
|
||||
}
|
||||
|
||||
LOG_DEBUG("Loot response: ", (int)itemCount, " regular + ", (int)questItemCount,
|
||||
LOG_DEBUG("Loot response: ", static_cast<int>(itemCount), " regular + ", static_cast<int>(questItemCount),
|
||||
" quest items, ", data.gold, " copper");
|
||||
return true;
|
||||
}
|
||||
|
|
@ -4990,7 +4990,7 @@ bool ListInventoryParser::parse(network::Packet& packet, ListInventoryData& data
|
|||
const size_t bytesPerItemWithExt = 32;
|
||||
bool hasExtendedCost = false;
|
||||
if (remaining < static_cast<size_t>(itemCount) * bytesPerItemNoExt) {
|
||||
LOG_WARNING("ListInventoryParser: truncated packet (items=", (int)itemCount,
|
||||
LOG_WARNING("ListInventoryParser: truncated packet (items=", static_cast<int>(itemCount),
|
||||
", remaining=", remaining, ")");
|
||||
return false;
|
||||
}
|
||||
|
|
@ -5002,7 +5002,7 @@ bool ListInventoryParser::parse(network::Packet& packet, ListInventoryData& data
|
|||
for (uint8_t i = 0; i < itemCount; ++i) {
|
||||
const size_t perItemBytes = hasExtendedCost ? bytesPerItemWithExt : bytesPerItemNoExt;
|
||||
if (packet.getSize() - packet.getReadPos() < perItemBytes) {
|
||||
LOG_WARNING("ListInventoryParser: item ", (int)i, " truncated");
|
||||
LOG_WARNING("ListInventoryParser: item ", static_cast<int>(i), " truncated");
|
||||
return false;
|
||||
}
|
||||
VendorItem item;
|
||||
|
|
@ -5017,7 +5017,7 @@ bool ListInventoryParser::parse(network::Packet& packet, ListInventoryData& data
|
|||
data.items.push_back(item);
|
||||
}
|
||||
|
||||
LOG_DEBUG("Vendor inventory: ", (int)itemCount, " items (extendedCost: ", hasExtendedCost ? "yes" : "no", ")");
|
||||
LOG_DEBUG("Vendor inventory: ", static_cast<int>(itemCount), " items (extendedCost: ", hasExtendedCost ? "yes" : "no", ")");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -5138,8 +5138,8 @@ bool TalentsInfoParser::parse(network::Packet& packet, TalentsInfoData& data) {
|
|||
return false;
|
||||
}
|
||||
|
||||
LOG_INFO("SMSG_TALENTS_INFO: spec=", (int)data.talentSpec,
|
||||
" unspent=", (int)data.unspentPoints,
|
||||
LOG_INFO("SMSG_TALENTS_INFO: spec=", static_cast<int>(data.talentSpec),
|
||||
" unspent=", static_cast<int>(data.unspentPoints),
|
||||
" talentCount=", talentCount,
|
||||
" entryCount=", entryCount);
|
||||
|
||||
|
|
@ -5157,7 +5157,7 @@ bool TalentsInfoParser::parse(network::Packet& packet, TalentsInfoData& data) {
|
|||
uint8_t rank = packet.readUInt8();
|
||||
data.talents.push_back({id, rank});
|
||||
|
||||
LOG_INFO(" Entry: id=", id, " rank=", (int)rank);
|
||||
LOG_INFO(" Entry: id=", id, " rank=", static_cast<int>(rank));
|
||||
}
|
||||
|
||||
// Parse glyph tail: glyphSlots + glyphIds[]
|
||||
|
|
@ -5170,11 +5170,11 @@ bool TalentsInfoParser::parse(network::Packet& packet, TalentsInfoData& data) {
|
|||
|
||||
// Sanity check: Wrath has 6 glyph slots, cap at 12 for safety
|
||||
if (glyphSlots > 12) {
|
||||
LOG_WARNING("SMSG_TALENTS_INFO: glyphSlots too large (", (int)glyphSlots, "), clamping to 12");
|
||||
LOG_WARNING("SMSG_TALENTS_INFO: glyphSlots too large (", static_cast<int>(glyphSlots), "), clamping to 12");
|
||||
glyphSlots = 12;
|
||||
}
|
||||
|
||||
LOG_INFO(" GlyphSlots: ", (int)glyphSlots);
|
||||
LOG_INFO(" GlyphSlots: ", static_cast<int>(glyphSlots));
|
||||
|
||||
data.glyphs.clear();
|
||||
data.glyphs.reserve(glyphSlots);
|
||||
|
|
@ -5389,7 +5389,7 @@ bool PacketParsers::parseMailList(network::Packet& packet, std::vector<MailMessa
|
|||
uint8_t shownCount = packet.readUInt8();
|
||||
(void)totalCount;
|
||||
|
||||
LOG_INFO("SMSG_MAIL_LIST_RESULT (WotLK): total=", totalCount, " shown=", (int)shownCount);
|
||||
LOG_INFO("SMSG_MAIL_LIST_RESULT (WotLK): total=", totalCount, " shown=", static_cast<int>(shownCount));
|
||||
|
||||
inbox.clear();
|
||||
inbox.reserve(shownCount);
|
||||
|
|
@ -5593,14 +5593,14 @@ bool GuildBankListParser::parse(network::Packet& packet, GuildBankData& data) {
|
|||
uint8_t tabCount = packet.readUInt8();
|
||||
// Cap at 8 (normal guild bank tab limit in WoW)
|
||||
if (tabCount > 8) {
|
||||
LOG_WARNING("GuildBankListParser: tabCount capped (requested=", (int)tabCount, ")");
|
||||
LOG_WARNING("GuildBankListParser: tabCount capped (requested=", static_cast<int>(tabCount), ")");
|
||||
tabCount = 8;
|
||||
}
|
||||
data.tabs.resize(tabCount);
|
||||
for (uint8_t i = 0; i < tabCount; ++i) {
|
||||
// Validate before reading strings
|
||||
if (packet.getReadPos() >= packet.getSize()) {
|
||||
LOG_WARNING("GuildBankListParser: truncated tab at index ", (int)i);
|
||||
LOG_WARNING("GuildBankListParser: truncated tab at index ", static_cast<int>(i));
|
||||
break;
|
||||
}
|
||||
data.tabs[i].tabName = packet.readString();
|
||||
|
|
@ -5624,7 +5624,7 @@ bool GuildBankListParser::parse(network::Packet& packet, GuildBankData& data) {
|
|||
for (uint8_t i = 0; i < numSlots; ++i) {
|
||||
// Validate minimum bytes before reading slot (slotId(1) + itemEntry(4) = 5)
|
||||
if (packet.getReadPos() + 5 > packet.getSize()) {
|
||||
LOG_WARNING("GuildBankListParser: truncated slot at index ", (int)i);
|
||||
LOG_WARNING("GuildBankListParser: truncated slot at index ", static_cast<int>(i));
|
||||
break;
|
||||
}
|
||||
GuildBankItemSlot slot;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue