diff --git a/config/config.php.in b/config/config.php.in index bd0c30fe..b4036d97 100644 --- a/config/config.php.in +++ b/config/config.php.in @@ -4,6 +4,8 @@ if (!defined('AOWOW_REVISION')) die('illegal access'); +// use as example. File is generated from setup. + // -- Aowow Database -- // contains world-data, user-data and logs $AoWoWconf['aowow'] = array( @@ -36,14 +38,12 @@ $AoWoWconf['auth'] = array( // -- Characters Database -- // used to display profiles -$AoWoWconf['characters'][0] = array( +$AoWoWconf['characters'][] = array( 'host' => '127.0.0.1', 'user' => '', 'pass' => '', 'db' => 'characters', 'prefix' => '' ); -// add other realms if necessary -// $AoWoWconf['characters'][] = []; ?> diff --git a/includes/defines.php b/includes/defines.php index b605ee60..4e160e90 100644 --- a/includes/defines.php +++ b/includes/defines.php @@ -250,6 +250,7 @@ define('QUEST_CU_AUTO_ACCEPT', 0x20); define('QUEST_CU_PVP_ENABLED', 0x40); define('MAX_LEVEL', 80); +define('WOW_BUILD', 12340); // Loot handles define('LOOT_FISHING', 'fishing_loot_template'); diff --git a/localization/locale_dede.php b/localization/locale_dede.php index 69171b6d..a2c96a1a 100644 --- a/localization/locale_dede.php +++ b/localization/locale_dede.php @@ -437,6 +437,7 @@ $lang = array( 'titleReward' => 'Euch wird der Titel "%s" verliehen', 'slain' => "getötet", 'reqNumCrt' => "Benötigt", + 'rfAvailable' => "Verfügbar auf Realm:", '_transfer' => 'Dieser Erfolg wird mit %s vertauscht, wenn Ihr zur %s wechselt.', ), 'race' => array( diff --git a/localization/locale_enus.php b/localization/locale_enus.php index 49c5fbce..1334ef39 100644 --- a/localization/locale_enus.php +++ b/localization/locale_enus.php @@ -432,6 +432,7 @@ $lang = array( 'titleReward' => 'You shall be granted the title "%s"', 'slain' => "slain", 'reqNumCrt' => "Requires", + 'rfAvailable' => "Available on realm:", '_transfer' => 'This achievement will be converted to %s if you transfer to %s.', ), 'race' => array( diff --git a/localization/locale_eses.php b/localization/locale_eses.php index 0e3f2f87..2cd71e59 100644 --- a/localization/locale_eses.php +++ b/localization/locale_eses.php @@ -436,6 +436,7 @@ $lang = array( 'titleReward' => 'Deberías obtener el título "%s"', 'slain' => "matado", 'reqNumCrt' => "Requiere", + 'rfAvailable' => "Disponible en reino:", '_transfer' => 'Este logro será convertido a %s si lo transfieres a la %s.', ), 'race' => array( diff --git a/localization/locale_frfr.php b/localization/locale_frfr.php index 9d8678a2..1d6deb9a 100644 --- a/localization/locale_frfr.php +++ b/localization/locale_frfr.php @@ -60,7 +60,7 @@ $lang = array( 'oneFilter' => "Au moins un", 'applyFilter' => "Appliquer le filtre", 'resetForm' => "Rétablir", - 'refineSearch' => "Astuce : Affinez votre recherche en utilisant une sous-catégorie.", + 'refineSearch' => "Astuce : Affinez votre recherche en utilisant une sous-catégorie.", 'clear' => "effacer", 'exactMatch' => "Concordance exacte", '_reqLevel' => "Niveau requis", @@ -119,7 +119,7 @@ $lang = array( // help 'help' => "Aide", 'helpTopics' => array( - "Le guide du commentaire", "Visionneuse 3D", "Captures d'écran : Trucs et astuces", "Échelles de valeurs", + "Le guide du commentaire", "Visionneuse 3D", "Captures d'écran : Trucs et astuces", "Échelles de valeurs", "Calculateur de talents", "Comparaison d'objets", "Profiler", "Markup Guide" ), @@ -129,7 +129,7 @@ $lang = array( 'foundResult' => "Résultats de recherche pour", 'noResult' => "Aucun résultat pour malordawsne", 'tryAgain' => "Veuillez essayer d'autres mots ou vérifiez l'orthographe des termes de recherche.", - 'ignoredTerms' => "Les mots suivants ont été ignorés dans votre recherches : %s", + 'ignoredTerms' => "Les mots suivants ont été ignorés dans votre recherches : %s", // formating 'colon' => ' : ', @@ -317,11 +317,11 @@ $lang = array( // recovery 'recoverUser' => "Demande de nom d'utilisateur", - 'recoverPass' => "Changement de mot de passe : Étape %s de 2", + 'recoverPass' => "Changement de mot de passe : Étape %s de 2", 'newPass' => "New Password", // creation - 'register' => "Enregistrement : Étape %s de 2", + 'register' => "Enregistrement : Étape %s de 2", 'passConfirm' => "Confirmez", // dashboard @@ -430,11 +430,12 @@ $lang = array( 'points' => "Points", 'series' => "Série", 'outOf' => "sur", - 'criteriaType' => "Criterium Type-Id:", + 'criteriaType' => "Criterium Type-Id : ", 'itemReward' => "Vous recevrez", 'titleReward' => "Vous devriez recevoir le titre \"%s\"", 'slain' => "tué", 'reqNumCrt' => "Nécessite", + 'rfAvailable' => "Disponibles sur les royaumes : ", '_transfer' => 'Cet haut fait sera converti en %s si vous transférez en %s.', ), 'race' => array( @@ -546,7 +547,7 @@ $lang = array( 1 => "Dun Morogh", 41 => "Défilé de Deuillevent", 1537 => "Forgefer", 12 => "Forêt d'Elwynn", 130 => "Forêt des Pins argentés", 1497 => "Fossoyeuse", 51 => "Gorge des Vents brûlants", 45 => "Hautes-terres d'Arathi", 1519 => "Hurlevent", 44 => "Les Carmines", 47 => "Les Hinterlands", 11 => "Les Paluns", 3433 => "Les Terres fantômes", 38 => "Loch Modan", 3487 => "Lune-d'argent", - 139 => "Maleterres de l'est", 28 => "Maleterres de l'ouest", 4298 => "Maleterres : l'enclave Écarlate", 8 => "Marais des Chagrins", 40 => "Marche de l'Ouest", + 139 => "Maleterres de l'est", 28 => "Maleterres de l'ouest", 4298 => "Maleterres : l'enclave Écarlate", 8 => "Marais des Chagrins", 40 => "Marche de l'Ouest", 25 => "Mont Rochenoire", 36 => "Montagnes d'Alterac", 46 => "Steppes ardentes", 4 => "Terres foudroyées", 3 => "Terres ingrates", 2257 => "Tram des profondeurs", 33 => "Vallée de Strangleronce", 4080 => "Île de Quel'Danas" ), @@ -575,7 +576,7 @@ $lang = array( -81 => "Guerrier", -161 => "Mage", -141 => "Paladin", -262 => "Prêtre", -162 => "Voleur" ), 2 => array( "Donjons", - 4494 => "Ahn'kahet : l'Ancien royaume", 4277 => "Azjol-Nérub", 718 => "Cavernes des lamentations", 1196 => "Cime d'Utgarde", 2367 => "Contreforts de Hautebrande d'antan", + 4494 => "Ahn'kahet : l'Ancien royaume", 4277 => "Azjol-Nérub", 718 => "Cavernes des lamentations", 1196 => "Cime d'Utgarde", 2367 => "Contreforts de Hautebrande d'antan", 3790 => "Cryptes Auchenaï", 209 => "Donjon d'Ombrecroc", 206 => "Donjon d'Utgarde", 4196 => "Donjon de Drak'Tharon", 3845 => "Donjon de la Tempête", 4813 => "Fosse de Saron", 721 => "Gnomeregan", 2437 => "Gouffre de Ragefeu", 1941 => "Grottes du temps", 4416 => "Gundrak", 2557 => "Hache-tripes", 491 => "Kraal de Tranchebauge", 3848 => "L'Arcatraz", 4228 => "L'Oculus", 4100 => "L'Épuration de Stratholme", @@ -893,7 +894,7 @@ $lang = array( "Épique", "Légendaire", "Artefact", "Héritage" ), 'trigger' => array( - "Utilise : ", "Équipé : ", "Chances quand vous touchez : ", null, null, + "Utilise : ", "Équipé : ", "Chances quand vous touchez : ", null, null, null, null ), 'bonding' => array( diff --git a/localization/locale_ruru.php b/localization/locale_ruru.php index f4e47d0e..3686c337 100644 --- a/localization/locale_ruru.php +++ b/localization/locale_ruru.php @@ -435,6 +435,7 @@ $lang = array( 'titleReward' => 'Наградное звание: "%s"', 'slain' => "убито", 'reqNumCrt' => "Требуется", + 'rfAvailable' => "[Available on realm]:", '_transfer' => 'Этот предмет превратится в %s, если вы перейдете за %s.', ), 'race' => array( diff --git a/pages/achievement.php b/pages/achievement.php index ed25622c..95170e01 100644 --- a/pages/achievement.php +++ b/pages/achievement.php @@ -99,9 +99,22 @@ class AchievementPage extends GenericPage $infobox[] = Lang::main('side').Lang::main('colon').Lang::game('si', SIDE_BOTH); } - // todo (low): crosslink with charactersDB to check if realmFirsts are still available + // realm first available? + if ($this->subject->getField('flags') & 0x100 && DB::isConnectable(DB_AUTH)) + { + $avlb = []; + foreach (DB::Auth()->selectCol('SELECT id AS ARRAY_KEY, name FROM realmlist WHERE allowedSecurityLevel = 0 AND gamebuild = ?d', WOW_VERSION) AS $rId => $name) + { + if (!DB::isConnectable(DB_CHARACTERS . $rId)) + continue; - $infobox = array_merge($infobox, Lang::getInfoBoxForFlags($this->subject->getField('cuFlags'))); + if (!DB::Characters($rId)->selectCell('SELECT 1 FROM character_achievement WHERE achievement = ?d LIMIT 1', $this->typeId)) + $avlb[] = $name; + } + + if ($avlb) + $infobox[] = Lang::achievement('rfAvailable').implode(', ', $avlb); + } /**********/ /* Series */ diff --git a/setup/tools/clisetup/dbconfig.func.php b/setup/tools/clisetup/dbconfig.func.php index cf9af00a..e09fabc3 100644 --- a/setup/tools/clisetup/dbconfig.func.php +++ b/setup/tools/clisetup/dbconfig.func.php @@ -24,7 +24,7 @@ function dbconfig() ); $testDB = function($idx, $name, $dbInfo) { - $buff = '['.CLISetup::bold($idx).'] '.str_pad($name, 12); + $buff = '['.CLISetup::bold($idx).'] '.str_pad($name, 17); $errStr = ''; if ($dbInfo['host']) @@ -50,9 +50,7 @@ function dbconfig() foreach ($databases as $idx => $name) { - if ($name == 'characters' && empty($AoWoWconf[$name][0])) - $AoWoWconf[$name][0] = array_combine(array_keys($dbFields), ['', '', '', '', '']); - else if (empty($AoWoWconf[$name])) + if (empty($AoWoWconf[$name]) && $name != 'characters' ) $AoWoWconf[$name] = array_combine(array_keys($dbFields), ['', '', '', '', '']); } @@ -61,39 +59,50 @@ function dbconfig() CLISetup::log(); CLISetup::log("select a numerical index to use the corresponding entry"); - $charOffset = 0; + $nCharDBs = 0; foreach ($databases as $idx => $name) { if ($idx != 3) CLISetup::log($testDB($idx, $name, $AoWoWconf[$name])); else foreach ($AoWoWconf[$name] as $charIdx => $dbInfo) - CLISetup::log($testDB($idx + $charOffset++, $name, $AoWoWconf[$name][$charIdx])); + CLISetup::log($testDB($idx + $nCharDBs++, $name.' ['.$charIdx.']', $AoWoWconf[$name][$charIdx])); } - CLISetup::log("[".CLISetup::bold(3 + $charOffset)."] add an additional Character DB"); + CLISetup::log("[".CLISetup::bold(3 + $nCharDBs)."] add an additional Character DB"); while (true) { $inp = ['idx' => ['', true, '/\d/']]; if (CLISetup::readInput($inp, true) && $inp) { - if (is_numeric($inp['idx']) && $inp['idx'] >= 0 && $inp['idx'] <= (3 + $charOffset)) + if ($inp['idx'] >= 0 && $inp['idx'] <= (3 + $nCharDBs)) { $curFields = $dbFields; + + if ($inp['idx'] == 3 + $nCharDBs) // add new realmDB + $curFields['realmId'] = ['Realm Id', false, '/[1-9][0-9]*/']; + if (CLISetup::readInput($curFields)) { + // auth, world or aowow if ($inp['idx'] < 3) $AoWoWconf[$databases[$inp['idx']]] = $curFields ?: array_combine(array_keys($dbFields), ['', '', '', '', '']); - else if ($inp['idx'] == 3 + $charOffset) + // new char DB + else if ($inp['idx'] == 3 + $nCharDBs) { if ($curFields) - $AoWoWconf[$databases[3]][] = $curFields; + { + $_ = $curFields['realmId']; + unset($curFields['realmId']); + $AoWoWconf[$databases[3]][$_] = $curFields; + } } + // existing char DB else { $i = 0; - foreach ($AoWoWconf[$databases[3]] as $offset => &$dbInfo) + foreach ($AoWoWconf[$databases[3]] as $realmId => &$dbInfo) { if ($inp['idx'] - 3 != $i++) continue; @@ -101,7 +110,7 @@ function dbconfig() if ($curFields) $dbInfo = $curFields; else - unset($AoWoWconf[$databases[3]][$offset]); + unset($AoWoWconf[$databases[3]][$realmId]); } } diff --git a/setup/tools/filegen/realmMenu.func.php b/setup/tools/filegen/realmMenu.func.php index aac92394..4b3ccc55 100644 --- a/setup/tools/filegen/realmMenu.func.php +++ b/setup/tools/filegen/realmMenu.func.php @@ -48,7 +48,7 @@ if (!CLI) if (DB::isConnectable(DB_AUTH)) { - $rows = DB::Auth()->select('SELECT name, IF(timezone IN (8, 9, 10, 11, 12), "eu", "us") AS region FROM realmlist WHERE allowedSecurityLevel = 0'); + $rows = DB::Auth()->select('SELECT name, IF(timezone IN (8, 9, 10, 11, 12), "eu", "us") AS region FROM realmlist WHERE allowedSecurityLevel = 0 AND gamebuild = ?d', WOW_VERSION); foreach ($rows as $row) { diff --git a/setup/tools/filegen/realms.func.php b/setup/tools/filegen/realms.func.php index 6cb0882a..8f85dc2c 100644 --- a/setup/tools/filegen/realms.func.php +++ b/setup/tools/filegen/realms.func.php @@ -30,7 +30,7 @@ if (!CLI) { $realms = []; if (DB::isConnectable(DB_AUTH)) - $realms = DB::Auth()->select('SELECT id AS ARRAY_KEY, name, ? AS battlegroup, IF(timezone IN (8, 9, 10, 11, 12), "eu", "us") AS region FROM realmlist WHERE allowedSecurityLevel = 0', CFG_BATTLEGROUP); + $realms = DB::Auth()->select('SELECT id AS ARRAY_KEY, name, ? AS battlegroup, IF(timezone IN (8, 9, 10, 11, 12), "eu", "us") AS region FROM realmlist WHERE allowedSecurityLevel = 0 AND gamebuild = ?d', CFG_BATTLEGROUP, WOW_VERSION); else CLISetup::log(' - realms: Auth-DB not set up .. static data g_realms will be empty', CLISetup::LOG_WARN);