diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index efb09dbb..96699dc8 100755 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -2204,7 +2204,7 @@ class Automation { } } if ($herosend_att>0){ - $hero_unit = $database->getHeroField($from['owner'], 'unit', false); + $hero_unit = $database->getHeroField($from['owner'], 'unit'); $speeds[] = $GLOBALS['u'.$hero_unit]['speed']; } @@ -2803,7 +2803,7 @@ class Automation { } if ($prisoner['t11']>0){ - $p_hero_unit = $database->getHeroField($p_owner, 'unit', false)['unit']; + $p_hero_unit = $database->getHeroField($p_owner, 'unit'); $p_speeds[] = $GLOBALS['u'.$p_hero_unit]['speed']; } @@ -3004,7 +3004,7 @@ class Automation { } if ($herosend_att>0){ - $hero_unit = $database->getHeroField($from['owner'], 'unit', false)['unit']; + $hero_unit = $database->getHeroField($from['owner'], 'unit'); $speeds[] = $GLOBALS['u'.$hero_unit]['speed']; } @@ -3325,10 +3325,7 @@ class Automation { } if (isset($post['t11'])){ if( $post['t11'] != '' && $post['t11'] > 0){ - $qh = "SELECT unit FROM ".TB_PREFIX."hero WHERE uid = ".(int) $from['owner']." AND dead = 0"; - $resulth = mysqli_query($GLOBALS['link'],$qh); - $hero_f=mysqli_fetch_array($resulth); - $hero_unit=$hero_f['unit']; + $hero_unit = getHeroField($from['owner'], 'unit'); $speeds[] = $GLOBALS['u'.$hero_unit]['speed']; } else { $post['t11']='0'; diff --git a/GameEngine/Database.php b/GameEngine/Database.php index 798577b9..88601b18 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -5717,7 +5717,7 @@ References: User ID/Message ID, Mode $q = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = $uid AND dead = 0"; $result = mysqli_query($this->dblink,$q); - self::$heroFieldCache[$uid.$field] = $this->mysqli_fetch_all($result); + self::$heroFieldCache[$uid.$field] = $this->mysqli_fetch_all($result)[0]; return self::$heroFieldCache[$uid.$field][$field]; } diff --git a/Templates/Build/16_walking.tpl b/Templates/Build/16_walking.tpl index d3d527f5..bc9820e8 100644 --- a/Templates/Build/16_walking.tpl +++ b/Templates/Build/16_walking.tpl @@ -19,12 +19,12 @@ if($units[$y]['attack_type'] == 4){ $attack_type = RAID_ON; } $isoasis = $database->isVillageOases($units[$y]['to']); -if ($isoasis ==0){ +if ($isoasis ==0){ $to = $database->getMInfo($units[$y]['to']); } else { $to = $database->getOMInfo($units[$y]['to']);} ?> - +
@@ -35,10 +35,10 @@ $to = $database->getOMInfo($units[$y]['to']);} "; for($i=($session->tribe-1)*10+1;$i<=$session->tribe*10;$i++) { - echo ""; + echo ""; } if($units[$y]['t11'] != 0) { - echo ""; + echo ""; } ?> @@ -84,17 +84,17 @@ $to = $database->getOMInfo($units[$y]['to']);} - + getMovement(5,$village->wid,0); + $settlers = $database->getMovement(5,$village->wid,0); if($settlers){ $total_for = count($settlers); for($y=0;$y<$total_for;$y++){ $timer += 1; - + ?> -
vname; ?> getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" />getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" />\"Hero\"\"Hero\"
+
@@ -108,7 +108,7 @@ $timer += 1; $end = ($tribe*10); echo ""; for($i=$start;$i<=($end);$i++) { - echo ""; + echo ""; } ?> diff --git a/Templates/a2b/attack.tpl b/Templates/a2b/attack.tpl index 190bba68..df279f02 100644 --- a/Templates/a2b/attack.tpl +++ b/Templates/a2b/attack.tpl @@ -38,16 +38,16 @@ $ckey= $generator->generateRandStr(6); if (!isset($process['t1']) || $process['t1'] == ''){ $t1='0'; }else{ $t1=$process['t1']; } - if (!isset($process['t2']) || $process['t2'] == ''){ $t2='0'; }else{ $t2=$process['t2']; } - if (!isset($process['t3']) || $process['t3'] == ''){ $t3='0'; }else{ $t3=$process['t3']; if ($session->tribe == 3){ $scout=1; } } - if (!isset($process['t4']) || $process['t4'] == ''){ $t4='0'; }else{ $t4=$process['t4']; if ($session->tribe == 1 || $session->tribe == 2 || $session->tribe == 4 || $session->tribe == 5){ $scout=1;} } - if (!isset($process['t5']) || $process['t5'] == ''){ $t5='0'; }else{ $t5=$process['t5']; } - if (!isset($process['t6']) || $process['t6'] == ''){ $t6='0'; }else{ $t6=$process['t6']; } - if (!isset($process['t7']) || $process['t7'] == ''){ $t7='0'; }else{ $t7=$process['t7']; } - if (!isset($process['t8']) || $process['t8'] == ''){ $t8='0'; }else{ $t8=$process['t8']; } - if (!isset($process['t9']) || $process['t9'] == ''){ $t9='0'; }else{ $t9=$process['t9']; } - if (!isset($process['t10']) || $process['t10'] == ''){ $t10='0'; }else{ $t10=$process['t10']; } - if (!isset($process['t11']) || $process['t11'] == ''){ $t11='0'; }else{ $t11=$process['t11']; $showhero=1;} + if (!isset($process['t2']) || $process['t2'] == ''){ $t2='0'; }else{ $t2=$process['t2']; } + if (!isset($process['t3']) || $process['t3'] == ''){ $t3='0'; }else{ $t3=$process['t3']; if ($session->tribe == 3){ $scout=1; } } + if (!isset($process['t4']) || $process['t4'] == ''){ $t4='0'; }else{ $t4=$process['t4']; if ($session->tribe == 1 || $session->tribe == 2 || $session->tribe == 4 || $session->tribe == 5){ $scout=1;} } + if (!isset($process['t5']) || $process['t5'] == ''){ $t5='0'; }else{ $t5=$process['t5']; } + if (!isset($process['t6']) || $process['t6'] == ''){ $t6='0'; }else{ $t6=$process['t6']; } + if (!isset($process['t7']) || $process['t7'] == ''){ $t7='0'; }else{ $t7=$process['t7']; } + if (!isset($process['t8']) || $process['t8'] == ''){ $t8='0'; }else{ $t8=$process['t8']; } + if (!isset($process['t9']) || $process['t9'] == ''){ $t9='0'; }else{ $t9=$process['t9']; } + if (!isset($process['t10']) || $process['t10'] == ''){ $t10='0'; }else{ $t10=$process['t10']; } + if (!isset($process['t11']) || $process['t11'] == ''){ $t11='0'; }else{ $t11=$process['t11']; $showhero=1;} if ($session->tribe == 3){ $totalunits = (!empty($process['t1']) ? $process['t1'] : 0) + (!empty($process['t2']) ? $process['t2'] : 0) + @@ -59,7 +59,7 @@ $ckey= $generator->generateRandStr(6); (!empty($process['t9']) ? $process['t9'] : 0) + (!empty($process['t10']) ? $process['t10'] : 0) + (!empty($process['t11']) ? $process['t11'] : 0); - + }else{ $totalunits = (!empty($process['t1']) ? $process['t1'] : 0) + (!empty($process['t2']) ? $process['t2'] : 0) + @@ -106,7 +106,7 @@ $start = ($tribe-1)*10+1; $end = ($tribe*10); ?> -

+

vname; ?>
 getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" />getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" />
@@ -154,14 +154,14 @@ $end = ($tribe*10); - getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" />"; + echo ""; } if (!empty($process['t11'])){ - echo ""; - + echo ""; + }?> - + @@ -204,7 +204,7 @@ $end = ($tribe*10); - + @@ -212,7 +212,7 @@ $end = ($tribe*10); - + ?> @@ -354,7 +354,7 @@ $end = ($tribe*10); - + tribe-1)*10+$i)}['speed']; + if ($i<11) + $speeds[] = ${'u'.(($session->tribe-1)*10+$i)}['speed']; else { - //$uid - $q = "SELECT unit FROM ".TB_PREFIX."hero WHERE uid = ".(int) $uid." AND dead = 0"; - $result = mysqli_query($GLOBALS['link'],$q); - $hero_f=mysqli_fetch_array($result); - $hero_unit=$hero_f['unit']; - $speeds[] = ${'u'.$hero_unit}['speed']; + $hero_unit = $database->getHeroField($uid, 'unit'); + $speeds[] = ${'u'.$hero_unit}['speed']; } if($i != 4) @@ -393,7 +389,7 @@ $end = ($tribe*10); } - + } @@ -401,7 +397,7 @@ $end = ($tribe*10); - + if($scout) @@ -434,7 +430,7 @@ $end = ($tribe*10); ?> - +
getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" />\"Hero\"\"Hero\"
Destination: "> - +
Destination: "> ONLY shoot with a normal attack (they dont shoot with raids!)"; ?> Arrived:"> @@ -450,13 +446,13 @@ $end = ($tribe*10);
- + - + - + - + @@ -465,11 +461,11 @@ $end = ($tribe*10); if(($database->hasBeginnerProtection($village->wid)==1)&&($database->hasBeginnerProtection($process['0'])==0)){ echo"Caution: Attacking a player will lose the protection!"; } - if($database->hasBeginnerProtection($process['0'])==1) { + if($database->hasBeginnerProtection($process['0'])==1) { echo"User presently has beginners protection"; } else { ?> -

diff --git a/Templates/a2b/attack_5.tpl b/Templates/a2b/attack_5.tpl index d092a4cf..39e59acf 100644 --- a/Templates/a2b/attack_5.tpl +++ b/Templates/a2b/attack_5.tpl @@ -40,22 +40,22 @@ $ckey= $generator->generateRandStr(6); if (!isset($process['t1']) || $process['t1'] == ''){ $t1='0'; }else{ $t1=$process['t1']; } - if (!isset($process['t2']) || $process['t2'] == ''){ $t2='0'; }else{ $t2=$process['t2']; } - if (!isset($process['t3']) || $process['t3'] == ''){ $t3='0'; }else{ $t3=$process['t3']; $scout=1; } - if (!isset($process['t4']) || $process['t4'] == ''){ $t4='0'; }else{ $t4=$process['t4']; } - if (!isset($process['t5']) || $process['t5'] == ''){ $t5='0'; }else{ $t5=$process['t5']; } - if (!isset($process['t6']) || $process['t6'] == ''){ $t6='0'; }else{ $t6=$process['t6']; } - if (!isset($process['t7']) || $process['t7'] == ''){ $t7='0'; }else{ $t7=$process['t7']; } - if (!isset($process['t8']) || $process['t8'] == ''){ $t8='0'; }else{ $t8=$process['t8']; } - if (!isset($process['t9']) || $process['t9'] == ''){ $t9='0'; }else{ $t9=$process['t9']; } - if (!isset($process['t10']) || $process['t10'] == ''){ $t10='0'; }else{ $t10=$process['t10']; } - if (!isset($process['t11']) || $process['t11'] == ''){ $t11='0'; }else{ $t11=$process['t11']; } + if (!isset($process['t2']) || $process['t2'] == ''){ $t2='0'; }else{ $t2=$process['t2']; } + if (!isset($process['t3']) || $process['t3'] == ''){ $t3='0'; }else{ $t3=$process['t3']; $scout=1; } + if (!isset($process['t4']) || $process['t4'] == ''){ $t4='0'; }else{ $t4=$process['t4']; } + if (!isset($process['t5']) || $process['t5'] == ''){ $t5='0'; }else{ $t5=$process['t5']; } + if (!isset($process['t6']) || $process['t6'] == ''){ $t6='0'; }else{ $t6=$process['t6']; } + if (!isset($process['t7']) || $process['t7'] == ''){ $t7='0'; }else{ $t7=$process['t7']; } + if (!isset($process['t8']) || $process['t8'] == ''){ $t8='0'; }else{ $t8=$process['t8']; } + if (!isset($process['t9']) || $process['t9'] == ''){ $t9='0'; }else{ $t9=$process['t9']; } + if (!isset($process['t10']) || $process['t10'] == ''){ $t10='0'; }else{ $t10=$process['t10']; } + if (!isset($process['t11']) || $process['t11'] == ''){ $t11='0'; }else{ $t11=$process['t11']; } $totalunits =$process['t1']+$process['t2']+$process['t4']+$process['t5']+$process['t6']+$process['t7']+$process['t8']+$process['t9']+$process['t10']+$process['t11']; if ($scout==1 && $totalunits==0) { $process['c'] = 1; -} +} $id = $database->addA2b($ckey,time(),$process['0'],$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$t10,$t11,$process['c']); @@ -77,7 +77,7 @@ $actionType = "Raid"; ?> -

+

@@ -123,7 +123,7 @@ $actionType = "Raid"; - + @@ -189,7 +189,7 @@ $actionType = "Raid"; - + @@ -208,7 +208,7 @@ $actionType = "Raid"; - + @@ -225,13 +225,13 @@ $actionType = "Raid"; - + - + getTypeLevel(16) >= 10) { ?> @@ -243,7 +243,7 @@ $actionType = "Raid"; - + @@ -262,7 +262,7 @@ $actionType = "Raid"; - + @@ -279,13 +279,13 @@ $actionType = "Raid"; - + - + getTypeLevel(16) >= 10) { ?> @@ -297,7 +297,7 @@ $actionType = "Raid"; - + @@ -308,16 +308,16 @@ $actionType = "Raid"; (will be attacked by catapult(s)) - + ?> Destination: "> ONLY shoot with a normal attack (they dont shoot with raids!)"; ?> @@ -337,7 +337,7 @@ $actionType = "Raid"; Arrived: - + - + ">
in getTimeFormat($time); ?>
- +
at procMtime(date('U')+$time,9)?> hours
@@ -427,18 +427,18 @@ $actionType = "Raid"; - + - + - + - + -