Skip to content
Permalink
Browse files

Profiler/Prep:

 * misc changes from profiler branch. No real changes on its own
  • Loading branch information...
Sarjuuk committed Mar 22, 2018
1 parent 5abb3f7 commit 3303722bc75abbeaccec8c291e75280ca739b062
0 aowow 100644 → 100755
No changes.
@@ -53,20 +53,39 @@ public function getContentType()
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;
}
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);
}
}
?>
@@ -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 @@ protected function handleWeightscales()
$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 @@ protected function handleWeightscales()
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;
}
@@ -60,7 +60,7 @@ protected function handleData()
// &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 @@ protected function handleData()
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 @@ protected function handleData()
case 'talents':
if ($_ = $this->_get['class'])
$set .= "-".$_;
case 'achievements':
case 'pet-talents':
case 'glyphs':
case 'gems':
@@ -113,12 +114,12 @@ protected function handleData()
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 @@ private function loadProfilerData($file, $catg = 'null')
}
?>
?>
@@ -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 @@ public static function itemModByRatingMask($mask)
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])
@@ -133,7 +133,7 @@ protected function generateContent()
$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()),
@@ -32,7 +32,6 @@ protected function generateCacheKey($withStaff = true)
return implode('_', $key);
}
protected function applyCCErrors()
{
if (!empty($_SESSION['error']['co']))
@@ -253,7 +252,7 @@ private function isValidPage() // has a valid combinati
/* 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 @@ private function addAnnouncements() // get announcements and
'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]'
);
}
@@ -21,11 +21,6 @@
]
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 @@ private function _searchSound($cndBase) // 27 Sounds $searchMask
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
}
?>

0 comments on commit 3303722

Please sign in to comment.
You can’t perform that action at this time.