mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-28 22:27:15 +00:00
Some additional fixes for PHP errors
Some additional fixes for PHP errors
This commit is contained in:
@@ -16,16 +16,15 @@ The taskmaster will help you on your way to establishing your empire with advice
|
|||||||
|
|
||||||
<b>Game World Timeline</b>
|
<b>Game World Timeline</b>
|
||||||
|
|
||||||
This game world is expected to run until approximately <b>%WORLD_END_DATE%</b>
|
This game world is expected to run until approximately <b>%WORLD_END_DATE%</b>. The estimated end date is calculated dynamically, following the timeline below, plus an additional <b>5 days</b> to allow for final attacks and possible World Wonder setbacks.
|
||||||
.
|
|
||||||
The estimated end date is calculated dynamically from the World Wonder Construction Plan release, the time required to construct the World Wonder from level 0 to level 100 at the current server speed, and an additional <b>5 days</b> to allow for final attacks and possible World Wonder setbacks.
|
|
||||||
|
|
||||||
<ul style="margin-top:0;margin-bottom:0;">
|
<ul style="margin-top:0;margin-bottom:0;">
|
||||||
<li><b>Natars appear:</b> %NATARS_DATE%</li>
|
<li><b>Natars appear:</b> %NATARS_DATE%</li>
|
||||||
<li><b>World Wonder villages appear:</b> %WW_VILLAGES_DATE%</li>
|
<li><b>World Wonder villages appear:</b> %WW_VILLAGES_DATE%</li>
|
||||||
<li><b>World Wonder Construction Plans appear:</b> %WW_PLANS_DATE%</li>
|
<li><b>World Wonder Construction Plans appear:</b> %WW_PLANS_DATE%</li>
|
||||||
<li><b>World Wonder construction time from level 0 to 100:</b> %WW_BUILD_TIME%</li>
|
<li><b>World Wonder build time (level 0 → 100):</b> %WW_BUILD_TIME%</li>
|
||||||
<li><b>Estimated World Wonder completion:</b> %WW100_DATE%</li>
|
<li><b>Estimated World Wonder completion:</b> %WW100_DATE%</li>
|
||||||
|
<li><b>Estimated world end date:</b> %WORLD_END_DATE%</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<b>Natars</b>
|
<b>Natars</b>
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ trait DatabaseBuildingQueries {
|
|||||||
if($job['id'] == $d) $jobToDelete = $job;
|
if($job['id'] == $d) $jobToDelete = $job;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($canBeRemoved && $jobToDelete['field'] > 18 && $jobToDelete['field'] != 99 && $jobToDelete['level'] - 1 == 0){
|
if($canBeRemoved && !empty($jobToDelete) && $jobToDelete['field'] > 18 && $jobToDelete['field'] != 99 && $jobToDelete['level'] - 1 == 0){
|
||||||
$this->setVillageLevel($wid, ["f".$jobToDelete['field']."t"], [0]);
|
$this->setVillageLevel($wid, ["f".$jobToDelete['field']."t"], [0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1563,7 +1563,7 @@ trait DatabaseVillageQueries {
|
|||||||
$y1 = intval($coor['y']);
|
$y1 = intval($coor['y']);
|
||||||
$prevdist = 0;
|
$prevdist = 0;
|
||||||
$array2 = $this->getVillage(0, 4);
|
$array2 = $this->getVillage(0, 4);
|
||||||
$vill = $array2['wref'];
|
$vill = $array2['wref'] ?? 0;
|
||||||
|
|
||||||
if ($array && count($array)){
|
if ($array && count($array)){
|
||||||
foreach($array as $village){
|
foreach($array as $village){
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ class MyGenerator
|
|||||||
*/
|
*/
|
||||||
public function getMapCheck($wref)
|
public function getMapCheck($wref)
|
||||||
{
|
{
|
||||||
return substr(md5($wref), 5, 2);
|
return substr(md5((string) $wref), 5, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -740,6 +740,14 @@ class Message
|
|||||||
|
|
||||||
public function sendWelcome($uid, $username){
|
public function sendWelcome($uid, $username){
|
||||||
global $database;
|
global $database;
|
||||||
|
/*
|
||||||
|
* FIX: $bid40 / $bid15 sunt deja incarcate global de Session.php
|
||||||
|
* (include_once("Data/buidata.php")), care ruleaza pe orice pagina.
|
||||||
|
* Fara "global" aici, require_once() de mai jos e no-op (fisierul
|
||||||
|
* e deja inclus o data in script), iar $bid40/$bid15 raman nesetate
|
||||||
|
* local -> blocul de calcul WW e sarit -> wwBuildSeconds = 0.
|
||||||
|
*/
|
||||||
|
global $bid40, $bid15;
|
||||||
|
|
||||||
$welcomemsg = file_get_contents("GameEngine/Admin/welcome.tpl");
|
$welcomemsg = file_get_contents("GameEngine/Admin/welcome.tpl");
|
||||||
|
|
||||||
|
|||||||
@@ -138,6 +138,12 @@ class Units {
|
|||||||
|
|
||||||
if(!empty($post['dname']) && $post['x'] != "" && $post['y'] != "") return "Insert name or coordinates";
|
if(!empty($post['dname']) && $post['x'] != "" && $post['y'] != "") return "Insert name or coordinates";
|
||||||
|
|
||||||
|
// Neither a village name nor coordinates were provided at all -> $id would
|
||||||
|
// otherwise stay undefined and reach array_push() below unset.
|
||||||
|
if(empty($post['dname']) && (!isset($post['x']) || !isset($post['y']) || $post['x'] === "" || $post['y'] === "")) {
|
||||||
|
return "Insert name or coordinates";
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($post['dname']) && !empty($post['dname'])) {
|
if(isset($post['dname']) && !empty($post['dname'])) {
|
||||||
$id = $database->resolveVillageInput(stripslashes($post['dname']),
|
$id = $database->resolveVillageInput(stripslashes($post['dname']),
|
||||||
(int) ($session->uid ?? 0)); // accepta si "Nume (x|y)"
|
(int) ($session->uid ?? 0)); // accepta si "Nume (x|y)"
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ $field = 'f' . $id;
|
|||||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||||
|
|
||||||
$currentCapacity = $bid10[$currentLevel]['attri'] * STORAGE_MULTIPLIER;
|
// $bid10 is keyed from level 1 upward; at level 0 (not built yet) fall back to the base capacity
|
||||||
|
$currentCapacity = ($currentLevel > 0) ? $bid10[$currentLevel]['attri'] * STORAGE_MULTIPLIER : STORAGE_BASE;
|
||||||
|
|
||||||
$isMax = $building->isMax($buildingType, $id);
|
$isMax = $building->isMax($buildingType, $id);
|
||||||
$maxLevel = 20;
|
$maxLevel = 20;
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ $field = 'f' . $id;
|
|||||||
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
$currentLevel = (int) ($village->resarray[$field] ?? 0);
|
||||||
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
$buildingType = $village->resarray[$field . 't'] ?? 0;
|
||||||
|
|
||||||
$currentCapacity = $bid11[$currentLevel]['attri'] * STORAGE_MULTIPLIER;
|
// $bid11 is keyed from level 1 upward; at level 0 (not built yet) fall back to the base capacity
|
||||||
|
$currentCapacity = ($currentLevel > 0) ? $bid11[$currentLevel]['attri'] * STORAGE_MULTIPLIER : STORAGE_BASE;
|
||||||
|
|
||||||
$isMax = $building->isMax($buildingType, $id);
|
$isMax = $building->isMax($buildingType, $id);
|
||||||
$maxLevel = 20;
|
$maxLevel = 20;
|
||||||
|
|||||||
+1
-1
@@ -41,7 +41,7 @@ if($village->capital == 1 && $village->resarray['f'.$_GET['id'].'t'] == 35 && $s
|
|||||||
$clay = $festival['clay'];
|
$clay = $festival['clay'];
|
||||||
$iron = $festival['iron'];
|
$iron = $festival['iron'];
|
||||||
$crop = $festival['crop'];
|
$crop = $festival['crop'];
|
||||||
$database->modifyResource($village->resarray['vref'],$wood,$clay,$iron,$crop,$mode);
|
$database->modifyResource($village->resarray['vref'],$wood,$clay,$iron,$crop,0);
|
||||||
$database->addFestival($village->resarray['vref'],$endtime);
|
$database->addFestival($village->resarray['vref'],$endtime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@ use App\Utils\AccessLogger;
|
|||||||
include_once("GameEngine/Village.php");
|
include_once("GameEngine/Village.php");
|
||||||
AccessLogger::logRequest();
|
AccessLogger::logRequest();
|
||||||
|
|
||||||
$amount = $_SESSION['amount'];
|
$amount = $_SESSION['amount'] ?? 0;
|
||||||
if(isset($_GET['newdid'])) {
|
if(isset($_GET['newdid'])) {
|
||||||
$_SESSION['wid'] = $_GET['newdid'];
|
$_SESSION['wid'] = $_GET['newdid'];
|
||||||
header("Location: ".$_SERVER['PHP_SELF']);
|
header("Location: ".$_SERVER['PHP_SELF']);
|
||||||
|
|||||||
+1
-1
@@ -26,7 +26,7 @@ use App\Utils\AccessLogger;
|
|||||||
include_once("GameEngine/Village.php");
|
include_once("GameEngine/Village.php");
|
||||||
AccessLogger::logRequest();
|
AccessLogger::logRequest();
|
||||||
|
|
||||||
$amount = $_SESSION['amount'];
|
$amount = $_SESSION['amount'] ?? 0;
|
||||||
if(isset($_GET['newdid'])) {
|
if(isset($_GET['newdid'])) {
|
||||||
$_SESSION['wid'] = $_GET['newdid'];
|
$_SESSION['wid'] = $_GET['newdid'];
|
||||||
header("Location: ".$_SERVER['PHP_SELF']);
|
header("Location: ".$_SERVER['PHP_SELF']);
|
||||||
|
|||||||
Reference in New Issue
Block a user