mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Fix for db throws and install process not going through
This commit is contained in:
+14
-3
@@ -1356,6 +1356,7 @@ class MYSQLi_DB implements IDbConnection {
|
||||
}
|
||||
|
||||
function setFieldTaken($id) {
|
||||
if(empty($id)) return;
|
||||
if (!is_array($id)) {
|
||||
$id = [$id];
|
||||
}
|
||||
@@ -5655,6 +5656,8 @@ References: User ID/Message ID, Mode
|
||||
list($moveid) = $this->escape_input($moveid);
|
||||
}
|
||||
|
||||
if(empty($moveid)) return;
|
||||
|
||||
// rather than re-selecting data and updating cache here, let's just
|
||||
// flush the cache and let it re-cach itself as neccessary
|
||||
self::$marketMovementCache = [];
|
||||
@@ -6012,6 +6015,7 @@ References: User ID/Message ID, Mode
|
||||
function addUnits($vid, $troopsArray = null) {
|
||||
list($vid, $type, $values) = $this->escape_input($vid, $type, $values);
|
||||
|
||||
if(empty($vid)) return;
|
||||
if (!is_array($vid)) $vid = [$vid];
|
||||
$types = $values = "";
|
||||
|
||||
@@ -6201,6 +6205,7 @@ References: User ID/Message ID, Mode
|
||||
}
|
||||
|
||||
function addTech($vid) {
|
||||
if(empty($vid)) return;
|
||||
if (!is_array($vid)) {
|
||||
$vid = [$vid];
|
||||
}
|
||||
@@ -6214,6 +6219,7 @@ References: User ID/Message ID, Mode
|
||||
}
|
||||
|
||||
function addABTech($vid) {
|
||||
if(empty($vid)) return;
|
||||
if (!is_array($vid)) {
|
||||
$vid = [$vid];
|
||||
}
|
||||
@@ -7056,9 +7062,13 @@ References: User ID/Message ID, Mode
|
||||
try {
|
||||
// check that we don't have the structure in place already
|
||||
// (we'd have at least 1 user present, since 4 are being created by default - Support, Nature, Multihunter & Taskmaster)
|
||||
$data_exist = $this->query_return("SELECT * FROM " . TB_PREFIX . "users LIMIT 1");
|
||||
if ($data_exist && count($data_exist)) {
|
||||
return false;
|
||||
try {
|
||||
$data_exist = $this->query_return("SELECT * FROM " . TB_PREFIX . "users LIMIT 1");
|
||||
if ($data_exist && count($data_exist)) {
|
||||
return false;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
||||
}
|
||||
|
||||
// load the DB structure SQL file
|
||||
@@ -7073,6 +7083,7 @@ References: User ID/Message ID, Mode
|
||||
return false;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
echo($e);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user