From d0ec950dc1982aa6254b27b384e5ea36f31f9a1f Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sun, 12 Feb 2017 02:36:31 +0100 Subject: [PATCH] Setup/Misc * fixed complexImage always selecting images for LOCALE_EN if able * fixed serverside events being displayed in the calendar * set initial memory limit to 4GB * set initial db_version to current version (forgotten to do that for a long time :x ) * updated README.md and .gitignore; revision incremented --- .gitignore | 7 +++++-- README.md | Bin 9920 -> 9920 bytes includes/shared.php | 2 +- pages/events.php | 2 +- setup/db_structure.sql | 4 ++-- setup/setup.php | 2 +- setup/tools/CLISetup.class.php | 3 ++- setup/tools/clisetup/account.func.php | 3 +++ setup/tools/clisetup/siteconfig.func.php | 2 +- setup/tools/filegen/complexImg.func.php | 2 +- setup/tools/filegen/itemsets.func.php | 4 ++-- setup/tools/sqlgen/item_stats.func.php | 1 - setup/tools/sqlgen/titles.func.php | 8 ++++---- 13 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index f72b08f2..ea13d78c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,8 @@ /static/widgets/searchbox/searchbox.html /static/download/searchplugins/aowow.xml /config/config.php +/datasets/* +!/datasets/zones # /datasets/item-scaling # extracted images @@ -19,12 +21,13 @@ /static/images/wow/icons/small/* /static/images/wow/icons/tiny/* !/static/images/wow/icons/tiny/quest_* -/static/images/wow/hunterpettalents/icons* -/static/images/wow/interface/* +/static/images/wow/hunterpettalents/* +/static/images/wow/Interface/* /static/images/wow/loadingscreens/* /static/images/wow/maps/* !/static/images/wow/maps/overlay* /static/images/wow/talents/icons/* +/static/images/wow/talents/backgrounds/* # modelviewer (~7GB data) /static/modelviewer/models/* diff --git a/README.md b/README.md index 45d454f32e21e604fdb53eaa83e4a2b1afeed38d..89861d88d5262c4759031419888821e52226f182 100644 GIT binary patch delta 24 gcmX@$d%$;t5<8>OWJXTy$$sonj7FPRvWv?D0Ampb{Qv*} delta 24 gcmX@$d%$;t5<8>8WJXTy$$sonj0T%mvWv?D0Al3^`2YX_ diff --git a/includes/shared.php b/includes/shared.php index ab5b1cec..1f54171f 100644 --- a/includes/shared.php +++ b/includes/shared.php @@ -1,6 +1,6 @@ lvTabs[] = ['event', ['data' => $data]]; - if ($_ = array_filter($data, function($x) {return $x['id'] > 0;})) + if ($_ = array_values(array_filter($data, function($x) {return $x['category'] > 0;}))) { $this->lvTabs[] = ['calendar', array( 'data' => $_, diff --git a/setup/db_structure.sql b/setup/db_structure.sql index b61d5f8b..6d4e2cd8 100644 --- a/setup/db_structure.sql +++ b/setup/db_structure.sql @@ -2503,7 +2503,7 @@ UNLOCK TABLES; LOCK TABLES `aowow_config` WRITE; /*!40000 ALTER TABLE `aowow_config` DISABLE KEYS */; -INSERT INTO `aowow_config` VALUES ('sql_limit_search','500',1,129,'default: 500 - max results for search'),('sql_limit_default','300',1,129,'default: 300 - max results for listviews'),('sql_limit_quicksearch','10',1,129,'default: 10 - max results for suggestions'),('sql_limit_none','0',1,129,'default: 0 - unlimited results (i wouldn\'t change that mate)'),('ttl_rss','60',1,129,'default: 60 - time to live for RSS (in seconds)'),('name','Aowow Database Viewer (ADV)',1,136,' - website title'),('name_short','Aowow',1,136,' - feed title'),('board_url','http://www.wowhead.com/forums?board=',1,136,' - another halfbaked javascript thing..'),('contact_email','feedback@aowow.org',1,136,' - displayed sender for auth-mails, ect'),('battlegroup','Pure Pwnage',1,136,' - pretend, we belong to a battlegroup to satisfy profiler-related Jscripts'),('debug','0',1,132,'default: 0 - disable cache, enable sql-errors, enable error_reporting'),('maintenance','1',1,132,'default: 0 - display brb gnomes and block access for non-staff'),('user_max_votes','50',1,129,'default: 50 - vote limit per day'),('force_ssl','0',1,132,'default: 0 - enforce SSL, if the server is behind a load balancer'),('locales','333',1,161,'default: 0x14D - allowed locales - 0:English, 2:French, 3:German, 6:Spanish, 8:Russian'),('screenshot_min_size','200',1,129,'default: 200 - minimum dimensions of uploaded screenshots in px (yes, it\'s square)'),('site_host','',1,136,' - points js to executable files'),('static_host','',1,136,' - points js to images & scripts'),('cache_decay','25200',2,129,'default: 60 * 60 * 7 - time to keep cache in seconds'),('cache_mode','1',2,161,'default: 1 - set cache method - 0:filecache, 1:memcached'),('cache_dir','',2,136,'default: cache/template - generated pages are saved here (requires CACHE_MODE: filecache)'),('acc_failed_auth_block','900',3,129,'default: 15 * 60 - how long an account is closed after exceeding FAILED_AUTH_COUNT (in seconds)'),('acc_failed_auth_count','5',3,129,'default: 5 - how often invalid passwords are tolerated'),('acc_allow_register','1',3,132,'default: 1 - allow/disallow account creation (requires AUTH_MODE: aowow)'),('acc_auth_mode','0',3,145,'default: 0 - source to auth against - 0:aowow, 1:TC auth-table, 2:external script'),('acc_create_save_decay','604800',3,129,'default: 604800 - time in wich an unconfirmed account cannot be overwritten by new registrations'),('acc_recovery_decay','300',3,129,'default: 300 - time to recover your account and new recovery requests are blocked'),('session_timeout_delay','3600',4,129,'default: 60 * 60 - non-permanent session times out in time() + X'),('session.gc_maxlifetime','604800',4,200,'default: 7*24*60*60 - lifetime of session data'),('session.gc_probability','1',4,200,'default: 0 - probability to remove session data on garbage collection'),('session.gc_divisor',100,4,200,'default: 100 - probability to remove session data on garbage collection'),('session_cache_dir','',4,136,'default: - php sessions are saved here. Leave empty to use php default directory.'),('rep_req_upvote','125',5,129,'default: 125 - required reputation to upvote comments'),('rep_req_downvote','250',5,129,'default: 250 - required reputation to downvote comments'),('rep_req_comment','75',5,129,'default: 75 - required reputation to write a comment / reply'),('rep_req_supervote','2500',5,129,'default: 2500 - required reputation for double vote effect'),('rep_req_votemore_base','2000',5,129,'default: 2000 - gains more votes past this threshold'),('rep_reward_register','100',5,129,'default: 100 - activated an account'),('rep_reward_upvoted','5',5,129,'default: 5 - comment received upvote'),('rep_reward_downvoted','0',5,129,'default: 0 - comment received downvote'),('rep_reward_good_report','10',5,129,'default: 10 - filed an accepted report'),('rep_reward_bad_report','0',5,129,'default: 0 - filed a rejected report'),('rep_reward_dailyvisit','5',5,129,'default: 5 - daily visit'),('rep_reward_user_warned','-50',5,129,'default: -50 - moderator imposed a warning'),('rep_reward_comment','1',5,129,'default: 1 - created a comment (not a reply) '),('rep_req_premium','25000',5,129,'default: 25000 - required reputation for premium status through reputation'),('rep_reward_upload','10',5,129,'default: 10 - suggested / uploaded video / screenshot was approved'),('rep_reward_article','100',5,129,'default: 100 - submitted an approved article/guide'),('rep_reward_user_suspended','-200',5,129,'default: -200 - moderator revoked rights'),('rep_req_votemore_add','250',5,129,'default: 250 - required reputation per additional vote past threshold'),('serialize_precision','5',0,65,' - some derelict code, probably unused'),('memory_limit','2048M',0,200,'default: 2048M - parsing spell.dbc is quite intense'),('default_charset','UTF-8',0,72,'default: UTF-8'),('analytics_user','',6,136,'default: - enter your GA-user here to track site stats'); +INSERT INTO `aowow_config` VALUES ('sql_limit_search','500',1,129,'default: 500 - max results for search'),('sql_limit_default','300',1,129,'default: 300 - max results for listviews'),('sql_limit_quicksearch','10',1,129,'default: 10 - max results for suggestions'),('sql_limit_none','0',1,129,'default: 0 - unlimited results (i wouldn\'t change that mate)'),('ttl_rss','60',1,129,'default: 60 - time to live for RSS (in seconds)'),('name','Aowow Database Viewer (ADV)',1,136,' - website title'),('name_short','Aowow',1,136,' - feed title'),('board_url','http://www.wowhead.com/forums?board=',1,136,' - another halfbaked javascript thing..'),('contact_email','feedback@aowow.org',1,136,' - displayed sender for auth-mails, ect'),('battlegroup','Pure Pwnage',1,136,' - pretend, we belong to a battlegroup to satisfy profiler-related Jscripts'),('debug','0',1,132,'default: 0 - disable cache, enable sql-errors, enable error_reporting'),('maintenance','1',1,132,'default: 0 - display brb gnomes and block access for non-staff'),('user_max_votes','50',1,129,'default: 50 - vote limit per day'),('force_ssl','0',1,132,'default: 0 - enforce SSL, if the server is behind a load balancer'),('locales','333',1,161,'default: 0x14D - allowed locales - 0:English, 2:French, 3:German, 6:Spanish, 8:Russian'),('screenshot_min_size','200',1,129,'default: 200 - minimum dimensions of uploaded screenshots in px (yes, it\'s square)'),('site_host','',1,136,' - points js to executable files'),('static_host','',1,136,' - points js to images & scripts'),('cache_decay','25200',2,129,'default: 60 * 60 * 7 - time to keep cache in seconds'),('cache_mode','1',2,161,'default: 1 - set cache method - 0:filecache, 1:memcached'),('cache_dir','',2,136,'default: cache/template - generated pages are saved here (requires CACHE_MODE: filecache)'),('acc_failed_auth_block','900',3,129,'default: 15 * 60 - how long an account is closed after exceeding FAILED_AUTH_COUNT (in seconds)'),('acc_failed_auth_count','5',3,129,'default: 5 - how often invalid passwords are tolerated'),('acc_allow_register','1',3,132,'default: 1 - allow/disallow account creation (requires AUTH_MODE: aowow)'),('acc_auth_mode','0',3,145,'default: 0 - source to auth against - 0:aowow, 1:TC auth-table, 2:external script'),('acc_create_save_decay','604800',3,129,'default: 604800 - time in wich an unconfirmed account cannot be overwritten by new registrations'),('acc_recovery_decay','300',3,129,'default: 300 - time to recover your account and new recovery requests are blocked'),('session_timeout_delay','3600',4,129,'default: 60 * 60 - non-permanent session times out in time() + X'),('session.gc_maxlifetime','604800',4,200,'default: 7*24*60*60 - lifetime of session data'),('session.gc_probability','1',4,200,'default: 0 - probability to remove session data on garbage collection'),('session.gc_divisor',100,4,200,'default: 100 - probability to remove session data on garbage collection'),('session_cache_dir','',4,136,'default: - php sessions are saved here. Leave empty to use php default directory.'),('rep_req_upvote','125',5,129,'default: 125 - required reputation to upvote comments'),('rep_req_downvote','250',5,129,'default: 250 - required reputation to downvote comments'),('rep_req_comment','75',5,129,'default: 75 - required reputation to write a comment / reply'),('rep_req_supervote','2500',5,129,'default: 2500 - required reputation for double vote effect'),('rep_req_votemore_base','2000',5,129,'default: 2000 - gains more votes past this threshold'),('rep_reward_register','100',5,129,'default: 100 - activated an account'),('rep_reward_upvoted','5',5,129,'default: 5 - comment received upvote'),('rep_reward_downvoted','0',5,129,'default: 0 - comment received downvote'),('rep_reward_good_report','10',5,129,'default: 10 - filed an accepted report'),('rep_reward_bad_report','0',5,129,'default: 0 - filed a rejected report'),('rep_reward_dailyvisit','5',5,129,'default: 5 - daily visit'),('rep_reward_user_warned','-50',5,129,'default: -50 - moderator imposed a warning'),('rep_reward_comment','1',5,129,'default: 1 - created a comment (not a reply) '),('rep_req_premium','25000',5,129,'default: 25000 - required reputation for premium status through reputation'),('rep_reward_upload','10',5,129,'default: 10 - suggested / uploaded video / screenshot was approved'),('rep_reward_article','100',5,129,'default: 100 - submitted an approved article/guide'),('rep_reward_user_suspended','-200',5,129,'default: -200 - moderator revoked rights'),('rep_req_votemore_add','250',5,129,'default: 250 - required reputation per additional vote past threshold'),('serialize_precision','5',0,65,' - some derelict code, probably unused'),('memory_limit','4096M',0,200,'default: 4096M - parsing spell.dbc is quite intense'),('default_charset','UTF-8',0,72,'default: UTF-8'),('analytics_user','',6,136,'default: - enter your GA-user here to track site stats'); /*!40000 ALTER TABLE `aowow_config` ENABLE KEYS */; UNLOCK TABLES; @@ -2513,7 +2513,7 @@ UNLOCK TABLES; LOCK TABLES `aowow_dbversion` WRITE; /*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */; -INSERT INTO `aowow_dbversion` VALUES (1448204650,0,NULL,NULL); +INSERT INTO `aowow_dbversion` VALUES (1484926142,0,NULL,NULL); /*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */; UNLOCK TABLES; diff --git a/setup/setup.php b/setup/setup.php index 0e7d0664..4d229ed8 100644 --- a/setup/setup.php +++ b/setup/setup.php @@ -37,7 +37,7 @@ if (!$opt || ((isset($opt['help']) || isset($opt['h'])) && (isset($opt['firstrun echo "--account : create an account with admin privileges\n"; echo "--sql : generate db content from your world tables\n"; echo "--build : create server specific files\n"; - echo "--sync= : regenerate tables/files that depend on given world-table\n"; + echo "--sync= : regenerate tables/files that depend on given world-table\n"; echo "--update : apply new sql updates fetched from github\n"; echo "--firstrun : goes through the nessecary hoops of the initial setup.\n"; echo "additional options\n"; diff --git a/setup/tools/CLISetup.class.php b/setup/tools/CLISetup.class.php index 79267b5b..189360ab 100644 --- a/setup/tools/CLISetup.class.php +++ b/setup/tools/CLISetup.class.php @@ -385,7 +385,8 @@ class CLISetup continue; $charBuff = mb_substr($charBuff, 0, -1); - echo chr(self::CHR_BACK)." ".chr(self::CHR_BACK); + if (!$isHidden && self::$hasReadline) + echo chr(self::CHR_BACK)." ".chr(self::CHR_BACK); } else if ($keyId == self::CHR_LF) { diff --git a/setup/tools/clisetup/account.func.php b/setup/tools/clisetup/account.func.php index f3260ab1..f2f31438 100644 --- a/setup/tools/clisetup/account.func.php +++ b/setup/tools/clisetup/account.func.php @@ -19,6 +19,9 @@ function account() 'pass2' => ['Confirm Password', true ] ); + User::useLocale(LOCALE_EN); + Lang::load(Util::$localeStrings[LOCALE_EN]); + if (CLISetup::readInput($fields)) { CLISetup::log(); diff --git a/setup/tools/clisetup/siteconfig.func.php b/setup/tools/clisetup/siteconfig.func.php index d62684ea..22851dea 100644 --- a/setup/tools/clisetup/siteconfig.func.php +++ b/setup/tools/clisetup/siteconfig.func.php @@ -13,7 +13,7 @@ if (!CLI) function siteconfig() { - $reqKeys = ['SITE_HOST', 'STATIC_HOST']; + $reqKeys = ['site_host', 'static_host']; if (!DB::isConnected(DB_AOWOW)) { diff --git a/setup/tools/filegen/complexImg.func.php b/setup/tools/filegen/complexImg.func.php index f09f80ec..5b971929 100644 --- a/setup/tools/filegen/complexImg.func.php +++ b/setup/tools/filegen/complexImg.func.php @@ -387,7 +387,7 @@ if (!CLI) // source for mapFiles $mapSrcDir = null; - $locDirs = array_filter(CLISetup::$expectedPaths, function($var) use ($l) { return !$var || $var == $l; }); + $locDirs = array_reverse(array_filter(CLISetup::$expectedPaths, function($var) use ($l) { return !$var || $var == $l; }), true); foreach ($locDirs as $mapLoc => $__) { if ($mapLoc) // and trailing slash again diff --git a/setup/tools/filegen/itemsets.func.php b/setup/tools/filegen/itemsets.func.php index e3c053e1..009f833c 100644 --- a/setup/tools/filegen/itemsets.func.php +++ b/setup/tools/filegen/itemsets.func.php @@ -69,8 +69,8 @@ if (!CLI) $setOut['classes'] = []; for ($i = 0; $i < 12; $i++) - if ($set['classMask'] & (1 << ($i - 1))) - $setOut['classes'][] = $i; + if ($set['classMask'] & (1 << $i)) + $setOut['classes'][] = $i + 1; } if ($set['contentGroup']) diff --git a/setup/tools/sqlgen/item_stats.func.php b/setup/tools/sqlgen/item_stats.func.php index 31ad557a..be1e2d75 100644 --- a/setup/tools/sqlgen/item_stats.func.php +++ b/setup/tools/sqlgen/item_stats.func.php @@ -161,7 +161,6 @@ function item_stats(array $ids = []) $offset = $max; $items->writeStatsTable(); - } return true; diff --git a/setup/tools/sqlgen/titles.func.php b/setup/tools/sqlgen/titles.func.php index 295b3987..ce6e1f58 100644 --- a/setup/tools/sqlgen/titles.func.php +++ b/setup/tools/sqlgen/titles.func.php @@ -37,9 +37,9 @@ function titles() $questQuery = ' SELECT - qt.RewardTitle AS ARRAY_KEY, - qt.AllowableRaces, - ge.eventEntry + qt.RewardTitle AS ARRAY_KEY, + qt.AllowableRaces, + IFNULL(ge.eventEntry, 0) AS eventEntry FROM quest_template qt LEFT JOIN @@ -47,7 +47,7 @@ function titles() LEFT JOIN game_event ge ON ge.eventEntry = sq.eventEntry WHERE - qt.RewardTitle <> 0'; + qt.RewardTitle <> 0'; DB::Aowow()->query('REPLACE INTO ?_titles SELECT Id, 0, 0, 0, 0, 0, 0, 0, bitIdx, male_loc0, male_loc2, male_loc3, male_loc6, male_loc8, female_loc0, female_loc2, female_loc3, female_loc6, female_loc8 FROM dbc_chartitles');