diff options
| author | Shauren <shauren.trinity@gmail.com> | 2023-01-08 21:16:53 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2023-01-08 21:16:53 +0100 |
| commit | d791afae1dfcfaf592326f787755ca32d629e4d3 (patch) | |
| tree | 54dc9916ede5800e110a2f0edff91530811fbdb8 /src/server/game/Handlers/ItemHandler.cpp | |
| parent | b6820a706f46f18b9652fcd9806e4bec8805d29d (diff) | |
Core/Logging: Switch from fmt::sprintf to fmt::format (c++20 standard compatible api)
Diffstat (limited to 'src/server/game/Handlers/ItemHandler.cpp')
| -rw-r--r-- | src/server/game/Handlers/ItemHandler.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/server/game/Handlers/ItemHandler.cpp b/src/server/game/Handlers/ItemHandler.cpp index db374048017..5a8bb2d2b98 100644 --- a/src/server/game/Handlers/ItemHandler.cpp +++ b/src/server/game/Handlers/ItemHandler.cpp @@ -34,11 +34,11 @@ void WorldSession::HandleSplitItemOpcode(WorldPackets::Item::SplitItem& splitIte { if (!splitItem.Inv.Items.empty()) { - TC_LOG_ERROR("network", "HandleSplitItemOpcode - Invalid ItemCount (" SZFMTD ")", splitItem.Inv.Items.size()); + TC_LOG_ERROR("network", "HandleSplitItemOpcode - Invalid ItemCount ({})", splitItem.Inv.Items.size()); return; } - TC_LOG_DEBUG("network", "HandleSplitItemOpcode: receive FromPackSlot: %u, FromSlot: %u, ToPackSlot: %u, ToSlot: %u, Quantity: %u", + TC_LOG_DEBUG("network", "HandleSplitItemOpcode: receive FromPackSlot: {}, FromSlot: {}, ToPackSlot: {}, ToSlot: {}, Quantity: {}", splitItem.FromPackSlot, splitItem.FromSlot, splitItem.ToPackSlot, splitItem.ToSlot, splitItem.Quantity); uint16 src = ((splitItem.FromPackSlot << 8) | splitItem.FromSlot); @@ -70,11 +70,11 @@ void WorldSession::HandleSwapInvItemOpcode(WorldPackets::Item::SwapInvItem& swap { if (swapInvItem.Inv.Items.size() != 2) { - TC_LOG_ERROR("network", "HandleSwapInvItemOpcode - Invalid itemCount (" SZFMTD ")", swapInvItem.Inv.Items.size()); + TC_LOG_ERROR("network", "HandleSwapInvItemOpcode - Invalid itemCount ({})", swapInvItem.Inv.Items.size()); return; } - TC_LOG_DEBUG("network", "HandleSwapInvItemOpcode: receive Slot1: %u, Slot2: %u", + TC_LOG_DEBUG("network", "HandleSwapInvItemOpcode: receive Slot1: {}, Slot2: {}", swapInvItem.Slot1, swapInvItem.Slot2); // prevent attempt swap same item to current position generated by client at special checting sequence @@ -95,13 +95,13 @@ void WorldSession::HandleSwapInvItemOpcode(WorldPackets::Item::SwapInvItem& swap if (_player->IsBankPos(INVENTORY_SLOT_BAG_0, swapInvItem.Slot1) && !CanUseBank()) { - TC_LOG_DEBUG("network", "HandleSwapInvItemOpcode - Unit (%s) not found or you can't interact with him.", _player->PlayerTalkClass->GetInteractionData().SourceGuid.ToString().c_str()); + TC_LOG_DEBUG("network", "HandleSwapInvItemOpcode - Unit ({}) not found or you can't interact with him.", _player->PlayerTalkClass->GetInteractionData().SourceGuid.ToString()); return; } if (_player->IsBankPos(INVENTORY_SLOT_BAG_0, swapInvItem.Slot2) && !CanUseBank()) { - TC_LOG_DEBUG("network", "HandleSwapInvItemOpcode - Unit (%s) not found or you can't interact with him.", _player->PlayerTalkClass->GetInteractionData().SourceGuid.ToString().c_str()); + TC_LOG_DEBUG("network", "HandleSwapInvItemOpcode - Unit ({}) not found or you can't interact with him.", _player->PlayerTalkClass->GetInteractionData().SourceGuid.ToString()); return; } @@ -131,11 +131,11 @@ void WorldSession::HandleSwapItem(WorldPackets::Item::SwapItem& swapItem) { if (swapItem.Inv.Items.size() != 2) { - TC_LOG_ERROR("network", "HandleSwapItem - Invalid itemCount (" SZFMTD ")", swapItem.Inv.Items.size()); + TC_LOG_ERROR("network", "HandleSwapItem - Invalid itemCount ({})", swapItem.Inv.Items.size()); return; } - TC_LOG_DEBUG("network", "HandleSwapItem: receive ContainerSlotA: %u, SlotA: %u, ContainerSlotB: %u, SlotB: %u", + TC_LOG_DEBUG("network", "HandleSwapItem: receive ContainerSlotA: {}, SlotA: {}, ContainerSlotB: {}, SlotB: {}", swapItem.ContainerSlotA, swapItem.SlotA, swapItem.ContainerSlotB, swapItem.SlotB); uint16 src = ((swapItem.ContainerSlotA << 8) | swapItem.SlotA); @@ -159,13 +159,13 @@ void WorldSession::HandleSwapItem(WorldPackets::Item::SwapItem& swapItem) if (_player->IsBankPos(swapItem.ContainerSlotA, swapItem.SlotA) && !CanUseBank()) { - TC_LOG_DEBUG("network", "HandleSwapItem - Unit (%s) not found or you can't interact with him.", _player->PlayerTalkClass->GetInteractionData().SourceGuid.ToString().c_str()); + TC_LOG_DEBUG("network", "HandleSwapItem - Unit ({}) not found or you can't interact with him.", _player->PlayerTalkClass->GetInteractionData().SourceGuid.ToString()); return; } if (_player->IsBankPos(swapItem.ContainerSlotB, swapItem.SlotB) && !CanUseBank()) { - TC_LOG_DEBUG("network", "HandleSwapItem - Unit (%s) not found or you can't interact with him.", _player->PlayerTalkClass->GetInteractionData().SourceGuid.ToString().c_str()); + TC_LOG_DEBUG("network", "HandleSwapItem - Unit ({}) not found or you can't interact with him.", _player->PlayerTalkClass->GetInteractionData().SourceGuid.ToString()); return; } @@ -176,11 +176,11 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPackets::Item::AutoEquipItem& { if (autoEquipItem.Inv.Items.size() != 1) { - TC_LOG_ERROR("network", "HandleAutoEquipItemOpcode - Invalid itemCount (" SZFMTD ")", autoEquipItem.Inv.Items.size()); + TC_LOG_ERROR("network", "HandleAutoEquipItemOpcode - Invalid itemCount ({})", autoEquipItem.Inv.Items.size()); return; } - TC_LOG_DEBUG("network", "HandleAutoEquipItemOpcode: receive PackSlot: %u, Slot: %u", + TC_LOG_DEBUG("network", "HandleAutoEquipItemOpcode: receive PackSlot: {}, Slot: {}", autoEquipItem.PackSlot, autoEquipItem.Slot); Item* srcItem = _player->GetItemByPos(autoEquipItem.PackSlot, autoEquipItem.Slot); @@ -312,7 +312,7 @@ void WorldSession::HandleAutoEquipItemOpcode(WorldPackets::Item::AutoEquipItem& void WorldSession::HandleDestroyItemOpcode(WorldPackets::Item::DestroyItem& destroyItem) { - TC_LOG_DEBUG("network", "HandleDestroyItemOpcode: receive ContainerId: %u, SlotNum: %u, Count: %u", + TC_LOG_DEBUG("network", "HandleDestroyItemOpcode: receive ContainerId: {}, SlotNum: {}, Count: {}", destroyItem.ContainerId, destroyItem.SlotNum, destroyItem.Count); uint16 pos = (destroyItem.ContainerId << 8) | destroyItem.SlotNum; @@ -383,8 +383,8 @@ void WorldSession::HandleReadItem(WorldPackets::Item::ReadItem& readItem) void WorldSession::HandleSellItemOpcode(WorldPackets::Item::SellItem& packet) { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_SELL_ITEM: Vendor %s, Item %s, Amount: %u", - packet.VendorGUID.ToString().c_str(), packet.ItemGUID.ToString().c_str(), packet.Amount); + TC_LOG_DEBUG("network", "WORLD: Received CMSG_SELL_ITEM: Vendor {}, Item {}, Amount: {}", + packet.VendorGUID.ToString(), packet.ItemGUID.ToString(), packet.Amount); if (packet.ItemGUID.IsEmpty()) return; @@ -392,7 +392,7 @@ void WorldSession::HandleSellItemOpcode(WorldPackets::Item::SellItem& packet) Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(packet.VendorGUID, UNIT_NPC_FLAG_VENDOR, UNIT_NPC_FLAG_2_NONE); if (!creature) { - TC_LOG_DEBUG("network", "WORLD: HandleSellItemOpcode - %s not found or you can not interact with him.", packet.VendorGUID.ToString().c_str()); + TC_LOG_DEBUG("network", "WORLD: HandleSellItemOpcode - {} not found or you can not interact with him.", packet.VendorGUID.ToString()); _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, packet.ItemGUID); return; } @@ -471,7 +471,7 @@ void WorldSession::HandleSellItemOpcode(WorldPackets::Item::SellItem& packet) Item* pNewItem = pItem->CloneItem(packet.Amount, _player); if (!pNewItem) { - TC_LOG_ERROR("network", "WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), packet.Amount); + TC_LOG_ERROR("network", "WORLD: HandleSellItemOpcode - could not create clone of item {}; count = {}", pItem->GetEntry(), packet.Amount); _player->SendSellError(SELL_ERR_CANT_SELL_ITEM, creature, packet.ItemGUID); return; } @@ -505,12 +505,12 @@ void WorldSession::HandleSellItemOpcode(WorldPackets::Item::SellItem& packet) void WorldSession::HandleBuybackItem(WorldPackets::Item::BuyBackItem& packet) { - TC_LOG_DEBUG("network", "WORLD: Received CMSG_BUYBACK_ITEM: Vendor %s, Slot: %u", packet.VendorGUID.ToString().c_str(), packet.Slot); + TC_LOG_DEBUG("network", "WORLD: Received CMSG_BUYBACK_ITEM: Vendor {}, Slot: {}", packet.VendorGUID.ToString(), packet.Slot); Creature* creature = GetPlayer()->GetNPCIfCanInteractWith(packet.VendorGUID, UNIT_NPC_FLAG_VENDOR, UNIT_NPC_FLAG_2_NONE); if (!creature) { - TC_LOG_DEBUG("network", "WORLD: HandleBuybackItem - Unit (%s) not found or you can not interact with him.", packet.VendorGUID.ToString().c_str()); + TC_LOG_DEBUG("network", "WORLD: HandleBuybackItem - Unit ({}) not found or you can not interact with him.", packet.VendorGUID.ToString()); _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, ObjectGuid::Empty); return; } @@ -577,7 +577,7 @@ void WorldSession::HandleBuyItemOpcode(WorldPackets::Item::BuyItem& packet) } default: { - TC_LOG_DEBUG("network", "WORLD: received wrong itemType (%u) in HandleBuyItemOpcode", packet.ItemType); + TC_LOG_DEBUG("network", "WORLD: received wrong itemType ({}) in HandleBuyItemOpcode", packet.ItemType); break; } } @@ -596,7 +596,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid) Creature* vendor = GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_VENDOR, UNIT_NPC_FLAG_2_NONE); if (!vendor) { - TC_LOG_DEBUG("network", "WORLD: SendListInventory - %s not found or you can not interact with him.", vendorGuid.ToString().c_str()); + TC_LOG_DEBUG("network", "WORLD: SendListInventory - {} not found or you can not interact with him.", vendorGuid.ToString()); _player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, nullptr, ObjectGuid::Empty); return; } @@ -657,7 +657,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid) if (!sConditionMgr->IsObjectMeetingVendorItemConditions(vendor->GetEntry(), vendorItem->item, _player, vendor)) { - TC_LOG_DEBUG("condition", "SendListInventory: conditions not met for creature entry %u item %u", vendor->GetEntry(), vendorItem->item); + TC_LOG_DEBUG("condition", "SendListInventory: conditions not met for creature entry {} item {}", vendor->GetEntry(), vendorItem->item); continue; } @@ -719,11 +719,11 @@ void WorldSession::HandleAutoStoreBagItemOpcode(WorldPackets::Item::AutoStoreBag { if (!packet.Inv.Items.empty()) { - TC_LOG_ERROR("network", "HandleAutoStoreBagItemOpcode - Invalid itemCount (" SZFMTD ")", packet.Inv.Items.size()); + TC_LOG_ERROR("network", "HandleAutoStoreBagItemOpcode - Invalid itemCount ({})", packet.Inv.Items.size()); return; } - TC_LOG_DEBUG("network", "HandleAutoStoreBagItemOpcode: receive ContainerSlotA: %u, SlotA: %u, ContainerSlotB: %u", + TC_LOG_DEBUG("network", "HandleAutoStoreBagItemOpcode: receive ContainerSlotA: {}, SlotA: {}, ContainerSlotB: {}", packet.ContainerSlotA, packet.SlotA, packet.ContainerSlotB); Item* item = _player->GetItemByPos(packet.ContainerSlotA, packet.SlotA); @@ -795,7 +795,7 @@ void WorldSession::HandleWrapItem(WorldPackets::Item::WrapItem& packet) { if (packet.Inv.Items.size() != 2) { - TC_LOG_ERROR("network", "HandleWrapItem - Invalid itemCount (" SZFMTD ")", packet.Inv.Items.size()); + TC_LOG_ERROR("network", "HandleWrapItem - Invalid itemCount ({})", packet.Inv.Items.size()); return; } @@ -807,7 +807,7 @@ void WorldSession::HandleWrapItem(WorldPackets::Item::WrapItem& packet) uint8 itemContainerSlot = packet.Inv.Items[1].ContainerSlot; uint8 itemSlot = packet.Inv.Items[1].Slot; - TC_LOG_DEBUG("network", "HandleWrapItem - Receive giftContainerSlot = %u, giftSlot = %u, itemContainerSlot = %u, itemSlot = %u", giftContainerSlot, giftSlot, itemContainerSlot, itemSlot); + TC_LOG_DEBUG("network", "HandleWrapItem - Receive giftContainerSlot = {}, giftSlot = {}, itemContainerSlot = {}, itemSlot = {}", giftContainerSlot, giftSlot, itemContainerSlot, itemSlot); Item* gift = _player->GetItemByPos(giftContainerSlot, giftSlot); if (!gift) @@ -1154,11 +1154,11 @@ void WorldSession::HandleGetItemPurchaseData(WorldPackets::Item::GetItemPurchase Item* item = _player->GetItemByGuid(packet.ItemGUID); if (!item) { - TC_LOG_DEBUG("network", "HandleGetItemPurchaseData: Item %s not found!", packet.ItemGUID.ToString().c_str()); + TC_LOG_DEBUG("network", "HandleGetItemPurchaseData: Item {} not found!", packet.ItemGUID.ToString()); return; } - TC_LOG_DEBUG("network", "HandleGetItemPurchaseData: Item %s", packet.ItemGUID.ToString().c_str()); + TC_LOG_DEBUG("network", "HandleGetItemPurchaseData: Item {}", packet.ItemGUID.ToString()); GetPlayer()->SendRefundInfo(item); } @@ -1168,7 +1168,7 @@ void WorldSession::HandleItemRefund(WorldPackets::Item::ItemPurchaseRefund& pack Item* item = _player->GetItemByGuid(packet.ItemGUID); if (!item) { - TC_LOG_DEBUG("network", "WorldSession::HandleItemRefund: Item (%s) not found!", packet.ItemGUID.ToString().c_str()); + TC_LOG_DEBUG("network", "WorldSession::HandleItemRefund: Item ({}) not found!", packet.ItemGUID.ToString()); return; } @@ -1242,7 +1242,7 @@ void WorldSession::HandleRemoveNewItem(WorldPackets::Item::RemoveNewItem& remove Item* item = _player->GetItemByGuid(removeNewItem.ItemGuid); if (!item) { - TC_LOG_DEBUG("network", "WorldSession::HandleRemoveNewItem: Item (%s) not found for %s!", removeNewItem.ItemGuid.ToString().c_str(), GetPlayerInfo().c_str()); + TC_LOG_DEBUG("network", "WorldSession::HandleRemoveNewItem: Item ({}) not found for {}!", removeNewItem.ItemGuid.ToString(), GetPlayerInfo()); return; } |
