From 3303722bc75abbeaccec8c291e75280ca739b062 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Thu, 22 Mar 2018 13:59:30 +0100 Subject: [PATCH] Profiler/Prep: * misc changes from profiler branch. No real changes on its own --- aowow | 0 includes/ajaxHandler.class.php | 23 ++++++- includes/ajaxHandler/account.class.php | 8 +-- includes/ajaxHandler/data.class.php | 11 ++-- includes/game.php | 6 +- pages/class.php | 2 +- pages/genericPage.class.php | 7 +-- pages/search.php | 10 --- pages/spell.php | 73 ++++++++++++---------- pages/spells.php | 6 +- setup/tools/filegen/weightPresets.func.php | 9 ++- setup/tools/sqlgen/talents.func.php | 23 +++++-- template/pages/admin/siteconfig.tpl.php | 2 +- 13 files changed, 107 insertions(+), 73 deletions(-) mode change 100644 => 100755 aowow diff --git a/aowow b/aowow old mode 100644 new mode 100755 diff --git a/includes/ajaxHandler.class.php b/includes/ajaxHandler.class.php index bdb22581..2387c506 100644 --- a/includes/ajaxHandler.class.php +++ b/includes/ajaxHandler.class.php @@ -53,10 +53,15 @@ class AjaxHandler return $this->contentType; } + protected function checkEmptySet($val) + { + return $val === ''; // parameter is expected to be empty + } + protected function checkLocale($val) { if (preg_match('/^'.implode('|', array_keys(array_filter(Util::$localeStrings))).'$/', $val)) - return intVal($val); + return intval($val); return null; } @@ -64,9 +69,23 @@ class AjaxHandler protected function checkInt($val) { if (preg_match('/^-?\d+$/', $val)) - return intVal($val); + return intval($val); return null; } + + protected function checkIdList($val) + { + if (preg_match('/^-?\d+(,-?\d+)*$/', $val)) + return array_map('intval', explode(',', $val)); + + return null; + } + + protected function checkFulltext($val) + { + // trim non-printable chars + return preg_replace('/[\p{C}]/ui', '', $val); + } } ?> diff --git a/includes/ajaxHandler/account.class.php b/includes/ajaxHandler/account.class.php index 13e05e11..1bc47257 100644 --- a/includes/ajaxHandler/account.class.php +++ b/includes/ajaxHandler/account.class.php @@ -10,7 +10,7 @@ class AjaxAccount extends AjaxHandler // 'groups' => [FILTER_CALLBACK, ['options' => 'AjaxHandler::checkInt']], 'save' => [FILTER_SANITIZE_NUMBER_INT, null], 'delete' => [FILTER_SANITIZE_NUMBER_INT, null], - 'id' => [FILTER_CALLBACK, ['options' => 'AjaxHandler::checkInt']], + 'id' => [FILTER_CALLBACK, ['options' => 'AjaxHandler::checkIdList']], 'name' => [FILTER_CALLBACK, ['options' => 'AjaxAccount::checkName']], 'scale' => [FILTER_CALLBACK, ['options' => 'AjaxAccount::checkScale']], ); @@ -52,7 +52,7 @@ class AjaxAccount extends AjaxHandler $id = 0; - if ($id = $this->_post['id']) + if ($this->_post['id'] && ($id = $this->_post['id'][0])) { if (!DB::Aowow()->selectCell('SELECT 1 FROM ?_account_weightscales WHERE userId = ?d AND id = ?d', User::$id, $id)) return 0; @@ -81,8 +81,8 @@ class AjaxAccount extends AjaxHandler return $id; } - else if ($this->_post['delete'] && $this->_post['id']) - DB::Aowow()->query('DELETE FROM ?_account_weightscales WHERE id = ?d AND userId = ?d', $this->_post['id'], User::$id); + else if ($this->_post['delete'] && $this->_post['id'] && $this->_post['id'][0]) + DB::Aowow()->query('DELETE FROM ?_account_weightscales WHERE id = ?d AND userId = ?d', $this->_post['id'][0], User::$id); else return 0; } diff --git a/includes/ajaxHandler/data.class.php b/includes/ajaxHandler/data.class.php index 8c977ea2..cd1c666d 100644 --- a/includes/ajaxHandler/data.class.php +++ b/includes/ajaxHandler/data.class.php @@ -60,7 +60,7 @@ class AjaxData extends AjaxHandler // &partial: im not doing this right // it expects a full quest dump on first lookup but will query subCats again if clicked..? // for now omiting the detail clicks with empty results and just set catg update - $catg = $this->_get['catg'] ?: 'null'; + $catg = isset($this->_get['catg']) ? $this->_get['catg'] : 'null'; if ($catg == 'null') $result .= $this->loadProfilerData($set); else if ($this->_get['callback']) @@ -79,7 +79,7 @@ class AjaxData extends AjaxHandler break; // locale independant - case 'quick-excludes': // generated per character in profiler + case 'quick-excludes': case 'zones': case 'weight-presets': case 'item-scaling': @@ -94,6 +94,7 @@ class AjaxData extends AjaxHandler case 'talents': if ($_ = $this->_get['class']) $set .= "-".$_; + case 'achievements': case 'pet-talents': case 'glyphs': case 'gems': @@ -113,12 +114,12 @@ class AjaxData extends AjaxHandler return $result; } - private function checkSkill($val) + protected function checkSkill($val) { return array_intersect([171, 164, 333, 202, 182, 773, 755, 165, 186, 393, 197, 185, 129, 356], explode(',', $val)); } - private function checkCallback($val) + protected function checkCallback($val) { return substr($val, 0, 29) == '$WowheadProfiler.loadOnDemand'; } @@ -135,4 +136,4 @@ class AjaxData extends AjaxHandler } -?> \ No newline at end of file +?> diff --git a/includes/game.php b/includes/game.php index e48d041b..07ef3279 100644 --- a/includes/game.php +++ b/includes/game.php @@ -97,6 +97,7 @@ class Game 'meta', 'red', 'yellow', 'blue' ); + // 'replicates' $WH.g_statToJson public static $itemMods = array( // zero-indexed; "mastrtng": unused mastery; _[a-z] => taken mods.. 'dmg', 'mana', 'health', 'agi', 'str', 'int', 'spi', 'sta', 'energy', 'rage', 'focus', 'runicpwr', 'defrtng', 'dodgertng', @@ -119,9 +120,12 @@ class Game if (($mask & 0x1C000) == 0x1C000) // special case resilience return ITEM_MOD_RESILIENCE_RATING; - if (($mask & 0x00E0) == 0x00E0) // special case hit rating + if (($mask & 0x00E0) == 0x00E0) // hit rating - all subcats (mle, rgd, spl) return ITEM_MOD_HIT_RATING; + if (($mask & 0x0700) == 0x0700) // crit rating - all subcats (mle, rgd, spl) + return ITEM_MOD_CRIT_RATING; + for ($j = 0; $j < count(self::$combatRatingToItemMod); $j++) { if (!self::$combatRatingToItemMod[$j]) diff --git a/pages/class.php b/pages/class.php index 16f858be..a890119b 100644 --- a/pages/class.php +++ b/pages/class.php @@ -133,7 +133,7 @@ class ClassPage extends GenericPage $genSpells = new SpellList($conditions); if (!$genSpells->error) { - $this->extendGlobalData($genSpells->getJSGlobals(GLOBALINFO_SELF)); + $this->extendGlobalData($genSpells->getJSGlobals(GLOBALINFO_SELF | GLOBALINFO_RELATED)); $this->lvTabs[] = ['spell', array( 'data' => array_values($genSpells->getListviewData()), diff --git a/pages/genericPage.class.php b/pages/genericPage.class.php index 623df6a9..3b5cf2ad 100644 --- a/pages/genericPage.class.php +++ b/pages/genericPage.class.php @@ -32,7 +32,6 @@ trait DetailPage return implode('_', $key); } - protected function applyCCErrors() { if (!empty($_SESSION['error']['co'])) @@ -253,7 +252,7 @@ class GenericPage /* Prepare Page */ /****************/ - private function prepareContent() // get from cache ?: run generators + protected function prepareContent() // get from cache ?: run generators { if (!$this->loadCache()) { @@ -415,8 +414,8 @@ class GenericPage 'mode' => 1, 'status' => 1, 'name' => 'internal error', - 'style' => 'padding-left: 40px; background-image: url('.STATIC_URL.'/images/announcements/warn-small.png); background-size: 15px 15px; background-position: 12px center; border: dashed 2px #C03030;', - 'text' => '[span id=inputbox-error]'.implode("[br]", $_).'[/span]', + 'style' => 'color: #ff3333; font-weight: bold; font-size: 14px; padding-left: 40px; background-image: url('.STATIC_URL.'/images/announcements/warn-small.png); background-size: 15px 15px; background-position: 12px center; border: dashed 2px #C03030;', + 'text' => '[span]'.implode("[br]", $_).'[/span]' ); } diff --git a/pages/search.php b/pages/search.php index 24ea3bd1..54108eb1 100644 --- a/pages/search.php +++ b/pages/search.php @@ -21,11 +21,6 @@ if (!defined('AOWOW_REVISION')) ] else => listviews - -todo 26: Listview - template: 'profile', id: 'characters', name: LANG.tab_characters, visibleCols: ['race','classs','level','talents','gearscore','achievementpoints'], - 27: Profiles..? - 28: Guilds..? - 29: Arena Teams..? */ @@ -1379,11 +1374,6 @@ class SearchPage extends GenericPage return false; } - - - // private function _searchCharacter($cndBase) { } // 28 Characters $searchMask & 0x10000000 - // private function _searchGuild($cndBase) { } // 29 Guilds $searchMask & 0x20000000 - // private function _searchArenaTeam($cndBase) { } // 30 Arena Teams $searchMask & 0x40000000 } ?> diff --git a/pages/spell.php b/pages/spell.php index e6fe0a74..486592fe 100644 --- a/pages/spell.php +++ b/pages/spell.php @@ -1466,7 +1466,7 @@ class SpellPage extends GenericPage $subClass = $this->subject->getField('equippedItemSubClassMask'); $invType = $this->subject->getField('equippedItemInventoryTypeMask'); - if ($class <= 0 || $subClass <= 0) + if ($class <= 0) return; $title = ['Class: '.$class, 'SubClass: '.Util::asHex($subClass)]; @@ -1478,13 +1478,13 @@ class SpellPage extends GenericPage if ($invType & (1 << INVTYPE_ROBE)) // Robe => Chest { $invType &= ~(1 << INVTYPE_ROBE); - $invType &= (1 << INVTYPE_CHEST); + $invType |= (1 << INVTYPE_CHEST); } if ($invType & (1 << INVTYPE_RANGEDRIGHT)) // Ranged2 => Ranged { $invType &= ~(1 << INVTYPE_RANGEDRIGHT); - $invType &= (1 << INVTYPE_RANGED); + $invType |= (1 << INVTYPE_RANGED); } $_ = []; @@ -1539,6 +1539,7 @@ class SpellPage extends GenericPage $effId = (int)$this->subject->getField('effect'.$i.'Id'); $effMV = (int)$this->subject->getField('effect'.$i.'MiscValue'); + $effMVB = (int)$this->subject->getField('effect'.$i.'MiscValueB'); $effBP = (int)$this->subject->getField('effect'.$i.'BasePoints'); $effDS = (int)$this->subject->getField('effect'.$i.'DieSides'); $effRPPL = $this->subject->getField('effect'.$i.'RealPointsPerLevel'); @@ -1642,7 +1643,7 @@ class SpellPage extends GenericPage case 137: // Energize Pct $_ = Lang::spell('powerTypes', $effMV); if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); + $_ = sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_); else if (!$_) $_ = $effMV; @@ -1672,7 +1673,7 @@ class SpellPage extends GenericPage case 33: // Open Lock $_ = $effMV ? Lang::spell('lockType', $effMV) : $effMV; if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); + $_ = sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_); else if (!$_) $_ = $effMV; @@ -1691,7 +1692,7 @@ class SpellPage extends GenericPage case 126: // Steal Aura $_ = Lang::game('dt', $effMV); if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); + $_ = sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_); else if (!$_) $_ = $effMV; @@ -1700,7 +1701,7 @@ class SpellPage extends GenericPage case 39: // Learn Language $_ = Lang::game('languages', $effMV); if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); + $_ = sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_); else if (!$_) $_ = $effMV; @@ -1743,7 +1744,7 @@ class SpellPage extends GenericPage default; $_ = ''; } if (User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); + $_ = sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_); else $_ = $effMV; @@ -1752,7 +1753,7 @@ class SpellPage extends GenericPage case 108: // Dispel Mechanic $_ = Lang::game('me', $effMV); if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); + $_ = sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_); else if (!$_) $_ = $effMV; @@ -1767,7 +1768,7 @@ class SpellPage extends GenericPage case 146: // Activate Rune $_ = Lang::spell('powerRunes', $effMV); if ($_ && User::isInGroup(U_GROUP_EMPLOYEE)) - $_ = sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_); + $_ = sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_); else if (!$_) $_ = $effMV; @@ -1816,12 +1817,12 @@ class SpellPage extends GenericPage { case 17: // Mod Stealth Detection if ($_ = Lang::spell('stealthType', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; break; case 19: // Mod Invisibility Detection if ($_ = Lang::spell('invisibilityType', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; break; case 24: // Periodic Energize @@ -1830,7 +1831,7 @@ class SpellPage extends GenericPage case 85: // Mod Power Regeneration case 110: // Mod Power Regeneration Pct if ($_ = Lang::spell('powerTypes', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; break; case 29: // Mod Stat @@ -1847,7 +1848,7 @@ class SpellPage extends GenericPage $_[] = Lang::game('stats', $j); if ($_ = implode(', ', $_)); - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; break; case 36: // Shapeshift @@ -1862,39 +1863,39 @@ class SpellPage extends GenericPage $infobox[] = Lang::game('type').Lang::main('colon').Lang::game('ct', $st['creatureType']); if ($_ = $st['displayName']) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; } break; case 37: // Effect immunity if ($_ = Lang::spell('effects', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; break; case 38: // Aura immunity if ($_ = Lang::spell('auras', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; break; case 41: // Dispel Immunity case 178: // Mod Debuff Resistance case 245: // Mod Aura Duration By Dispel if ($_ = Lang::game('dt', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; break; case 44: // Track Creature if ($_ = Lang::game('ct', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; break; case 45: // Track Resource if ($_ = Lang::spell('lockType', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; break; case 75: // Language if ($_ = Lang::game('languages', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; break; case 77: // Mechanic Immunity @@ -1904,7 +1905,7 @@ class SpellPage extends GenericPage case 255: // Mod Mechanic Damage Taken Pct case 276: // Mod Mechanic Damage Done Percent if ($_ = Lang::game('me', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').Util::asHex($effMV), $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').Util::asHex($effMV), $_) : $_; break; case 147: // Mechanic Immunity Mask @@ -1914,7 +1915,7 @@ class SpellPage extends GenericPage $_[] = $str; if ($_ = implode(', ', $_)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').Util::asHex($effMV), $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').Util::asHex($effMV), $_) : $_; break; case 10: // Mod Threat @@ -1954,8 +1955,10 @@ class SpellPage extends GenericPage case 229: // Mod AoE Damage Avoidance case 271: // Mod Damage Percent Taken Form Caster case 310: // Mod Creature AoE Damage Avoidance + case 237: // Mod Spell Damage Of Attack Power + case 238: // Mod Spell Healing Of Attack Power if ($_ = Lang::getMagicSchools($effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').Util::asHex($effMV), $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').Util::asHex($effMV), $_) : $_; break; case 30: // Mod Skill @@ -1969,7 +1972,12 @@ class SpellPage extends GenericPage case 107: // Flat Modifier case 108: // Pct Modifier if ($_ = Lang::spell('spellModOp', $effMV)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$effMV, $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; + + break; + case 132: // Mod Increase Energy Percent + if ($_ = Lang::spell('powerTypes', $effMV)) + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').$effMV, $_) : $_; break; case 189: // Mod Rating @@ -1980,7 +1988,7 @@ class SpellPage extends GenericPage $_[] = $str; if ($_ = implode(', ', $_)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').Util::asHex($effMV), $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').Util::asHex($effMV), $_) : $_; break; case 168: // Mod Damage Done Versus @@ -1994,13 +2002,12 @@ class SpellPage extends GenericPage $_[] = $str; if ($_ = implode(', ', $_)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').Util::asHex($effMV), $_) : $_; + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValue'.Lang::main('colon').Util::asHex($effMV), $_) : $_; break; case 249: // Convert Rune - $x = $this->subject->getField('effect'.$i.'MiscValueB'); - if ($_ = Lang::spell('powerRunes', $x)) - $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, Lang::spell('_value').Lang::main('colon').$x, $_) : $_; + if ($_ = Lang::spell('powerRunes', $effMVB)) + $bar = User::isInGroup(U_GROUP_EMPLOYEE) ? sprintf(Util::$dfnString, 'MiscValueB'.Lang::main('colon').$effMVB, $_) : $_; break; case 78: // Mounted @@ -2040,9 +2047,9 @@ class SpellPage extends GenericPage $foo['name'] .= strstr($bar, 'href') || strstr($bar, '#') ? $bar : ($bar ? ' ('.$bar.')' : null); if (in_array($effAura, [174, 220, 182])) - $foo['name'] .= ' ['.sprintf(Util::$dfnString, Lang::game('stats', $this->subject->getField('effect'.$i.'MiscValueB')), $this->subject->getField('effect'.$i.'MiscValueB')).']'; - else if ($this->subject->getField('effect'.$i.'MiscValueB') > 0) - $foo['name'] .= ' ['.$this->subject->getField('effect'.$i.'MiscValueB').']'; + $foo['name'] .= ' ['.sprintf(Util::$dfnString, 'MiscValueB'.Lang::main('colon').$effMVB, Lang::game('stats', $effMVB)).']'; + else if ($effMVB > 0) + $foo['name'] .= ' ['.$effMVB.']'; } else if ($effAura > 0) diff --git a/pages/spells.php b/pages/spells.php index 9c080d34..241131fb 100644 --- a/pages/spells.php +++ b/pages/spells.php @@ -405,15 +405,15 @@ class SpellsPage extends GenericPage $hiddenCols[] = 'skill'; if (($mask & 0x4)) $visibleCols[] = 'trainingcost'; - if (($mask & 0x8) && !in_array('singleclass', $visibleCols)) + if (($mask & 0x8) && !in_array('classes', $visibleCols)) $visibleCols[] = 'singleclass'; if ($visibleCols) - $tabData['visibleCols'] = $visibleCols; + $tabData['visibleCols'] = array_unique($visibleCols); if ($hiddenCols) - $tabData['hiddenCols'] = $hiddenCols; + $tabData['hiddenCols'] = array_unique($hiddenCols); $this->lvTabs[] = ['spell', $tabData]; diff --git a/setup/tools/filegen/weightPresets.func.php b/setup/tools/filegen/weightPresets.func.php index ba8baded..0772967c 100644 --- a/setup/tools/filegen/weightPresets.func.php +++ b/setup/tools/filegen/weightPresets.func.php @@ -20,14 +20,13 @@ if (!CLI) foreach ($scales as $s) { - $weights = DB::Aowow()->selectCol('SELECT field AS ARRAY_KEY, val FROM ?_account_weightscale_data WHERE id = ?d', $s['id']); - if (!$weights) + if ($weights = DB::Aowow()->selectCol('SELECT field AS ARRAY_KEY, val FROM ?_account_weightscale_data WHERE id = ?d', $s['id'])) + $wtPresets[$s['class']]['pve'][$s['name']] = array_merge(['__icon' => $s['icon']], $weights); + else { CLISetup::log('WeightScale \''.CLISetup::bold($s['name']).'\' has no data set. Skipping...', CLISetup::LOG_WARN); - continue; + $wtPresets[$s['class']]['pve'][$s['name']] = ['__icon' => $s['icon']]; } - - $wtPresets[$s['class']]['pve'][$s['name']] = array_merge(['__icon' => $s['icon']], $weights); } $toFile = "var wt_presets = ".Util::toJSON($wtPresets).";"; diff --git a/setup/tools/sqlgen/talents.func.php b/setup/tools/sqlgen/talents.func.php index 6dbf5215..443b0c4c 100644 --- a/setup/tools/sqlgen/talents.func.php +++ b/setup/tools/sqlgen/talents.func.php @@ -15,10 +15,25 @@ function talents() { // class: 0 => hunter pets for ($i = 1; $i < 6; $i++) - DB::Aowow()->query( - 'REPLACE INTO ?_talents SELECT t.id, IF(tt.classMask <> 0, LOG(2, tt.classMask) + 1, 0), IF(tt.creaturefamilyMask <> 0, LOG(2, tt.creaturefamilyMask), tt.tabNumber), t.row, t.column, t.rank?d, ?d FROM dbc_talenttab tt JOIN dbc_talent t ON tt.id = t.tabId WHERE t.rank?d <> 0', - $i, $i, $i - ); + DB::Aowow()->query(' + REPLACE INTO + ?_talents + SELECT + t.id, + IF(tt.classMask <> 0, LOG(2, tt.classMask) + 1, 0), + tt.creatureFamilyMask, + IF(tt.creaturefamilyMask <> 0, LOG(2, tt.creaturefamilyMask), tt.tabNumber), + t.row, + t.column, + t.rank?d, + ?d + FROM + dbc_talenttab tt + JOIN + dbc_talent t ON tt.id = t.tabId + WHERE + t.rank?d <> 0 + ', $i, $i, $i); return true; } diff --git a/template/pages/admin/siteconfig.tpl.php b/template/pages/admin/siteconfig.tpl.php index 3046ca99..cdfb067d 100644 --- a/template/pages/admin/siteconfig.tpl.php +++ b/template/pages/admin/siteconfig.tpl.php @@ -185,7 +185,7 @@ } else if (node.tagName == 'INPUT') // string or numeric { - if (node.value && node.value.search(/[^\d\s\/\*\-\+\.]/i) == -1) + if (node.value && node.value.search(/[^\d\s\/\*\-\+\.]/i) == -1 && node.value.split('.').length < 3) node.value = eval(node.value); value = node.value;