mirror of
https://github.com/Sarjuuk/aowow.git
synced 2025-11-29 15:58:16 +08:00
Setup/Update
* reapply flags for community content when rebuilding DB fixes associated filters and meta page 'missing screenshots'
This commit is contained in:
@@ -84,6 +84,21 @@ abstract class SetupScript
|
||||
{
|
||||
return $this->command;
|
||||
}
|
||||
|
||||
protected function reapplyCCFlags(string $tbl, int $type) : void
|
||||
{
|
||||
// reaply flags for community content as these are lost when the table is rebuild
|
||||
|
||||
if (preg_match('/[^a-z]/i', $tbl))
|
||||
{
|
||||
trigger_error('SetupScript::reapplyCCFlags() - invalid table name');
|
||||
return;
|
||||
}
|
||||
|
||||
DB::Aowow()->query('UPDATE ?_'.$tbl.' x, ?_comments y SET x.`cuFlags` = x.`cuFlags` | ?d WHERE x.`id` = y.`typeId` AND y.`type` = ?d AND y.`flags` & ?d', CUSTOM_HAS_COMMENT, $type, CC_FLAG_APPROVED);
|
||||
DB::Aowow()->query('UPDATE ?_'.$tbl.' x, ?_screenshots y SET x.`cuFlags` = x.`cuFlags` | ?d WHERE x.`id` = y.`typeId` AND y.`type` = ?d AND y.`status` & ?d', CUSTOM_HAS_SCREENSHOT, $type, CC_FLAG_APPROVED);
|
||||
DB::Aowow()->query('UPDATE ?_'.$tbl.' x, ?_videos y SET x.`cuFlags` = x.`cuFlags` | ?d WHERE x.`id` = y.`typeId` AND y.`type` = ?d AND y.`status` & ?d', CUSTOM_HAS_VIDEO, $type, CC_FLAG_APPROVED);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -123,6 +123,8 @@ SqlGen::register(new class extends SetupScript
|
||||
if ($criteria = DB::World()->selectCol('SELECT entry FROM disables WHERE sourceType = 4'))
|
||||
DB::Aowow()->query('UPDATE aowow_achievement a JOIN aowow_achievementcriteria ac ON a.id = ac.refAchievementId SET a.cuFlags = ?d WHERE ac.id IN (?a)', CUSTOM_DISABLED, $criteria);
|
||||
|
||||
$this->reapplyCCFlags('achievement', TYPE_ACHIEVEMENT);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -80,6 +80,8 @@ SqlGen::register(new class extends SetupScript
|
||||
foreach ($addData as $id => $ad)
|
||||
DB::Aowow()->query('UPDATE ?_areatrigger SET ?a WHERE id = ?d', $ad, $id);
|
||||
|
||||
$this->reapplyCCFlags('areatrigger', TYPE_AREATRIGGER);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -37,6 +37,8 @@ SqlGen::register(new class extends SetupScript
|
||||
foreach ($classes as $cl)
|
||||
DB::Aowow()->query('REPLACE INTO ?_classes (?#) VALUES (?a)', array_keys($cl), array_values($cl));
|
||||
|
||||
$this->reapplyCCFlags('classes', TYPE_CLASS);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -182,6 +182,8 @@ SqlGen::register(new class extends SetupScript
|
||||
// apply cuFlag: exCludeFromListview [for nameparts indicating internal usage]
|
||||
DB::Aowow()->query('UPDATE ?_creature SET cuFlags = cuFlags | ?d WHERE name_loc0 LIKE "%[%" OR name_loc0 LIKE "%(%" OR name_loc0 LIKE "%visual%" OR name_loc0 LIKE "%trigger%" OR name_loc0 LIKE "%credit%" OR name_loc0 LIKE "%marker%"', CUSTOM_EXCLUDE_FOR_LISTVIEW);
|
||||
|
||||
$this->reapplyCCFlags('creature', TYPE_NPC);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -75,6 +75,8 @@ SqlGen::register(new class extends SetupScript
|
||||
c.itemId = ?d
|
||||
', $iconId, $itemId);
|
||||
|
||||
$this->reapplyCCFlags('currencies', TYPE_CURRENCY);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -95,6 +95,8 @@ SqlGen::register(new class extends SetupScript
|
||||
}
|
||||
}
|
||||
|
||||
$this->reapplyCCFlags('emotes', TYPE_EMOTE);
|
||||
|
||||
return $allOK;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -42,6 +42,8 @@ SqlGen::register(new class extends SetupScript
|
||||
foreach ($events as $e)
|
||||
DB::Aowow()->query('REPLACE INTO ?_events VALUES (?a)', array_values($e));
|
||||
|
||||
$this->reapplyCCFlags('events', TYPE_WORLDEVENT);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -96,6 +96,8 @@ SqlGen::register(new class extends SetupScript
|
||||
foreach ($pairs as $p)
|
||||
DB::Aowow()->query($recursiveUpdateQuery, $p[0], $p[1], $p[0]);
|
||||
|
||||
$this->reapplyCCFlags('factions', TYPE_FACTION);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -34,6 +34,8 @@ SqlGen::register(new class extends SetupScript
|
||||
|
||||
DB::Aowow()->query($baseQuery);
|
||||
|
||||
$this->reapplyCCFlags('icons', TYPE_ICON);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -34,6 +34,8 @@ SqlGen::register(new class extends SetupScript
|
||||
DB::Aowow()->query('UPDATE ?_itemenchantment SET cuFlags = ?d WHERE type1 = 0 AND type2 = 0 AND type3 = 0', CUSTOM_EXCLUDE_FOR_LISTVIEW);
|
||||
DB::Aowow()->query('UPDATE ?_itemenchantment SET cuFlags = ?d WHERE name_loc0 LIKE "%test%"', CUSTOM_EXCLUDE_FOR_LISTVIEW);
|
||||
|
||||
$this->reapplyCCFlags('itemenchantment', TYPE_ENCHANTMENT);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -243,6 +243,8 @@ SqlGen::register(new class extends SetupScript
|
||||
WHERE
|
||||
durability > 0 AND ((classBak = 4 AND subClassBak IN (1, 2, 3, 4, 6)) OR (classBak = 2 AND subClassBak <> 9))');
|
||||
|
||||
$this->reapplyCCFlags('items', TYPE_ITEM);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -318,6 +318,8 @@ SqlGen::register(new class extends SetupScript
|
||||
}
|
||||
}
|
||||
|
||||
$this->reapplyCCFlags('itemset', TYPE_ITEMSET);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -120,6 +120,8 @@ SqlGen::register(new class extends SetupScript
|
||||
// apply typeCat and reqSkill depending on locks
|
||||
DB::Aowow()->query($updateQuery, $ids ?: DBSIMPLE_SKIP);
|
||||
|
||||
$this->reapplyCCFlags('objects', TYPE_OBJECT);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -119,6 +119,8 @@ SqlGen::register(new class extends SetupScript
|
||||
foreach ($res as $pId => $row)
|
||||
DB::Aowow()->query('UPDATE ?_pet SET ?a WHERE id = ?d', $row, $pId);
|
||||
|
||||
$this->reapplyCCFlags('pet', TYPE_PET);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -260,6 +260,8 @@ SqlGen::register(new class extends SetupScript
|
||||
// dungeon quests to Misc/Dungeon Finder
|
||||
DB::Aowow()->query('UPDATE ?_quests SET zoneOrSort = ?d WHERE (specialFlags & ?d OR id IN (?a)){ AND id IN (?a)}', -1010, QUEST_FLAG_SPECIAL_DUNGEON_FINDER, [24789, 24791, 24923], $ids ?: DBSIMPLE_SKIP);
|
||||
|
||||
$this->reapplyCCFlags('quests', TYPE_QUEST);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -37,6 +37,8 @@ SqlGen::register(new class extends SetupScript
|
||||
// add cuFlags
|
||||
DB::Aowow()->query('UPDATE ?_races SET cuFlags = ?d WHERE flags & ?d', CUSTOM_EXCLUDE_FOR_LISTVIEW, 0x1);
|
||||
|
||||
$this->reapplyCCFlags('races', TYPE_RACE);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -58,6 +58,8 @@ SqlGen::register(new class extends SetupScript
|
||||
DB::Aowow()->query('UPDATE ?_skillline sl, ?_icons ic SET sl.iconId = ic.id WHERE ic.name = ? AND sl.id = ?d', 'inv_misc_pelt_wolf_01', 393);
|
||||
DB::Aowow()->query('UPDATE ?_skillline sl, ?_icons ic SET sl.iconId = ic.id WHERE ic.name = ? AND sl.id = ?d', 'inv_misc_key_03', 633);
|
||||
|
||||
$this->reapplyCCFlags('skillline', TYPE_SKILL);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -422,6 +422,8 @@ SqlGen::register(new class extends SetupScript
|
||||
subClassMask = subClassMask | (1 << isc.subClass)
|
||||
');
|
||||
|
||||
$this->reapplyCCFlags('sounds', TYPE_SOUND);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -726,6 +726,8 @@ SqlGen::register(new class extends SetupScript
|
||||
// hide unused glyphs
|
||||
DB::Aowow()->query('UPDATE ?_spell SET skillLine1 = 0, iconIdAlt = 0, cuFlags = cuFlags | ?d WHERE id IN (?a)', CUSTOM_EXCLUDE_FOR_LISTVIEW, [60460, 58166, 58239, 58240, 58261, 58262, 54910]);
|
||||
|
||||
$this->reapplyCCFlags('spell', TYPE_SPELL);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -94,6 +94,8 @@ SqlGen::register(new class extends SetupScript
|
||||
DB::Aowow()->query('UPDATE ?_titles SET side = 2 WHERE id <= 28 OR id IN (118, 119, 116, 117, 110, 127)');
|
||||
DB::Aowow()->query('UPDATE ?_titles SET side = 1 WHERE id <= 14 OR id IN (111, 115, 112, 114, 126)');
|
||||
|
||||
$this->reapplyCCFlags('titles', TYPE_TITLE);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -217,6 +217,8 @@ SqlGen::register(new class extends SetupScript
|
||||
DB::Aowow()->query('UPDATE ?_zones SET ?a WHERE mapId = ?d', $update, $mapId);
|
||||
}
|
||||
|
||||
$this->reapplyCCFlags('zones', TYPE_ZONE);
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user