Added multi-session loading

This commit is contained in:
NathanHandley
2025-03-09 19:19:10 -05:00
parent 17c3956bac
commit 9aba71e545
4 changed files with 97 additions and 48 deletions

View File

@@ -33,23 +33,49 @@ public:
void OnBeforeAuctionHouseMgrSendAuctionSuccessfulMail(AuctionHouseMgr* /*auctionHouseMgr*/, AuctionEntry* /*auction*/, Player* owner, uint32& /*owner_accId*/, uint32& /*profit*/, bool& sendNotification, bool& updateAchievementCriteria, bool& /*sendMail*/) override
{
if (owner && owner->GetGUID().GetCounter() == auctionbot->GetAHBplayerGUID())
if (owner)
{
sendNotification = false;
updateAchievementCriteria = false;
bool isAHBot = false;
for (AuctionHouseBotCharacter character : auctionbot->AHCharacters)
{
if (character.CharacterGUID == owner->GetGUID().GetCounter())
{
isAHBot = true;
break;
}
}
if (isAHBot == true)
{
sendNotification = false;
updateAchievementCriteria = false;
}
}
}
void OnBeforeAuctionHouseMgrSendAuctionExpiredMail(AuctionHouseMgr* /*auctionHouseMgr*/, AuctionEntry* /*auction*/, Player* owner, uint32& /*owner_accId*/, bool& sendNotification, bool& /*sendMail*/) override
{
if (owner && owner->GetGUID().GetCounter() == auctionbot->GetAHBplayerGUID())
sendNotification = false;
if (owner)
{
bool isAHBot = false;
for (AuctionHouseBotCharacter character : auctionbot->AHCharacters)
{
if (character.CharacterGUID == owner->GetGUID().GetCounter())
{
isAHBot = true;
break;
}
}
if (isAHBot == true)
{
sendNotification = false;
}
}
}
void OnBeforeAuctionHouseMgrSendAuctionOutbiddedMail(AuctionHouseMgr* /*auctionHouseMgr*/, AuctionEntry* auction, Player* oldBidder, uint32& /*oldBidder_accId*/, Player* newBidder, uint32& newPrice, bool& /*sendNotification*/, bool& /*sendMail*/) override
{
if (oldBidder && !newBidder)
oldBidder->GetSession()->SendAuctionBidderNotification((uint32)auction->GetHouseId(), auction->Id, ObjectGuid::Create<HighGuid::Player>(auctionbot->GetAHBplayerGUID()), newPrice, auction->GetAuctionOutBid(), auction->item_template);
//if (oldBidder && !newBidder)
// oldBidder->GetSession()->SendAuctionBidderNotification((uint32)auction->GetHouseId(), auction->Id, ObjectGuid::Create<HighGuid::Player>(auctionbot->GetAHBplayerGUID()), newPrice, auction->GetAuctionOutBid(), auction->item_template);
}
void OnBeforeAuctionHouseMgrUpdate() override
@@ -65,7 +91,16 @@ public:
void OnBeforeMailDraftSendMailTo(MailDraft* /*mailDraft*/, MailReceiver const& receiver, MailSender const& sender, MailCheckMask& /*checked*/, uint32& /*deliver_delay*/, uint32& /*custom_expiration*/, bool& deleteMailItemsFromDB, bool& sendMail) override
{
if (receiver.GetPlayerGUIDLow() == auctionbot->GetAHBplayerGUID())
bool isAHBot = false;
for (AuctionHouseBotCharacter character : auctionbot->AHCharacters)
{
if (character.CharacterGUID == receiver.GetPlayerGUIDLow())
{
isAHBot = true;
break;
}
}
if (isAHBot == true)
{
if (sender.GetMailMessageType() == MAIL_AUCTION) // auction mail with items
deleteMailItemsFromDB = true;