mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-28 21:02:14 +01:00
Merge remote-tracking branch 'origin/master' into 4.3.4
This commit is contained in:
@@ -147,6 +147,11 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry* auction, SQLTransaction&
|
||||
.AddItem(pItem)
|
||||
.SendMailTo(trans, MailReceiver(bidder, auction->bidder), auction, MAIL_CHECK_MASK_COPIED);
|
||||
}
|
||||
else
|
||||
{
|
||||
// bidder doesn't exist, delete the item
|
||||
sAuctionMgr->RemoveAItem(auction->itemGUIDLow, true);
|
||||
}
|
||||
}
|
||||
|
||||
void AuctionHouseMgr::SendAuctionSalePendingMail(AuctionEntry* auction, SQLTransaction& trans)
|
||||
@@ -207,6 +212,11 @@ void AuctionHouseMgr::SendAuctionExpiredMail(AuctionEntry* auction, SQLTransacti
|
||||
.AddItem(pItem)
|
||||
.SendMailTo(trans, MailReceiver(owner, auction->owner), auction, MAIL_CHECK_MASK_COPIED, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// owner doesn't exist, delete the item
|
||||
sAuctionMgr->RemoveAItem(auction->itemGUIDLow, true);
|
||||
}
|
||||
}
|
||||
|
||||
//this function sends mail to old bidder
|
||||
@@ -353,12 +363,19 @@ void AuctionHouseMgr::AddAItem(Item* it)
|
||||
mAitems[it->GetGUIDLow()] = it;
|
||||
}
|
||||
|
||||
bool AuctionHouseMgr::RemoveAItem(uint32 id)
|
||||
bool AuctionHouseMgr::RemoveAItem(uint32 id, bool deleteItem)
|
||||
{
|
||||
ItemMap::iterator i = mAitems.find(id);
|
||||
if (i == mAitems.end())
|
||||
return false;
|
||||
|
||||
if (deleteItem)
|
||||
{
|
||||
SQLTransaction trans = SQLTransaction(nullptr);
|
||||
i->second->FSetState(ITEM_REMOVED);
|
||||
i->second->SaveToDB(trans);
|
||||
}
|
||||
|
||||
mAitems.erase(i);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ class AuctionHouseMgr
|
||||
void LoadAuctions();
|
||||
|
||||
void AddAItem(Item* it);
|
||||
bool RemoveAItem(uint32 id);
|
||||
bool RemoveAItem(uint32 id, bool deleteItem = false);
|
||||
|
||||
void Update();
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ typedef std::map<uint32, TransportRotationEntry const*> TransportPathRotationCon
|
||||
|
||||
struct TransportAnimation
|
||||
{
|
||||
TransportAnimation() : TotalTime(0) { }
|
||||
|
||||
TransportPathContainer Path;
|
||||
TransportPathRotationContainer Rotations;
|
||||
uint32 TotalTime;
|
||||
|
||||
@@ -280,7 +280,20 @@ extern int main(int argc, char** argv)
|
||||
if (cliThread != nullptr)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
CancelSynchronousIo(cliThread->native_handle());
|
||||
if (!CancelSynchronousIo(cliThread->native_handle()))
|
||||
{
|
||||
DWORD errorCode = GetLastError();
|
||||
LPSTR errorBuffer;
|
||||
|
||||
DWORD formatReturnCode = FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
nullptr, errorCode, 0, (LPTSTR)&errorBuffer, 0, nullptr);
|
||||
if (!formatReturnCode)
|
||||
errorBuffer = "Unknown error";
|
||||
|
||||
TC_LOG_ERROR("server.worldserver", "Error cancelling I/O of CliThread, error code %u, detail: %s",
|
||||
errorCode, errorBuffer);
|
||||
LocalFree(errorBuffer);
|
||||
}
|
||||
#endif
|
||||
cliThread->join();
|
||||
delete cliThread;
|
||||
|
||||
Reference in New Issue
Block a user