Merge branch 'TPLinux-master'

This commit is contained in:
Martin Ambrus
2017-08-28 13:55:21 +02:00
14 changed files with 238 additions and 158 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ class Automation {
$isThere = mysql_num_rows($q); $isThere = mysql_num_rows($q);
if($isThere > 0) if($isThere > 0)
{ {
header('Location: /winner.php'); header('Location: winner.php');
}else{ }else{
## there is no winner ## there is no winner
} }
+6 -3
View File
@@ -7,7 +7,7 @@
## Version: 22.06.2015 ## ## Version: 22.06.2015 ##
## Filename Building.php ## ## Filename Building.php ##
## Developed by: Mr.php , Advocaite , brainiacX , yi12345 , Shadow , ronix ## ## Developed by: Mr.php , Advocaite , brainiacX , yi12345 , Shadow , ronix ##
## Fixed by: Shadow - STARVATION , HERO FIXED COMPL. ## ## Fixed by: Shadow - STARVATION , HERO FIXED COMPL., TPLinux ##
## Fixed by: InCube - double troops ## ## Fixed by: InCube - double troops ##
## License: TravianZ Project ## ## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2015. All rights reserved. ## ## Copyright: TravianZ (c) 2010-2015. All rights reserved. ##
@@ -97,7 +97,7 @@ class Building {
} }
} }
if(isset($get['buildingFinish']) && $session->plus) { if(isset($get['buildingFinish']) && $session->plus) {
if($session->gold >= 2 && $session->sit == 0) { if(intval($session->gold) >= 2 && $session->sit == 0) {
$this->finishAll(); $this->finishAll();
} }
} }
@@ -278,7 +278,7 @@ class Building {
return $build; return $build;
} }
private function loadBuilding() { public function loadBuilding() {
global $database,$village,$session; global $database,$village,$session;
$this->buildArray = $database->getJobs($village->wid); $this->buildArray = $database->getJobs($village->wid);
$this->allocated = count($this->buildArray); $this->allocated = count($this->buildArray);
@@ -301,7 +301,10 @@ class Building {
} }
} }
} }
// echo var_dump($this->buildArray);
$this->NewBuilding = true; $this->NewBuilding = true;
}else{
$this->NewBuilding = false;
} }
} }
+18
View File
@@ -138,3 +138,21 @@ TienTN changes:
I found out that unx.js handle a static map size(400x400). I found out that unx.js handle a static map size(400x400).
So I fixed this with a m_c.world_max variable from mapview.tpl and changed the unx.js accordingly. So I fixed this with a m_c.world_max variable from mapview.tpl and changed the unx.js accordingly.
7. Fix the constructor global variable missing in Session.php 7. Fix the constructor global variable missing in Session.php
TPLinux Changes:
1. Fix FinishAll with two gold issue/bug
2. Fix Reload crush issue after building construction finished
3. Fix in_array bug in show more buldings in WWV
4. Fix winner redirection
5. Fix winner WW image path
6. Convert '<?' To '<?php' in a2ab.php (Account transaction page)
7. Fixing ( Building shape not upgraded after Construct finish )
8. Change multihunter msg color to orange
9. Change fetch time to server speed if > 5
10. Fixing Quest not appears if press (play no tasks)
11. Fix the redirection from rally point when attack is finished
12. Remove Rally point advantage
13. Fix fullscreen map in rtl layout
14. Fix divesion by Zero bug in general statics
--
+1 -2
View File
@@ -40,9 +40,8 @@ if(SPEED == '1'){
} else if(SPEED <= '5'){ } else if(SPEED <= '5'){
$skipp_time="7200"; $skipp_time="7200";
} else if(SPEED > '5'){ } else if(SPEED > '5'){
$skipp_time="3600"; $skipp_time= 3600 / SPEED;
} }
if (isset($qact)){ if (isset($qact)){
if ($qact == $_SESSION['qst']+1 && (($_SESSION['qst']>= 1 && $_SESSION['qst']<=30) || (time()-$_SESSION['qst_time']>=0 && ($_SESSION['qst'] >= 90 && $_SESSION['qst'] <=97))) || ($_SESSION['qst']== 0 && ($qact == "enter" || $qact == "skip")) || ($qact == "rank" && ($_SESSION['qst']== 4 || $_SESSION['qst']== 18)) || ($_SESSION['qst']== 7 && $qact == "coor") || ($_SESSION['qst']== 16 && $qact == "lumber") || ($_SESSION['qst']== 19 && $qact == 23) || ($_SESSION['qst']== 22 && $qact == 26) || ($_SESSION['qst']== 27 && $qact == "gold")) { //avoid hacking gold, resources or reward -- added by Ronix - Fixed by Pietro if ($qact == $_SESSION['qst']+1 && (($_SESSION['qst']>= 1 && $_SESSION['qst']<=30) || (time()-$_SESSION['qst_time']>=0 && ($_SESSION['qst'] >= 90 && $_SESSION['qst'] <=97))) || ($_SESSION['qst']== 0 && ($qact == "enter" || $qact == "skip")) || ($qact == "rank" && ($_SESSION['qst']== 4 || $_SESSION['qst']== 18)) || ($_SESSION['qst']== 7 && $qact == "coor") || ($_SESSION['qst']== 16 && $qact == "lumber") || ($_SESSION['qst']== 19 && $qact == 23) || ($_SESSION['qst']== 22 && $qact == 26) || ($_SESSION['qst']== 27 && $qact == "gold")) { //avoid hacking gold, resources or reward -- added by Ronix - Fixed by Pietro
switch($qact) { switch($qact) {
+6 -1
View File
@@ -173,9 +173,11 @@ while($villaggi_array = mysql_fetch_array($query)){
//loop structure village //loop structure village
$query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref'].""); $query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref']."");
$strutture= mysql_fetch_array($query1); $strutture= mysql_fetch_array($query1);
if($strutture == false)
$strutture = [];
//search Castle in array structure village //search Castle in array structure village
$test = in_array(26,$strutture); $test = in_array(26,$strutture);
if ($test){ if ($test){
break; break;
} }
@@ -297,7 +299,10 @@ while($villaggi_array = mysql_fetch_array($query)){
$strutture= mysql_fetch_array($query1); $strutture= mysql_fetch_array($query1);
//search Castle in array structure village //search Castle in array structure village
if($strutture !== false)
$test = in_array(26,$strutture); $test = in_array(26,$strutture);
else
$test = in_array(26,[]);
if ($test){ if ($test){
break; break;
} }
+7 -1
View File
@@ -8,8 +8,9 @@
## Copyright: TravianX (c) 2010-2011. All rights reserved. ## ## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ## ## ##
################################################################################# #################################################################################
$building->loadBuilding();
?> ?>
<?php if($building->NewBuilding){ ?>
<table cellpadding="1" cellspacing="1" id="building_contract"> <table cellpadding="1" cellspacing="1" id="building_contract">
<thead><tr> <thead><tr>
<th colspan="4"><?php echo BUILDING_UPGRADING;?> <th colspan="4"><?php echo BUILDING_UPGRADING;?>
@@ -57,3 +58,8 @@
</tbody> </tbody>
</table> </table>
<script type="text/javascript">var bld=[{"stufe":1,"gid":"1","aid":"3"}]</script> <script type="text/javascript">var bld=[{"stufe":1,"gid":"1","aid":"3"}]</script>
<?php }else{
$the_link = (isset($_SERVER['HTTPS']) ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
header('Location: '. $the_link);
} ?>
+8 -1
View File
@@ -1,4 +1,4 @@
<div id="content" class="messages"> x<div id="content" class="messages">
<h1>Messages</h1> <h1>Messages</h1>
<?php <?php
include("menu.tpl"); include("menu.tpl");
@@ -42,6 +42,11 @@ include("menu.tpl");
} }
} }
?></th></tr></tfoot><tbody> ?></th></tr></tfoot><tbody>
<style>
tr.multihunterMsg td.sel{
background-color:orange;
}
</style>
<?php <?php
if(isset($_GET['s'])) { if(isset($_GET['s'])) {
$s = $_GET['s']; $s = $_GET['s'];
@@ -54,6 +59,8 @@ include("menu.tpl");
if(count($message->inbox1) >= $i) { if(count($message->inbox1) >= $i) {
if($message->inbox1[$i-1]['owner'] <= 1) { if($message->inbox1[$i-1]['owner'] <= 1) {
echo "<tr class=\"sup\">"; echo "<tr class=\"sup\">";
}elseif($message->inbox1[$i-1]['owner'] == 5){
echo "<tr class=\"multihunterMsg\">";
} }
else { else {
echo "<tr>"; echo "<tr>";
-10
View File
@@ -28,16 +28,6 @@ include("Templates/Plus/pmenu.tpl");
</tr><tr> </tr><tr>
<td colspan="2" class="empty"></td> <td colspan="2" class="empty"></td>
</tr> </tr>
<tr>
<th colspan="2">Improved view in the rally point.</th>
</tr>
<tr>
<td class="preview"><a href="plus.php?id=3"><img class="att_mark" src="img/x.gif" alt="Improved view in the rally point." title="Improved view in the rally point." /></a></td>
<td class="text">In your rally point you can mark incoming attacks in the colours green, yellow and red to be able to distinguish between what you think are severe and harmless attacks . Additionally the total movement time (without taking into consideration the tournament square or an artefact effect) of the troop types is shown.</td>
</tr><tr>
<td colspan="2" class="empty"></td>
</tr>
<tr> <tr>
<th colspan="2">Archive function for reports and messages</th> <th colspan="2">Archive function for reports and messages</th>
</tr> </tr>
+22 -4
View File
@@ -70,10 +70,18 @@
<td><?php <td><?php
echo $tribes[0]; ?></td> echo $tribes[0]; ?></td>
<td><?php <td>
<?php
if($users > 0){
$percents = 100 * (($tribes[0]) / $users); $percents = 100 * (($tribes[0]) / $users);
echo $percents = intval($percents); echo $percents = intval($percents);
echo "%"; ?></td> echo "%";
}else{
echo '---';
}
?>
</td>
</tr> </tr>
<tr> <tr>
@@ -83,9 +91,14 @@
echo $tribes[1]; ?></td> echo $tribes[1]; ?></td>
<td><?php <td><?php
if($users > 0){
$percents = 100 * ($tribes[1] / $users); $percents = 100 * ($tribes[1] / $users);
echo $percents = intval($percents); echo $percents = intval($percents);
echo "%"; ?></td> echo "%";
}else{
echo '---';
}
?></td>
</tr> </tr>
<tr> <tr>
@@ -95,9 +108,14 @@
echo $tribes[2]; ?></td> echo $tribes[2]; ?></td>
<td><?php <td><?php
if($users > 0){
$percents = 100 * ($tribes[2] / $users); $percents = 100 * ($tribes[2] / $users);
echo $percents = intval($percents); echo $percents = intval($percents);
echo "%"; ?></td> echo "%";
}else{
echo '---';
}
?></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
+1 -1
View File
@@ -11,7 +11,7 @@
## ## ## ##
################################################################################# #################################################################################
$_SESSION['qtyp'] = QTYPE; $_SESSION['qtyp'] = QTYPE;
if (($_SESSION['qst']<38 && QTYPE==37 && QUEST==true) || ($_SESSION['qst']<31 && QTYPE==25 && QUEST==true)) {?> if (($_SESSION['qst'] < 38 && QTYPE == 37 && QUEST == true) || ($_SESSION['qst'] < 31 && QTYPE == 25 && QUEST == true) || ($_SESSION['qst'] >= 90 && QTYPE == 25 && QUEST == true)) {?>
<div id="anm" style="width:120px; height:140px; visibility:hidden;"></div> <div id="anm" style="width:120px; height:140px; visibility:hidden;"></div>
<div id="qge"> <div id="qge">
<?php if ($_SESSION['qst'] == 0 or (isset($_SESSION['qstnew']) && $_SESSION['qstnew']==1)){ ?> <?php if ($_SESSION['qst'] == 0 or (isset($_SESSION['qstnew']) && $_SESSION['qstnew']==1)){ ?>
+5 -5
View File
@@ -112,7 +112,7 @@ $golds1 = mysql_fetch_array($MyGold);
<p>Please verify the information.<br />It will let us know if the data is incorrect.</p> <p>Please verify the information.<br />It will let us know if the data is incorrect.</p>
<p>Please mail your username, package, order time and email used to <a href="mailto:cata7007@gmail.com">our billing address</a>.</p> <p>Please mail your username, package, order time and email used to <a href="mailto:cata7007@gmail.com">our billing address</a>.</p>
<? <?php
} }
if ($amount == 499) { if ($amount == 499) {
@@ -159,7 +159,7 @@ $golds1 = mysql_fetch_array($MyGold);
</tbody></table> </tbody></table>
<p>Please verify the information.<br />It will let us know if the data is incorrect.</p> <p>Please verify the information.<br />It will let us know if the data is incorrect.</p>
<p>Please mail your username, package, order time and email used to <a href="mailto:cata7007@gmail.com">our billing address</a>.</p> <p>Please mail your username, package, order time and email used to <a href="mailto:cata7007@gmail.com">our billing address</a>.</p>
<? <?php
} }
if ($amount == 999) { if ($amount == 999) {
@@ -206,7 +206,7 @@ $golds1 = mysql_fetch_array($MyGold);
</tbody></table> </tbody></table>
<p>Please verify the information.<br />It will let us know if the data is incorrect.</p> <p>Please verify the information.<br />It will let us know if the data is incorrect.</p>
<p>Please mail your username, package, order time and email used to <a href="mailto:cata7007@gmail.com">our billing address</a>.</p> <p>Please mail your username, package, order time and email used to <a href="mailto:cata7007@gmail.com">our billing address</a>.</p>
<? <?php
} }
if ($amount == 1999) { if ($amount == 1999) {
@@ -253,7 +253,7 @@ $golds1 = mysql_fetch_array($MyGold);
</tbody></table> </tbody></table>
<p>Please verify the information.<br />It will let us know if the data is incorrect.</p> <p>Please verify the information.<br />It will let us know if the data is incorrect.</p>
<p>Please mail your username, package, order time and email used to <a href="cata7007@gmail.com">our billing address</a>.</p> <p>Please mail your username, package, order time and email used to <a href="cata7007@gmail.com">our billing address</a>.</p>
<? <?php
} }
if ($amount == 4999) { if ($amount == 4999) {
@@ -300,7 +300,7 @@ $golds1 = mysql_fetch_array($MyGold);
</tbody></table> </tbody></table>
<p>Please verify the information.<br />It will let us know if the data is incorrect.</p> <p>Please verify the information.<br />It will let us know if the data is incorrect.</p>
<p>Please mail your username, package, order time and email used to <a href="mailto:cata7007@gmail.com">our billing address</a>.</p> <p>Please mail your username, package, order time and email used to <a href="mailto:cata7007@gmail.com">our billing address</a>.</p>
<? <?php
} }
if ($amount == 0) if ($amount == 0)
{ {
+1 -1
View File
@@ -353,7 +353,7 @@ if(isset($_GET['id']) or isset($_GET['gid']) or $route == 1 or isset($_GET['rout
} }
} }
}else{ }else{
header("Location: dorf1.php"); header("Location: ".$_SERVER['PHP_SELF']."?id=39");
} }
?> ?>
+42 -8
View File
@@ -1,3 +1,4 @@
window.dlang = 'ar'; // edit it to en if fullscreen map not working
var timer=new Object();var ab=new Object();var bb=new Object();var cb=db();var eb=0;var auto_reload=1;var fb=new Object();var is_opera=window.opera!==undefined;var is_ie=document.all!==undefined&&window.opera===undefined;var is_ie6p=document.compatMode!==undefined&&document.all!==undefined&&window.opera===undefined;var is_ie7=document.documentElement!==undefined&&document.documentElement.style.maxHeight!==undefined;var is_ie6=is_ie6p&&!is_ie7;var is_ff2p=window.Iterator!==undefined;var is_ff3p=document.getElementsByClassName!==undefined;var is_ff2=is_ff2p&&!is_ff3p var timer=new Object();var ab=new Object();var bb=new Object();var cb=db();var eb=0;var auto_reload=1;var fb=new Object();var is_opera=window.opera!==undefined;var is_ie=document.all!==undefined&&window.opera===undefined;var is_ie6p=document.compatMode!==undefined&&document.all!==undefined&&window.opera===undefined;var is_ie7=document.documentElement!==undefined&&document.documentElement.style.maxHeight!==undefined;var is_ie6=is_ie6p&&!is_ie7;var is_ff2p=window.Iterator!==undefined;var is_ff3p=document.getElementsByClassName!==undefined;var is_ff2=is_ff2p&&!is_ff3p
function gb(){return hb('height');} function gb(){return hb('height');}
function ib(){return hb('width');} function ib(){return hb('width');}
@@ -58,15 +59,40 @@ for(i=1;;i++){pb=document.getElementById("timer"+i);if(pb!=null){bb[i]=new Objec
else{break;} else{break;}
} }
executeCounter();} executeCounter();}
function executeCounter(){for(var i in ab){wb=db()-cb;xb=rb(ab[i].counter_time+wb);ab[i].node.innerHTML=xb;} function executeCounter(){
for(i in bb){wb=db()-cb;yb=bb[i].counter_time-wb; for(var i in ab){
if(eb==0&&yb<1){eb=1;if(auto_reload==1){setTimeout("document.location.reload()",1000);} wb = db() - cb;
else if(auto_reload==0){setTimeout("mreload()",1000);} xb = rb(ab[i].counter_time + wb);
ab[i].node.innerHTML = xb;
} }
else{} for(i in bb){
xb=rb(yb);bb[i].node.innerHTML=xb;} wb = db() - cb;
if(eb==0){window.setTimeout("executeCounter()",1000);} yb = bb[i].counter_time - wb;
// console.log('yb: ' + yb);
if(eb == 0 && yb < 0){
bb[i] = null;
eb = 1;
setTimeout(function(){window.location.href = ''},1000);
} }
// eb = 1;
// if(auto_reload == 1){
// setTimeout("document.location.reload()",1000);
// }
// else if(auto_reload==0){
// setTimeout("mreload()",1000);
// }
//}
else{
xb=rb(yb);
bb[i].node.innerHTML = xb;
}
if(eb == 0 && yb >= 0){
setTimeout("executeCounter()",1000);
}
}
setTimeout("executeCounter()",1000);
}
function mb(zb){pb=document.getElementById(zb);if(pb!=null){fb[zb]=new Object();var $b=pb.innerHTML.match(/(\d+)\/(\d+)/);element=$b[0].split("/");_b=parseInt(element[0]);ac=parseInt(element[1]);bc=pb.title;if(bc!=0){cc=nb();timer[zb]=new Object();timer[zb].start=cc;timer[zb].production=bc;timer[zb].start_res=_b;timer[zb].max_res=ac;timer[zb].ms=3600000/bc;dc=100;if(timer[zb].ms<dc){timer[zb].ms=dc;} function mb(zb){pb=document.getElementById(zb);if(pb!=null){fb[zb]=new Object();var $b=pb.innerHTML.match(/(\d+)\/(\d+)/);element=$b[0].split("/");_b=parseInt(element[0]);ac=parseInt(element[1]);bc=pb.title;if(bc!=0){cc=nb();timer[zb]=new Object();timer[zb].start=cc;timer[zb].production=bc;timer[zb].start_res=_b;timer[zb].max_res=ac;timer[zb].ms=3600000/bc;dc=100;if(timer[zb].ms<dc){timer[zb].ms=dc;}
timer[zb].node=pb;executeTimer(zb);} timer[zb].node=pb;executeTimer(zb);}
else else
@@ -109,7 +135,11 @@ function PopupMap(i){
if(typeof sc=='undefined'){sc='s';} if(typeof sc=='undefined'){sc='s';}
pb=document.getElementById("ce"); pb=document.getElementById("ce");
if(pb!=null){ if(pb!=null){
var tc='<div class="popup_map">'+'<div id="drag2"><a href="#" onClick="Close(); return false;"><img src="img/x.gif" border="0" width="20px" height="20px" alt="Move"></a></div>'+'<iframe frameborder="0" id="Frame" src="karte2.php?z='+i+'" width="1000" height="575" border="0" scrolling="no"></iframe>'+'</div>'; if(window.dlang== 'ar'){
var tc='<div class="popup_map" style="right: 320px; left: -100px; top: 20px">'+'<div id="drag2"><a href="#" style="position: absolute;right: 968px;margin-top: 10px;" id="map_popclose" onClick="Close(); return false;"><img src="img/x.gif" border="0" width="20px" height="20px" alt="Move"></a>'+'<iframe frameborder="0" id="Frame" src="karte2.php?z='+i+'" width="1000" height="575" border="0" scrolling="no"></iframe>'+'</div></div>';
}else{
var tc='<div class="popup_map">'+'<div id="drag2"><a href="#" id="map_popclose" onClick="Close(); return false;"><img src="img/x.gif" border="0" width="20px" height="20px" alt="Move"></a>'+'<iframe frameborder="0" id="Frame" src="karte2.php?z='+i+'" width="1000" height="575" border="0" scrolling="no"></iframe>'+'</div></div>';
}
pb.innerHTML=tc;uc2(); pb.innerHTML=tc;uc2();
} }
vc(); vc();
@@ -124,7 +154,11 @@ $$('.popup3')[0].grab(new Element('div',{'id':'drag'}
} }
function uc2(){ function uc2(){
if($('drag')){return;} if($('drag')){return;}
if(window.dlang== 'ar'){
$$('.popup_map')[0].grab(new Element('div',{'id':'drag', "style": "width: 1000px;height: 10px;background-color: #fff0;position: absolute;cursor: move;"}),'top').makeDraggable({'handle':'drag'});
}else{
$$('.popup_map')[0].grab(new Element('div',{'id':'drag'}),'top').makeDraggable({'handle':'drag'}); $$('.popup_map')[0].grab(new Element('div',{'id':'drag'}),'top').makeDraggable({'handle':'drag'});
}
if($$('body')[0].getStyle('direction').toLowerCase()=='rtl'){ if($$('body')[0].getStyle('direction').toLowerCase()=='rtl'){
$$('.popup_map')[0].setStyle('direction','rtl').getParent().setStyle('direction','ltr'); $$('.popup_map')[0].setStyle('direction','rtl').getParent().setStyle('direction','ltr');
} }
+1 -1
View File
@@ -193,7 +193,7 @@ $q = "
<div id="mid"> <div id="mid">
<?php include("Templates/menu.tpl"); ?> <?php include("Templates/menu.tpl"); ?>
<div id="content" class="village2" style="font-size: 9pt;"> <div id="content" class="village2" style="font-size: 9pt;">
<img src="../gpack/travian_default/img/misc/win.png" align="right" style="padding-top: 40px;"> <img src="./gpack/travian_default/img/misc/win.png" align="right" style="padding-top: 40px;">
<p> <p>
<b>Dear <?php echo SERVER_NAME; ?> Players,</b> <b>Dear <?php echo SERVER_NAME; ?> Players,</b>
<br /><br /> <br /><br />