Merge commit '799bdc17105c566a705cb93b4f1d1813c23f2ba2' into 4.3.4

Conflicts:
	sql/updates/world/2014_10_27_00_world.sql
	sql/updates/world/2014_10_27_01_world_335.sql
	src/server/game/AuctionHouse/AuctionHouseMgr.cpp
This commit is contained in:
Carbenium committed 2015-07-21 18:30:05 +02:00
commit 68fd138476
10 files changed
+73 -44

No files matched your search

@@ -435,7 +435,7 @@ void AuctionHouseObject::AddAuction(AuctionEntry* auction)
sScriptMgr->OnAuctionAdd(this, auction);
}
bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction, uint32 /*itemEntry*/)
bool AuctionHouseObject::RemoveAuction(AuctionEntry* auction)
{
bool wasInMap = AuctionsMap.erase(auction->Id) ? true : false;
@@ -457,23 +457,20 @@ void AuctionHouseObject::Update()
if (AuctionsMap.empty())
return;
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_AUCTION_BY_TIME);
stmt->setUInt32(0, (uint32)curTime+60);
PreparedQueryResult result = CharacterDatabase.Query(stmt);
if (!result)
return;
SQLTransaction trans = CharacterDatabase.BeginTransaction();
do
for (AuctionEntryMap::iterator it = AuctionsMap.begin(); it != AuctionsMap.end();)
{
// from auctionhousehandler.cpp, creates auction pointer & player pointer
AuctionEntry* auction = GetAuction(result->Fetch()->GetUInt32());
AuctionEntry* auction = it->second;
// Increment iterator due to AuctionEntry deletion
++it;
if (!auction)
///- filter auctions expired on next update
if (auction->expire_time > curTime + 60)
continue;
SQLTransaction trans = CharacterDatabase.BeginTransaction();
///- Either cancel the auction if there was no bidder
if (auction->bidder == 0)
{
@@ -491,16 +488,15 @@ void AuctionHouseObject::Update()
sScriptMgr->OnAuctionSuccessful(this, auction);
}
uint32 itemEntry = auction->itemEntry;
///- In any case clear the auction
auction->DeleteFromDB(trans);
CharacterDatabase.CommitTransaction(trans);
sAuctionMgr->RemoveAItem(auction->itemGUIDLow);
RemoveAuction(auction, itemEntry);
RemoveAuction(auction);
}
while (result->NextRow());
// Run DB changes
CharacterDatabase.CommitTransaction(trans);
}
void AuctionHouseObject::BuildListBidderItems(WorldPacket& data, Player* player, uint32& count, uint32& totalcount)
@@ -595,22 +591,31 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
if (propRefID)
{
// Append the suffix to the name (ie: of the Monkey) if one exists
// These are found in ItemRandomProperties.dbc, not ItemRandomSuffix.dbc
// These are found in ItemRandomSuffix.dbc and ItemRandomProperties.dbc
// even though the DBC names seem misleading
const ItemRandomPropertiesEntry* itemRandProp = sItemRandomPropertiesStore.LookupEntry(propRefID);
if (itemRandProp)
char* const* suffix = nullptr;
if (propRefID < 0)
{
char* temp = itemRandProp->nameSuffix;
const ItemRandomSuffixEntry* itemRandSuffix = sItemRandomSuffixStore.LookupEntry(-propRefID);
if (itemRandSuffix)
suffix = itemRandSuffix->nameSuffix;
}
else
{
const ItemRandomPropertiesEntry* itemRandProp = sItemRandomPropertiesStore.LookupEntry(propRefID);
if (itemRandProp)
suffix = itemRandProp->nameSuffix;
}
// dbc local name
if (temp)
{
// Append the suffix (ie: of the Monkey) to the name using localization
// or default enUS if localization is invalid
name += ' ';
name += temp[locdbc_idx >= 0 ? locdbc_idx : LOCALE_enUS];
}
// dbc local name
if (suffix)
{
// Append the suffix (ie: of the Monkey) to the name using localization
// or default enUS if localization is invalid
name += ' ';
name += suffix[locdbc_idx >= 0 ? locdbc_idx : LOCALE_enUS];
}
}