This commit is contained in:
novgorodschi catalin
2026-08-01 07:29:11 +03:00
parent a1a714b062
commit f058203aa4
6 changed files with 97 additions and 15 deletions
+8 -8
View File
@@ -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)),
@@ -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;
+12
View File
@@ -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");
}
+12
View File
@@ -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");
}
+45 -1
View File
@@ -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");
+6 -6
View File
@@ -1,11 +1,11 @@
<?php
#################################################################################
# Regenerates css/hero_items.css from GameEngine/Data/hero_items.php so the #
# sprite grid can never drift from the catalog. Run from the repo root: #
# php var/tools/generate_hero_sprites.php #
# Grid contract: img/hero/items.png is a 16-column sheet of 32x32 cells in #
# CATALOG ORDER. Replace the PNG with real art on the same grid and rerun #
# nothing - only rerun this script when the CATALOG changes. #
## Regenerates css/hero_items.css from GameEngine/Data/hero_items.php so the ##
## sprite grid can never drift from the catalog. Run from the repo root: ##
## php var/tools/generate_hero_sprites.php ##
## Grid contract: img/hero/items.png is a 16-column sheet of 32x32 cells in ##
## CATALOG ORDER. Replace the PNG with real art on the same grid and rerun ##
## nothing - only rerun this script when the CATALOG changes. ##
#################################################################################
define('TB_PREFIX', 'x');
include __DIR__ . '/../../GameEngine/Data/hero_items.php';