mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-31 07:37:13 +00:00
@@ -4242,7 +4242,7 @@ class Automation {
|
|||||||
}
|
}
|
||||||
$crop = $database->getCropProdstarv($train['vref'], false);
|
$crop = $database->getCropProdstarv($train['vref'], false);
|
||||||
$unitarrays = $this->getAllUnits($train['vref'], false);
|
$unitarrays = $this->getAllUnits($train['vref'], false);
|
||||||
$village = $database->getVillage($train['vref'], false);
|
$village = $database->getVillage($train['vref'], 0, false);
|
||||||
$upkeep = $village['pop'] + $this->getUpkeep($unitarrays, 0);
|
$upkeep = $village['pop'] + $this->getUpkeep($unitarrays, 0);
|
||||||
$starv = $database->getVillageField($train['vref'],"starv");
|
$starv = $database->getVillageField($train['vref'],"starv");
|
||||||
if ($crop < $upkeep){
|
if ($crop < $upkeep){
|
||||||
|
|||||||
@@ -1001,7 +1001,7 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getVrefField($ref, $field, $use_cache = true) {
|
function getVrefField($ref, $field, $use_cache = true) {
|
||||||
return $this->getVillage($ref, $use_cache)[$field];
|
return $this->getVillage($ref, 0, $use_cache)[$field];
|
||||||
}
|
}
|
||||||
|
|
||||||
// no need to cache this method
|
// no need to cache this method
|
||||||
@@ -1685,7 +1685,7 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
return self::$villageIDsCacheSimple[$uid];
|
return self::$villageIDsCacheSimple[$uid];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getVillage($vid, $use_cache = true) {
|
function getVillage($vid, $mode = 0, $use_cache = true) {
|
||||||
list($vid) = $this->escape_input((int) $vid);
|
list($vid) = $this->escape_input((int) $vid);
|
||||||
|
|
||||||
// first of all, check if we should be using cache and whether the field
|
// first of all, check if we should be using cache and whether the field
|
||||||
@@ -1803,7 +1803,7 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
|
|
||||||
function getVillageField($ref, $field, $use_cache = true) {
|
function getVillageField($ref, $field, $use_cache = true) {
|
||||||
// return all data, don't waste time by selecting fields one by one
|
// return all data, don't waste time by selecting fields one by one
|
||||||
$villageArray = $this->getVillage($ref, $use_cache);
|
$villageArray = $this->getVillage($ref, 0, $use_cache);
|
||||||
$result = (isset($villageArray[$field]) ? $villageArray[$field] : null);
|
$result = (isset($villageArray[$field]) ? $villageArray[$field] : null);
|
||||||
|
|
||||||
if($result){
|
if($result){
|
||||||
@@ -1828,7 +1828,7 @@ class MYSQLi_DB implements IDbConnection {
|
|||||||
|
|
||||||
function getVillageFields($ref, $fields, $use_cache = true) {
|
function getVillageFields($ref, $fields, $use_cache = true) {
|
||||||
// return all data, don't waste time by selecting fields one by one
|
// return all data, don't waste time by selecting fields one by one
|
||||||
return $this->getVillage($ref, $use_cache);
|
return $this->getVillage($ref, 0, $use_cache);
|
||||||
|
|
||||||
/*list($ref, $field) = $this->escape_input((int) $ref, $fields);
|
/*list($ref, $field) = $this->escape_input((int) $ref, $fields);
|
||||||
|
|
||||||
@@ -6068,27 +6068,27 @@ References: User ID/Message ID, Mode
|
|||||||
//MARKET FIXES
|
//MARKET FIXES
|
||||||
function getWoodAvailable($wref, $use_cache = true) {
|
function getWoodAvailable($wref, $use_cache = true) {
|
||||||
// return from cache
|
// return from cache
|
||||||
return $this->getVillage($wref, $use_cache)['wood'];
|
return $this->getVillage($wref, 0, $use_cache)['wood'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getClayAvailable($wref, $use_cache = true) {
|
function getClayAvailable($wref, $use_cache = true) {
|
||||||
// return from cache
|
// return from cache
|
||||||
return $this->getVillage($wref, $use_cache)['clay'];
|
return $this->getVillage($wref, 0, $use_cache)['clay'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIronAvailable($wref, $use_cache = true) {
|
function getIronAvailable($wref, $use_cache = true) {
|
||||||
// return from cache
|
// return from cache
|
||||||
return $this->getVillage($wref, $use_cache)['iron'];
|
return $this->getVillage($wref, 0, $use_cache)['iron'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCropAvailable($wref, $use_cache = true) {
|
function getCropAvailable($wref, $use_cache = true) {
|
||||||
// return from cache
|
// return from cache
|
||||||
return $this->getVillage($wref, $use_cache)['crop'];
|
return $this->getVillage($wref, 0, $use_cache)['crop'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function Getowner($vid) {
|
function Getowner($vid) {
|
||||||
// return from cache
|
// return from cache
|
||||||
return $this->getVillage($vid, $use_cache)['owner'];
|
return $this->getVillage($vid, 0, $use_cache)['owner'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user