diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index 05931357..5fcc6555 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -3416,28 +3416,43 @@ class MYSQL_DB { Made by: Shadow ***************************/ - function checkAttack($wref, $toWref){ - $q = "SELECT * FROM ".TB_PREFIX."movement WHERE `from` = '$wref' AND `to` = '$toWref' AND `proc` = '0' AND `sort_type` = '3'"; + function checkAttack($wref, $toWref){ + $q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and (" . TB_PREFIX . "attacks.attack_type = 3 or " . TB_PREFIX . "attacks.attack_type = 4) ORDER BY endtime ASC"; $result = mysql_query($q, $this->connection); if(mysql_num_rows($result)) { - return mysql_fetch_array($result); - } else { + return true; + }else{ return false; } - } + } /*************************** Function checkEnforce Made by: Shadow ***************************/ - function checkEnforce($vid, $from) { - $q = "SELECT * from " . TB_PREFIX . "enforcement where `from` = $from and vref = $vid"; - $result = mysql_query($q, $this->connection); - if(!empty($result)) { - return mysql_insert_id($this->connection); - }else{ + function checkEnforce($wref, $toWref) { + $q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and " . TB_PREFIX . "attacks.attack_type = 2 ORDER BY endtime ASC"; + $result = mysql_query($q, $this->connection); + if(mysql_num_rows($result)) { return true; + }else{ + return false; + } + } + + /*************************** + Function checkEnforce + Made by: yi12345 + ***************************/ + + function checkScout($wref, $toWref) { + $q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and " . TB_PREFIX . "attacks.attack_type = 1 ORDER BY endtime ASC"; + $result = mysql_query($q, $this->connection); + if(mysql_num_rows($result)) { + return true; + }else{ + return false; } } }; diff --git a/GameEngine/Ranking.php b/GameEngine/Ranking.php index 06b1af8f..1e75fc21 100644 --- a/GameEngine/Ranking.php +++ b/GameEngine/Ranking.php @@ -53,15 +53,27 @@ break; case 11: $this->procRankRaceArray(1); + if($this->searchRank($session->uid, "userid") != 0){ $this->getStart($this->searchRank($session->uid, "userid")); + }else{ + $this->getStart(1); + } break; case 12: $this->procRankRaceArray(2); + if($this->searchRank($session->uid, "userid") != 0){ $this->getStart($this->searchRank($session->uid, "userid")); + }else{ + $this->getStart(1); + } break; case 13: $this->procRankRaceArray(3); + if($this->searchRank($session->uid, "userid") != 0){ $this->getStart($this->searchRank($session->uid, "userid")); + }else{ + $this->getStart(1); + } break; case 31: $this->procAttRankArray(); diff --git a/Templates/Map/mapview.tpl b/Templates/Map/mapview.tpl index 5fbb6299..549fba2b 100644 --- a/Templates/Map/mapview.tpl +++ b/Templates/Map/mapview.tpl @@ -158,8 +158,10 @@ $neutral = (($neutralarray[0]['alli1']>0 and $neutralarray[0]['alli2']>0 and $do $att = ''; }elseif ($database->checkEnforce($wref,$toWref) != 0) { $att = ''; - } - } + }elseif ($database->checkScout($wref,$toWref) != 0) { + $att = ''; + } + } // Map content if($donnees['ville_user']==3 && $donnees['ville_name']=='WW Buildingplan'){ diff --git a/Templates/Map/mapviewlarge.tpl b/Templates/Map/mapviewlarge.tpl index 9c38ffc6..e97d355e 100644 --- a/Templates/Map/mapviewlarge.tpl +++ b/Templates/Map/mapviewlarge.tpl @@ -230,7 +230,9 @@ $neutral = (($neutralarray[0]['alli1']>0 and $neutralarray[0]['alli2']>0 and $do $att = ''; }elseif ($database->checkEnforce($wref,$toWref) != 0) { $att = ''; - } + }elseif ($database->checkScout($wref,$toWref) != 0) { + $att = ''; + } } // Map content diff --git a/Templates/movement.tpl b/Templates/movement.tpl index 95a88af3..d10cb641 100644 --- a/Templates/movement.tpl +++ b/Templates/movement.tpl @@ -12,7 +12,7 @@ $oases = 0; $array = $database->getOasis($village->wid); foreach($array as $conqured){ -$oases += count($database->getMovement(6,$village->wid,0)); +$oases += count($database->getMovement(6,$conqured['wref'],0)); } $aantal = (count($database->getMovement(4,$village->wid,1))+count($database->getMovement(3,$village->wid,1))+count($database->getMovement(3,$village->wid,0))+count($database->getMovement(7,$village->wid,1))+count($database->getMovement(5,$village->wid,0))+$oases-count($database->getMovement(8,$village->wid,1))-count($database->getMovement(9,$village->wid,0))); @@ -24,6 +24,9 @@ $NextArrival = array(); $NextArrival1 = array(); $NextArrival2 = array(); $NextArrival3 = array(); +$NextArrival4 = array(); +$NextArrival5 = array(); +$NextArrival6 = array(); /* Units coming back from Reinf,attack,raid,evasion or reinf to my town */ $aantal = count($database->getMovement(4,$village->wid,1))+count($database->getMovement(7,$village->wid,1)); @@ -80,7 +83,7 @@ if($aantal > 0){ if ($receive['attack_type'] != 2 && $receive['attack_type'] != 1) { $action = 'att1'; $aclass = 'a1'; - $title = ''.OWN_ATTACKING_TROOPS.''; + $title = ''.UNDERATTACK.''; $short = ''.ATTACK.''; $NextArrival1[] = $receive['endtime']; } @@ -151,7 +154,7 @@ if($aantal > 0){ } echo '
»
»