diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index 792486f8..abb3585c 100755 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -35,7 +35,7 @@ class Automation { $isThere = mysql_num_rows($q); if($isThere > 0) { - header('Location: /winner.php'); + header('Location: winner.php'); }else{ ## there is no winner } diff --git a/GameEngine/Building.php b/GameEngine/Building.php index 98242098..16ce3ae0 100755 --- a/GameEngine/Building.php +++ b/GameEngine/Building.php @@ -7,7 +7,7 @@ ## Version: 22.06.2015 ## ## Filename Building.php ## ## 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 ## ## License: TravianZ Project ## ## Copyright: TravianZ (c) 2010-2015. All rights reserved. ## @@ -97,7 +97,7 @@ class Building { } } if(isset($get['buildingFinish']) && $session->plus) { - if($session->gold >= 2 && $session->sit == 0) { + if(intval($session->gold) >= 2 && $session->sit == 0) { $this->finishAll(); } } @@ -278,7 +278,7 @@ class Building { return $build; } - private function loadBuilding() { + public function loadBuilding() { global $database,$village,$session; $this->buildArray = $database->getJobs($village->wid); $this->allocated = count($this->buildArray); @@ -301,8 +301,11 @@ class Building { } } } + // echo var_dump($this->buildArray); $this->NewBuilding = true; - } + }else{ + $this->NewBuilding = false; + } } private function removeBuilding($d) { diff --git a/README b/README index b1a8b6e8..764c2248 100644 --- a/README +++ b/README @@ -138,3 +138,21 @@ TienTN changes: 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. 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 ' 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 +-- diff --git a/Templates/Ajax/quest_core25.tpl b/Templates/Ajax/quest_core25.tpl index c17de09b..79922d38 100644 --- a/Templates/Ajax/quest_core25.tpl +++ b/Templates/Ajax/quest_core25.tpl @@ -40,9 +40,8 @@ if(SPEED == '1'){ } else if(SPEED <= '5'){ $skipp_time="7200"; } else if(SPEED > '5'){ - $skipp_time="3600"; + $skipp_time= 3600 / SPEED; } - 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 switch($qact) { diff --git a/Templates/Build/avaliable.tpl b/Templates/Build/avaliable.tpl index 28873714..b1511277 100644 --- a/Templates/Build/avaliable.tpl +++ b/Templates/Build/avaliable.tpl @@ -171,14 +171,16 @@ $query = mysql_query("SELECT * FROM ".TB_PREFIX."vdata WHERE owner = ".$user."") while($villaggi_array = mysql_fetch_array($query)){ //loop structure village - $query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref'].""); - $strutture= mysql_fetch_array($query1); - + $query1 = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE vref = ".$villaggi_array['wref'].""); + $strutture= mysql_fetch_array($query1); + if($strutture == false) + $strutture = []; //search Castle in array structure village -$test = in_array(26,$strutture); +$test = in_array(26,$strutture); + if ($test){ - break; - } + break; +} } @@ -297,7 +299,10 @@ while($villaggi_array = mysql_fetch_array($query)){ $strutture= mysql_fetch_array($query1); //search Castle in array structure village -$test = in_array(26,$strutture); + if($strutture !== false) + $test = in_array(26,$strutture); + else + $test = in_array(26,[]); if ($test){ break; } @@ -466,4 +471,4 @@ function show_build_list(list) { - \ No newline at end of file + diff --git a/Templates/Building.tpl b/Templates/Building.tpl index e85be398..15585389 100644 --- a/Templates/Building.tpl +++ b/Templates/Building.tpl @@ -8,11 +8,12 @@ ## Copyright: TravianX (c) 2010-2011. All rights reserved. ## ## ## ################################################################################# +$building->loadBuilding(); ?> - +NewBuilding){ ?> - - +
+
gold >= 2) { @@ -57,3 +58,8 @@
+ + diff --git a/Templates/Message/inbox.tpl b/Templates/Message/inbox.tpl index 9d2380e6..3386e502 100644 --- a/Templates/Message/inbox.tpl +++ b/Templates/Message/inbox.tpl @@ -1,16 +1,16 @@ -
-

Messages

- -
- - - - - - + + inbox1) >= $i) { + if($message->inbox1[$i-1]['owner'] <= 1) { + echo ""; + }elseif($message->inbox1[$i-1]['owner'] == 5){ + echo ""; + } + else { + echo ""; + } + echo " + + "; + } + else { + echo " + "; + } + } + $name++; + } + if(count($message->inbox1) == 0) { + echo ""; + } + ?> +
SubjectSenderSent
- +

