We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | $menuItems[] = array('Link'=>Globals::getPlanetListHREF($alliance_id), 'Text'=>'Defense'); |
| 13 | 13 | $menuItems[] = array('Link'=>Globals::getPlanetListFinancialHREF($alliance_id), 'Text'=>'Financial'); |
| 14 | 14 | // make the selected index bold |
| 15 | - $boldItem =& $menuItems[$selected_index]['Text']; |
|
| 15 | + $boldItem = & $menuItems[$selected_index]['Text']; |
|
| 16 | 16 | $boldItem = '<span class="bold">' . $boldItem . '</span>'; |
| 17 | 17 | $template->assign('MenuItems', $menuItems); |
| 18 | 18 | } |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | $menuItems[] = ['Link' => SmrSession::getNewHREF($container), |
| 108 | 108 | 'Text' => 'Game News']; |
| 109 | 109 | // make the selected index bold |
| 110 | - $boldItem =& $menuItems[$selected_index]['Text']; |
|
| 110 | + $boldItem = & $menuItems[$selected_index]['Text']; |
|
| 111 | 111 | $boldItem = '<b>' . $boldItem . '</b>'; |
| 112 | 112 | $template->assign('MenuItems', $menuItems); |
| 113 | 113 | } |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | /** |
| 41 | 41 | * Access properties of structures that this planet type can build. |
| 42 | 42 | */ |
| 43 | - public function structureTypes($structureID=false) { |
|
| 43 | + public function structureTypes($structureID = false) { |
|
| 44 | 44 | if (!isset($this->structures)) { |
| 45 | 45 | foreach (static::STRUCTURES as $ID => $Info) { |
| 46 | 46 | $this->structures[$ID] = new SmrPlanetStructureType($ID, $Info); |
@@ -77,12 +77,12 @@ discard block |
||
| 77 | 77 | 'exp_gain' => 540, |
| 78 | 78 | ], |
| 79 | 79 | ]; |
| 80 | - public function name() { return "Terran Planet"; } |
|
| 81 | - public function imageLink() { return "images/planet1.png"; } |
|
| 82 | - public function description() { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; } |
|
| 80 | + public function name() { return "Terran Planet"; } |
|
| 81 | + public function imageLink() { return "images/planet1.png"; } |
|
| 82 | + public function description() { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; } |
|
| 83 | 83 | public function maxAttackers() { return 10; } |
| 84 | - public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
| 85 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 84 | + public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
| 85 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | class AridPlanet extends SmrPlanetType { |
@@ -106,12 +106,12 @@ discard block |
||
| 106 | 106 | 'exp_gain' => 180, |
| 107 | 107 | ], |
| 108 | 108 | ]; |
| 109 | - public function name() { return "Arid Planet"; } |
|
| 110 | - public function imageLink() { return "images/planet2.png"; } |
|
| 111 | - public function description() { return "A world mostly devoid of surface water, but capable of supporting life."; } |
|
| 109 | + public function name() { return "Arid Planet"; } |
|
| 110 | + public function imageLink() { return "images/planet2.png"; } |
|
| 111 | + public function description() { return "A world mostly devoid of surface water, but capable of supporting life."; } |
|
| 112 | 112 | public function maxAttackers() { return 5; } |
| 113 | - public function maxLanded() { return 5; } |
|
| 114 | - public function menuOptions() { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; } |
|
| 113 | + public function maxLanded() { return 5; } |
|
| 114 | + public function menuOptions() { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; } |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | class DwarfPlanet extends SmrPlanetType { |
@@ -135,12 +135,12 @@ discard block |
||
| 135 | 135 | 'exp_gain' => 540, |
| 136 | 136 | ], |
| 137 | 137 | ]; |
| 138 | - public function name() { return "Dwarf Planet"; } |
|
| 139 | - public function imageLink() { return "images/planet3.png"; } |
|
| 140 | - public function description() { return "A smaller than usual planet, with no native life present."; } |
|
| 138 | + public function name() { return "Dwarf Planet"; } |
|
| 139 | + public function imageLink() { return "images/planet3.png"; } |
|
| 140 | + public function description() { return "A smaller than usual planet, with no native life present."; } |
|
| 141 | 141 | public function maxAttackers() { return 5; } |
| 142 | - public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
| 143 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 142 | + public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
| 143 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | class ProtoPlanet extends SmrPlanetType { |
@@ -170,12 +170,12 @@ discard block |
||
| 170 | 170 | 'exp_gain' => 540, |
| 171 | 171 | ], |
| 172 | 172 | ]; |
| 173 | - public function name() { return "Protoplanet"; } |
|
| 174 | - public function imageLink() { return "images/planet5.png"; } |
|
| 175 | - public function description() { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; } |
|
| 173 | + public function name() { return "Protoplanet"; } |
|
| 174 | + public function imageLink() { return "images/planet5.png"; } |
|
| 175 | + public function description() { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; } |
|
| 176 | 176 | public function maxAttackers() { return 5; } |
| 177 | - public function maxLanded() { return 5; } |
|
| 178 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 177 | + public function maxLanded() { return 5; } |
|
| 178 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | class DefenseWorld extends SmrPlanetType { |
@@ -205,10 +205,10 @@ discard block |
||
| 205 | 205 | 'exp_gain' => 9, |
| 206 | 206 | ], |
| 207 | 207 | ]; |
| 208 | - public function name() { return "Defense World"; } |
|
| 209 | - public function imageLink() { return "images/planet4.png"; } |
|
| 210 | - public function description() { return "A fully armed and operational battle station loaded with excessive firepower."; } |
|
| 208 | + public function name() { return "Defense World"; } |
|
| 209 | + public function imageLink() { return "images/planet4.png"; } |
|
| 210 | + public function description() { return "A fully armed and operational battle station loaded with excessive firepower."; } |
|
| 211 | 211 | public function maxAttackers() { return 10; } |
| 212 | - public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
| 213 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 212 | + public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
| 213 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 214 | 214 | } |
@@ -1180,7 +1180,7 @@ discard block |
||
| 1180 | 1180 | do { |
| 1181 | 1181 | $targetPlayer = $targetPlayers[array_rand($targetPlayers)]; |
| 1182 | 1182 | } while ($results['TotalShotsPerTargetPlayer'][$targetPlayer->getAccountID()] > min($results['TotalShotsPerTargetPlayer'])); |
| 1183 | - $results['Weapons'][$orderID] =& $weapon->shootPlayerAsPort($this, $targetPlayer); |
|
| 1183 | + $results['Weapons'][$orderID] = & $weapon->shootPlayerAsPort($this, $targetPlayer); |
|
| 1184 | 1184 | $results['TotalShotsPerTargetPlayer'][$targetPlayer->getAccountID()]++; |
| 1185 | 1185 | if ($results['Weapons'][$orderID]['Hit']) { |
| 1186 | 1186 | $results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; |
@@ -1189,7 +1189,7 @@ discard block |
||
| 1189 | 1189 | } |
| 1190 | 1190 | if ($this->hasCDs()) { |
| 1191 | 1191 | $thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs(), true); |
| 1192 | - $results['Drones'] =& $thisCDs->shootPlayerAsPort($this, $targetPlayers[array_rand($targetPlayers)]); |
|
| 1192 | + $results['Drones'] = & $thisCDs->shootPlayerAsPort($this, $targetPlayers[array_rand($targetPlayers)]); |
|
| 1193 | 1193 | $results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage']; |
| 1194 | 1194 | $results['TotalDamagePerTargetPlayer'][$results['Drones']['TargetPlayer']->getAccountID()] += $results['Drones']['ActualDamage']['TotalDamage']; |
| 1195 | 1195 | } |
@@ -1146,7 +1146,7 @@ discard block |
||
| 1146 | 1146 | $results['DeadBeforeShot'] = false; |
| 1147 | 1147 | $weapons = $this->getWeapons(); |
| 1148 | 1148 | foreach ($weapons as $orderID => $weapon) { |
| 1149 | - $results['Weapons'][$orderID] =& $weapon->shootPlayerAsPlanet($this, $targetPlayers[array_rand($targetPlayers)]); |
|
| 1149 | + $results['Weapons'][$orderID] = & $weapon->shootPlayerAsPlanet($this, $targetPlayers[array_rand($targetPlayers)]); |
|
| 1150 | 1150 | if ($results['Weapons'][$orderID]['Hit']) { |
| 1151 | 1151 | $results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; |
| 1152 | 1152 | $results['TotalDamagePerTargetPlayer'][$results['Weapons'][$orderID]['TargetPlayer']->getAccountID()] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; |
@@ -1154,7 +1154,7 @@ discard block |
||
| 1154 | 1154 | } |
| 1155 | 1155 | if ($this->hasCDs()) { |
| 1156 | 1156 | $thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs(), true); |
| 1157 | - $results['Drones'] =& $thisCDs->shootPlayerAsPlanet($this, $targetPlayers[array_rand($targetPlayers)]); |
|
| 1157 | + $results['Drones'] = & $thisCDs->shootPlayerAsPlanet($this, $targetPlayers[array_rand($targetPlayers)]); |
|
| 1158 | 1158 | $results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage']; |
| 1159 | 1159 | $results['TotalDamagePerTargetPlayer'][$results['Drones']['TargetPlayer']->getAccountID()] += $results['Drones']['ActualDamage']['TotalDamage']; |
| 1160 | 1160 | } |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | $shareFrom[$fromAccountId] = array( |
| 20 | 20 | 'Player ID' => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(), |
| 21 | 21 | 'Player Name' => $otherPlayer == null ? |
| 22 | - '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofDisplayName() : |
|
| 23 | - $otherPlayer->getPlayerName(), |
|
| 22 | + '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofDisplayName() : $otherPlayer->getPlayerName(), |
|
| 24 | 23 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
| 25 | 24 | 'Game ID' => $gameId, |
| 26 | 25 | ); |
@@ -40,8 +39,7 @@ discard block |
||
| 40 | 39 | $shareTo[$toAccountId] = array( |
| 41 | 40 | 'Player ID' => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(), |
| 42 | 41 | 'Player Name' => $otherPlayer == null ? |
| 43 | - '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofDisplayName() : |
|
| 44 | - $otherPlayer->getPlayerName(), |
|
| 42 | + '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofDisplayName() : $otherPlayer->getPlayerName(), |
|
| 45 | 43 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
| 46 | 44 | 'Game ID' => $gameId, |
| 47 | 45 | ); |
@@ -1,91 +1,91 @@ |
||
| 1 | 1 | <?php declare(strict_types=1); |
| 2 | -$template->assign('PageTopic','Combat Simulator'); |
|
| 2 | +$template->assign('PageTopic', 'Combat Simulator'); |
|
| 3 | 3 | |
| 4 | -$template->assign('EditDummysLink',SmrSession::getNewHREF(create_container('skeleton.php','edit_dummys.php'))); |
|
| 4 | +$template->assign('EditDummysLink', SmrSession::getNewHREF(create_container('skeleton.php', 'edit_dummys.php'))); |
|
| 5 | 5 | $template->assign('DummyNames', DummyPlayer::getDummyPlayerNames()); |
| 6 | 6 | |
| 7 | 7 | $duplicates = false; |
| 8 | 8 | $usedNames = array(); |
| 9 | 9 | $realAttackers = array(); |
| 10 | 10 | $attackers = array(); |
| 11 | -$i=1; |
|
| 12 | -if(isset($_POST['attackers'])) |
|
| 13 | - foreach($_POST['attackers'] as $attackerName) { |
|
| 14 | - if($attackerName=='none') |
|
| 11 | +$i = 1; |
|
| 12 | +if (isset($_POST['attackers'])) |
|
| 13 | + foreach ($_POST['attackers'] as $attackerName) { |
|
| 14 | + if ($attackerName == 'none') |
|
| 15 | 15 | continue; |
| 16 | - if(isset($usedNames[$attackerName])) { |
|
| 16 | + if (isset($usedNames[$attackerName])) { |
|
| 17 | 17 | $duplicates = true; |
| 18 | 18 | continue; |
| 19 | 19 | } |
| 20 | 20 | $usedNames[$attackerName] = true; |
| 21 | - $attackers[$i] =& DummyPlayer::getCachedDummyPlayer($attackerName); |
|
| 21 | + $attackers[$i] = & DummyPlayer::getCachedDummyPlayer($attackerName); |
|
| 22 | 22 | $attackers[$i]->setAllianceID(1); |
| 23 | - $realAttackers[$i] =& $attackers[$i]; |
|
| 23 | + $realAttackers[$i] = & $attackers[$i]; |
|
| 24 | 24 | ++$i; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | -for(;$i<=10;++$i) |
|
| 27 | +for (;$i <= 10; ++$i) |
|
| 28 | 28 | $attackers[$i] = null; |
| 29 | -$template->assign('Attackers',$attackers); |
|
| 29 | +$template->assign('Attackers', $attackers); |
|
| 30 | 30 | |
| 31 | -$i=1; |
|
| 31 | +$i = 1; |
|
| 32 | 32 | $realDefenders = array(); |
| 33 | 33 | $defenders = array(); |
| 34 | -if(isset($_POST['defenders'])) |
|
| 35 | - foreach($_POST['defenders'] as $defenderName) { |
|
| 36 | - if($defenderName=='none') |
|
| 34 | +if (isset($_POST['defenders'])) |
|
| 35 | + foreach ($_POST['defenders'] as $defenderName) { |
|
| 36 | + if ($defenderName == 'none') |
|
| 37 | 37 | continue; |
| 38 | - if(isset($usedNames[$defenderName])) { |
|
| 38 | + if (isset($usedNames[$defenderName])) { |
|
| 39 | 39 | $duplicates = true; |
| 40 | 40 | continue; |
| 41 | 41 | } |
| 42 | 42 | $usedNames[$attackerName] = true; |
| 43 | - $defenders[$i] =& DummyPlayer::getCachedDummyPlayer($defenderName); |
|
| 43 | + $defenders[$i] = & DummyPlayer::getCachedDummyPlayer($defenderName); |
|
| 44 | 44 | $defenders[$i]->setAllianceID(2); |
| 45 | - $realDefenders[$i] =& $defenders[$i]; |
|
| 45 | + $realDefenders[$i] = & $defenders[$i]; |
|
| 46 | 46 | ++$i; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | -for(;$i<=10;++$i) |
|
| 49 | +for (;$i <= 10; ++$i) |
|
| 50 | 50 | $defenders[$i] = null; |
| 51 | -$template->assign('Defenders',$defenders); |
|
| 51 | +$template->assign('Defenders', $defenders); |
|
| 52 | 52 | |
| 53 | -$template->assign('Duplicates',$duplicates); |
|
| 53 | +$template->assign('Duplicates', $duplicates); |
|
| 54 | 54 | |
| 55 | -$template->assign('CombatSimHREF',SmrSession::getNewHREF(create_container('skeleton.php','combat_simulator.php'))); |
|
| 55 | +$template->assign('CombatSimHREF', SmrSession::getNewHREF(create_container('skeleton.php', 'combat_simulator.php'))); |
|
| 56 | 56 | |
| 57 | 57 | if (!empty($realAttackers) && !empty($realDefenders)) { |
| 58 | - if(isset($_REQUEST['run'])) { |
|
| 59 | - runAnAttack($realAttackers,$realDefenders); |
|
| 58 | + if (isset($_REQUEST['run'])) { |
|
| 59 | + runAnAttack($realAttackers, $realDefenders); |
|
| 60 | 60 | } |
| 61 | - if(isset($_REQUEST['death_run'])) { |
|
| 62 | - while(count($realAttackers)>0 && count($realDefenders)>0) { |
|
| 63 | - runAnAttack($realAttackers,$realDefenders); |
|
| 64 | - foreach($realAttackers as $key => &$teamPlayer) { |
|
| 65 | - if($teamPlayer->isDead()) |
|
| 61 | + if (isset($_REQUEST['death_run'])) { |
|
| 62 | + while (count($realAttackers) > 0 && count($realDefenders) > 0) { |
|
| 63 | + runAnAttack($realAttackers, $realDefenders); |
|
| 64 | + foreach ($realAttackers as $key => &$teamPlayer) { |
|
| 65 | + if ($teamPlayer->isDead()) |
|
| 66 | 66 | unset($realAttackers[$key]); |
| 67 | 67 | } unset($teamPlayer); |
| 68 | - foreach($realDefenders as $key => &$teamPlayer) { |
|
| 69 | - if($teamPlayer->isDead()) |
|
| 68 | + foreach ($realDefenders as $key => &$teamPlayer) { |
|
| 69 | + if ($teamPlayer->isDead()) |
|
| 70 | 70 | unset($realDefenders[$key]); |
| 71 | 71 | } unset($teamPlayer); |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | -function runAnAttack($realAttackers,$realDefenders) { |
|
| 76 | +function runAnAttack($realAttackers, $realDefenders) { |
|
| 77 | 77 | global $template; |
| 78 | 78 | $results = array('Attackers' => array('Traders' => array(), 'TotalDamage' => 0), |
| 79 | 79 | 'Defenders' => array('Traders' => array(), 'TotalDamage' => 0)); |
| 80 | 80 | foreach ($realAttackers as $accountID => $teamPlayer) { |
| 81 | - $playerResults =& $teamPlayer->shootPlayers($realDefenders); |
|
| 82 | - $results['Attackers']['Traders'][] =& $playerResults; |
|
| 81 | + $playerResults = & $teamPlayer->shootPlayers($realDefenders); |
|
| 82 | + $results['Attackers']['Traders'][] = & $playerResults; |
|
| 83 | 83 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; |
| 84 | 84 | } |
| 85 | 85 | foreach ($realDefenders as $accountID => $teamPlayer) { |
| 86 | - $playerResults =& $teamPlayer->shootPlayers($realAttackers); |
|
| 87 | - $results['Defenders']['Traders'][] =& $playerResults; |
|
| 86 | + $playerResults = & $teamPlayer->shootPlayers($realAttackers); |
|
| 87 | + $results['Defenders']['Traders'][] = & $playerResults; |
|
| 88 | 88 | $results['Defenders']['TotalDamage'] += $playerResults['TotalDamage']; |
| 89 | 89 | } |
| 90 | - $template->assign('TraderCombatResults',$results); |
|
| 90 | + $template->assign('TraderCombatResults', $results); |
|
| 91 | 91 | } |
@@ -1,31 +1,31 @@ discard block |
||
| 1 | 1 | <?php declare(strict_types=1); |
| 2 | 2 | |
| 3 | 3 | class DummyPlayer extends AbstractSmrPlayer { |
| 4 | - public function __construct($gameID=0,$playerName='Dummy',$raceID=1,$experience=1000,$alignment=100,$allianceID=0,$shipTypeID=60) { |
|
| 4 | + public function __construct($gameID = 0, $playerName = 'Dummy', $raceID = 1, $experience = 1000, $alignment = 100, $allianceID = 0, $shipTypeID = 60) { |
|
| 5 | 5 | parent::__construct(); |
| 6 | 6 | $this->accountID = 0; |
| 7 | - $this->gameID = (int) $gameID; |
|
| 8 | - $this->playerName = (string) $playerName; |
|
| 7 | + $this->gameID = (int)$gameID; |
|
| 8 | + $this->playerName = (string)$playerName; |
|
| 9 | 9 | $this->playerID = 0; |
| 10 | 10 | $this->sectorID = 0; |
| 11 | - $this->lastSectorID = 0; |
|
| 11 | + $this->lastSectorID = 0; |
|
| 12 | 12 | $this->turns = 1000; |
| 13 | - $this->newbieTurns = 0; |
|
| 13 | + $this->newbieTurns = 0; |
|
| 14 | 14 | $this->lastNewsUpdate = 0; |
| 15 | 15 | $this->dead = false; |
| 16 | 16 | $this->landedOnPlanet = false; |
| 17 | - $this->lastActive = 0; |
|
| 18 | - $this->lastCPLAction = 0; |
|
| 19 | - $this->raceID = (int) $raceID; |
|
| 20 | - $this->credits = 0; |
|
| 21 | - $this->experience = (int) $experience; |
|
| 22 | - $this->alignment = (int) $alignment; |
|
| 23 | - $this->militaryPayment = 0; |
|
| 24 | - $this->allianceID = (int) $allianceID; |
|
| 25 | - $this->shipID = (int) $shipTypeID; |
|
| 17 | + $this->lastActive = 0; |
|
| 18 | + $this->lastCPLAction = 0; |
|
| 19 | + $this->raceID = (int)$raceID; |
|
| 20 | + $this->credits = 0; |
|
| 21 | + $this->experience = (int)$experience; |
|
| 22 | + $this->alignment = (int)$alignment; |
|
| 23 | + $this->militaryPayment = 0; |
|
| 24 | + $this->allianceID = (int)$allianceID; |
|
| 25 | + $this->shipID = (int)$shipTypeID; |
|
| 26 | 26 | $this->kills = 0; |
| 27 | 27 | $this->deaths = 0; |
| 28 | - $this->lastPort = 0; |
|
| 28 | + $this->lastPort = 0; |
|
| 29 | 29 | $this->bank = 0; |
| 30 | 30 | $this->zoom = 0; |
| 31 | 31 | |
@@ -53,9 +53,9 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | public function setAllianceID($ID) { |
| 56 | - if($this->allianceID == $ID) |
|
| 56 | + if ($this->allianceID == $ID) |
|
| 57 | 57 | return; |
| 58 | - $this->allianceID=$ID; |
|
| 58 | + $this->allianceID = $ID; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | public function &killPlayerByPlayer(AbstractSmrPlayer $killer) { |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | $db = new SmrMySqlDatabase(); |
| 82 | 82 | $db->query('REPLACE INTO cached_dummys ' . |
| 83 | 83 | '(type, id, info) ' . |
| 84 | - 'VALUES (\'DummyPlayer\', '.$db->escapeString($this->getPlayerName()).', '.$db->escapeString($cache).')'); |
|
| 84 | + 'VALUES (\'DummyPlayer\', ' . $db->escapeString($this->getPlayerName()) . ', ' . $db->escapeString($cache) . ')'); |
|
| 85 | 85 | unserialize($cache); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | $db->query('SELECT info FROM cached_dummys |
| 91 | 91 | WHERE type = \'DummyPlayer\' |
| 92 | 92 | AND id = ' . $db->escapeString($name) . ' LIMIT 1'); |
| 93 | - if($db->nextRecord()) { |
|
| 93 | + if ($db->nextRecord()) { |
|
| 94 | 94 | $return = unserialize($db->getField('info')); |
| 95 | 95 | return $return; |
| 96 | 96 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | $db->query('SELECT id FROM cached_dummys |
| 106 | 106 | WHERE type = \'DummyPlayer\''); |
| 107 | 107 | $dummyNames = array(); |
| 108 | - while($db->nextRecord()) { |
|
| 108 | + while ($db->nextRecord()) { |
|
| 109 | 109 | $dummyNames[] = $db->getField('id'); |
| 110 | 110 | } |
| 111 | 111 | return $dummyNames; |
@@ -202,7 +202,7 @@ |
||
| 202 | 202 | AND receiver_delete = ' . $db->escapeBoolean(false) . ' |
| 203 | 203 | ORDER BY send_time DESC'); |
| 204 | 204 | while ($db->nextRecord()) { |
| 205 | - $groupBox =& $messageBox['GroupedMessages'][$db->getInt('sender_id')]; |
|
| 205 | + $groupBox = & $messageBox['GroupedMessages'][$db->getInt('sender_id')]; |
|
| 206 | 206 | // Limit the number of messages in each group |
| 207 | 207 | if (!isset($groupBox['Messages']) || count($groupBox['Messages']) < MESSAGE_SCOUT_GROUP_LIMIT) { |
| 208 | 208 | displayMessage($groupBox, $db->getInt('message_id'), $db->getInt('account_id'), $db->getInt('sender_id'), stripslashes($db->getField('message_text')), $db->getInt('send_time'), $db->getBoolean('msg_read'), MSG_SCOUT); |
@@ -7,7 +7,7 @@ discard block |
||
| 7 | 7 | $db3 = new SmrMySqlDatabase(); |
| 8 | 8 | |
| 9 | 9 | // get current entry |
| 10 | - $db->query('SELECT * FROM manual WHERE topic_id = '.$db->escapeNumber($topic_id)); |
|
| 10 | + $db->query('SELECT * FROM manual WHERE topic_id = ' . $db->escapeNumber($topic_id)); |
|
| 11 | 11 | if ($db->nextRecord()) { |
| 12 | 12 | $parent_topic_id = $db->getInt('parent_topic_id'); |
| 13 | 13 | $order_id = $db->getInt('order_id'); |
@@ -19,17 +19,17 @@ discard block |
||
| 19 | 19 | // ************************** |
| 20 | 20 | // ** PREVIOUS |
| 21 | 21 | // ************************** |
| 22 | - $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id - 1)); |
|
| 22 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($order_id - 1)); |
|
| 23 | 23 | |
| 24 | 24 | // no result? |
| 25 | 25 | if (!$db2->getNumRows()) |
| 26 | - $db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id)); |
|
| 26 | + $db2->query('SELECT * FROM manual WHERE topic_id = ' . $db2->escapeNumber($parent_topic_id)); |
|
| 27 | 27 | |
| 28 | 28 | echo ('<th width="32">'); |
| 29 | 29 | if ($db2->nextRecord()) { |
| 30 | 30 | $previous_topic_id = $db2->getInt('topic_id'); |
| 31 | 31 | $previous_topic = stripslashes($db2->getField('topic')); |
| 32 | - echo ('<a href="/manual.php?'.$previous_topic_id.'"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>'); |
|
| 32 | + echo ('<a href="/manual.php?' . $previous_topic_id . '"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>'); |
|
| 33 | 33 | } else |
| 34 | 34 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
| 35 | 35 | echo ('</th>'); |
@@ -37,12 +37,12 @@ discard block |
||
| 37 | 37 | // ************************** |
| 38 | 38 | // ** UP |
| 39 | 39 | // ************************** |
| 40 | - $db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id)); |
|
| 40 | + $db2->query('SELECT * FROM manual WHERE topic_id = ' . $db2->escapeNumber($parent_topic_id)); |
|
| 41 | 41 | echo ('<th width="32">'); |
| 42 | 42 | if ($db2->nextRecord()) { |
| 43 | 43 | $up_topic_id = $db2->getInt('topic_id'); |
| 44 | 44 | $up_topic = stripslashes($db2->getField('topic')); |
| 45 | - echo ('<a href="/manual.php?'.$up_topic_id.'"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>'); |
|
| 45 | + echo ('<a href="/manual.php?' . $up_topic_id . '"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>'); |
|
| 46 | 46 | } else |
| 47 | 47 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
| 48 | 48 | echo ('</th>'); |
@@ -50,35 +50,35 @@ discard block |
||
| 50 | 50 | // ************************** |
| 51 | 51 | // ** NEXT |
| 52 | 52 | // ************************** |
| 53 | - $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($topic_id).' AND order_id = 1'); |
|
| 53 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($topic_id) . ' AND order_id = 1'); |
|
| 54 | 54 | |
| 55 | 55 | if (!$db2->getNumRows()) |
| 56 | - $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id + 1)); |
|
| 56 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($order_id + 1)); |
|
| 57 | 57 | |
| 58 | 58 | $seenParentIDs = array(0); |
| 59 | 59 | $curr_parent_topic_id = $parent_topic_id; |
| 60 | 60 | while (!$db2->getNumRows() && !in_array($curr_parent_topic_id, $seenParentIDs)) { |
| 61 | 61 | $seenParentIDs[] = $curr_parent_topic_id; |
| 62 | - $db3->query('SELECT * FROM manual WHERE topic_id = '.$db3->escapeNumber($parent_topic_id)); |
|
| 62 | + $db3->query('SELECT * FROM manual WHERE topic_id = ' . $db3->escapeNumber($parent_topic_id)); |
|
| 63 | 63 | $db3->nextRecord(); |
| 64 | 64 | $curr_order_id = $db3->getInt('order_id'); |
| 65 | 65 | $curr_parent_topic_id = $db3->getInt('parent_topic_id'); |
| 66 | 66 | |
| 67 | - $db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($curr_order_id + 1)); |
|
| 67 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($curr_order_id + 1)); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | echo ('<th width="32">'); |
| 71 | 71 | if ($db2->nextRecord()) { |
| 72 | 72 | $next_topic_id = $db2->getInt('topic_id'); |
| 73 | 73 | $next_topic = stripslashes($db2->getField('topic')); |
| 74 | - echo ('<a href="/manual.php?'.$next_topic_id.'"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>'); |
|
| 74 | + echo ('<a href="/manual.php?' . $next_topic_id . '"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>'); |
|
| 75 | 75 | } |
| 76 | 76 | else { |
| 77 | 77 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
| 78 | 78 | } |
| 79 | 79 | echo ('</th>'); |
| 80 | 80 | |
| 81 | - echo ('<th width="100%" class="center" validn="middle" style="font-size:18pt;font-weight:bold;">' . get_numbering($topic_id) . $topic.'</th>'); |
|
| 81 | + echo ('<th width="100%" class="center" validn="middle" style="font-size:18pt;font-weight:bold;">' . get_numbering($topic_id) . $topic . '</th>'); |
|
| 82 | 82 | echo ('<th width="32"><a href="/manual_toc.php"><img src="/images/help/contents.jpg" width="32" height="32" border="0"></a></th>'); |
| 83 | 83 | |
| 84 | 84 | echo ('</tr>'); |
@@ -86,11 +86,11 @@ discard block |
||
| 86 | 86 | echo ('<tr>'); |
| 87 | 87 | echo ('<td colspan="5">'); |
| 88 | 88 | if (isset($previous_topic_id) && $previous_topic_id > 0) |
| 89 | - echo ('<b>Previous:</b> <a href="/manual.php?'.$previous_topic_id.'">' . get_numbering($previous_topic_id) . $previous_topic.'</a> '); |
|
| 89 | + echo ('<b>Previous:</b> <a href="/manual.php?' . $previous_topic_id . '">' . get_numbering($previous_topic_id) . $previous_topic . '</a> '); |
|
| 90 | 90 | if (isset($up_topic_id) && $up_topic_id > 0) |
| 91 | - echo ('<b>Up:</b> <a href="/manual.php?'.$up_topic_id.'">' . get_numbering($up_topic_id) . $up_topic.'</a> '); |
|
| 91 | + echo ('<b>Up:</b> <a href="/manual.php?' . $up_topic_id . '">' . get_numbering($up_topic_id) . $up_topic . '</a> '); |
|
| 92 | 92 | if (isset($next_topic_id) && $next_topic_id > 0) |
| 93 | - echo ('<b>Next:</b> <a href="/manual.php?'.$next_topic_id.'">' . get_numbering($next_topic_id) . $next_topic.'</a>'); |
|
| 93 | + echo ('<b>Next:</b> <a href="/manual.php?' . $next_topic_id . '">' . get_numbering($next_topic_id) . $next_topic . '</a>'); |
|
| 94 | 94 | echo ('</tr>'); |
| 95 | 95 | |
| 96 | 96 | echo ('</table>'); |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | $db = new SmrMySqlDatabase(); |
| 104 | 104 | |
| 105 | 105 | // get current entry |
| 106 | - $db->query('SELECT * FROM manual WHERE topic_id = '.$topic_id); |
|
| 106 | + $db->query('SELECT * FROM manual WHERE topic_id = ' . $topic_id); |
|
| 107 | 107 | if ($db->nextRecord()) { |
| 108 | 108 | $parent_topic_id = $db->getInt('parent_topic_id'); |
| 109 | 109 | $order_id = $db->getInt('order_id'); |
@@ -111,8 +111,8 @@ discard block |
||
| 111 | 111 | $text = stripslashes($db->getField('text')); |
| 112 | 112 | |
| 113 | 113 | echo ('<div id="help_content">'); |
| 114 | - echo ('<h1>' . get_numbering($topic_id) . $topic.'</h1>'); |
|
| 115 | - echo ('<p>'.$text.'<p>'); |
|
| 114 | + echo ('<h1>' . get_numbering($topic_id) . $topic . '</h1>'); |
|
| 115 | + echo ('<p>' . $text . '<p>'); |
|
| 116 | 116 | echo ('</div>'); |
| 117 | 117 | } else |
| 118 | 118 | echo ('Invalid Topic!'); |
@@ -121,9 +121,9 @@ discard block |
||
| 121 | 121 | function echo_subsection($topic_id) { |
| 122 | 122 | // database object |
| 123 | 123 | $db = new SmrMySqlDatabase(); |
| 124 | - $return=''; |
|
| 124 | + $return = ''; |
|
| 125 | 125 | // check if there are subsections |
| 126 | - $db->query('SELECT * FROM manual WHERE parent_topic_id = '.$db->escapeNumber($topic_id).' ORDER BY order_id'); |
|
| 126 | + $db->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db->escapeNumber($topic_id) . ' ORDER BY order_id'); |
|
| 127 | 127 | if ($db->getNumRows()) { |
| 128 | 128 | echo ('<hr noshade width="75%" size="1" class="center"/>'); |
| 129 | 129 | echo ('<div id="help_menu">'); |
@@ -137,19 +137,19 @@ discard block |
||
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | function echo_menu($topic_id) { |
| 140 | - $return=''; |
|
| 140 | + $return = ''; |
|
| 141 | 141 | // database object |
| 142 | 142 | $db = new SmrMySqlDatabase(); |
| 143 | 143 | |
| 144 | - $db->query('SELECT * FROM manual WHERE parent_topic_id = '.$db->escapeNumber($topic_id).' ORDER BY order_id'); |
|
| 144 | + $db->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db->escapeNumber($topic_id) . ' ORDER BY order_id'); |
|
| 145 | 145 | if ($db->getNumRows()) { |
| 146 | 146 | echo ('<ul type="disc">'); |
| 147 | - while($db->nextRecord()) { |
|
| 147 | + while ($db->nextRecord()) { |
|
| 148 | 148 | $sub_topic_id = $db->getInt('topic_id'); |
| 149 | 149 | $order_id = $db->getInt('order_id'); |
| 150 | 150 | $sub_topic = stripslashes($db->getField('topic')); |
| 151 | 151 | |
| 152 | - echo ('<li><a href="/manual.php?'.$sub_topic_id.'">' . get_numbering($sub_topic_id) . $sub_topic.'</a></li>'); |
|
| 152 | + echo ('<li><a href="/manual.php?' . $sub_topic_id . '">' . get_numbering($sub_topic_id) . $sub_topic . '</a></li>'); |
|
| 153 | 153 | echo_menu($sub_topic_id); |
| 154 | 154 | } |
| 155 | 155 | echo ('</ul>'); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | function get_numbering($topic_id) { |
| 161 | 161 | $db = new SmrMySqlDatabase(); |
| 162 | 162 | |
| 163 | - $db->query('SELECT * FROM manual WHERE topic_id = '.$db->escapeNumber($topic_id)); |
|
| 163 | + $db->query('SELECT * FROM manual WHERE topic_id = ' . $db->escapeNumber($topic_id)); |
|
| 164 | 164 | if ($db->nextRecord()) { |
| 165 | 165 | $up_topic_id = $db->getInt('parent_topic_id'); |
| 166 | 166 | $order_id = $db->getInt('order_id'); |