141 SF_LOG_DEBUG(
"network",
"WORLD: Received CMSG_VOID_STORAGE_TRANSFER");
149 if (countDeposit > 9)
151 SF_LOG_DEBUG(
"network",
"WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to deposit more than 9 items (%u).", player->
GetGUIDLow(), player->
GetName().c_str(), countDeposit);
156 std::vector<ObjectGuid> itemGuids(countDeposit);
157 for (
uint32 i = 0; i < countDeposit; ++i)
159 recvData.
ReadGuidMask(itemGuids[i], 0, 3, 6, 5, 4, 2, 1, 7);
164 if (countWithdraw > 9)
166 SF_LOG_DEBUG(
"network",
"WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to withdraw more than 9 items (%u).", player->
GetGUIDLow(), player->
GetName().c_str(), countWithdraw);
171 std::vector<ObjectGuid> itemIds(countWithdraw);
172 for (
uint32 i = 0; i < countWithdraw; ++i)
174 recvData.
ReadGuidMask(itemIds[i], 4, 0, 5, 7, 6, 1, 2, 3);
179 for (
uint32 i = 0; i < countDeposit; ++i)
181 recvData.
ReadGuidBytes(itemGuids[i], 5, 6, 3, 4, 1, 7, 2, 0);
186 for (
uint32 i = 0; i < countWithdraw; ++i)
196 SF_LOG_DEBUG(
"network",
"WORLD: HandleVoidStorageTransfer - Unit (GUID: %u) not found or player can't interact with it.",
GUID_LOPART(npcGuid));
202 SF_LOG_DEBUG(
"network",
"WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) queried void storage without unlocking it.", player->
GetGUIDLow(), player->
GetName().c_str());
213 if (itemIds.size() != 0)
218 freeBagSlots += bag->GetFreeSlots();
224 if (itemIds.size() > freeBagSlots)
237 uint8 depositCount = 0;
238 for (std::vector<ObjectGuid>::iterator itr = itemGuids.begin(); itr != itemGuids.end(); ++itr)
243 SF_LOG_DEBUG(
"network",
"WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) wants to deposit an invalid item (item guid: " UI64FMTD ").", player->
GetGUIDLow(), player->
GetName().c_str(),
uint64(*itr));
251 depositItems[depositCount++] = std::make_pair(itemVS, slot);
261 uint8 withdrawCount = 0;
262 for (std::vector<ObjectGuid>::iterator itr = itemIds.begin(); itr != itemIds.end(); ++itr)
277 SF_LOG_DEBUG(
"network",
"WORLD: HandleVoidStorageTransfer - Player (GUID: %u, name: %s) couldn't withdraw item id " UI64FMTD " because inventory was full.", player->
GetGUIDLow(), player->
GetName().c_str(),
uint64(*itr));
286 withdrawItems[withdrawCount++] = *itemVS;
292 7 * withdrawCount) / 8) + 7 * withdrawCount + (7 + 7 + 4 * 4) * depositCount);
296 for (
uint8 i = 0; i < withdrawCount; ++i)
304 for (
uint8 i = 0; i < depositCount; ++i)
306 ObjectGuid itemId = depositItems[i].first.ItemId;
307 ObjectGuid creatorGuid = depositItems[i].first.CreatorGuid;
322 for (
uint8 i = 0; i < depositCount; ++i)
324 ObjectGuid itemId = depositItems[i].first.ItemId;
325 ObjectGuid creatorGuid = depositItems[i].first.CreatorGuid;
326 data <<
uint32(depositItems[i].second);
328 data <<
uint32(depositItems[i].first.ItemEntry);
330 data <<
uint32(depositItems[i].first.ItemSuffixFactor);
333 data <<
uint32(depositItems[i].first.ItemRandomPropertyId);
343 for (
uint8 i = 0; i < withdrawCount; ++i)
357 SF_LOG_DEBUG(
"network",
"WORLD: Received CMSG_VOID_SWAP_ITEM");
390 SF_LOG_DEBUG(
"network",
"WORLD: HandleVoidSwapItem - Unit (GUID: %u) not found or player can't interact with it.",
GUID_LOPART(npcGuid));
396 SF_LOG_DEBUG(
"network",
"WORLD: HandleVoidSwapItem - Player (GUID: %u, name: %s) queried void storage without unlocking it.", player->
GetGUIDLow(), player->
GetName().c_str());
403 SF_LOG_DEBUG(
"network",
"WORLD: HandleVoidSwapItem - Player (GUID: %u, name: %s) requested swapping an invalid item (slot: %u, itemid: " UI64FMTD ").", player->
GetGUIDLow(), player->
GetName().c_str(), newSlot,
uint64(itemId));