Messages

+ + + + + + + + - + - inbox1) >= $i) { - if($message->inbox1[$i-1]['owner'] <= 1) { - echo ""; - } - else { - echo ""; - } - echo " - - "; - } - else { - echo " - "; - } - } - $name++; - } - if(count($message->inbox1) == 0) { - echo ""; - } - ?> -
SubjectSenderSent
+ uid."'") or die(mysql_error()); $golds = mysql_fetch_array($MyGold); $date2=strtotime("NOW"); @@ -18,67 +18,74 @@ include("menu.tpl"); - + - plus) { echo ""; } ?> - - inbox1) < 10) { - echo "«»"; - } - else if (!isset($_GET['s']) && count($message->inbox1) > 10) { - echo "«»"; - } - else if(isset($_GET['s']) && count($message->inbox1) > $_GET['s']) { - if(count($message->inbox1) > ($_GET['s']+10) && $_GET['s']-10 < count($message->inbox1) && $_GET['s'] != 0) { - echo "«»"; - } - else if(count($message->inbox1) > $_GET['s']+10) { + plus) { echo ""; } ?> + + inbox1) < 10) { + echo "«»"; + } + else if (!isset($_GET['s']) && count($message->inbox1) > 10) { + echo "«»"; + } + else if(isset($_GET['s']) && count($message->inbox1) > $_GET['s']) { + if(count($message->inbox1) > ($_GET['s']+10) && $_GET['s']-10 < count($message->inbox1) && $_GET['s'] != 0) { + echo "«»"; + } + else if(count($message->inbox1) > $_GET['s']+10) { echo "«»"; - } - else { - echo "«»"; - } - } - ?>
inbox1[$i-1]['id']."\" />inbox1[$i-1]['id']."\">".$message->inbox1[$i-1]['topic']." "; - if($message->inbox1[$i-1]['viewed'] == 0) { - echo "(new)"; - } - $date = $generator->procMtime($message->inbox1[$i-1]['time']); - if($message->inbox1[$i-1]['owner'] <= 1) { - echo "".$database->getUserField($message->inbox1[$i-1]['owner'],'username',0)."".$date[0]." ".$date[1]."
inbox1[$i-1]['owner']."\">".$database->getUserField($message->inbox1[$i-1]['owner'],'username',0)."".$date[0]." ".$date[1]."
There are no messages available.
- - \ No newline at end of file + } + else { + echo "«»"; + } + } + ?>
inbox1[$i-1]['id']."\" />inbox1[$i-1]['id']."\">".$message->inbox1[$i-1]['topic']." "; + if($message->inbox1[$i-1]['viewed'] == 0) { + echo "(new)"; + } + $date = $generator->procMtime($message->inbox1[$i-1]['time']); + if($message->inbox1[$i-1]['owner'] <= 1) { + echo "".$database->getUserField($message->inbox1[$i-1]['owner'],'username',0)."".$date[0]." ".$date[1]."
inbox1[$i-1]['owner']."\">".$database->getUserField($message->inbox1[$i-1]['owner'],'username',0)."".$date[0]." ".$date[1]."
There are no messages available.
+ +
diff --git a/Templates/Plus/2.tpl b/Templates/Plus/2.tpl index 2953e730..90f30a97 100644 --- a/Templates/Plus/2.tpl +++ b/Templates/Plus/2.tpl @@ -22,22 +22,12 @@ include("Templates/Plus/pmenu.tpl"); Larger map - Larger map + Larger map You can enlarge the map to get a better overview. Instead of 7x7 fields you can have a map of 13x13 fields. Other alliances which are allied or have a non-aggression pact (NAP) with you are shown in special colours. - - Improved view in the rally point. - - - - Improved view in the rally point. - 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. - - - Archive function for reports and messages diff --git a/Templates/Ranking/general.tpl b/Templates/Ranking/general.tpl index 2bc7ce71..1631a24b 100644 --- a/Templates/Ranking/general.tpl +++ b/Templates/Ranking/general.tpl @@ -70,10 +70,18 @@ - + + 0){ + $percents = 100 * (($tribes[0]) / $users); + echo $percents = intval($percents); + echo "%"; + }else{ + echo '---'; + } + ?> + + @@ -83,9 +91,14 @@ echo $tribes[1]; ?> + if($users > 0){ + $percents = 100 * ($tribes[1] / $users); + echo $percents = intval($percents); + echo "%"; + }else{ + echo '---'; + } + ?> @@ -95,9 +108,14 @@ echo $tribes[2]; ?> 0){ + $percents = 100 * ($tribes[2] / $users); echo $percents = intval($percents); - echo "%"; ?> + echo "%"; + }else{ + echo '---'; + } + ?> diff --git a/Templates/quest.tpl b/Templates/quest.tpl index 5b4b1f72..6bfe222e 100644 --- a/Templates/quest.tpl +++ b/Templates/quest.tpl @@ -1,4 +1,4 @@ - +$_SESSION['qtyp'] = QTYPE; +if (($_SESSION['qst'] < 38 && QTYPE == 37 && QUEST == true) || ($_SESSION['qst'] < 31 && QTYPE == 25 && QUEST == true) || ($_SESSION['qst'] >= 90 && QTYPE == 25 && QUEST == true)) {?> -
- - to the task - - to the task - -
- - \ No newline at end of file +
+ + to the task + + to the task + +
+ + diff --git a/a2b2.php b/a2b2.php index f7b359cd..c25409fa 100644 --- a/a2b2.php +++ b/a2b2.php @@ -66,7 +66,7 @@ $automation->isWinner();

Account transactions

-uid."'") or die(mysql_error()); @@ -112,7 +112,7 @@ $golds1 = mysql_fetch_array($MyGold);

