mirror of
https://github.com/mangosfour/server.git
synced 2025-12-24 01:37:02 +00:00
[11739] Fixed possible crash after auction loading with wrong houseid field value.
Also * Fixed error report at 'commands' load for "ahbot items" security level * Some auction code cleanups and speedups
This commit is contained in:
parent
0254ad6bf9
commit
f1bec402e9
4 changed files with 19 additions and 19 deletions
|
|
@ -426,7 +426,7 @@ void AuctionHouseMgr::LoadAuctions()
|
||||||
|
|
||||||
auction->auctionHouseEntry = sAuctionHouseStore.LookupEntry(houseid);
|
auction->auctionHouseEntry = sAuctionHouseStore.LookupEntry(houseid);
|
||||||
|
|
||||||
if (!houseid)
|
if (!auction->auctionHouseEntry)
|
||||||
{
|
{
|
||||||
// need for send mail, use goblin auctionhouse
|
// need for send mail, use goblin auctionhouse
|
||||||
auction->auctionHouseEntry = sAuctionHouseStore.LookupEntry(7);
|
auction->auctionHouseEntry = sAuctionHouseStore.LookupEntry(7);
|
||||||
|
|
@ -568,13 +568,9 @@ void AuctionHouseObject::Update()
|
||||||
{
|
{
|
||||||
time_t curTime = sWorld.GetGameTime();
|
time_t curTime = sWorld.GetGameTime();
|
||||||
///- Handle expired auctions
|
///- Handle expired auctions
|
||||||
AuctionEntryMap::iterator next;
|
for (AuctionEntryMap::iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); )
|
||||||
for (AuctionEntryMap::iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); itr = next)
|
|
||||||
{
|
{
|
||||||
next = itr;
|
if (itr->second->moneyDeliveryTime) // pending auction
|
||||||
++next;
|
|
||||||
|
|
||||||
if (itr->second->moneyDeliveryTime)
|
|
||||||
{
|
{
|
||||||
if (curTime > itr->second->moneyDeliveryTime)
|
if (curTime > itr->second->moneyDeliveryTime)
|
||||||
{
|
{
|
||||||
|
|
@ -583,10 +579,11 @@ void AuctionHouseObject::Update()
|
||||||
itr->second->DeleteFromDB();
|
itr->second->DeleteFromDB();
|
||||||
MANGOS_ASSERT(!itr->second->itemGuidLow); // already removed or send in mail at won
|
MANGOS_ASSERT(!itr->second->itemGuidLow); // already removed or send in mail at won
|
||||||
delete itr->second;
|
delete itr->second;
|
||||||
RemoveAuction(itr->first);
|
AuctionsMap.erase(itr++);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else // active auction
|
||||||
{
|
{
|
||||||
if (curTime > itr->second->expireTime)
|
if (curTime > itr->second->expireTime)
|
||||||
{
|
{
|
||||||
|
|
@ -600,10 +597,13 @@ void AuctionHouseObject::Update()
|
||||||
|
|
||||||
itr->second->DeleteFromDB();
|
itr->second->DeleteFromDB();
|
||||||
delete itr->second;
|
delete itr->second;
|
||||||
RemoveAuction(itr->first);
|
AuctionsMap.erase(itr++);
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
++itr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -612,9 +612,9 @@ void AuctionHouseObject::BuildListBidderItems(WorldPacket& data, Player* player,
|
||||||
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin();itr != AuctionsMap.end();++itr)
|
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin();itr != AuctionsMap.end();++itr)
|
||||||
{
|
{
|
||||||
AuctionEntry *Aentry = itr->second;
|
AuctionEntry *Aentry = itr->second;
|
||||||
if (Aentry->moneyDeliveryTime)
|
if (Aentry->moneyDeliveryTime) // skip pending sell auctions
|
||||||
continue;
|
continue;
|
||||||
if (Aentry && Aentry->bidder == player->GetGUIDLow())
|
if (Aentry->bidder == player->GetGUIDLow())
|
||||||
{
|
{
|
||||||
if (itr->second->BuildAuctionInfo(data))
|
if (itr->second->BuildAuctionInfo(data))
|
||||||
++count;
|
++count;
|
||||||
|
|
@ -628,9 +628,9 @@ void AuctionHouseObject::BuildListOwnerItems(WorldPacket& data, Player* player,
|
||||||
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
|
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
|
||||||
{
|
{
|
||||||
AuctionEntry *Aentry = itr->second;
|
AuctionEntry *Aentry = itr->second;
|
||||||
if (Aentry->moneyDeliveryTime)
|
if (Aentry->moneyDeliveryTime) // skip pending sell auctions
|
||||||
continue;
|
continue;
|
||||||
if (Aentry && Aentry->owner == player->GetGUIDLow())
|
if (Aentry->owner == player->GetGUIDLow())
|
||||||
{
|
{
|
||||||
if (Aentry->BuildAuctionInfo(data))
|
if (Aentry->BuildAuctionInfo(data))
|
||||||
++count;
|
++count;
|
||||||
|
|
@ -878,9 +878,9 @@ void AuctionHouseObject::BuildListPendingSales(WorldPacket& data, Player* player
|
||||||
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
|
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
|
||||||
{
|
{
|
||||||
AuctionEntry *Aentry = itr->second;
|
AuctionEntry *Aentry = itr->second;
|
||||||
if (!Aentry->moneyDeliveryTime)
|
if (!Aentry->moneyDeliveryTime) // skip not pending auctions
|
||||||
continue;
|
continue;
|
||||||
if (Aentry && Aentry->owner == player->GetGUIDLow())
|
if (Aentry->owner == player->GetGUIDLow())
|
||||||
{
|
{
|
||||||
std::ostringstream str1;
|
std::ostringstream str1;
|
||||||
str1 << Aentry->itemTemplate << ":" << Aentry->itemRandomPropertyId << ":" << AUCTION_SUCCESSFUL << ":" << Aentry->Id << ":" << Aentry->itemCount;
|
str1 << Aentry->itemTemplate << ":" << Aentry->itemRandomPropertyId << ":" << AUCTION_SUCCESSFUL << ":" << Aentry->Id << ":" << Aentry->itemCount;
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ class AuctionHouseObject
|
||||||
|
|
||||||
bool RemoveAuction(uint32 id)
|
bool RemoveAuction(uint32 id)
|
||||||
{
|
{
|
||||||
return AuctionsMap.erase(id) ? true : false;
|
return AuctionsMap.erase(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Update();
|
void Update();
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||||
|
|
||||||
static ChatCommand ahbotCommandTable[] =
|
static ChatCommand ahbotCommandTable[] =
|
||||||
{
|
{
|
||||||
{ "items", SEC_GAMEMASTER, true, NULL, "", ahbotItemsCommandTable},
|
{ "items", SEC_ADMINISTRATOR, true, NULL, "", ahbotItemsCommandTable},
|
||||||
{ "rebuild", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotRebuildCommand, "", NULL },
|
{ "rebuild", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotRebuildCommand, "", NULL },
|
||||||
{ "reload", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotReloadCommand, "", NULL },
|
{ "reload", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotReloadCommand, "", NULL },
|
||||||
{ "status", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotStatusCommand, "", NULL },
|
{ "status", SEC_ADMINISTRATOR, true, &ChatHandler::HandleAHBotStatusCommand, "", NULL },
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11738"
|
#define REVISION_NR "11739"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue