mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-02 16:37:15 +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) {
|
function setFieldTaken($id) {
|
||||||
|
if(empty($id)) return;
|
||||||
if (!is_array($id)) {
|
if (!is_array($id)) {
|
||||||
$id = [$id];
|
$id = [$id];
|
||||||
}
|
}
|
||||||
@@ -5655,6 +5656,8 @@ References: User ID/Message ID, Mode
|
|||||||
list($moveid) = $this->escape_input($moveid);
|
list($moveid) = $this->escape_input($moveid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(empty($moveid)) return;
|
||||||
|
|
||||||
// rather than re-selecting data and updating cache here, let's just
|
// rather than re-selecting data and updating cache here, let's just
|
||||||
// flush the cache and let it re-cach itself as neccessary
|
// flush the cache and let it re-cach itself as neccessary
|
||||||
self::$marketMovementCache = [];
|
self::$marketMovementCache = [];
|
||||||
@@ -6012,6 +6015,7 @@ References: User ID/Message ID, Mode
|
|||||||
function addUnits($vid, $troopsArray = null) {
|
function addUnits($vid, $troopsArray = null) {
|
||||||
list($vid, $type, $values) = $this->escape_input($vid, $type, $values);
|
list($vid, $type, $values) = $this->escape_input($vid, $type, $values);
|
||||||
|
|
||||||
|
if(empty($vid)) return;
|
||||||
if (!is_array($vid)) $vid = [$vid];
|
if (!is_array($vid)) $vid = [$vid];
|
||||||
$types = $values = "";
|
$types = $values = "";
|
||||||
|
|
||||||
@@ -6201,6 +6205,7 @@ References: User ID/Message ID, Mode
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addTech($vid) {
|
function addTech($vid) {
|
||||||
|
if(empty($vid)) return;
|
||||||
if (!is_array($vid)) {
|
if (!is_array($vid)) {
|
||||||
$vid = [$vid];
|
$vid = [$vid];
|
||||||
}
|
}
|
||||||
@@ -6214,6 +6219,7 @@ References: User ID/Message ID, Mode
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addABTech($vid) {
|
function addABTech($vid) {
|
||||||
|
if(empty($vid)) return;
|
||||||
if (!is_array($vid)) {
|
if (!is_array($vid)) {
|
||||||
$vid = [$vid];
|
$vid = [$vid];
|
||||||
}
|
}
|
||||||
@@ -7056,9 +7062,13 @@ References: User ID/Message ID, Mode
|
|||||||
try {
|
try {
|
||||||
// check that we don't have the structure in place already
|
// 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)
|
// (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");
|
try {
|
||||||
if ($data_exist && count($data_exist)) {
|
$data_exist = $this->query_return("SELECT * FROM " . TB_PREFIX . "users LIMIT 1");
|
||||||
return false;
|
if ($data_exist && count($data_exist)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// load the DB structure SQL file
|
// load the DB structure SQL file
|
||||||
@@ -7073,6 +7083,7 @@ References: User ID/Message ID, Mode
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
echo($e);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user