2 * Copyright (C) 2005-2010 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include "WorldPacket.h"
20 #include "WorldSession.h"
24 #include "ObjectMgr.h"
25 #include "ObjectGuid.h"
27 #include "UpdateMask.h"
28 #include "AuctionHouseMgr.h"
31 //please DO NOT use iterator++, because it is slower than ++iterator!!!
32 //post-incrementation is always slower than pre-incrementation !
34 //void called when player click on auctioneer npc
35 void WorldSession::HandleAuctionHelloOpcode( WorldPacket
& recv_data
)
37 uint64 guid
; //NPC guid
40 Creature
*unit
= GetPlayer()->GetNPCIfCanInteractWith(guid
,UNIT_NPC_FLAG_AUCTIONEER
);
43 sLog
.outDebug( "WORLD: HandleAuctionHelloOpcode - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid
)) );
48 if(GetPlayer()->hasUnitState(UNIT_STAT_DIED
))
49 GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH
);
51 SendAuctionHello(guid
, unit
);
54 //this void causes that auction window is opened
55 void WorldSession::SendAuctionHello( uint64 guid
, Creature
* unit
)
57 AuctionHouseEntry
const* ahEntry
= AuctionHouseMgr::GetAuctionHouseEntry(unit
->getFaction());
61 WorldPacket
data( MSG_AUCTION_HELLO
, 12 );
62 data
<< (uint64
) guid
;
63 data
<< (uint32
) ahEntry
->houseId
;
67 //call this method when player bids, creates, or deletes auction
68 void WorldSession::SendAuctionCommandResult(uint32 auctionId
, uint32 Action
, uint32 ErrorCode
, uint32 bidError
)
70 WorldPacket
data( SMSG_AUCTION_COMMAND_RESULT
, 16 );
74 if ( !ErrorCode
&& Action
)
75 data
<< bidError
; //when bid, then send 0, once...
79 //this function sends notification, if bidder is online
80 void WorldSession::SendAuctionBidderNotification( uint32 location
, uint32 auctionId
, uint64 bidder
, uint32 bidSum
, uint32 diff
, uint32 item_template
)
82 WorldPacket
data(SMSG_AUCTION_BIDDER_NOTIFICATION
, (8*4));
83 data
<< uint32(location
);
84 data
<< uint32(auctionId
);
85 data
<< uint64(bidder
);
86 data
<< uint32(bidSum
);
88 data
<< uint32(item_template
);
93 //this void causes on client to display: "Your auction sold"
94 void WorldSession::SendAuctionOwnerNotification( AuctionEntry
* auction
)
96 WorldPacket
data(SMSG_AUCTION_OWNER_NOTIFICATION
, (7*4));
99 data
<< (uint32
) 0; //unk
100 data
<< (uint32
) 0; //unk
101 data
<< (uint32
) 0; //unk
102 data
<< auction
->item_template
;
103 data
<< (uint32
) 0; //unk
107 //this function sends mail to old bidder
108 void WorldSession::SendAuctionOutbiddedMail(AuctionEntry
*auction
, uint32 newPrice
)
110 uint64 oldBidder_guid
= MAKE_NEW_GUID(auction
->bidder
,0, HIGHGUID_PLAYER
);
111 Player
*oldBidder
= sObjectMgr
.GetPlayer(oldBidder_guid
);
113 uint32 oldBidder_accId
= 0;
115 oldBidder_accId
= sObjectMgr
.GetPlayerAccountIdByGUID(oldBidder_guid
);
118 if(oldBidder
|| oldBidder_accId
)
120 std::ostringstream msgAuctionOutbiddedSubject
;
121 msgAuctionOutbiddedSubject
<< auction
->item_template
<< ":0:" << AUCTION_OUTBIDDED
;
124 oldBidder
->GetSession()->SendAuctionBidderNotification( auction
->GetHouseId(), auction
->Id
, _player
->GetGUID(), newPrice
, auction
->GetAuctionOutBid(), auction
->item_template
);
126 MailDraft(msgAuctionOutbiddedSubject
.str())
127 .AddMoney(auction
->bid
)
128 .SendMailTo(MailReceiver(oldBidder
, auction
->bidder
), auction
);
132 //this function sends mail, when auction is cancelled to old bidder
133 void WorldSession::SendAuctionCancelledToBidderMail( AuctionEntry
* auction
)
135 uint64 bidder_guid
= MAKE_NEW_GUID(auction
->bidder
, 0, HIGHGUID_PLAYER
);
136 Player
*bidder
= sObjectMgr
.GetPlayer(bidder_guid
);
138 uint32 bidder_accId
= 0;
140 bidder_accId
= sObjectMgr
.GetPlayerAccountIdByGUID(bidder_guid
);
143 if(bidder
|| bidder_accId
)
145 std::ostringstream msgAuctionCancelledSubject
;
146 msgAuctionCancelledSubject
<< auction
->item_template
<< ":0:" << AUCTION_CANCELLED_TO_BIDDER
;
148 MailDraft(msgAuctionCancelledSubject
.str())
149 .AddMoney(auction
->bid
)
150 .SendMailTo(MailReceiver(bidder
, auction
->bidder
), auction
);
154 //this void creates new auction and adds auction to some auctionhouse
155 void WorldSession::HandleAuctionSellItem( WorldPacket
& recv_data
)
157 uint64 auctioneer
, item
;
158 uint32 etime
, bid
, buyout
;
159 recv_data
>> auctioneer
;
160 recv_data
.read_skip
<uint32
>(); // const 1?
162 recv_data
.read_skip
<uint32
>(); // unk 3.2.2, const 1?
167 Player
*pl
= GetPlayer();
169 if (!item
|| !bid
|| !etime
)
170 return; //check for cheaters
172 Creature
*pCreature
= GetPlayer()->GetNPCIfCanInteractWith(auctioneer
,UNIT_NPC_FLAG_AUCTIONEER
);
175 sLog
.outDebug( "WORLD: HandleAuctionSellItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer
)) );
179 AuctionHouseEntry
const* auctionHouseEntry
= AuctionHouseMgr::GetAuctionHouseEntry(pCreature
->getFaction());
180 if(!auctionHouseEntry
)
182 sLog
.outDebug( "WORLD: HandleAuctionSellItem - Unit (GUID: %u) has wrong faction.", uint32(GUID_LOPART(auctioneer
)) );
186 // client send time in minutes, convert to common used sec time
189 // client understand only 3 auction time
192 case 1*MIN_AUCTION_TIME
:
193 case 2*MIN_AUCTION_TIME
:
194 case 4*MIN_AUCTION_TIME
:
201 if(GetPlayer()->hasUnitState(UNIT_STAT_DIED
))
202 GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH
);
204 Item
*it
= pl
->GetItemByGuid( item
);
205 //do not allow to sell already auctioned items
206 if(sAuctionMgr
.GetAItem(GUID_LOPART(item
)))
208 sLog
.outError("AuctionError, player %s is sending item id: %u, but item is already in another auction", pl
->GetName(), GUID_LOPART(item
));
209 SendAuctionCommandResult(0, AUCTION_SELL_ITEM
, AUCTION_INTERNAL_ERROR
);
212 // prevent sending bag with items (cheat: can be placed in bag after adding equiped empty bag to auction)
215 SendAuctionCommandResult(0, AUCTION_SELL_ITEM
, AUCTION_ITEM_NOT_FOUND
);
219 if(!it
->CanBeTraded())
221 SendAuctionCommandResult(0, AUCTION_SELL_ITEM
, AUCTION_INTERNAL_ERROR
);
225 if (it
->HasFlag(ITEM_FIELD_FLAGS
, ITEM_FLAGS_CONJURED
) || it
->GetUInt32Value(ITEM_FIELD_DURATION
))
227 SendAuctionCommandResult(0, AUCTION_SELL_ITEM
, AUCTION_INTERNAL_ERROR
);
231 AuctionHouseObject
* auctionHouse
= sAuctionMgr
.GetAuctionsMap( pCreature
->getFaction() );
233 //we have to take deposit :
234 uint32 deposit
= AuctionHouseMgr::GetAuctionDeposit( auctionHouseEntry
, etime
, it
);
235 if ( pl
->GetMoney() < deposit
)
237 SendAuctionCommandResult(0, AUCTION_SELL_ITEM
, AUCTION_NOT_ENOUGHT_MONEY
);
241 if( GetSecurity() > SEC_PLAYER
&& sWorld
.getConfig(CONFIG_BOOL_GM_LOG_TRADE
) )
243 sLog
.outCommand(GetAccountId(),"GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
244 GetPlayerName(),GetAccountId(),it
->GetProto()->Name1
,it
->GetEntry(),it
->GetCount());
247 pl
->ModifyMoney( -int32(deposit
) );
249 uint32 auction_time
= uint32(etime
* sWorld
.getConfig(CONFIG_FLOAT_RATE_AUCTION_TIME
));
251 AuctionEntry
*AH
= new AuctionEntry
;
252 AH
->Id
= sObjectMgr
.GenerateAuctionID();
253 AH
->auctioneer
= GUID_LOPART(auctioneer
);
254 AH
->item_guidlow
= GUID_LOPART(item
);
255 AH
->item_template
= it
->GetEntry();
256 AH
->owner
= pl
->GetGUIDLow();
261 AH
->expire_time
= time(NULL
) + auction_time
;
262 AH
->deposit
= deposit
;
263 AH
->auctionHouseEntry
= auctionHouseEntry
;
265 sLog
.outDetail("selling item %u to auctioneer %u with initial bid %u with buyout %u and with time %u (in sec) in auctionhouse %u", GUID_LOPART(item
), GUID_LOPART(auctioneer
), bid
, buyout
, auction_time
, AH
->GetHouseId());
266 auctionHouse
->AddAuction(AH
);
268 sAuctionMgr
.AddAItem(it
);
269 pl
->MoveItemFromInventory( it
->GetBagSlot(), it
->GetSlot(), true);
271 CharacterDatabase
.BeginTransaction();
272 it
->DeleteFromInventoryDB();
273 it
->SaveToDB(); // recursive and not have transaction guard into self, not in inventiory and can be save standalone
275 pl
->SaveInventoryAndGoldToDB();
276 CharacterDatabase
.CommitTransaction();
278 SendAuctionCommandResult(AH
->Id
, AUCTION_SELL_ITEM
, AUCTION_OK
);
280 GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_CREATE_AUCTION
, 1);
283 //this function is called when client bids or buys out auction
284 void WorldSession::HandleAuctionPlaceBid( WorldPacket
& recv_data
)
289 recv_data
>> auctioneer
;
290 recv_data
>> auctionId
>> price
;
292 if (!auctionId
|| !price
)
293 return; //check for cheaters
295 Creature
*pCreature
= GetPlayer()->GetNPCIfCanInteractWith(auctioneer
,UNIT_NPC_FLAG_AUCTIONEER
);
298 sLog
.outDebug( "WORLD: HandleAuctionPlaceBid - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer
)) );
303 if(GetPlayer()->hasUnitState(UNIT_STAT_DIED
))
304 GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH
);
306 AuctionHouseObject
* auctionHouse
= sAuctionMgr
.GetAuctionsMap( pCreature
->getFaction() );
308 AuctionEntry
*auction
= auctionHouse
->GetAuction(auctionId
);
309 Player
*pl
= GetPlayer();
311 if( !auction
|| auction
->owner
== pl
->GetGUIDLow() )
313 //you cannot bid your own auction:
314 SendAuctionCommandResult( 0, AUCTION_PLACE_BID
, CANNOT_BID_YOUR_AUCTION_ERROR
);
318 // impossible have online own another character (use this for speedup check in case online owner)
319 Player
* auction_owner
= sObjectMgr
.GetPlayer(MAKE_NEW_GUID(auction
->owner
, 0, HIGHGUID_PLAYER
));
320 if( !auction_owner
&& sObjectMgr
.GetPlayerAccountIdByGUID(MAKE_NEW_GUID(auction
->owner
, 0, HIGHGUID_PLAYER
)) == pl
->GetSession()->GetAccountId())
322 //you cannot bid your another character auction:
323 SendAuctionCommandResult( 0, AUCTION_PLACE_BID
, CANNOT_BID_YOUR_AUCTION_ERROR
);
328 if(price
<= auction
->bid
|| price
< auction
->startbid
)
331 // price too low for next bid if not buyout
332 if ((price
< auction
->buyout
|| auction
->buyout
== 0) &&
333 price
< auction
->bid
+ auction
->GetAuctionOutBid())
335 //auction has already higher bid, client tests it!
339 if (price
> pl
->GetMoney())
341 //you don't have enought money!, client tests!
342 //SendAuctionCommandResult(auction->auctionId, AUCTION_PLACE_BID, ???);
346 if ((price
< auction
->buyout
) || (auction
->buyout
== 0))
348 if (auction
->bidder
> 0)
350 if ( auction
->bidder
== pl
->GetGUIDLow() )
352 pl
->ModifyMoney( -int32(price
- auction
->bid
));
356 // mail to last bidder and return money
357 SendAuctionOutbiddedMail( auction
, price
);
358 pl
->ModifyMoney( -int32(price
) );
363 pl
->ModifyMoney( -int32(price
) );
365 auction
->bidder
= pl
->GetGUIDLow();
366 auction
->bid
= price
;
367 GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID
, price
);
369 // after this update we should save player's money ...
370 CharacterDatabase
.PExecute("UPDATE auctionhouse SET buyguid = '%u',lastbid = '%u' WHERE id = '%u'", auction
->bidder
, auction
->bid
, auction
->Id
);
372 SendAuctionCommandResult(auction
->Id
, AUCTION_PLACE_BID
, AUCTION_OK
, 0 );
377 if (pl
->GetGUIDLow() == auction
->bidder
)
379 pl
->ModifyMoney(-int32(auction
->buyout
- auction
->bid
));
383 pl
->ModifyMoney(-int32(auction
->buyout
));
384 if ( auction
->bidder
) //buyout for bidded auction ..
386 SendAuctionOutbiddedMail( auction
, auction
->buyout
);
389 auction
->bidder
= pl
->GetGUIDLow();
390 auction
->bid
= auction
->buyout
;
391 GetPlayer()->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HIGHEST_AUCTION_BID
, auction
->buyout
);
393 sAuctionMgr
.SendAuctionSalePendingMail( auction
);
394 sAuctionMgr
.SendAuctionSuccessfulMail( auction
);
395 sAuctionMgr
.SendAuctionWonMail( auction
);
397 SendAuctionCommandResult(auction
->Id
, AUCTION_PLACE_BID
, AUCTION_OK
);
399 sAuctionMgr
.RemoveAItem(auction
->item_guidlow
);
400 auctionHouse
->RemoveAuction(auction
->Id
);
401 auction
->DeleteFromDB();
405 CharacterDatabase
.BeginTransaction();
406 pl
->SaveInventoryAndGoldToDB();
407 CharacterDatabase
.CommitTransaction();
410 //this void is called when auction_owner cancels his auction
411 void WorldSession::HandleAuctionRemoveItem( WorldPacket
& recv_data
)
415 recv_data
>> auctioneer
;
416 recv_data
>> auctionId
;
417 //sLog.outDebug( "Cancel AUCTION AuctionID: %u", auctionId);
419 Creature
*pCreature
= GetPlayer()->GetNPCIfCanInteractWith(auctioneer
,UNIT_NPC_FLAG_AUCTIONEER
);
422 sLog
.outDebug( "WORLD: HandleAuctionRemoveItem - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(auctioneer
)) );
427 if(GetPlayer()->hasUnitState(UNIT_STAT_DIED
))
428 GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH
);
430 AuctionHouseObject
* auctionHouse
= sAuctionMgr
.GetAuctionsMap( pCreature
->getFaction() );
432 AuctionEntry
*auction
= auctionHouse
->GetAuction(auctionId
);
433 Player
*pl
= GetPlayer();
435 if (auction
&& auction
->owner
== pl
->GetGUIDLow())
437 Item
*pItem
= sAuctionMgr
.GetAItem(auction
->item_guidlow
);
440 if (auction
->bidder
> 0) // If we have a bidder, we have to send him the money he paid
442 uint32 auctionCut
= auction
->GetAuctionCut();
443 if ( pl
->GetMoney() < auctionCut
) //player doesn't have enough money, maybe message needed
445 //some auctionBidderNotification would be needed, but don't know that parts..
446 SendAuctionCancelledToBidderMail( auction
);
447 pl
->ModifyMoney( -int32(auctionCut
) );
449 // Return the item by mail
450 std::ostringstream msgAuctionCanceledOwner
;
451 msgAuctionCanceledOwner
<< auction
->item_template
<< ":0:" << AUCTION_CANCELED
;
453 // item will deleted or added to received mail list
454 MailDraft(msgAuctionCanceledOwner
.str())
456 .SendMailTo(pl
, auction
);
460 sLog
.outError("Auction id: %u has non-existed item (item guid : %u)!!!", auction
->Id
, auction
->item_guidlow
);
461 SendAuctionCommandResult( 0, AUCTION_CANCEL
, AUCTION_INTERNAL_ERROR
);
467 SendAuctionCommandResult( 0, AUCTION_CANCEL
, AUCTION_INTERNAL_ERROR
);
468 //this code isn't possible ... maybe there should be assert
469 sLog
.outError("CHEATER : %u, he tried to cancel auction (id: %u) of another player, or auction is NULL", pl
->GetGUIDLow(), auctionId
);
473 //inform player, that auction is removed
474 SendAuctionCommandResult( auction
->Id
, AUCTION_CANCEL
, AUCTION_OK
);
475 // Now remove the auction
476 CharacterDatabase
.BeginTransaction();
477 auction
->DeleteFromDB();
478 pl
->SaveInventoryAndGoldToDB();
479 CharacterDatabase
.CommitTransaction();
480 sAuctionMgr
.RemoveAItem( auction
->item_guidlow
);
481 auctionHouse
->RemoveAuction( auction
->Id
);
485 //called when player lists his bids
486 void WorldSession::HandleAuctionListBidderItems( WorldPacket
& recv_data
)
488 uint64 guid
; //NPC guid
489 uint32 listfrom
; //page of auctions
490 uint32 outbiddedCount
; //count of outbidded auctions
493 recv_data
>> listfrom
; // not used in fact (this list not have page control in client)
494 recv_data
>> outbiddedCount
;
495 if (recv_data
.size() != (16 + outbiddedCount
* 4 ))
497 sLog
.outError("Client sent bad opcode!!! with count: %u and size : %lu (must be: %u)", outbiddedCount
, (unsigned long)recv_data
.size(),(16 + outbiddedCount
* 4 ));
501 Creature
*pCreature
= GetPlayer()->GetNPCIfCanInteractWith(guid
,UNIT_NPC_FLAG_AUCTIONEER
);
504 sLog
.outDebug( "WORLD: HandleAuctionListBidderItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid
)) );
509 if(GetPlayer()->hasUnitState(UNIT_STAT_DIED
))
510 GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH
);
512 AuctionHouseObject
* auctionHouse
= sAuctionMgr
.GetAuctionsMap( pCreature
->getFaction() );
514 WorldPacket
data( SMSG_AUCTION_BIDDER_LIST_RESULT
, (4+4+4) );
515 Player
*pl
= GetPlayer();
516 data
<< (uint32
) 0; //add 0 as count
518 uint32 totalcount
= 0;
519 while ( outbiddedCount
> 0) //add all data, which client requires
522 uint32 outbiddedAuctionId
;
523 recv_data
>> outbiddedAuctionId
;
524 AuctionEntry
* auction
= auctionHouse
->GetAuction( outbiddedAuctionId
);
525 if ( auction
&& auction
->BuildAuctionInfo(data
))
532 auctionHouse
->BuildListBidderItems(data
,pl
,count
,totalcount
);
533 data
.put
<uint32
>( 0, count
); // add count to placeholder
535 data
<< (uint32
)300; //unk 2.3.0
539 //this void sends player info about his auctions
540 void WorldSession::HandleAuctionListOwnerItems( WorldPacket
& recv_data
)
546 recv_data
>> listfrom
; // not used in fact (this list not have page control in client)
548 Creature
*pCreature
= GetPlayer()->GetNPCIfCanInteractWith(guid
,UNIT_NPC_FLAG_AUCTIONEER
);
551 sLog
.outDebug( "WORLD: HandleAuctionListOwnerItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid
)) );
556 if(GetPlayer()->hasUnitState(UNIT_STAT_DIED
))
557 GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH
);
559 AuctionHouseObject
* auctionHouse
= sAuctionMgr
.GetAuctionsMap( pCreature
->getFaction() );
561 WorldPacket
data( SMSG_AUCTION_OWNER_LIST_RESULT
, (4+4+4) );
562 data
<< (uint32
) 0; // amount place holder
565 uint32 totalcount
= 0;
567 auctionHouse
->BuildListOwnerItems(data
,_player
,count
,totalcount
);
568 data
.put
<uint32
>(0, count
);
569 data
<< (uint32
) totalcount
;
574 //this void is called when player clicks on search button
575 void WorldSession::HandleAuctionListItems( WorldPacket
& recv_data
)
577 std::string searchedname
;
578 uint8 levelmin
, levelmax
, usable
;
579 uint32 listfrom
, auctionSlotID
, auctionMainCategory
, auctionSubCategory
, quality
;
583 recv_data
>> listfrom
; // start, used for page control listing by 50 elements
584 recv_data
>> searchedname
;
586 recv_data
>> levelmin
>> levelmax
;
587 recv_data
>> auctionSlotID
>> auctionMainCategory
>> auctionSubCategory
;
588 recv_data
>> quality
>> usable
;
590 recv_data
.read_skip(16); // unknown 16 bytes: 00 07 01 00 00 01 05 00 06 00 09 01 08 00 03 00
592 Creature
*pCreature
= GetPlayer()->GetNPCIfCanInteractWith(guid
,UNIT_NPC_FLAG_AUCTIONEER
);
595 sLog
.outDebug( "WORLD: HandleAuctionListItems - Unit (GUID: %u) not found or you can't interact with him.", uint32(GUID_LOPART(guid
)) );
600 if(GetPlayer()->hasUnitState(UNIT_STAT_DIED
))
601 GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH
);
603 AuctionHouseObject
* auctionHouse
= sAuctionMgr
.GetAuctionsMap( pCreature
->getFaction() );
605 //sLog.outDebug("Auctionhouse search (GUID: %u TypeId: %u)", , list from: %u, searchedname: %s, levelmin: %u, levelmax: %u, auctionSlotID: %u, auctionMainCategory: %u, auctionSubCategory: %u, quality: %u, usable: %u",
606 // GUID_LOPART(guid),GuidHigh2TypeId(GUID_HIPART(guid)), listfrom, searchedname.c_str(), levelmin, levelmax, auctionSlotID, auctionMainCategory, auctionSubCategory, quality, usable);
608 WorldPacket
data( SMSG_AUCTION_LIST_RESULT
, (4+4+4) );
610 uint32 totalcount
= 0;
613 // converting string that we try to find to lower case
614 std::wstring wsearchedname
;
615 if(!Utf8toWStr(searchedname
,wsearchedname
))
618 wstrToLower(wsearchedname
);
620 auctionHouse
->BuildListAuctionItems(data
,_player
,
621 wsearchedname
, listfrom
, levelmin
, levelmax
, usable
,
622 auctionSlotID
, auctionMainCategory
, auctionSubCategory
, quality
,
625 data
.put
<uint32
>(0, count
);
626 data
<< (uint32
) totalcount
;
627 data
<< (uint32
) 300; // unk 2.3.0 const?
631 void WorldSession::HandleAuctionListPendingSales( WorldPacket
& recv_data
)
633 sLog
.outDebug("CMSG_AUCTION_LIST_PENDING_SALES");
635 recv_data
.read_skip
<uint64
>(); // auctioner guid
639 WorldPacket
data(SMSG_AUCTION_LIST_PENDING_SALES
, 4);
640 data
<< uint32(count
); // count
641 /*for(uint32 i = 0; i < count; ++i)
643 data << ""; // string
644 data << ""; // string