mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-15 00:56:09 +00:00
refactor: much speedier installation process
This commit is contained in:
@@ -1571,9 +1571,9 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%users` (
|
||||
--
|
||||
|
||||
INSERT INTO `%PREFIX%users` (`id`, `username`, `password`, `email`, `tribe`, `access`, `gold`, `gender`, `birthday`, `location`, `desc1`, `desc2`, `plus`, `b1`, `b2`, `b3`, `b4`, `sit1`, `sit2`, `alliance`, `sessid`, `act`, `timestamp`, `ap`, `apall`, `dp`, `dpall`, `protect`, `quest`, `gpack`, `cp`, `lastupdate`, `RR`, `Rc`, `ok`) VALUES
|
||||
(5, 'Multihunter', '', 'multihunter@travianx.mail', 0, 9, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0),
|
||||
(5, 'Multihunter', '', 'multihunter@travianz.game', 0, 9, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0),
|
||||
(1, 'Support', '', 'support@travianz.game', 0, 8, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0),
|
||||
(2, 'Nature', '4262cc190152adfc1a3fcf32af6aa430', 'nature@travianz.game', 4, 9, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0),
|
||||
(2, 'Nature', '', 'nature@travianz.game', 4, 2, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0),
|
||||
(4, 'Taskmaster', '', 'taskmaster@travianz.game', 0, 8, 0, 0, '1970-01-01', '', '', '', 0, 0, 0, 0, 0, 0, 0, 0, '', '', 0, 0, 0, 0, 0, 0, 0, 'gpack/travian_default/', 1, 0, 0, 0, 0);
|
||||
|
||||
-- --------------------------------------------------------
|
||||
|
||||
@@ -23,6 +23,6 @@
|
||||
|
||||
|
||||
|
||||
header("Location: ../index.php?s=6");
|
||||
header("Location: ../index.php?s=7");
|
||||
|
||||
?>
|
||||
@@ -20,6 +20,8 @@ if (count($data_exist)) {
|
||||
}
|
||||
|
||||
$xyas=(1+(2*WORLD_MAX));
|
||||
$values_batch = [];
|
||||
$max_batch_size = 10000;
|
||||
|
||||
for($i=0; $i<$xyas; $i++){
|
||||
$y=(WORLD_MAX-$i);
|
||||
@@ -115,11 +117,24 @@ $y=(WORLD_MAX-$i);
|
||||
}
|
||||
|
||||
//into database
|
||||
$q = "INSERT into ".TB_PREFIX."wdata values (0,'".$typ."','".$otype."','".$x."','".$y."',0,'".$image."')";
|
||||
$database->query($q);
|
||||
$values_batch[] = "(0,'".$typ."','".$otype."','".$x."','".$y."',0,'".$image."')";
|
||||
|
||||
// insert the full batch when threshold is reached
|
||||
if (count($values_batch) === $max_batch_size) {
|
||||
$q = "INSERT into ".TB_PREFIX."wdata VALUES ".implode(',', $values_batch);
|
||||
$database->query($q);
|
||||
$values_batch = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// last batch may not be as big as $max_batch_size
|
||||
if (count($values_batch)) {
|
||||
$q = "INSERT into ".TB_PREFIX."wdata VALUES ".implode(',', $values_batch);
|
||||
$database->query($q);
|
||||
$values_batch = [];
|
||||
}
|
||||
|
||||
header("Location: ../index.php?s=4");
|
||||
|
||||
?>
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
## Source code: https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
#################################################################################
|
||||
rename("include/constant.php","../GameEngine/config.php");
|
||||
?>
|
||||
|
||||
|
||||
@@ -24,7 +25,7 @@
|
||||
<span class="f10 c">Create Multihunter account</span>
|
||||
<table>
|
||||
<tr><td>Name:</td><td><input type="text" name="mhpw" id="mhpw" value="Multihunter" disabled="disabled"></td></tr>
|
||||
<tr><td>Password:</td><td><input type="text" name="mhpw" id="mhpw" value=""></td></tr>
|
||||
<tr><td>Password:</td><td><input type="password" name="mhpw" id="mhpw" value=""></td></tr>
|
||||
<tr><td>Note: Rember this password! You need it for the ACP</td><td></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
## Source code: https://github.com/Shadowss/TravianZ ##
|
||||
## ##
|
||||
#################################################################################
|
||||
rename("include/constant.php","../GameEngine/config.php");
|
||||
?>
|
||||
|
||||
|
||||
@@ -25,7 +24,7 @@
|
||||
<span class="f10 c">Create Support account</span>
|
||||
<table>
|
||||
<tr><td>Name:</td><td><input type="text" name="sname" value="Support" disabled="disabled"></td></tr>
|
||||
<tr><td>Password:</td><td><input type="text" name="spw" id="spw" value=""></td></tr>
|
||||
<tr><td>Password:</td><td><input type="password" name="spw" id="spw" value=""></td></tr>
|
||||
<tr><td>Note: Rember this password! You need it for the ACP</td><td></td></tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user