diff --git a/GameEngine/Data/hero_items.php b/GameEngine/Data/hero_items.php index a6c05ba7..717362d0 100644 --- a/GameEngine/Data/hero_items.php +++ b/GameEngine/Data/hero_items.php @@ -38,13 +38,13 @@ if (!defined('NTYPE_ADVENTURE_REPORT')) define('NTYPE_ADVENTURE_REPORT', 26); if (!defined('NTYPE_AUCTION_REPORT')) define('NTYPE_AUCTION_REPORT', 27); /* Equipment slots */ -if (!defined('HSLOT_HELMET')) define('HSLOT_HELMET', 1); -if (!defined('HSLOT_BODY')) define('HSLOT_BODY', 2); -if (!defined('HSLOT_RIGHT')) define('HSLOT_RIGHT', 3); // weapon -if (!defined('HSLOT_LEFT')) define('HSLOT_LEFT', 4); // shield/horn/sack/map/pennant/standard -if (!defined('HSLOT_SHOES')) define('HSLOT_SHOES', 5); // boots + spurs -if (!defined('HSLOT_HORSE')) define('HSLOT_HORSE', 6); -if (!defined('HSLOT_BAG')) define('HSLOT_BAG', 7); // stackable consumables +if (!defined('HSLOT_HELMET')) define('HSLOT_HELMET', 1); //HELMET +if (!defined('HSLOT_BODY')) define('HSLOT_BODY', 2); //ARMOUR +if (!defined('HSLOT_RIGHT')) define('HSLOT_RIGHT', 3); //WEAPONS RIGHT +if (!defined('HSLOT_LEFT')) define('HSLOT_LEFT', 4); //WEAPONS LEFT shield/horn/sack/map/pennant/standard +if (!defined('HSLOT_SHOES')) define('HSLOT_SHOES', 5); //SHOES&BOOTS +if (!defined('HSLOT_HORSE')) define('HSLOT_HORSE', 6); //HORSE +if (!defined('HSLOT_BAG')) define('HSLOT_BAG', 7); //Stackable consumables /* ============================================================================ * BONUS TYPES (keys inside $item['bonus']) @@ -146,7 +146,7 @@ $heroItemCatalog = array( 56 => array('name' => 'Standard', 'slot' => HSLOT_LEFT, 'tier' => 2, 'bonus' => array(HB_SPEED_ALLY => 20)), 57 => array('name' => 'Great Standard', 'slot' => HSLOT_LEFT, 'tier' => 3, 'bonus' => array(HB_SPEED_ALLY => 25)), - /* ---------------- SHOES (sheet: Incaltaminte_Cai - boots + spurs) ---------------- */ + /* ---------------- SHOES (sheet: Incaltaminte - boots + spurs) ---------------- */ 60 => array('name' => 'Boots of Regeneration', 'slot' => HSLOT_SHOES, 'tier' => 1, 'bonus' => array(HB_REGEN_HP => 10)), 61 => array('name' => 'Boots of Recovery', 'slot' => HSLOT_SHOES, 'tier' => 2, 'bonus' => array(HB_REGEN_HP => 15)), 62 => array('name' => 'Boots of Healing', 'slot' => HSLOT_SHOES, 'tier' => 3, 'bonus' => array(HB_REGEN_HP => 20)), diff --git a/GameEngine/Database/DatabaseTroopQueries.php b/GameEngine/Database/DatabaseTroopQueries.php index cac482ac..458a2408 100644 --- a/GameEngine/Database/DatabaseTroopQueries.php +++ b/GameEngine/Database/DatabaseTroopQueries.php @@ -176,6 +176,20 @@ trait DatabaseTroopQueries { } } + // Pastram doar identificatorii utilizabili. + // + // BUG REPARAT: un cont fara niciun sat ajungea aici cu [null]. Garda de mai + // sus verifica doar count(), care e 1, deci trecea - iar implode producea + // "vref IN()", eroare de sintaxa MariaDB si 500 pe toata interfata, fara + // cale de iesire. Asa patise contul Support, creat fara sat la instalare. + $vid = array_values(array_filter(array_map('intval', $vid), function ($v) { + return $v > 0; + })); + + if (!$vid) { + return $returnArray; + } + $q = "SELECT * from " . TB_PREFIX . "units where vref IN(".implode(', ', $vid).")"; $result = mysqli_query($this->dblink,$q); $resCount = 0; diff --git a/gpack/travian_default/lang/en/compact.css b/gpack/travian_default/lang/en/compact.css index 44b61dc3..788768f6 100644 --- a/gpack/travian_default/lang/en/compact.css +++ b/gpack/travian_default/lang/en/compact.css @@ -8520,6 +8520,18 @@ img.g29 { img.g29b { background-image: url("../../img/g/g29b.gif"); } +/* Zidurile triburilor vechi: regulile lipseau, desi imaginile exista in + img/g/. De aceea in pagina de constructie se vedea zidul la triburile noi + (Huni, Egipteni, Spartani, Vikingi) dar nu si la Romani, Teutoni si Gali. */ +img.g31 { + background-image: url("../../img/g/g31.gif"); +} +img.g32 { + background-image: url("../../img/g/g32.gif"); +} +img.g33 { + background-image: url("../../img/g/g33.gif"); +} img.g30 { background-image: url("../../img/g/g30.gif"); } diff --git a/gpack/travian_t4/lang/en/compact.css b/gpack/travian_t4/lang/en/compact.css index 44b61dc3..788768f6 100644 --- a/gpack/travian_t4/lang/en/compact.css +++ b/gpack/travian_t4/lang/en/compact.css @@ -8520,6 +8520,18 @@ img.g29 { img.g29b { background-image: url("../../img/g/g29b.gif"); } +/* Zidurile triburilor vechi: regulile lipseau, desi imaginile exista in + img/g/. De aceea in pagina de constructie se vedea zidul la triburile noi + (Huni, Egipteni, Spartani, Vikingi) dar nu si la Romani, Teutoni si Gali. */ +img.g31 { + background-image: url("../../img/g/g31.gif"); +} +img.g32 { + background-image: url("../../img/g/g32.gif"); +} +img.g33 { + background-image: url("../../img/g/g33.gif"); +} img.g30 { background-image: url("../../img/g/g30.gif"); } diff --git a/install/include/accounts.php b/install/include/accounts.php index f6a8539c..be1d7a61 100644 --- a/install/include/accounts.php +++ b/install/include/accounts.php @@ -79,7 +79,11 @@ if($status == 0) { $database->setFieldTaken($wid); $database->addVillage($wid, $uid, $_POST['aname'], 1); - $database->addResourceFields($wid, $database->getVillageType($wid, false)); + + // Satul adminului primeste mereu configuratia 4-4-4-6 (tipul 3), + // nu una aleatoare: e satul de la centrul hartii si trebuie sa fie + // echilibrat, indiferent ce tip are casuta pe harta. + $database->addResourceFields($wid, 3); $addUnitsWrefs[] = $wid; $addTechWrefs[] = $wid; $addABTechWrefs[] = $wid; @@ -111,6 +115,46 @@ $password = $_POST['spw']; mysqli_query($database->dblink, "UPDATE " . TB_PREFIX . "users SET password = '" . password_hash($password, PASSWORD_BCRYPT,['cost' => 12]) . "' WHERE username = 'Support'"); + /** + * Satul contului Support. + * + * BUG REPARAT: Support primea doar parola, fara sat. La prima autentificare, + * Village.php nu gasea niciun sat, iar lantul se termina cu o eroare fatala + * in getUnit() (interogare SQL construita din valori goale) - adica 500 pe + * toata interfata, fara nicio cale de iesire. + * + * Ii dam un sat langa Multihunter, cu aceeasi configuratie 4-4-4-6. + */ + $supportRow = mysqli_fetch_assoc(mysqli_query($database->dblink, + "SELECT id FROM " . TB_PREFIX . "users WHERE username = 'Support' LIMIT 1")); + + if ($supportRow) { + $supportUid = (int) $supportRow['id']; + $supportHas = mysqli_fetch_assoc(mysqli_query($database->dblink, + "SELECT COUNT(*) AS total FROM " . TB_PREFIX . "vdata WHERE owner = " . $supportUid)); + + if (!$supportHas || (int) $supportHas['total'] === 0) { + // pornim de langa Multihunter (0,0) si mergem pana gasim liber + $supportX = 1; + + while ($supportX < 20) { + $supportWid = $admin->getWref($supportX, 0); + + if ($database->getVillageState($supportWid) == 0) { + $database->setFieldTaken($supportWid); + $database->addVillage($supportWid, $supportUid, 'Support', 1); + $database->addResourceFields($supportWid, 3); + $database->addUnits($supportWid); + $database->addTech($supportWid); + $database->addABTech($supportWid); + break; + } + + $supportX++; + } + } + } + $gameinstall = 0; header("Location: ../index.php?s=5"); diff --git a/var/tools/generate_hero_sprites.php b/var/tools/generate_hero_sprites.php index b83bc14e..a6bc0c9d 100644 --- a/var/tools/generate_hero_sprites.php +++ b/var/tools/generate_hero_sprites.php @@ -1,11 +1,11 @@