diff --git a/datasets/weight-presets b/datasets/weight-presets deleted file mode 100644 index 9faeb6d1..00000000 --- a/datasets/weight-presets +++ /dev/null @@ -1,74 +0,0 @@ -var wt_presets = { - 1: { - pve: { - arms: {__icon:'ability_rogue_eviscerate'}, - fury: {__icon:'ability_warrior_innerrage',exprtng:100,str:82,critstrkrtng:66,agi:53,armorpenrtng:52,hitrtng:48,hastertng:36,atkpwr:31,armor:5}, - prot: {__icon:'ability_warrior_defensivestance',sta:100,dodgertng:90,defrtng:86,block:81,agi:67,parryrtng:67,blockrtng:48,str:48,exprtng:19,hitrtng:10,armorpenrtng:10,critstrkrtng:7,armor:6,hastertng:1,atkpwr:1} - } - }, - 2: { - pve: { - holy: {__icon:'spell_holy_holybolt',int:100,manargn:88,splpwr:58,critstrkrtng:46,hastertng:35}, - prot: {__icon:'ability_paladin_shieldofthetemplar',sta:100,dodgertng:94,block:86,defrtng:86,exprtng:79,agi:76,parryrtng:76,hitrtng:58,blockrtng:52,str:50,armor:6,atkpwr:6,splpwr:4,critstrkrtng:3}, - retrib: {__icon:'spell_holy_auraoflight',mledps:470,hitrtng:100,str:80,exprtng:66,critstrkrtng:40,atkpwr:34,agi:32,hastertng:30,armorpenrtng:22,splpwr:9} - } - }, - 3: { - pve: { - beast: {__icon:'ability_hunter_beasttaming',rgddps:213,hitrtng:100,agi:58,critstrkrtng:40,int:37,atkpwr:30,armorpenrtng:28,hastertng:21}, - marks: {__icon:'ability_marksmanship',rgddps:379,hitrtng:100,agi:74,critstrkrtng:57,armorpenrtng:40,int:39,atkpwr:32,hastertng:24}, - surv: {__icon:'ability_hunter_swiftstrike',rgddps:181,hitrtng:100,agi:76,critstrkrtng:42,int:35,hastertng:31,atkpwr:29,armorpenrtng:26} - } - }, - 4: { - pve: { - assas: {__icon:'ability_rogue_eviscerate',mledps:170,agi:100,exprtng:87,hitrtng:83,critstrkrtng:81,atkpwr:65,armorpenrtng:65,hastertng:64,str:55}, - combat: {__icon:'ability_backstab',mledps:220,armorpenrtng:100,agi:100,exprtng:82,hitrtng:80,critstrkrtng:75,hastertng:73,str:55,atkpwr:50}, - subtle: {__icon:'ability_stealth',mledps:228,exprtng:100,agi:100,hitrtng:80,armorpenrtng:75,critstrkrtng:75,hastertng:75,str:55,atkpwr:50} - } - }, - 5: { - pve: { - disc: {__icon:'spell_holy_wordfortitude',splpwr:100,manargn:67,int:65,hastertng:59,critstrkrtng:48,spi:22}, - holy: {__icon:'spell_holy_guardianspirit',manargn:100,int:69,splpwr:60,spi:52,critstrkrtng:38,hastertng:31}, - shadow: {__icon:'spell_shadow_shadowwordpain',hitrtng:100,shasplpwr:76,splpwr:76,critstrkrtng:54,hastertng:50,spi:16,int:16} - } - }, - 6: { - pve: { - blooddps: {__icon:'spell_deathknight_bloodpresence',mledps:360,armorpenrtng:100,str:99,hitrtng:91,exprtng:90,critstrkrtng:57,hastertng:55,atkpwr:36,armor:1}, - frostdps: {__icon:'spell_deathknight_frostpresence',mledps:337,hitrtng:100,str:97,exprtng:81,armorpenrtng:61,critstrkrtng:45,atkpwr:35,hastertng:28,armor:1}, - frosttank: {__icon:'spell_deathknight_frostpresence',mledps:419,parryrtng:100,hitrtng:97,str:96,defrtng:85,exprtng:69,dodgertng:61,agi:61,sta:61,critstrkrtng:49,atkpwr:41,armorpenrtng:31,armor:5}, - unholydps: {__icon:'spell_deathknight_unholypresence',mledps:209,str:100,hitrtng:66,exprtng:51,hastertng:48,critstrkrtng:45,atkpwr:34,armorpenrtng:32,armor:1} - } - }, - 7: { - pve: { - elem: {__icon:'spell_nature_lightning',hitrtng:100,splpwr:60,hastertng:56,critstrkrtng:40,int:11}, - enhance: {__icon:'spell_nature_lightningshield',mledps:135,hitrtng:100,exprtng:84,agi:55,int:55,critstrkrtng:55,hastertng:42,str:35,atkpwr:32,splpwr:29,armorpenrtng:26}, - resto: {__icon:'spell_nature_magicimmunity',manargn:100,int:85,splpwr:77,critstrkrtng:62,hastertng:35} - } - }, - 8: { - pve: { - arcane: {__icon:'spell_holy_magicalsentry',hitrtng:100,hastertng:54,arcsplpwr:49,splpwr:49,critstrkrtng:37,int:34,frosplpwr:24,firsplpwr:24,spi:14}, - fire: {__icon:'spell_fire_firebolt02',hitrtng:100,hastertng:53,firsplpwr:46,splpwr:46,critstrkrtng:43,frosplpwr:23,arcsplpwr:23,int:13}, - frost: {__icon:'spell_frost_frostbolt02',hitrtng:100,hastertng:42,frosplpwr:39,splpwr:39,arcsplpwr:19,firsplpwr:19,critstrkrtng:19,int:6} - } - }, - 9: { - pve: { - afflic: {__icon:'spell_shadow_deathcoil',hitrtng:100,shasplpwr:72,splpwr:72,hastertng:61,critstrkrtng:38,firsplpwr:36,spi:34,int:15}, - demo: {__icon:'spell_shadow_metamorphosis',hitrtng:100,hastertng:50,firsplpwr:45,shasplpwr:45,splpwr:45,critstrkrtng:31,spi:29,int:13}, - destro: {__icon:'spell_shadow_rainoffire',hitrtng:100,firsplpwr:47,splpwr:47,hastertng:46,spi:26,shasplpwr:23,critstrkrtng:16,int:13} - } - }, - 11: { - pve: { - balance: {__icon:'spell_nature_starfall',hitrtng:100,splpwr:66,hastertng:54,critstrkrtng:43,spi:22,int:22}, - feraltank: {__icon:'ability_racial_bearform',agi:100,sta:75,dodgertng:65,defrtng:60,exprtng:16,str:10,armor:10,hitrtng:8,hastertng:5,atkpwr:4,feratkpwr:4,critstrkrtng:3}, - resto: {__icon:'spell_nature_healingtouch',splpwr:100,manargn:73,hastertng:57,int:51,spi:32,critstrkrtng:11}, - feraldps: {__icon:'ability_druid_catform',agi:100,armorpenrtng:90,str:80,critstrkrtng:55,exprtng:50,hitrtng:50,feratkpwr:40,atkpwr:40,hastertng:35} - } - } -}; diff --git a/includes/ajaxHandler/account.class.php b/includes/ajaxHandler/account.class.php index cc8ac327..a71c20b9 100644 --- a/includes/ajaxHandler/account.class.php +++ b/includes/ajaxHandler/account.class.php @@ -50,19 +50,34 @@ protected function handleWeightscales() if (!$this->_post['scale']) return 0; - if (!$this->_post['id']) + $id = 0; + + if ($id = $this->_post['id']) { - $res = DB::Aowow()->selectRow('SELECT MAX(id) AS max, count(id) AS num FROM ?_account_weightscales WHERE userId = ?d', User::$id); - if ($res['num'] < 5) // more or less hard-defined in LANG.message_weightscalesaveerror - $this->_post['id'] = ++$res['max']; - else + if (!DB::Aowow()->selectCell('SELECT 1 FROM ?_account_weightscales WHERE userId = ?d AND id = ?d', User::$id, $id)) return 0; } - - if (DB::Aowow()->query('REPLACE INTO ?_account_weightscales VALUES (?d, ?d, ?, ?)', $this->_post['id'], User::$id, $this->_post['name'], $this->_post['scale'])) - return $this->_post['id']; else - return 0; + { + $nScales = DB::Aowow()->selectCell('SELECT COUNT(id) FROM ?_account_weightscales WHERE userId = ?d', User::$id); + if ($nScales >= 5) // more or less hard-defined in LANG.message_weightscalesaveerror + return 0; + + $id = DB::Aowow()->query('INSERT INTO ?_account_weightscales (`userId`, `name`) VALUES (?d, ?)', User::$id, $this->_post['name']); + } + + DB::Aowow()->query('DELETE FROM ?_account_weightscale_data WHERE id = ?d', $id); + + foreach (explode(',', $this->_post['scale']) as $s) + { + list($k, $v) = explode(':', $s); + if (!in_array($k, Util::$weightScales) || $v < 1) + continue; + + DB::Aowow()->query('INSERT INTO ?_account_weightscale_data VALUES (?d, ?, ?d)', $id, $k, $v); + } + + 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); @@ -77,4 +92,4 @@ protected function checkScale($val) return null; } -} \ No newline at end of file +} diff --git a/includes/ajaxHandler/admin.class.php b/includes/ajaxHandler/admin.class.php index 931d945f..1e77c350 100644 --- a/includes/ajaxHandler/admin.class.php +++ b/includes/ajaxHandler/admin.class.php @@ -5,7 +5,7 @@ class AjaxAdmin extends AjaxHandler { - protected $validParams = ['screenshots', 'siteconfig']; + protected $validParams = ['screenshots', 'siteconfig', 'weight-presets']; protected $_get = array( 'action' => [FILTER_SANITIZE_STRING, 0xC], // FILTER_FLAG_STRIP_LOW | *_HIGH 'id' => [FILTER_CALLBACK, ['options' => 'AjaxAdmin::checkId']], @@ -17,7 +17,10 @@ class AjaxAdmin extends AjaxHandler 'val' => [FILTER_UNSAFE_RAW, null] ); protected $_post = array( - 'alt' => [FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW], + 'alt' => [FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_LOW], + 'id' => [FILTER_SANITIZE_NUMBER_INT, null], + 'scale' => [FILTER_CALLBACK, ['options' => 'AjaxAccount::checkScale']], + '__icon' => [FILTER_CALLBACK, ['options' => 'AjaxAdmin::checkKey']], ); public function __construct(array $params) @@ -30,7 +33,7 @@ public function __construct(array $params) if ($this->params[0] == 'screenshots') { - if (!User::isInGroup(U_GROUP_STAFF | U_GROUP_SCREENSHOT)) // comment_mod, handleSSmod, vi_mod ? + if (!User::isInGroup(U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_SCREENSHOT)) return; if ($this->_get['action'] == 'list') @@ -60,6 +63,14 @@ public function __construct(array $params) else if ($this->_get['action'] == 'update') $this->handler = 'confUpdate'; } + else if ($this->params[0] == 'weight-presets') + { + if (!User::isInGroup(U_GROUP_DEV | U_GROUP_ADMIN | U_GROUP_BUREAU)) + return; + + if ($this->_get['action'] == 'save') + $this->handler = 'wtSave'; + } } // get all => null (optional) @@ -304,6 +315,74 @@ protected function confUpdate() return ''; } + protected function wtSave() + { + if (!$this->_post['id'] || !$this->_post['__icon']) + return 3; + + $writeFile = function($file, $content) + { + $success = false; + if ($handle = @fOpen($file, "w")) + { + if (fWrite($handle, $content)) + $success = true; + + fClose($handle); + } + else + die('me no file'); + + if ($success) + @chmod($file, Util::FILE_ACCESS); + + return $success; + }; + + + // save to db + + DB::Aowow()->query('DELETE FROM ?_account_weightscale_data WHERE id = ?d', $this->_post['id']); + DB::Aowow()->query('UPDATE ?_account_weightscales SET `icon`= ? WHERE `id` = ?d', $this->_post['__icon'], $this->_post['id']); + + foreach (explode(',', $this->_post['scale']) as $s) + { + list($k, $v) = explode(':', $s); + + if (!in_array($k, Util::$weightScales) || $v < 1) + continue; + + if (DB::Aowow()->query('INSERT INTO ?_account_weightscale_data VALUES (?d, ?, ?d)', $this->_post['id'], $k, $v) === null) + return 1; + } + + + // write dataset + + $wtPresets = []; + $scales = DB::Aowow()->select('SELECT id, name, icon, class FROM ?_account_weightscales WHERE userId = 0 ORDER BY class, id ASC'); + + 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) + continue; + + $wtPresets[$s['class']]['pve'][$s['name']] = array_merge(['__icon' => $s['icon']], $weights); + } + + $toFile = "var wt_presets = ".Util::toJSON($wtPresets).";"; + $file = 'datasets/weight-presets'; + + if (!$writeFile($file, $toFile)) + return 2; + + + // all done + + return 0; + } + protected function checkId($val) { // expecting id-list @@ -331,4 +410,12 @@ protected function checkUser($val) return null; } + + protected function checkScale($val) + { + if (preg_match('/^((\w+:\d+)(,\w+:\d+)*)$/', $val)) + return $val; + + return null; + } } diff --git a/includes/shared.php b/includes/shared.php index 3f4e3f49..b39e0115 100644 --- a/includes/shared.php +++ b/includes/shared.php @@ -1,6 +1,6 @@ select('SELECT * FROM ?_account_weightscales WHERE userId = ?d', self::$id); - foreach ($res as $i) - { - $set = array ( - 'name' => $i['name'], - 'id' => $i['id'] - ); + $res = DB::Aowow()->selectCol('SELECT id AS ARRAY_KEY, name FROM ?_account_weightscales WHERE userId = ?d', self::$id); + if (!$res) + return $result; - $weights = explode(',', $i['weights']); - foreach ($weights as $weight) - { - $w = explode(':', $weight); + $weights = DB::Aowow()->selectCol('SELECT id AS ARRAY_KEY, `field` AS ARRAY_KEY2, val FROM ?_account_weightscale_data WHERE id IN (?a)', array_keys($res)); + foreach ($weights as $id => $data) + $result[] = array_merge(['name' => $res[$id], 'id' => $id], $data); - if ($w[1] === 'undefined') - $w[1] = 0; - - $set[$w[0]] = $w[1]; - } - - $data[] = $set; - } - - return $data; + return $result; } public static function getCharacters() diff --git a/includes/utilities.php b/includes/utilities.php index b5cc06b7..6accecc6 100644 --- a/includes/utilities.php +++ b/includes/utilities.php @@ -174,6 +174,18 @@ class Util 'clothChestArmor', 'leatherChestArmor', 'mailChestArmor', 'plateChestArmor' ); + public static $weightScales = array( + 'agi', 'int', 'sta', 'spi', 'str', 'health', 'mana', 'healthrgn', 'manargn', + 'armor', 'blockrtng', 'block', 'defrtng', 'dodgertng', 'parryrtng', 'resirtng', + 'atkpwr', 'feratkpwr', 'armorpenrtng', 'critstrkrtng', 'exprtng', 'hastertng', 'hitrtng', 'splpen', + 'splpwr', 'arcsplpwr', 'firsplpwr', 'frosplpwr', 'holsplpwr', 'natsplpwr', 'shasplpwr', + 'dmg', 'mledps', 'rgddps', 'mledmgmin', 'rgddmgmin', 'mledmgmax', 'rgddmgmax', 'mlespeed', 'rgdspeed', + 'arcres', 'firres', 'frores', 'holres', 'natres', 'shares', + 'mleatkpwr', 'mlecritstrkrtng', 'mlehastertng', 'mlehitrtng', 'rgdatkpwr', 'rgdcritstrkrtng', 'rgdhastertng', 'rgdhitrtng', + 'splcritstrkrtng', 'splhastertng', 'splhitrtng', 'spldmg', 'splheal', + 'nsockets' + ); + public static $dateFormatInternal = "Y/m/d H:i:s"; public static $changeLevelString = '%s'; @@ -1573,7 +1585,7 @@ public static function toJSON($data, $forceFlags = 0) { $flags = $forceFlags ?: (JSON_NUMERIC_CHECK | JSON_UNESCAPED_UNICODE); - if (CFG_DEBUG) + if (CFG_DEBUG && !$forceFlags) $flags |= JSON_PRETTY_PRINT; $json = json_encode($data, $flags); diff --git a/pages/admin.php b/pages/admin.php index b9b68481..dbec15c9 100644 --- a/pages/admin.php +++ b/pages/admin.php @@ -20,7 +20,7 @@ public function __construct($pageCall, $pageParam) switch ($pageParam) { case 'screenshots': - $this->reqUGroup = U_GROUP_STAFF | U_GROUP_SCREENSHOT; + $this->reqUGroup = U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_SCREENSHOT; $this->generator = 'handleScreenshots'; $this->tpl = 'admin/screenshots'; @@ -38,11 +38,19 @@ public function __construct($pageCall, $pageParam) case 'siteconfig': $this->reqUGroup = U_GROUP_ADMIN | U_GROUP_DEV; $this->generator = 'handleConfig'; - $this->tpl = 'list-page-generic'; + $this->tpl = 'admin/siteconfig'; array_push($this->path, 2, 18); $this->name = 'Site Configuration'; break; + case 'weight-presets': + $this->reqUGroup = U_GROUP_ADMIN | U_GROUP_DEV | U_GROUP_BUREAU; + $this->generator = 'handleWeightPresets'; + $this->tpl = 'admin/weight-presets'; + + array_push($this->path, 2, 16); + $this->name = 'Weight Presets'; + break; default: // error out through unset template } @@ -69,275 +77,6 @@ private function handleConfig() ['string' => '.grid .status { position:absolute; right:5px; }'], )); - // well .. fuck! - ob_start(); -?> - -extraHTML = ob_get_contents(); - ob_end_clean(); - // eof (end of fuckup) - $head = ''; $mainTab = []; $miscTab = []; @@ -479,6 +218,33 @@ private function handleScreenshots() $this->ssNFound = $nMatches; // ssm_numPagesFound } + private function handleWeightPresets() + { + $this->addCSS(['string' => '.wt-edit {display:inline-block; vertical-align:top; width:350px;}']); + $this->addJS('filters.js'); + + $head = $body = ''; + + $scales = DB::Aowow()->select('SELECT class AS ARRAY_KEY, id AS ARRAY_KEY2, name, icon FROM ?_account_weightscales WHERE userId = 0'); + $weights = DB::Aowow()->selectCol('SELECT awd.id AS ARRAY_KEY, awd.field AS ARRAY_KEY2, awd.val FROM ?_account_weightscale_data awd JOIN ?_account_weightscales ad ON awd.id = ad.id WHERE ad.userId = 0'); + foreach ($scales as $cl => $data) + { + $ul = ''; + foreach ($data as $id => $s) + { + $weights[$id]['__icon'] = $s['icon']; + $ul .= '[url=# onclick="loadScale.bind(this, '.$id.')();"]'.$s['name'].'[/url][br]'; + } + + $head .= '[td=header]'.Lang::game('cl', $cl).'[/td]'; + $body .= '[td valign=top]'.$ul.'[/td]'; + } + + $this->extraText = '[table class=grid][tr]'.$head.'[/tr][tr]'.$body.'[/tr][/table]'; + + $this->extraHTML = '\n\n"; + } + private function configAddRow($r) { $buff = ''; diff --git a/setup/db_structure.sql b/setup/db_structure.sql index d753b72c..8c105b18 100644 --- a/setup/db_structure.sql +++ b/setup/db_structure.sql @@ -136,11 +136,28 @@ CREATE TABLE `aowow_account_weightscales` ( `id` int(32) NOT NULL AUTO_INCREMENT, `userId` int(10) unsigned NOT NULL, `name` varchar(32) NOT NULL, - `weights` text NOT NULL, + `class` tinyint(3) unsigned NOT NULL DEFAULT '0', + `icon` varchar(48) NOT NULL DEFAULT '', PRIMARY KEY (`id`,`userId`), KEY `FK_acc_weights` (`userId`), CONSTRAINT `FK_acc_weights` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE -) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `aowow_account_weightscale_data` +-- + +DROP TABLE IF EXISTS `aowow_account_weightscale_data`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `aowow_account_weightscale_data` ( + `id` int(32) NOT NULL, + `field` varchar(15) NOT NULL, + `val` smallint(6) unsigned NOT NULL, + KEY `id` (`id`), + CONSTRAINT `FK_acc_weightscales` FOREIGN KEY (`id`) REFERENCES `aowow_account_weightscales` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -335,26 +352,28 @@ DROP TABLE IF EXISTS `aowow_comments`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `aowow_comments` ( - `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Comment ID', + `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Comment ID', `type` smallint(5) unsigned NOT NULL COMMENT 'Type of Page', `typeId` mediumint(9) NOT NULL COMMENT 'ID Of Page', - `userId` int(10) unsigned NOT NULL COMMENT 'User ID', + `userId` int(10) unsigned NULL DEFAULT NULL COMMENT 'User ID', `roles` smallint(5) unsigned NOT NULL, `body` text NOT NULL COMMENT 'Comment text', `date` int(11) NOT NULL COMMENT 'Comment timestap', `flags` smallint(6) NOT NULL DEFAULT '0' COMMENT 'deleted, outofdate, sticky', - `replyTo` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Reply To, comment ID', + `replyTo` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Reply To, comment ID', `editUserId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Last Edit User ID', `editDate` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Last Edit Time', `editCount` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT 'Count Of Edits', `deleteUserId` int(10) unsigned NOT NULL DEFAULT '0', `deleteDate` int(10) unsigned NOT NULL DEFAULT '0', `responseUserId` int(10) unsigned NOT NULL DEFAULT '0', - `responseBody` text, + `responseBody` text NULL, `responseRoles` smallint(5) unsigned NOT NULL DEFAULT '0', PRIMARY KEY (`id`), - KEY `type_typeId` (`type`,`typeId`) -) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; + INDEX `type_typeId` (`type`, `typeId`), + INDEX `FK_acc_co` (`userId`), + CONSTRAINT `FK_acc_co` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE SET NULL +) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -369,8 +388,11 @@ CREATE TABLE `aowow_comments_rates` ( `userId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'User ID', `value` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Rating Set', PRIMARY KEY (`commentId`,`userId`), - UNIQUE KEY `commentId_userId` (`commentId`,`userId`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; + UNIQUE INDEX `commentId_userId` (`commentId`,`userId`), + INDEX `FK_acc_co_rate_user` (`userId`), + CONSTRAINT `FK_acc_co_rate` FOREIGN KEY (`commentId`) REFERENCES `aowow_comments` (`id`) ON UPDATE CASCADE ON DELETE CASCADE, + CONSTRAINT `FK_acc_co_rate_user` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE NO ACTION +) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -2420,6 +2442,38 @@ CREATE TABLE `aowow_zones` ( /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; +-- +-- Dumping data for table `aowow_account` +-- + +LOCK TABLES `aowow_account` WRITE; +/*!40000 ALTER TABLE `aowow_account` DISABLE KEYS */; +INSERT INTO `aowow_account` VALUES (0,0,'','','AoWoW','',0,0,0,0,'','',0,0,0,0,'','','',0,0,0,0,0,'',''); +/*!40000 ALTER TABLE `aowow_account` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +-- +-- Dumping data for table `aowow_account_weightscales` +-- + +LOCK TABLES `aowow_account_weightscales` WRITE; +/*!40000 ALTER TABLE `aowow_account_weightscales` DISABLE KEYS */; +INSERT INTO `aowow_account_weightscales` VALUES (1,0,'arms',1,'ability_rogue_eviscerate'),(2,0,'fury',1,'ability_warrior_innerrage'),(3,0,'prot',1,'ability_warrior_defensivestance'),(4,0,'holy',2,'spell_holy_holybolt'),(5,0,'prot',2,'ability_paladin_shieldofthetempl'),(6,0,'retrib',2,'spell_holy_auraoflight'),(7,0,'beast',3,'ability_hunter_beasttaming'),(8,0,'marks',3,'ability_marksmanship'),(9,0,'surv',3,'ability_hunter_swiftstrike'),(10,0,'assas',4,'ability_rogue_eviscerate'),(11,0,'combat',4,'ability_backstab'),(12,0,'subtle',4,'ability_stealth'),(13,0,'disc',5,'spell_holy_wordfortitude'),(14,0,'holy',5,'spell_holy_guardianspirit'),(15,0,'shadow',5,'spell_shadow_shadowwordpain'),(16,0,'blooddps',6,'spell_deathknight_bloodpresence'),(17,0,'frostdps',6,'spell_deathknight_frostpresence'),(18,0,'frosttank',6,'spell_deathknight_frostpresence'),(19,0,'unholydps',6,'spell_deathknight_unholypresence'),(20,0,'elem',7,'spell_nature_lightning'),(21,0,'enhance',7,'spell_nature_lightningshield'),(22,0,'resto',7,'spell_nature_magicimmunity'),(23,0,'arcane',8,'spell_holy_magicalsentry'),(24,0,'fire',8,'spell_fire_firebolt02'),(25,0,'frost',8,'spell_frost_frostbolt02'),(26,0,'afflic',9,'spell_shadow_deathcoil'),(27,0,'demo',9,'spell_shadow_metamorphosis'),(28,0,'destro',9,'spell_shadow_rainoffire'),(29,0,'balance',11,'spell_nature_starfall'),(30,0,'feraltank',11,'ability_racial_bearform'),(31,0,'resto',11,'spell_nature_healingtouch'),(32,0,'feraldps',11,'ability_druid_catform'); +/*!40000 ALTER TABLE `aowow_account_weightscales` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Dumping data for table `aowow_account_weightscale_data` +-- + +LOCK TABLES `aowow_account_weightscale_data` WRITE; +/*!40000 ALTER TABLE `aowow_account_weightscale_data` DISABLE KEYS */; +INSERT INTO `aowow_account_weightscale_data` VALUES (2,'exprtng',100),(2,'str',82),(2,'critstrkrtng',66),(2,'agi',53),(2,'armorpenrtng',52),(2,'hitrtng',48),(2,'hastertng',36),(2,'atkpwr',31),(2,'armor',5),(3,'sta',100),(3,'dodgertng',90),(3,'defrtng',86),(3,'block',81),(3,'agi',67),(3,'parryrtng',67),(3,'blockrtng',48),(3,'str',48),(3,'exprtng',19),(3,'hitrtng',10),(3,'armorpenrtng',10),(3,'critstrkrtng',7),(3,'armor',6),(3,'hastertng',1),(3,'atkpwr',1),(4,'int',100),(4,'manargn',88),(4,'splpwr',58),(4,'critstrkrtng',46),(4,'hastertng',35),(5,'sta',100),(5,'dodgertng',94),(5,'block',86),(5,'defrtng',86),(5,'exprtng',79),(5,'agi',76),(5,'parryrtng',76),(5,'hitrtng',58),(5,'blockrtng',52),(5,'str',50),(5,'armor',6),(5,'atkpwr',6),(5,'splpwr',4),(5,'critstrkrtng',3),(6,'mledps',470),(6,'hitrtng',100),(6,'str',80),(6,'exprtng',66),(6,'critstrkrtng',40),(6,'atkpwr',34),(6,'agi',32),(6,'hastertng',30),(6,'armorpenrtng',22),(6,'splpwr',9),(7,'rgddps',213),(7,'hitrtng',100),(7,'agi',58),(7,'critstrkrtng',40),(7,'int',37),(7,'atkpwr',30),(7,'armorpenrtng',28),(7,'hastertng',21),(8,'rgddps',379),(8,'hitrtng',100),(8,'agi',74),(8,'critstrkrtng',57),(8,'armorpenrtng',40),(8,'int',39),(8,'atkpwr',32),(8,'hastertng',24),(9,'rgddps',181),(9,'hitrtng',100),(9,'agi',76),(9,'critstrkrtng',42),(9,'int',35),(9,'hastertng',31),(9,'atkpwr',29),(9,'armorpenrtng',26),(10,'mledps',170),(10,'agi',100),(10,'exprtng',87),(10,'hitrtng',83),(10,'critstrkrtng',81),(10,'atkpwr',65),(10,'armorpenrtng',65),(10,'hastertng',64),(10,'str',55),(11,'mledps',220),(11,'armorpenrtng',100),(11,'agi',100),(11,'exprtng',82),(11,'hitrtng',80),(11,'critstrkrtng',75),(11,'hastertng',73),(11,'str',55),(11,'atkpwr',50),(12,'mledps',228),(12,'exprtng',100),(12,'agi',100),(12,'hitrtng',80),(12,'armorpenrtng',75),(12,'critstrkrtng',75),(12,'hastertng',75),(12,'str',55),(12,'atkpwr',50),(13,'splpwr',100),(13,'manargn',67),(13,'int',65),(13,'hastertng',59),(13,'critstrkrtng',48),(13,'spi',22),(14,'manargn',100),(14,'int',69),(14,'splpwr',60),(14,'spi',52),(14,'critstrkrtng',38),(14,'hastertng',31),(15,'hitrtng',100),(15,'shasplpwr',76),(15,'splpwr',76),(15,'critstrkrtng',54),(15,'hastertng',50),(15,'spi',16),(15,'int',16),(16,'mledps',360),(16,'armorpenrtng',100),(16,'str',99),(16,'hitrtng',91),(16,'exprtng',90),(16,'critstrkrtng',57),(16,'hastertng',55),(16,'atkpwr',36),(16,'armor',1),(17,'mledps',337),(17,'hitrtng',100),(17,'str',97),(17,'exprtng',81),(17,'armorpenrtng',61),(17,'critstrkrtng',45),(17,'atkpwr',35),(17,'hastertng',28),(17,'armor',1),(18,'mledps',419),(18,'parryrtng',100),(18,'hitrtng',97),(18,'str',96),(18,'defrtng',85),(18,'exprtng',69),(18,'dodgertng',61),(18,'agi',61),(18,'sta',61),(18,'critstrkrtng',49),(18,'atkpwr',41),(18,'armorpenrtng',31),(18,'armor',5),(19,'mledps',209),(19,'str',100),(19,'hitrtng',66),(19,'exprtng',51),(19,'hastertng',48),(19,'critstrkrtng',45),(19,'atkpwr',34),(19,'armorpenrtng',32),(19,'armor',1),(20,'hitrtng',100),(20,'splpwr',60),(20,'hastertng',56),(20,'critstrkrtng',40),(20,'int',11),(21,'mledps',135),(21,'hitrtng',100),(21,'exprtng',84),(21,'agi',55),(21,'int',55),(21,'critstrkrtng',55),(21,'hastertng',42),(21,'str',35),(21,'atkpwr',32),(21,'splpwr',29),(21,'armorpenrtng',26),(22,'manargn',100),(22,'int',85),(22,'splpwr',77),(22,'critstrkrtng',62),(22,'hastertng',35),(23,'hitrtng',100),(23,'hastertng',54),(23,'arcsplpwr',49),(23,'splpwr',49),(23,'critstrkrtng',37),(23,'int',34),(23,'frosplpwr',24),(23,'firsplpwr',24),(23,'spi',14),(24,'hitrtng',100),(24,'hastertng',53),(24,'firsplpwr',46),(24,'splpwr',46),(24,'critstrkrtng',43),(24,'frosplpwr',23),(24,'arcsplpwr',23),(24,'int',13),(25,'hitrtng',100),(25,'hastertng',42),(25,'frosplpwr',39),(25,'splpwr',39),(25,'arcsplpwr',19),(25,'firsplpwr',19),(25,'critstrkrtng',19),(25,'int',6),(26,'hitrtng',100),(26,'shasplpwr',72),(26,'splpwr',72),(26,'hastertng',61),(26,'critstrkrtng',38),(26,'firsplpwr',36),(26,'spi',34),(26,'int',15),(27,'hitrtng',100),(27,'hastertng',50),(27,'firsplpwr',45),(27,'shasplpwr',45),(27,'splpwr',45),(27,'critstrkrtng',31),(27,'spi',29),(27,'int',13),(28,'hitrtng',100),(28,'firsplpwr',47),(28,'splpwr',47),(28,'hastertng',46),(28,'spi',26),(28,'shasplpwr',23),(28,'critstrkrtng',16),(28,'int',13),(29,'hitrtng',100),(29,'splpwr',66),(29,'hastertng',54),(29,'critstrkrtng',43),(29,'spi',22),(29,'int',22),(30,'agi',100),(30,'sta',75),(30,'dodgertng',65),(30,'defrtng',60),(30,'exprtng',16),(30,'str',10),(30,'armor',10),(30,'hitrtng',8),(30,'hastertng',5),(30,'atkpwr',4),(30,'feratkpwr',4),(30,'critstrkrtng',3),(31,'splpwr',100),(31,'manargn',73),(31,'hastertng',57),(31,'int',51),(31,'spi',32),(31,'critstrkrtng',11),(32,'agi',100),(32,'armorpenrtng',90),(32,'str',80),(32,'critstrkrtng',55),(32,'exprtng',50),(32,'hitrtng',50),(32,'feratkpwr',40),(32,'atkpwr',40),(32,'hastertng',35); +/*!40000 ALTER TABLE `aowow_account_weightscale_data` ENABLE KEYS */; +UNLOCK TABLES; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + -- -- Dumping data for table `aowow_announcements` -- diff --git a/setup/tools/clisetup/firstrun.func.php b/setup/tools/clisetup/firstrun.func.php index 853cdb6f..368ef2aa 100644 --- a/setup/tools/clisetup/firstrun.func.php +++ b/setup/tools/clisetup/firstrun.func.php @@ -93,6 +93,7 @@ function firstrun() ['FileGen::generate', 'enchants', null, null, null], ['FileGen::generate', 'gems', null, null, null], ['FileGen::generate', 'profiler', null, null, null], + ['FileGen::generate', 'weightPresets', null, null, null], // apply sql-updates from repository ['update', null, null, null, null], ['account', null, 'testAcc', 'Please create your admin account.', 'There is no user with administrator priviledges in the DB.'], diff --git a/setup/tools/fileGen.class.php b/setup/tools/fileGen.class.php index f9042d0b..1884cf53 100644 --- a/setup/tools/fileGen.class.php +++ b/setup/tools/fileGen.class.php @@ -36,18 +36,19 @@ class FileGen 'itemScaling' => ['item-scaling', 'datasets/', []] ); public static $datasets = array( // name => [AowowDeps, TCDeps] - 'realms' => [null, ['realmlist']], - 'statistics' => [null, ['player_levelstats', 'player_classlevelstats']], - 'simpleImg' => [null, null], - 'complexImg' => [null, null], - 'talentCalc' => [null, null], - 'pets' => [['spawns', 'creature'], null], - 'talentIcons' => [null, null], - 'glyphs' => [['items', 'spell'], null], - 'itemsets' => [['itemset', 'spell'], null], - 'enchants' => [['items', 'spell', 'itemenchantment'], null], - 'gems' => [['items', 'spell', 'itemenchantment'], null], - 'profiler' => [['quests', 'quests_startend', 'spell', 'currencies', 'achievement', 'titles'], null] + 'realms' => [null, ['realmlist']], + 'statistics' => [null, ['player_levelstats', 'player_classlevelstats']], + 'simpleImg' => [null, null], + 'complexImg' => [null, null], + 'talentCalc' => [null, null], + 'pets' => [['spawns', 'creature'], null], + 'talentIcons' => [null, null], + 'glyphs' => [['items', 'spell'], null], + 'itemsets' => [['itemset', 'spell'], null], + 'enchants' => [['items', 'spell', 'itemenchantment'], null], + 'gems' => [['items', 'spell', 'itemenchantment'], null], + 'profiler' => [['quests', 'quests_startend', 'spell', 'currencies', 'achievement', 'titles'], null], + 'weightPresets' => [null, null] ); public static $defaultExecTime = 30; diff --git a/setup/tools/filegen/weightPresets.func.php b/setup/tools/filegen/weightPresets.func.php new file mode 100644 index 00000000..1b478230 --- /dev/null +++ b/setup/tools/filegen/weightPresets.func.php @@ -0,0 +1,41 @@ +select('SELECT id, name, icon, class FROM ?_account_weightscales WHERE userId = 0 ORDER BY class, id ASC'); + + 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) + { + CLISetup::log('WeightScale \''.CLISetup::bold($s['name']).'\' has no data set. Skipping...', CLISetup::LOG_WARN); + continue; + } + + $wtPresets[$s['class']]['pve'][$s['name']] = array_merge(['__icon' => $s['icon']], $weights); + } + + $toFile = "var wt_presets = ".Util::toJSON($wtPresets).";"; + $file = 'datasets/weight-presets'; + + if (!CLISetup::writeFile($file, $toFile)) + return false; + + return true; + } +?> diff --git a/setup/updates/1456585695_01.sql b/setup/updates/1456585695_01.sql new file mode 100644 index 00000000..0068f4f1 --- /dev/null +++ b/setup/updates/1456585695_01.sql @@ -0,0 +1,345 @@ +-- create system account +REPLACE INTO `aowow_account` (`id`, `user`, `displayName`) VALUES (0, '', 'AoWoW'); + +-- restructure weightscales (sorry for your loss...) +DROP TABLE IF EXISTS `aowow_account_weightscales`; +CREATE TABLE IF NOT EXISTS `aowow_account_weightscales` ( + `id` int(32) NOT NULL AUTO_INCREMENT, + `userId` int(10) unsigned NOT NULL, + `name` varchar(32) NOT NULL, + `class` tinyint(3) unsigned NOT NULL DEFAULT '0', + `icon` varchar(48) NOT NULL DEFAULT '', + PRIMARY KEY (`id`,`userId`), + KEY `FK_acc_weights` (`userId`), + CONSTRAINT `FK_acc_weights` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT; + +INSERT INTO `aowow_account_weightscales` (`id`, `userId`, `name`, `class`, `icon`) VALUES + (1, 0, 'arms', 1, 'ability_rogue_eviscerate'), + (2, 0, 'fury', 1, 'ability_warrior_innerrage'), + (3, 0, 'prot', 1, 'ability_warrior_defensivestance'), + (4, 0, 'holy', 2, 'spell_holy_holybolt'), + (5, 0, 'prot', 2, 'ability_paladin_shieldofthetemplar'), + (6, 0, 'retrib', 2, 'spell_holy_auraoflight'), + (7, 0, 'beast', 3, 'ability_hunter_beasttaming'), + (8, 0, 'marks', 3, 'ability_marksmanship'), + (9, 0, 'surv', 3, 'ability_hunter_swiftstrike'), + (10, 0, 'assas', 4, 'ability_rogue_eviscerate'), + (11, 0, 'combat', 4, 'ability_backstab'), + (12, 0, 'subtle', 4, 'ability_stealth'), + (13, 0, 'disc', 5, 'spell_holy_wordfortitude'), + (14, 0, 'holy', 5, 'spell_holy_guardianspirit'), + (15, 0, 'shadow', 5, 'spell_shadow_shadowwordpain'), + (16, 0, 'blooddps', 6, 'spell_deathknight_bloodpresence'), + (17, 0, 'frostdps', 6, 'spell_deathknight_frostpresence'), + (18, 0, 'frosttank', 6, 'spell_deathknight_frostpresence'), + (19, 0, 'unholydps', 6, 'spell_deathknight_unholypresence'), + (20, 0, 'elem', 7, 'spell_nature_lightning'), + (21, 0, 'enhance', 7, 'spell_nature_lightningshield'), + (22, 0, 'resto', 7, 'spell_nature_magicimmunity'), + (23, 0, 'arcane', 8, 'spell_holy_magicalsentry'), + (24, 0, 'fire', 8, 'spell_fire_firebolt02'), + (25, 0, 'frost', 8, 'spell_frost_frostbolt02'), + (26, 0, 'afflic', 9, 'spell_shadow_deathcoil'), + (27, 0, 'demo', 9, 'spell_shadow_metamorphosis'), + (28, 0, 'destro', 9, 'spell_shadow_rainoffire'), + (29, 0, 'balance', 11, 'spell_nature_starfall'), + (30, 0, 'feraltank', 11, 'ability_racial_bearform'), + (31, 0, 'resto', 11, 'spell_nature_healingtouch'), + (32, 0, 'feraldps', 11, 'ability_druid_catform'); + +DROP TABLE IF EXISTS `aowow_account_weightscale_data`; +CREATE TABLE IF NOT EXISTS `aowow_account_weightscale_data` ( + `id` int(32) NOT NULL, + `field` varchar(15) NOT NULL, + `val` smallint(6) unsigned NOT NULL, + KEY `id` (`id`), + CONSTRAINT `FK_acc_weightscales` FOREIGN KEY (`id`) REFERENCES `aowow_account_weightscales` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +INSERT INTO `aowow_account_weightscale_data` (`id`, `field`, `val`) VALUES + (2, 'exprtng', 100), + (2, 'str', 82), + (2, 'critstrkrtng', 66), + (2, 'agi', 53), + (2, 'armorpenrtng', 52), + (2, 'hitrtng', 48), + (2, 'hastertng', 36), + (2, 'atkpwr', 31), + (2, 'armor', 5), + (3, 'sta', 100), + (3, 'dodgertng', 90), + (3, 'defrtng', 86), + (3, 'block', 81), + (3, 'agi', 67), + (3, 'parryrtng', 67), + (3, 'blockrtng', 48), + (3, 'str', 48), + (3, 'exprtng', 19), + (3, 'hitrtng', 10), + (3, 'armorpenrtng', 10), + (3, 'critstrkrtng', 7), + (3, 'armor', 6), + (3, 'hastertng', 1), + (3, 'atkpwr', 1), + (4, 'int', 100), + (4, 'manargn', 88), + (4, 'splpwr', 58), + (4, 'critstrkrtng', 46), + (4, 'hastertng', 35), + (5, 'sta', 100), + (5, 'dodgertng', 94), + (5, 'block', 86), + (5, 'defrtng', 86), + (5, 'exprtng', 79), + (5, 'agi', 76), + (5, 'parryrtng', 76), + (5, 'hitrtng', 58), + (5, 'blockrtng', 52), + (5, 'str', 50), + (5, 'armor', 6), + (5, 'atkpwr', 6), + (5, 'splpwr', 4), + (5, 'critstrkrtng', 3), + (6, 'mledps', 470), + (6, 'hitrtng', 100), + (6, 'str', 80), + (6, 'exprtng', 66), + (6, 'critstrkrtng', 40), + (6, 'atkpwr', 34), + (6, 'agi', 32), + (6, 'hastertng', 30), + (6, 'armorpenrtng', 22), + (6, 'splpwr', 9), + (7, 'rgddps', 213), + (7, 'hitrtng', 100), + (7, 'agi', 58), + (7, 'critstrkrtng', 40), + (7, 'int', 37), + (7, 'atkpwr', 30), + (7, 'armorpenrtng', 28), + (7, 'hastertng', 21), + (8, 'rgddps', 379), + (8, 'hitrtng', 100), + (8, 'agi', 74), + (8, 'critstrkrtng', 57), + (8, 'armorpenrtng', 40), + (8, 'int', 39), + (8, 'atkpwr', 32), + (8, 'hastertng', 24), + (9, 'rgddps', 181), + (9, 'hitrtng', 100), + (9, 'agi', 76), + (9, 'critstrkrtng', 42), + (9, 'int', 35), + (9, 'hastertng', 31), + (9, 'atkpwr', 29), + (9, 'armorpenrtng', 26), + (10, 'mledps', 170), + (10, 'agi', 100), + (10, 'exprtng', 87), + (10, 'hitrtng', 83), + (10, 'critstrkrtng', 81), + (10, 'atkpwr', 65), + (10, 'armorpenrtng', 65), + (10, 'hastertng', 64), + (10, 'str', 55), + (11, 'mledps', 220), + (11, 'armorpenrtng', 100), + (11, 'agi', 100), + (11, 'exprtng', 82), + (11, 'hitrtng', 80), + (11, 'critstrkrtng', 75), + (11, 'hastertng', 73), + (11, 'str', 55), + (11, 'atkpwr', 50), + (12, 'mledps', 228), + (12, 'exprtng', 100), + (12, 'agi', 100), + (12, 'hitrtng', 80), + (12, 'armorpenrtng', 75), + (12, 'critstrkrtng', 75), + (12, 'hastertng', 75), + (12, 'str', 55), + (12, 'atkpwr', 50), + (13, 'splpwr', 100), + (13, 'manargn', 67), + (13, 'int', 65), + (13, 'hastertng', 59), + (13, 'critstrkrtng', 48), + (13, 'spi', 22), + (14, 'manargn', 100), + (14, 'int', 69), + (14, 'splpwr', 60), + (14, 'spi', 52), + (14, 'critstrkrtng', 38), + (14, 'hastertng', 31), + (15, 'hitrtng', 100), + (15, 'shasplpwr', 76), + (15, 'splpwr', 76), + (15, 'critstrkrtng', 54), + (15, 'hastertng', 50), + (15, 'spi', 16), + (15, 'int', 16), + (16, 'mledps', 360), + (16, 'armorpenrtng', 100), + (16, 'str', 99), + (16, 'hitrtng', 91), + (16, 'exprtng', 90), + (16, 'critstrkrtng', 57), + (16, 'hastertng', 55), + (16, 'atkpwr', 36), + (16, 'armor', 1), + (17, 'mledps', 337), + (17, 'hitrtng', 100), + (17, 'str', 97), + (17, 'exprtng', 81), + (17, 'armorpenrtng', 61), + (17, 'critstrkrtng', 45), + (17, 'atkpwr', 35), + (17, 'hastertng', 28), + (17, 'armor', 1), + (18, 'mledps', 419), + (18, 'parryrtng', 100), + (18, 'hitrtng', 97), + (18, 'str', 96), + (18, 'defrtng', 85), + (18, 'exprtng', 69), + (18, 'dodgertng', 61), + (18, 'agi', 61), + (18, 'sta', 61), + (18, 'critstrkrtng', 49), + (18, 'atkpwr', 41), + (18, 'armorpenrtng', 31), + (18, 'armor', 5), + (19, 'mledps', 209), + (19, 'str', 100), + (19, 'hitrtng', 66), + (19, 'exprtng', 51), + (19, 'hastertng', 48), + (19, 'critstrkrtng', 45), + (19, 'atkpwr', 34), + (19, 'armorpenrtng', 32), + (19, 'armor', 1), + (20, 'hitrtng', 100), + (20, 'splpwr', 60), + (20, 'hastertng', 56), + (20, 'critstrkrtng', 40), + (20, 'int', 11), + (21, 'mledps', 135), + (21, 'hitrtng', 100), + (21, 'exprtng', 84), + (21, 'agi', 55), + (21, 'int', 55), + (21, 'critstrkrtng', 55), + (21, 'hastertng', 42), + (21, 'str', 35), + (21, 'atkpwr', 32), + (21, 'splpwr', 29), + (21, 'armorpenrtng', 26), + (22, 'manargn', 100), + (22, 'int', 85), + (22, 'splpwr', 77), + (22, 'critstrkrtng', 62), + (22, 'hastertng', 35), + (23, 'hitrtng', 100), + (23, 'hastertng', 54), + (23, 'arcsplpwr', 49), + (23, 'splpwr', 49), + (23, 'critstrkrtng', 37), + (23, 'int', 34), + (23, 'frosplpwr', 24), + (23, 'firsplpwr', 24), + (23, 'spi', 14), + (24, 'hitrtng', 100), + (24, 'hastertng', 53), + (24, 'firsplpwr', 46), + (24, 'splpwr', 46), + (24, 'critstrkrtng', 43), + (24, 'frosplpwr', 23), + (24, 'arcsplpwr', 23), + (24, 'int', 13), + (25, 'hitrtng', 100), + (25, 'hastertng', 42), + (25, 'frosplpwr', 39), + (25, 'splpwr', 39), + (25, 'arcsplpwr', 19), + (25, 'firsplpwr', 19), + (25, 'critstrkrtng', 19), + (25, 'int', 6), + (26, 'hitrtng', 100), + (26, 'shasplpwr', 72), + (26, 'splpwr', 72), + (26, 'hastertng', 61), + (26, 'critstrkrtng', 38), + (26, 'firsplpwr', 36), + (26, 'spi', 34), + (26, 'int', 15), + (27, 'hitrtng', 100), + (27, 'hastertng', 50), + (27, 'firsplpwr', 45), + (27, 'shasplpwr', 45), + (27, 'splpwr', 45), + (27, 'critstrkrtng', 31), + (27, 'spi', 29), + (27, 'int', 13), + (28, 'hitrtng', 100), + (28, 'firsplpwr', 47), + (28, 'splpwr', 47), + (28, 'hastertng', 46), + (28, 'spi', 26), + (28, 'shasplpwr', 23), + (28, 'critstrkrtng', 16), + (28, 'int', 13), + (29, 'hitrtng', 100), + (29, 'splpwr', 66), + (29, 'hastertng', 54), + (29, 'critstrkrtng', 43), + (29, 'spi', 22), + (29, 'int', 22), + (30, 'agi', 100), + (30, 'sta', 75), + (30, 'dodgertng', 65), + (30, 'defrtng', 60), + (30, 'exprtng', 16), + (30, 'str', 10), + (30, 'armor', 10), + (30, 'hitrtng', 8), + (30, 'hastertng', 5), + (30, 'atkpwr', 4), + (30, 'feratkpwr', 4), + (30, 'critstrkrtng', 3), + (31, 'splpwr', 100), + (31, 'manargn', 73), + (31, 'hastertng', 57), + (31, 'int', 51), + (31, 'spi', 32), + (31, 'critstrkrtng', 11), + (32, 'agi', 100), + (32, 'armorpenrtng', 90), + (32, 'str', 80), + (32, 'critstrkrtng', 55), + (32, 'exprtng', 50), + (32, 'hitrtng', 50), + (32, 'feratkpwr', 40), + (32, 'atkpwr', 40), + (32, 'hastertng', 35); + +-- add cascading to comments +DELETE r FROM aowow_comments_rates r LEFT JOIN aowow_comments c ON c.id = r.commentId WHERE c.Id IS NULL; +DELETE r FROM aowow_comments_rates r LEFT JOIN aowow_account a ON a.id = r.userId WHERE a.Id IS NULL; + +ALTER TABLE `aowow_comments` + ENGINE=InnoDB, + CHANGE COLUMN `id` `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Comment ID' FIRST, + CHANGE COLUMN `replyTo` `replyTo` INT(10) UNSIGNED NOT NULL DEFAULT '0' COMMENT 'Reply To, comment ID' AFTER `flags`, + CHANGE COLUMN `userId` `userId` INT(10) UNSIGNED NULL COMMENT 'User ID' AFTER `typeId`, + ADD CONSTRAINT `FK_acc_co` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE SET NULL; + +ALTER TABLE `aowow_comments_rates` + ENGINE=InnoDB, + ADD CONSTRAINT `FK_acc_co_rate` FOREIGN KEY (`commentId`) REFERENCES `aowow_comments` (`id`) ON UPDATE CASCADE ON DELETE CASCADE, + ADD CONSTRAINT `FK_acc_co_rate_user` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON UPDATE CASCADE ON DELETE NO ACTION; + +-- auto-create datasets/weight-presets +UPDATE `aowow_dbversion` SET `build` = CONCAT(`build`, ' weightPresets'); diff --git a/static/js/Markup.js b/static/js/Markup.js index 5926ad20..7068af5a 100644 --- a/static/js/Markup.js +++ b/static/js/Markup.js @@ -2841,7 +2841,7 @@ var Markup = { attr: { unnamed: { req: false, valid: /\S+/ }, - rel: { req: false, valid: /(item|quest|spell|achievement|npc|object)=([0-9]+)/ }, + rel: { req: false, valid: /(item|quest|spell|achievement|event|npc|object|itemset|currency)=([0-9]+)/ }, onclick: { req: false, valid: /[\S ]+/ }, tooltip: { req: false, valid: /\S+/ }, tooltip2: { req: false, valid: /\S+/ } diff --git a/static/js/staff.js b/static/js/staff.js index 7970b5c1..6518e139 100644 --- a/static/js/staff.js +++ b/static/js/staff.js @@ -41,7 +41,7 @@ var mn_dev = [ // [17, 'Cookies', '?admin=cookies', null, {requiredAccess: U_GROUP_ADMIN | U_GROUP_DEV}], [21, 'PHP Information', '?admin=phpinfo', null, {requiredAccess: U_GROUP_ADMIN | U_GROUP_DEV}], [18, 'Site Configuration', '?admin=siteconfig', null, {requiredAccess: U_GROUP_ADMIN | U_GROUP_DEV}], -// [16, 'Weight Presets', '?admin=weight-presets', null, {requiredAccess: U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_DEV}], + [16, 'Weight Presets', '?admin=weight-presets', null, {requiredAccess: U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_DEV}], // [22, 'API Keys', '?admin=apikey', null, {requiredAccess: U_GROUP_ADMIN | U_GROUP_BUREAU | U_GROUP_DEV}], // [, 'Cache'], diff --git a/template/bricks/redButtons.tpl.php b/template/bricks/redButtons.tpl.php index 33cb6aa3..00bda71d 100644 --- a/template/bricks/redButtons.tpl.php +++ b/template/bricks/redButtons.tpl.php @@ -22,7 +22,7 @@ // view in 3D if (isset($this->redButtons[BUTTON_VIEW3D])): if ($b = $this->redButtons[BUTTON_VIEW3D]): // json_encode puts property names in brackets wich is not cool with inline javascript - echo ' '']).'})">'.Lang::main('view3D').''.Lang::main('view3D').''; + echo ' '']).')">'.Lang::main('view3D').''.Lang::main('view3D').''; else: echo ''.Lang::main('view3D').''.Lang::main('view3D').''; endif; diff --git a/template/pages/admin/siteconfig.tpl.php b/template/pages/admin/siteconfig.tpl.php new file mode 100644 index 00000000..5c9d1b84 --- /dev/null +++ b/template/pages/admin/siteconfig.tpl.php @@ -0,0 +1,280 @@ +brick('header'); ?> + + + +
+
+
+ +brick('announcement'); + + $this->brick('pageTemplate'); + + $this->brick('lvTabs'); +?> +
+
+
+ +brick('footer'); ?> diff --git a/template/pages/admin/weight-presets.tpl.php b/template/pages/admin/weight-presets.tpl.php new file mode 100644 index 00000000..24377c41 --- /dev/null +++ b/template/pages/admin/weight-presets.tpl.php @@ -0,0 +1,591 @@ +brick('header'); ?> + + + +
+
+
+ +brick('announcement'); + +$this->brick('pageTemplate'); +?> +
+

name;?>

+ +brick('article'); + + if (isset($this->extraText)): +?> +
+ + +
+extraHTML)): + echo $this->extraHTML; + endif; +?> +

Edit

+
+
Icon
+
+
+
+
Scale
+
+
+
+
+
+
+ +brick('footer'); ?> diff --git a/template/pages/text-page-generic.tpl.php b/template/pages/text-page-generic.tpl.php index 3cb5bdca..0c566792 100644 --- a/template/pages/text-page-generic.tpl.php +++ b/template/pages/text-page-generic.tpl.php @@ -14,13 +14,13 @@
-

notFound['title']; ?>

-
notFound['msg']; ?>
+

notFound['title'];?>

+
notFound['msg'];?>
-

name; ?>

+

name;?>

brick('article'); @@ -29,7 +29,7 @@ ?>
KeyValueOptions