Config/Misc

* hardcode sql limits within their respective components instead of
   having them configurable
 * creating a new DBTypeList defaults it to being unlimited
   * SQL_LIMIT_NONE (0) > removed as it only existed for consistency
   * SQL_LIMIT_DEFAULT (300) > frontend / Listview::DEFAULT_SIZE
   * SQL_LIMIT_SEARCH (500) > Search::DEFAULT_MAX_RESULTS
   * SQL_LIMIT_QUICKSEARCH (10) > Search::SUGGESTIONS_MAX_RESULTS
This commit is contained in:
Sarjuuk 2025-12-30 02:55:43 +01:00
parent b9d888ab3a
commit c44bf4f575
69 changed files with 183 additions and 219 deletions

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,4 @@
DELETE FROM aowow_config WHERE `key` = 'sql_limit_default';
DELETE FROM aowow_config WHERE `key` = 'sql_limit_none';
DELETE FROM aowow_config WHERE `key` = 'sql_limit_quicksearch';
DELETE FROM aowow_config WHERE `key` = 'sql_limit_search';

View file

@ -83,7 +83,7 @@ CLISetup::registerSetup("build", new class extends SetupScript
$enchIds = array_column($enchantSpells, 'effect1MiscValue');
$enchantments = new EnchantmentList(array(['id', $enchIds], Cfg::get('SQL_LIMIT_NONE')));
$enchantments = new EnchantmentList(array(['id', $enchIds]));
if ($enchantments->error)
{
CLI::write('[enchants] Required table ?_itemenchantment seems to be empty!', CLI::LOG_ERROR);
@ -91,7 +91,7 @@ CLISetup::registerSetup("build", new class extends SetupScript
return false;
}
$castItems = new ItemList(array(['spellId1', array_keys($enchantSpells)], ['src.typeId', null, '!'], Cfg::get('SQL_LIMIT_NONE')));
$castItems = new ItemList(array(['spellId1', array_keys($enchantSpells)], ['src.typeId', null, '!']));
if ($castItems->error)
{
CLI::write('[enchants] Required table ?_items seems to be empty!', CLI::LOG_ERROR);

View file

@ -53,7 +53,7 @@ CLISetup::registerSetup("build", new class extends SetupScript
EXP_BC, EXP_WOTLK
);
$enchantments = new EnchantmentList(array(['id', array_column($gems, 'enchId')], Cfg::get('SQL_LIMIT_NONE')));
$enchantments = new EnchantmentList(array(['id', array_column($gems, 'enchId')]));
if ($enchantments->error)
{
CLI::write('[gems] Required table ?_itemenchantment seems to be empty!', CLI::LOG_ERROR);

View file

@ -52,7 +52,7 @@ CLISetup::registerSetup("build", new class extends SetupScript
WHERE i.classBak = ?d',
ITEM_CLASS_GLYPH);
$glyphSpells = new SpellList(array(['s.id', array_keys($glyphList)], Cfg::get('SQL_LIMIT_NONE')));
$glyphSpells = new SpellList(array(['s.id', array_keys($glyphList)]));
foreach (CLISetup::$locales as $loc)
{

View file

@ -56,7 +56,6 @@ CLISetup::registerSetup("build", new class extends SetupScript
$questorder = [];
$questtotal = [];
$condition = [
Cfg::get('SQL_LIMIT_NONE'),
'AND',
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW | CUSTOM_UNAVAILABLE | CUSTOM_DISABLED, '&'], 0],
[['flags', QUEST_FLAG_DAILY | QUEST_FLAG_WEEKLY | QUEST_FLAG_REPEATABLE | QUEST_FLAG_AUTO_REWARDED, '&'], 0],
@ -125,11 +124,7 @@ CLISetup::registerSetup("build", new class extends SetupScript
private function titles(): void
{
$condition = array(
Cfg::get('SQL_LIMIT_NONE'),
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0],
);
$titlez = new TitleList($condition);
$titlez = new TitleList(array([['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]));
// get titles for exclusion
foreach ($titlez->iterate() as $id => $__)
@ -161,7 +156,6 @@ CLISetup::registerSetup("build", new class extends SetupScript
private function mounts() : void
{
$condition = array(
Cfg::get('SQL_LIMIT_NONE'),
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0],
['typeCat', -5],
['castTime', 0, '!']
@ -210,7 +204,6 @@ CLISetup::registerSetup("build", new class extends SetupScript
private function companions() : void
{
$condition = array(
Cfg::get('SQL_LIMIT_NONE'),
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0],
['typeCat', -6]
);
@ -246,11 +239,7 @@ CLISetup::registerSetup("build", new class extends SetupScript
private function factions() : void
{
$condition = array(
Cfg::get('SQL_LIMIT_NONE'),
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]
);
$factionz = new FactionList($condition);
$factionz = new FactionList(array([['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0]));
foreach (CLISetup::$locales as $loc)
{
@ -279,7 +268,6 @@ CLISetup::registerSetup("build", new class extends SetupScript
);
$baseCnd = array(
Cfg::get('SQL_LIMIT_NONE'),
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0],
// Inscryption Engineering
['effect1Id', [SPELL_EFFECT_APPLY_AURA, SPELL_EFFECT_TRADE_SKILL, SPELL_EFFECT_PROSPECTING, SPELL_EFFECT_OPEN_LOCK, SPELL_EFFECT_MILLING, SPELL_EFFECT_DISENCHANT, SPELL_EFFECT_SUMMON, SPELL_EFFECT_SKINNING], '!'],
@ -340,7 +328,6 @@ CLISetup::registerSetup("build", new class extends SetupScript
private function achievements() : void
{
$condition = array(
Cfg::get('SQL_LIMIT_NONE'),
[['cuFlags', CUSTOM_EXCLUDE_FOR_LISTVIEW, '&'], 0],
[['flags', 1, '&'], 0], // no statistics
);

View file

@ -49,12 +49,12 @@ CLISetup::registerSetup("build", new class extends SetupScript
// my neighbour is noisy as fuck and my head hurts, so ..
$this->petFamIcons = ['Ability_Druid_KingoftheJungle', 'Ability_Druid_DemoralizingRoar', 'Ability_EyeOfTheOwl']; // .. i've no idea where to fetch these from
$this->spellMods = (new SpellList(array(['typeCat', -2], Cfg::get('SQL_LIMIT_NONE'))))->getProfilerMods();
$this->spellMods = (new SpellList(array(['typeCat', -2])))->getProfilerMods();
$petIcons = Util::toJSON(DB::Aowow()->SelectCol('SELECT `id` AS ARRAY_KEY, LOWER(SUBSTRING_INDEX(`iconString`, "\\\\", -1)) AS "iconString" FROM dbc_creaturefamily WHERE `petTalentType` IN (0, 1, 2)'));
$tSpellIds = DB::Aowow()->selectCol('SELECT `rank1` FROM dbc_talent UNION SELECT `rank2` FROM dbc_talent UNION SELECT `rank3` FROM dbc_talent UNION SELECT `rank4` FROM dbc_talent UNION SELECT `rank5` FROM dbc_talent');
$this->tSpells = new SpellList(array(['s.id', $tSpellIds], Cfg::get('SQL_LIMIT_NONE')));
$this->tSpells = new SpellList(array(['s.id', $tSpellIds]));
foreach (CLISetup::$locales as $loc)
{