Fixed some bugs

+If you conquer a village with an artifact inside, the new owner will be
changed correctly
+Moved plus links under the menu
+Renewed the "debug" function in Logging.php
+Fixed some errors that could have shown in Ranking.php
This commit is contained in:
iopietro
2018-04-08 18:28:24 +02:00
parent b5037e1c33
commit 6ea4430372
27 changed files with 65 additions and 56 deletions
+2 -3
View File
@@ -56,8 +56,7 @@ class Automation {
{
$this->demolitionComplete();
}
// TODO: check if commenting-out this next line affected anything (it shouldn't) and should improve performance
//$this->updateStore();
$this->delTradeRoute();
$this->TradeRoute();
if(!file_exists("GameEngine/Prevention/market.txt") or time()-filemtime("GameEngine/Prevention/market.txt")>50) {
@@ -2571,7 +2570,7 @@ class Automation {
} else if (!$village_destroyed) {
// you took over the village
$villname = addslashes($database->getVillageField($data['to'],"name"));
$artifact = $database->getOwnArtefactInfo($data['to']);
$artifact = reset($database->getOwnArtefactInfo($data['to']));
$info_chief = "".$chief_pic.",Inhabitants of ".$villname." village decided to join your empire.";
+5 -11
View File
@@ -98,17 +98,11 @@ class Logging {
global $database;
}
public function debug($time,$uid,$debug_info) {
global $database;
list($time,$uid,$debug_info) = $database->escape_input((int) $time,(int) $uid,$debug_info);
//$debugFile = "/tmp/debug";
//$fh = fopen($debugFile, 'a') or die('No debug file');
//fwrite($fh,"\n".date("Y-m-d H:i:s")." : ".$time.",".$uid.",".$debug_info."\n");
//fclose($fh);
//$q = "INSERT INTO ".TB_PREFIX."debug_log (time,uid,debug_info) VALUES ($time,$uid,'$debug_info')";
//$database->query($q);
public function debug($debug_info, $time = 0) {
global $database, $generator;
list($debug_info) = $database->escape_input($debug_info);
echo '<script>console.log('.json_encode(($time > 0 ? "[".$generator->procMtime($time)[1]."] " : "").$debug_info).')</script>';
}
};
+10 -8
View File
@@ -19,9 +19,10 @@
}
public function getUserRank($id) {
global $database;
$ranking = $this->getRank();
$users = "SELECT Count(*) as Total FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8");
$users2 = mysqli_fetch_array(mysqli_query($GLOBALS['link'],$users), MYSQLI_ASSOC);
$users2 = mysqli_fetch_array(mysqli_query($database->dblink,$users), MYSQLI_ASSOC);
$users2 = $users2['Total'];
$users3 = $users2+1;
$myrank = 0;
@@ -220,7 +221,7 @@
}
public function procRankArray() {
global $multisort;
global $multisort, $database;
if($GLOBALS['db']->countUser() > 0){
$holder = array();
if(SHOW_NATARS == True){
@@ -273,7 +274,7 @@
$datas = array();
$result = (mysqli_query($GLOBALS['link'],$q));
$result = (mysqli_query($database->dblink,$q));
while($row = mysqli_fetch_assoc($result)) {
$datas[] = $row;
}
@@ -300,7 +301,7 @@
}
public function procRankRaceArray($race) {
global $multisort,$database;
global $multisort, $database;
$race = $database->escape((int) $race);
//$array = $GLOBALS['db']->getRanking();
$holder = array();
@@ -331,7 +332,7 @@
ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
$result = (mysqli_query($GLOBALS['link'],$q));
$result = (mysqli_query($database->dblink,$q));
while($row = mysqli_fetch_assoc($result)) {
$datas[] = $row;
}
@@ -367,7 +368,7 @@
}
public function procAttRankArray() {
global $multisort;
global $multisort, $database;
//$array = $GLOBALS['db']->getRanking();
$holder = array();
@@ -388,7 +389,7 @@
WHERE " . TB_PREFIX . "users.apall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3
AND " . TB_PREFIX . "users.id > 5
ORDER BY " . TB_PREFIX . "users.apall DESC, pop DESC, userid DESC";
$result = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink));
$result = mysqli_query($database->dblink,$q) or die(mysqli_error($database->dblink));
while($row = mysqli_Fetch_assoc($result)) {
$datas[] = $row;
}
@@ -413,6 +414,7 @@
}
public function procDefRankArray() {
global $database;
//global $GLOBALS['db'], $multisort;
//$array = $GLOBALS['db']->getRanking();
$holder = array();
@@ -431,7 +433,7 @@
WHERE " . TB_PREFIX . "users.dpall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3
AND " . TB_PREFIX . "users.id > 5
ORDER BY " . TB_PREFIX . "users.dpall DESC, pop DESC, userid DESC";
$result = mysqli_query($GLOBALS['link'],$q) or die(mysqli_error($database->dblink));
$result = mysqli_query($database->dblink,$q) or die(mysqli_error($database->dblink));
while($row = mysqli_Fetch_assoc($result)) {
$datas[] = $row;
}
+1 -1
View File
@@ -17,7 +17,7 @@ while($data = mysqli_fetch_assoc($query)) {
$links[] = $data;
}
print '<br /><br /><table id="vlist" cellpadding="1" cellspacing="1"><thead><tr><td colspan="3"><a href="spieler.php?s=2">Links:</a></td></tr></thead><tbody>';
print '<table cellpadding="1" cellspacing="1"><thead><tr><td colspan="3"><a href="spieler.php?s=2">Links:</a></td></tr></thead><tbody>';
foreach($links as $link) {
// Check, if the url is extern
if(substr($link['url'], -1, 1) == '*') {
+6 -5
View File
@@ -66,12 +66,13 @@ div.c1 {text-align: center}
<a href="support.php"><b><?php echo SUPPORT;?></b></a>
<?php
}
include("Templates/links.tpl");
?>
<br></p>
</p>
<?php
$timestamp = $database->isDeleting($session->uid);
if($timestamp) {
echo "<td colspan=\"2\" class=\"count\">";
echo "<br /><td colspan=\"2\" class=\"count\">";
if($timestamp > time()+48*3600) {
echo "<a href=\"spieler.php?s=3&id=".$session->uid."&a=1&e=4\"><img
class=\"del\" src=\"img/x.gif\" alt=\"Cancel process\"
@@ -79,7 +80,7 @@ div.c1 {text-align: center}
}
$time=$generator->getTimeFormat(($timestamp-time()));
echo "<a href=\"spieler.php?s=3\"> The account will be deleted in <span
id=\"timer1\">".$time."</span> .</a></td>";
id=\"timer1\">".$time."</span> .</a></td><br />";
}
?>
</div><?php
@@ -88,11 +89,11 @@ div.c1 {text-align: center}
<div id="content" class="village1">
<h1><?php echo ANNOUNCEMENT; ?></h1>
</br>
<br />
<h3>Hi <?php echo $session->username; ?>,</h3>
<?php include("Templates/text.tpl"); ?>
<div class="c1">
</br>
<br />
<h3><a href="dorf1.php?ok">&raquo; <?php echo GO2MY_VILLAGE; ?></a></h3>
</div>
</div>
-1
View File
@@ -248,7 +248,6 @@ if(isset($_GET['o'])) {
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -348,7 +348,6 @@ $golds1 = mysqli_fetch_array($MyGold);
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -68,7 +68,6 @@ include("Admin/Templates/ban_msg.tpl");
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -145,7 +145,6 @@ if ( isset( $_GET['aid'] ) ) {
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -570,7 +570,6 @@ if(isset($_POST['password']) && $_POST['password'] != ""){
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -322,7 +322,6 @@ $start_timer = $generator->pageLoadTimeStart();
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -91,7 +91,6 @@ if($building->NewBuilding) {
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -82,7 +82,6 @@ if($building->NewBuilding) {
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -99,7 +99,6 @@ if($session->plus){
<?php
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
+32
View File
@@ -396,6 +396,28 @@ div#side_navi p.deltimer a {
padding: 0;
text-align: center;
}
div#side_navi table {
background-color: #FFFFFF;
width: auto;
padding-left: 12px;
}
div#side_navi table td {
line-height: 18px;
padding: 0;
text-align: left;
white-space: nowrap;
}
div#side_navi table thead td {
background-color: #FFFFFF;
height: 22px;
}
div#side_navi td.dot {
padding: 0 6px;
width: 10px;
}
div#side_navi td.link {
padding-right: 10px;
}
div#side_info {
float: left;
padding-left: 10px;
@@ -5908,6 +5930,16 @@ div#side_navi p.deltimer a {
div#side_navi p.deltimer a span {
color: #FF8000;
}
div#side_navi table thead td a {
color: black;
font-weight: bold;
}
div#side_navi table tbody td {
font-size: 11px;
}
div#side_navi td.link {
font-size: 13px;
}
div#side_info h6 {
color: #FF8000;
font-size: 13px;
+1 -1
View File
@@ -50,7 +50,7 @@ $_SESSION[ 'csrf' ] = $key;
<script src="mt-more.js?0faab" type="text/javascript"></script>
<script src="unx.js?f4b7h" type="text/javascript"></script>
<script src="new.js?0faab" type="text/javascript"></script>
<link href="<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7i" rel="stylesheet" type="text/css" />
<link href="<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7h" rel="stylesheet" type="text/css" />
<link href="<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7d" rel="stylesheet" type="text/css" />
<link href="<?php echo GP_LOCATE ?>travian.css?f4b7d" rel="stylesheet" type="text/css" />
<link href="<?php echo GP_LOCATE ?>lang/en/lang.css" rel="stylesheet" type="text/css" />
-1
View File
@@ -161,7 +161,6 @@ else {
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -86,7 +86,6 @@ include("Templates/Packages/5.tpl");
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -159,7 +159,6 @@ $mailer->sendInvite($_POST['mail'],$session->uid,$_POST['text']);
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -74,7 +74,6 @@ if(isset($_GET['newdid'])) {
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -171,7 +171,6 @@ else if (isset($_GET['s'])) {
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -176,7 +176,6 @@ else {
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -149,7 +149,6 @@ function chkFormular () {
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
+3 -3
View File
@@ -15,10 +15,10 @@ include_once("GameEngine/Account.php");
AccessLogger::logRequest();
$max_per_pass = 1000;
if (mysqli_num_rows(mysqli_query($GLOBALS['link'],"SELECT id FROM ".TB_PREFIX."users WHERE access = 9 AND id = ".$session->uid)) != '1') die("Hacking attempt!");
if (mysqli_num_rows(mysqli_query($database->dblink,"SELECT id FROM ".TB_PREFIX."users WHERE access = 9 AND id = ".$session->uid)) != '1') die("Hacking attempt!");
if(isset($_GET['del'])){
mysqli_query($GLOBALS['link'], "UPDATE ".TB_PREFIX."users SET ok = 0");
mysqli_query($database->dblink, "UPDATE ".TB_PREFIX."users SET ok = 0");
}
if (@$_POST['submit'] == "Send")
@@ -44,7 +44,7 @@ if (@isset($_POST['confirm']))
// $text = utf8_encode($text);
fwrite($fh, $text);
mysqli_query($GLOBALS['link'], "UPDATE ".TB_PREFIX."users SET ok = 1");
mysqli_query($database->dblink, "UPDATE ".TB_PREFIX."users SET ok = 1");
$done = true;
} else { die("<br/><br/><br/>wrong"); }
+5 -6
View File
@@ -68,7 +68,7 @@ $automation->isWinner();
<div id="mid">
<?php include("Templates/menu.tpl"); ?>
<?php include("Templates/version.tpl"); ?>
<div id="products">
<div id="products"><b>
1. ronix - For coding above and beyond the call of duty<br />
2. Dzoki - Version starter<br />
3. Shadow - For coding above and beyond the call of duty<br />
@@ -101,10 +101,10 @@ $automation->isWinner();
30. Armando<br />
31. aggenkeech<br />
32. Niko28<br />
33. martinambrus<br /></b><br />
<b><u><center>Released by: Shadow</u></b><br />
<b>Visit: <a href="http://forum.ragezone.com/f583/travianz-version-modified-shadow-many-967580/">RageZone.com</a></b><br /></center></b><br />
<b><center>Download from <u><a href="https://github.com/Shadowss/TravianZ/archive/master.zip">Github</a></u></b><br />
33. martinambrus<br /></b></div><br />
<div style="text-align: center"><b><u>Released by: Shadow</u></b><br /><br />
<b>Visit: <a href="http://forum.ragezone.com/f583/travianz-version-modified-shadow-many-967580/">RageZone.com</a></b></div><br />
<div style="text-align: center"><b>Download from <u><a href="https://github.com/Shadowss/TravianZ/archive/master.zip">Github</a></u></b><br />
</div>
</div>
<br /><br /><br /><br /><div id="side_info">
@@ -112,7 +112,6 @@ $automation->isWinner();
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -172,7 +172,6 @@ if(count($target) > 0) {
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>
-1
View File
@@ -242,7 +242,6 @@ else {
include("Templates/multivillage.tpl");
include("Templates/quest.tpl");
include("Templates/news.tpl");
include("Templates/links.tpl");
?>
</div>
<div class="clear"></div>