diff options
author | Shauren <shauren.trinity@gmail.com> | 2023-08-15 20:10:04 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2023-08-15 20:10:04 +0200 |
commit | aaa6e73c8ca6d60e943cb964605536eb78219db2 (patch) | |
tree | f5a0187925e646ef071d647efa7a5dac20501813 /src/server/game/Handlers/SpellHandler.cpp | |
parent | 825c697a764017349ca94ecfca8f30a8365666c0 (diff) |
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
(cherry picked from commit d791afae1dfcfaf592326f787755ca32d629e4d3)
Diffstat (limited to 'src/server/game/Handlers/SpellHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/SpellHandler.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/server/game/Handlers/SpellHandler.cpp b/src/server/game/Handlers/SpellHandler.cpp index 3a4a6de52e2..06aab37890c 100644 --- a/src/server/game/Handlers/SpellHandler.cpp +++ b/src/server/game/Handlers/SpellHandler.cpp @@ -94,7 +94,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) return; } - TC_LOG_DEBUG("network", "WORLD: CMSG_USE_ITEM packet, bagIndex: %u, slot: %u, castCount: %u, spellId: %u, Item: %u, glyphIndex: %u, data length = %i", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); + TC_LOG_DEBUG("network", "WORLD: CMSG_USE_ITEM packet, bagIndex: {}, slot: {}, castCount: {}, spellId: {}, Item: {}, glyphIndex: {}, data length = {}", bagIndex, slot, castCount, spellId, pItem->GetEntry(), glyphIndex, (uint32)recvPacket.size()); ItemTemplate const* proto = pItem->GetTemplate(); if (!proto) @@ -170,7 +170,7 @@ void WorldSession::HandleUseItemOpcode(WorldPacket& recvPacket) void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) { - TC_LOG_DEBUG("network", "WORLD: CMSG_OPEN_ITEM packet, data length = %i", (uint32)recvPacket.size()); + TC_LOG_DEBUG("network", "WORLD: CMSG_OPEN_ITEM packet, data length = {}", (uint32)recvPacket.size()); Player* player = GetPlayer(); @@ -188,7 +188,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) uint8 bagIndex, slot; recvPacket >> bagIndex >> slot; - TC_LOG_INFO("network", "bagIndex: %u, slot: %u", bagIndex, slot); + TC_LOG_INFO("network", "bagIndex: {}, slot: {}", bagIndex, slot); Item* item = player->GetItemByPos(bagIndex, slot); if (!item) @@ -208,8 +208,8 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) if (!proto->HasFlag(ITEM_FLAG_HAS_LOOT) && !item->IsWrapped()) { player->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, item, nullptr); - TC_LOG_ERROR("entities.player.cheat", "Possible hacking attempt: Player %s %s tried to open item [%s, entry: %u] which is not openable!", - player->GetName().c_str(), player->GetGUID().ToString().c_str(), item->GetGUID().ToString().c_str(), proto->ItemId); + TC_LOG_ERROR("entities.player.cheat", "Possible hacking attempt: Player {} {} tried to open item [{}, entry: {}] which is not openable!", + player->GetName(), player->GetGUID().ToString(), item->GetGUID().ToString(), proto->ItemId); return; } @@ -222,7 +222,7 @@ void WorldSession::HandleOpenItemOpcode(WorldPacket& recvPacket) if (!lockInfo) { player->SendEquipError(EQUIP_ERR_ITEM_LOCKED, item, nullptr); - TC_LOG_ERROR("network", "WORLD::OpenItem: item %s has an unknown lockId: %u!", item->GetGUID().ToString().c_str(), lockId); + TC_LOG_ERROR("network", "WORLD::OpenItem: item {} has an unknown lockId: {}!", item->GetGUID().ToString(), lockId); return; } @@ -259,7 +259,7 @@ void WorldSession::HandleOpenWrappedItemCallback(uint16 pos, ObjectGuid itemGuid if (!result) { - TC_LOG_ERROR("network", "Wrapped item %s does't have record in character_gifts table and will deleted", itemGuid.ToString().c_str()); + TC_LOG_ERROR("network", "Wrapped item {} does't have record in character_gifts table and will deleted", itemGuid.ToString()); GetPlayer()->DestroyItem(item->GetBagSlot(), item->GetSlot(), true); return; } @@ -290,7 +290,7 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket& recvData) ObjectGuid guid; recvData >> guid; - TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_USE Message [%s]", guid.ToString().c_str()); + TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_USE Message [{}]", guid.ToString()); if (GameObject* obj = GetPlayer()->GetGameObjectIfCanInteractWith(guid)) { @@ -308,7 +308,7 @@ void WorldSession::HandleGameobjectReportUse(WorldPacket& recvPacket) ObjectGuid guid; recvPacket >> guid; - TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [%s]", guid.ToString().c_str()); + TC_LOG_DEBUG("network", "WORLD: Recvd CMSG_GAMEOBJ_REPORT_USE Message [{}]", guid.ToString()); // ignore for remote control state if (_player->IsCharmed()) @@ -330,12 +330,12 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket) recvPacket >> castCount >> spellId >> castFlags; TriggerCastFlags triggerFlag = TRIGGERED_NONE; - TC_LOG_DEBUG("network", "WORLD: got cast spell packet, castCount: %u, spellId: %u, castFlags: %u, data length = %u", castCount, spellId, castFlags, (uint32)recvPacket.size()); + TC_LOG_DEBUG("network", "WORLD: got cast spell packet, castCount: {}, spellId: {}, castFlags: {}, data length = {}", castCount, spellId, castFlags, (uint32)recvPacket.size()); SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo) { - TC_LOG_ERROR("network", "WORLD: unknown spell id %u", spellId); + TC_LOG_ERROR("network", "WORLD: unknown spell id {}", spellId); recvPacket.rfinish(); // prevent spam at ignore packet return; } @@ -467,7 +467,7 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPackets::Spells::PetCancelAura SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(packet.SpellID); if (!spellInfo) { - TC_LOG_ERROR("network", "WORLD: unknown PET spell id %u", packet.SpellID); + TC_LOG_ERROR("network", "WORLD: unknown PET spell id {}", packet.SpellID); return; } @@ -475,13 +475,13 @@ void WorldSession::HandlePetCancelAuraOpcode(WorldPackets::Spells::PetCancelAura if (!pet) { - TC_LOG_ERROR("network", "HandlePetCancelAura: Attempt to cancel an aura for non-existant %s by player '%s'", packet.PetGUID.ToString().c_str(), GetPlayer()->GetName().c_str()); + TC_LOG_ERROR("network", "HandlePetCancelAura: Attempt to cancel an aura for non-existant {} by player '{}'", packet.PetGUID.ToString(), GetPlayer()->GetName()); return; } if (pet != GetPlayer()->GetGuardianPet() && pet != GetPlayer()->GetCharmed()) { - TC_LOG_ERROR("network", "HandlePetCancelAura: %s is not a pet of player '%s'", packet.PetGUID.ToString().c_str(), GetPlayer()->GetName().c_str()); + TC_LOG_ERROR("network", "HandlePetCancelAura: {} is not a pet of player '{}'", packet.PetGUID.ToString(), GetPlayer()->GetName()); return; } |