feat(Core/AuctionHouse): Rework auctionhouse search threading (#20830)

This commit is contained in:
Takenbacon
2024-12-18 06:50:26 -08:00
committed by GitHub
parent e9c86737fb
commit 4d349e87b5
16 changed files with 1261 additions and 870 deletions
+1 -1
View File
@@ -418,8 +418,8 @@ enum WorldIntConfigs
CONFIG_LFG_KICK_PREVENTION_TIMER,
CONFIG_CHANGE_FACTION_MAX_MONEY,
CONFIG_WATER_BREATH_TIMER,
CONFIG_AUCTION_HOUSE_SEARCH_TIMEOUT,
CONFIG_DAILY_RBG_MIN_LEVEL_AP_REWARD,
CONFIG_AUCTIONHOUSE_WORKERTHREADS,
CONFIG_SPELL_QUEUE_WINDOW,
INT_CONFIG_VALUE_COUNT
};
+5 -14
View File
@@ -24,7 +24,6 @@
#include "AchievementMgr.h"
#include "AddonMgr.h"
#include "ArenaTeamMgr.h"
#include "AsyncAuctionListing.h"
#include "AuctionHouseMgr.h"
#include "AutobroadcastMgr.h"
#include "BattlefieldMgr.h"
@@ -1291,8 +1290,6 @@ void World::LoadConfigSettings(bool reload)
_int_configs[CONFIG_DAILY_RBG_MIN_LEVEL_AP_REWARD] = sConfigMgr->GetOption<uint32>("DailyRBGArenaPoints.MinLevel", 71);
_int_configs[CONFIG_AUCTION_HOUSE_SEARCH_TIMEOUT] = sConfigMgr->GetOption<uint32>("AuctionHouse.SearchTimeout", 1000);
///- Read the "Data" directory from the config file
std::string dataPath = sConfigMgr->GetOption<std::string>("DataDir", "./");
if (dataPath.empty() || (dataPath.at(dataPath.length() - 1) != '/' && dataPath.at(dataPath.length() - 1) != '\\'))
@@ -1488,6 +1485,9 @@ void World::LoadConfigSettings(bool reload)
// Realm Availability
_bool_configs[CONFIG_REALM_LOGIN_ENABLED] = sConfigMgr->GetOption<bool>("World.RealmAvailability", true);
// AH Worker threads
_int_configs[CONFIG_AUCTIONHOUSE_WORKERTHREADS] = sConfigMgr->GetOption<int32>("AuctionHouse.WorkerThreads", 1);
// SpellQueue
_bool_configs[CONFIG_SPELL_QUEUE_ENABLED] = sConfigMgr->GetOption<bool>("SpellQueue.Enabled", true);
_int_configs[CONFIG_SPELL_QUEUE_WINDOW] = sConfigMgr->GetOption<uint32>("SpellQueue.Window", 400);
@@ -2071,8 +2071,6 @@ void World::SetInitialWorldSettings()
LoginDatabase.Execute(stmt);
_timers[WUPDATE_WEATHERS].SetInterval(1 * IN_MILLISECONDS);
_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE * IN_MILLISECONDS);
_timers[WUPDATE_AUCTIONS].SetCurrent(MINUTE * IN_MILLISECONDS);
_timers[WUPDATE_UPTIME].SetInterval(_int_configs[CONFIG_UPTIME_UPDATE]*MINUTE * IN_MILLISECONDS);
//Update "uptime" table based on configuration entry in minutes.
@@ -2344,19 +2342,12 @@ void World::Update(uint32 diff)
ResetGuildCap();
}
// pussywizard: handle auctions when the timer has passed
if (_timers[WUPDATE_AUCTIONS].Passed())
{
METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update expired auctions"));
_timers[WUPDATE_AUCTIONS].Reset();
// pussywizard: handle expired auctions, auctions expired when realm was offline are also handled here (not during loading when many required things aren't loaded yet)
sAuctionMgr->Update();
METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update expired auctions"));
sAuctionMgr->Update(diff);
}
AsyncAuctionListingMgr::Update(Milliseconds(diff));
if (currentGameTime > _mail_expire_check_timer)
{
sObjectMgr->ReturnOrDeleteOldMails(true);
-1
View File
@@ -58,7 +58,6 @@ enum ShutdownExitCode : uint8
/// Timers for different object refresh rates
enum WorldTimers
{
WUPDATE_AUCTIONS,
WUPDATE_WEATHERS,
WUPDATE_UPTIME,
WUPDATE_CORPSES,