Please verify the information.
It will let us know if the data is incorrect.

Please mail your username, package, order time and email used to our billing address.

-

Please verify the information.
It will let us know if the data is incorrect.

Please mail your username, package, order time and email used to our billing address.

-

Please verify the information.
It will let us know if the data is incorrect.

Please mail your username, package, order time and email used to our billing address.

-

Please verify the information.
It will let us know if the data is incorrect.

Please mail your username, package, order time and email used to our billing address.

-

Please verify the information.
It will let us know if the data is incorrect.

Please mail your username, package, order time and email used to our billing address.

-

Please verify the information.
It will let us know if the data is incorrect.

Please mail your username, package, order time and email used to our billing address.

- diff --git a/unx.js b/unx.js index f6fa7496..a755779e 100644 --- a/unx.js +++ b/unx.js @@ -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 function gb(){return hb('height');} 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;} } executeCounter();} -function executeCounter(){for(var i in ab){wb=db()-cb;xb=rb(ab[i].counter_time+wb);ab[i].node.innerHTML=xb;} -for(i in bb){wb=db()-cb;yb=bb[i].counter_time-wb; -if(eb==0&&yb<1){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){window.setTimeout("executeCounter()",1000);} +function executeCounter(){ + for(var i in ab){ + wb = db() - cb; + xb = rb(ab[i].counter_time + wb); + ab[i].node.innerHTML = xb; + } + for(i in bb){ + wb = db() - cb; + 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].msMove
'+''+''; + if(pb!=null){ + if(window.dlang== 'ar'){ + var tc=''; + }else{ + var tc=''; + } pb.innerHTML=tc;uc2(); } vc(); @@ -123,8 +153,12 @@ $$('.popup3')[0].grab(new Element('div',{'id':'drag'} );if($$('body')[0].getStyle('direction').toLowerCase()=='rtl'){$$('.popup3')[0].setStyle('direction','rtl').getParent().setStyle('direction','ltr');} } 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'}); + } if($$('body')[0].getStyle('direction').toLowerCase()=='rtl'){ $$('.popup_map')[0].setStyle('direction','rtl').getParent().setStyle('direction','ltr'); } diff --git a/winner.php b/winner.php index 3de7948f..9b6f0749 100644 --- a/winner.php +++ b/winner.php @@ -193,7 +193,7 @@ $q = "
- +

Dear Players,