We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -1703,7 +1703,7 @@ discard block |
||
| 1703 | 1703 | create_error('The saved sector must be in the box!'); |
| 1704 | 1704 | } |
| 1705 | 1705 | |
| 1706 | - $storedDestinations =& $this->getStoredDestinations(); |
|
| 1706 | + $storedDestinations = & $this->getStoredDestinations(); |
|
| 1707 | 1707 | foreach ($storedDestinations as &$sd) { |
| 1708 | 1708 | if ($sd['SectorID'] == $sectorID) { |
| 1709 | 1709 | $sd['OffsetTop'] = $offsetTop; |
@@ -2030,13 +2030,13 @@ discard block |
||
| 2030 | 2030 | $this->db->query('SELECT type,amount FROM player_hof WHERE ' . $this->SQL); |
| 2031 | 2031 | $this->HOF = array(); |
| 2032 | 2032 | while ($this->db->nextRecord()) { |
| 2033 | - $hof =& $this->HOF; |
|
| 2033 | + $hof = & $this->HOF; |
|
| 2034 | 2034 | $typeList = explode(':', $this->db->getField('type')); |
| 2035 | 2035 | foreach ($typeList as $type) { |
| 2036 | 2036 | if (!isset($hof[$type])) { |
| 2037 | 2037 | $hof[$type] = array(); |
| 2038 | 2038 | } |
| 2039 | - $hof =& $hof[$type]; |
|
| 2039 | + $hof = & $hof[$type]; |
|
| 2040 | 2040 | } |
| 2041 | 2041 | $hof = $this->db->getFloat('amount'); |
| 2042 | 2042 | } |
@@ -2115,8 +2115,8 @@ discard block |
||
| 2115 | 2115 | } |
| 2116 | 2116 | self::$HOFVis[$hofType] = $visibility; |
| 2117 | 2117 | |
| 2118 | - $hof =& $this->HOF; |
|
| 2119 | - $hofChanged =& $this->hasHOFChanged; |
|
| 2118 | + $hof = & $this->HOF; |
|
| 2119 | + $hofChanged = & $this->hasHOFChanged; |
|
| 2120 | 2120 | $new = false; |
| 2121 | 2121 | foreach ($typeList as $type) { |
| 2122 | 2122 | if (!isset($hofChanged[$type])) { |
@@ -2126,8 +2126,8 @@ discard block |
||
| 2126 | 2126 | $hof[$type] = array(); |
| 2127 | 2127 | $new = true; |
| 2128 | 2128 | } |
| 2129 | - $hof =& $hof[$type]; |
|
| 2130 | - $hofChanged =& $hofChanged[$type]; |
|
| 2129 | + $hof = & $hof[$type]; |
|
| 2130 | + $hofChanged = & $hofChanged[$type]; |
|
| 2131 | 2131 | } |
| 2132 | 2132 | if ($hofChanged == null) { |
| 2133 | 2133 | $hofChanged = self::HOF_CHANGED; |
@@ -2730,7 +2730,7 @@ discard block |
||
| 2730 | 2730 | } |
| 2731 | 2731 | |
| 2732 | 2732 | private function setupMissionStep($missionID) { |
| 2733 | - $mission =& $this->missions[$missionID]; |
|
| 2733 | + $mission = & $this->missions[$missionID]; |
|
| 2734 | 2734 | if ($mission['On Step'] >= count(MISSIONS[$missionID]['Steps'])) { |
| 2735 | 2735 | // Nothing to do if this mission is already completed |
| 2736 | 2736 | return; |
@@ -2779,7 +2779,7 @@ discard block |
||
| 2779 | 2779 | 'Starting Sector' => $this->getSectorID() |
| 2780 | 2780 | ); |
| 2781 | 2781 | |
| 2782 | - $this->missions[$missionID] =& $mission; |
|
| 2782 | + $this->missions[$missionID] = & $mission; |
|
| 2783 | 2783 | $this->setupMissionStep($missionID); |
| 2784 | 2784 | $this->rebuildMission($missionID); |
| 2785 | 2785 | |
@@ -2829,7 +2829,7 @@ discard block |
||
| 2829 | 2829 | |
| 2830 | 2830 | public function claimMissionReward($missionID) { |
| 2831 | 2831 | $this->getMissions(); |
| 2832 | - $mission =& $this->missions[$missionID]; |
|
| 2832 | + $mission = & $this->missions[$missionID]; |
|
| 2833 | 2833 | if ($mission === false) { |
| 2834 | 2834 | throw new Exception('Unknown mission: ' . $missionID); |
| 2835 | 2835 | } |
@@ -79,12 +79,12 @@ discard block |
||
| 79 | 79 | 'exp_gain' => 540, |
| 80 | 80 | ], |
| 81 | 81 | ]; |
| 82 | - public function name() { return "Terran Planet"; } |
|
| 83 | - public function imageLink() { return "images/planet1.png"; } |
|
| 84 | - public function description() { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; } |
|
| 82 | + public function name() { return "Terran Planet"; } |
|
| 83 | + public function imageLink() { return "images/planet1.png"; } |
|
| 84 | + public function description() { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; } |
|
| 85 | 85 | public function maxAttackers() { return 10; } |
| 86 | - public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
| 87 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 86 | + public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
| 87 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | class AridPlanet extends SmrPlanetType { |
@@ -108,12 +108,12 @@ discard block |
||
| 108 | 108 | 'exp_gain' => 180, |
| 109 | 109 | ], |
| 110 | 110 | ]; |
| 111 | - public function name() { return "Arid Planet"; } |
|
| 112 | - public function imageLink() { return "images/planet2.png"; } |
|
| 113 | - public function description() { return "A world mostly devoid of surface water, but capable of supporting life."; } |
|
| 111 | + public function name() { return "Arid Planet"; } |
|
| 112 | + public function imageLink() { return "images/planet2.png"; } |
|
| 113 | + public function description() { return "A world mostly devoid of surface water, but capable of supporting life."; } |
|
| 114 | 114 | public function maxAttackers() { return 5; } |
| 115 | - public function maxLanded() { return 5; } |
|
| 116 | - public function menuOptions() { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; } |
|
| 115 | + public function maxLanded() { return 5; } |
|
| 116 | + public function menuOptions() { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; } |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | class DwarfPlanet extends SmrPlanetType { |
@@ -137,12 +137,12 @@ discard block |
||
| 137 | 137 | 'exp_gain' => 540, |
| 138 | 138 | ], |
| 139 | 139 | ]; |
| 140 | - public function name() { return "Dwarf Planet"; } |
|
| 141 | - public function imageLink() { return "images/planet3.png"; } |
|
| 142 | - public function description() { return "A smaller than usual planet, with no native life present."; } |
|
| 140 | + public function name() { return "Dwarf Planet"; } |
|
| 141 | + public function imageLink() { return "images/planet3.png"; } |
|
| 142 | + public function description() { return "A smaller than usual planet, with no native life present."; } |
|
| 143 | 143 | public function maxAttackers() { return 5; } |
| 144 | - public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
| 145 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 144 | + public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
| 145 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | class ProtoPlanet extends SmrPlanetType { |
@@ -178,12 +178,12 @@ discard block |
||
| 178 | 178 | 'exp_gain' => 540, |
| 179 | 179 | ], |
| 180 | 180 | ]; |
| 181 | - public function name() { return "Protoplanet"; } |
|
| 182 | - public function imageLink() { return "images/planet5.png"; } |
|
| 183 | - public function description() { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; } |
|
| 181 | + public function name() { return "Protoplanet"; } |
|
| 182 | + public function imageLink() { return "images/planet5.png"; } |
|
| 183 | + public function description() { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; } |
|
| 184 | 184 | public function maxAttackers() { return 5; } |
| 185 | - public function maxLanded() { return 5; } |
|
| 186 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 185 | + public function maxLanded() { return 5; } |
|
| 186 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | class DefenseWorld extends SmrPlanetType { |
@@ -213,10 +213,10 @@ discard block |
||
| 213 | 213 | 'exp_gain' => 9, |
| 214 | 214 | ], |
| 215 | 215 | ]; |
| 216 | - public function name() { return "Defense World"; } |
|
| 217 | - public function imageLink() { return "images/planet4.png"; } |
|
| 218 | - public function description() { return "A fully armed and operational battle station loaded with excessive firepower."; } |
|
| 216 | + public function name() { return "Defense World"; } |
|
| 217 | + public function imageLink() { return "images/planet4.png"; } |
|
| 218 | + public function description() { return "A fully armed and operational battle station loaded with excessive firepower."; } |
|
| 219 | 219 | public function maxAttackers() { return 10; } |
| 220 | - public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
| 221 | - public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 220 | + public function maxLanded() { return self::MAX_LANDED_UNLIMITED; } |
|
| 221 | + public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; } |
|
| 222 | 222 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | $return = array('MaxDamage' => 0, 'Shield' => 0, 'Armour' => 0, 'Rollover' => $this->isDamageRollover()); |
| 94 | 94 | return $return; |
| 95 | 95 | } |
| 96 | - $damage =& $this->getModifiedDamage(); |
|
| 96 | + $damage = & $this->getModifiedDamage(); |
|
| 97 | 97 | if ($targetPlayer->getShip()->isFederal()) { // do less damage to fed ships |
| 98 | 98 | $damage['MaxDamage'] = IRound($damage['MaxDamage'] * self::FED_SHIP_DAMAGE_MODIFIER); |
| 99 | 99 | $damage['Shield'] = IRound($damage['Shield'] * self::FED_SHIP_DAMAGE_MODIFIER); |
@@ -130,12 +130,12 @@ discard block |
||
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | protected function &doForceDamageToPlayer(array &$return, SmrForce $forces, AbstractSmrPlayer $targetPlayer, $minesAreAttacker = false) { |
| 133 | - $return['WeaponDamage'] =& $this->getModifiedForceDamageAgainstPlayer($forces, $targetPlayer, $minesAreAttacker); |
|
| 134 | - $return['ActualDamage'] =& $targetPlayer->getShip()->doMinesDamage($return['WeaponDamage']); |
|
| 133 | + $return['WeaponDamage'] = & $this->getModifiedForceDamageAgainstPlayer($forces, $targetPlayer, $minesAreAttacker); |
|
| 134 | + $return['ActualDamage'] = & $targetPlayer->getShip()->doMinesDamage($return['WeaponDamage']); |
|
| 135 | 135 | $return['ActualDamage']['Launched'] = ICeil($return['WeaponDamage']['Launched'] * $return['ActualDamage']['TotalDamage'] / $return['WeaponDamage']['MaxDamage']); |
| 136 | 136 | |
| 137 | 137 | if ($return['ActualDamage']['KillingShot']) { |
| 138 | - $return['KillResults'] =& $targetPlayer->killPlayerByForces($forces); |
|
| 138 | + $return['KillResults'] = & $targetPlayer->killPlayerByForces($forces); |
|
| 139 | 139 | } |
| 140 | 140 | return $return; |
| 141 | 141 | } |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | global $player, $db; |
| 99 | 99 | $offset = $minRank - 1; |
| 100 | 100 | $limit = $maxRank - $offset; |
| 101 | - $db->query('SELECT alliance_id, alliance_' . $stat . ' AS amount FROM alliance WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY amount DESC, alliance_name LIMIT ' . $offset. ', ' . $limit); |
|
| 101 | + $db->query('SELECT alliance_id, alliance_' . $stat . ' AS amount FROM alliance WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY amount DESC, alliance_name LIMIT ' . $offset . ', ' . $limit); |
|
| 102 | 102 | return self::collectAllianceRankings($db, $player, $offset); |
| 103 | 103 | } |
| 104 | 104 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | $template->assign('OurRank', $ourRank); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | -$expRanks = function (int $minRank, int $maxRank) use ($player, $db) : array { |
|
| 28 | +$expRanks = function(int $minRank, int $maxRank) use ($player, $db) : array { |
|
| 29 | 29 | $offset = $minRank - 1; |
| 30 | 30 | $limit = $maxRank - $offset; |
| 31 | 31 | $db->query('SELECT alliance_id, COALESCE(SUM(experience), 0) amount |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | $template->assign('OurRank', $ourRank); |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | -$profitRanks = function (int $minRank, int $maxRank) use ($player, $db, $profitTypeEscaped) : array { |
|
| 31 | +$profitRanks = function(int $minRank, int $maxRank) use ($player, $db, $profitTypeEscaped) : array { |
|
| 32 | 32 | $offset = $minRank - 1; |
| 33 | 33 | $limit = $maxRank - $offset; |
| 34 | 34 | $db->query('SELECT alliance_id, COALESCE(SUM(amount), 0) amount |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | |
| 25 | 25 | $totalPlayers = $player->getGame()->getTotalPlayers(); |
| 26 | 26 | |
| 27 | -$profitRanks = function (int $minRank, int $maxRank) use ($player, $db, $profitTypeEscaped) : array { |
|
| 27 | +$profitRanks = function(int $minRank, int $maxRank) use ($player, $db, $profitTypeEscaped) : array { |
|
| 28 | 28 | $offset = $minRank - 1; |
| 29 | 29 | $limit = $maxRank - $offset; |
| 30 | 30 | $db->query('SELECT p.*, COALESCE(ph.amount,0) amount FROM player p LEFT JOIN player_hof ph ON p.account_id = ph.account_id AND p.game_id = ph.game_id AND ph.type = ' . $profitTypeEscaped . ' WHERE p.game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY amount DESC, player_name ASC LIMIT ' . $offset . ', ' . $limit); |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | /** |
| 22 | 22 | * @var $messagePlayer SmrPlayer | string |
| 23 | 23 | */ |
| 24 | - $getName = function ($messagePlayer) use ($container, $account) : string { |
|
| 24 | + $getName = function($messagePlayer) use ($container, $account) : string { |
|
| 25 | 25 | $name = $messagePlayer; |
| 26 | 26 | if ($messagePlayer instanceof SmrPlayer) { |
| 27 | 27 | $name = $messagePlayer->getAccount()->getLogin(); |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | public function setWeaponLocations(array $orderArray) { |
| 311 | 311 | $weapons = $this->weapons; |
| 312 | 312 | foreach ($orderArray as $newOrder => $oldOrder) { |
| 313 | - $this->weapons[$newOrder] =& $weapons[$oldOrder]; |
|
| 313 | + $this->weapons[$newOrder] = & $weapons[$oldOrder]; |
|
| 314 | 314 | } |
| 315 | 315 | $this->hasChangedWeapons = true; |
| 316 | 316 | } |
@@ -939,14 +939,14 @@ discard block |
||
| 939 | 939 | } |
| 940 | 940 | $results['DeadBeforeShot'] = false; |
| 941 | 941 | foreach ($this->weapons as $orderID => $weapon) { |
| 942 | - $results['Weapons'][$orderID] =& $weapon->shootPlayer($thisPlayer, array_rand_value($targetPlayers)); |
|
| 942 | + $results['Weapons'][$orderID] = & $weapon->shootPlayer($thisPlayer, array_rand_value($targetPlayers)); |
|
| 943 | 943 | if ($results['Weapons'][$orderID]['Hit']) { |
| 944 | 944 | $results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; |
| 945 | 945 | } |
| 946 | 946 | } |
| 947 | 947 | if ($this->hasCDs()) { |
| 948 | 948 | $thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs()); |
| 949 | - $results['Drones'] =& $thisCDs->shootPlayer($thisPlayer, array_rand_value($targetPlayers)); |
|
| 949 | + $results['Drones'] = & $thisCDs->shootPlayer($thisPlayer, array_rand_value($targetPlayers)); |
|
| 950 | 950 | $results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage']; |
| 951 | 951 | } |
| 952 | 952 | $thisPlayer->increaseExperience(IRound($results['TotalDamage'] * self::EXP_PER_DAMAGE_PLAYER)); |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | } |
| 965 | 965 | $results['DeadBeforeShot'] = false; |
| 966 | 966 | foreach ($this->weapons as $orderID => $weapon) { |
| 967 | - $results['Weapons'][$orderID] =& $weapon->shootForces($thisPlayer, $forces); |
|
| 967 | + $results['Weapons'][$orderID] = & $weapon->shootForces($thisPlayer, $forces); |
|
| 968 | 968 | if ($results['Weapons'][$orderID]['Hit']) { |
| 969 | 969 | $results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; |
| 970 | 970 | $thisPlayer->increaseHOF($results['Weapons'][$orderID]['ActualDamage']['NumMines'], array('Combat', 'Forces', 'Mines', 'Killed'), HOF_PUBLIC); |
@@ -978,7 +978,7 @@ discard block |
||
| 978 | 978 | } |
| 979 | 979 | if ($this->hasCDs()) { |
| 980 | 980 | $thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs()); |
| 981 | - $results['Drones'] =& $thisCDs->shootForces($thisPlayer, $forces); |
|
| 981 | + $results['Drones'] = & $thisCDs->shootForces($thisPlayer, $forces); |
|
| 982 | 982 | $results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage']; |
| 983 | 983 | $thisPlayer->increaseHOF($results['Drones']['ActualDamage']['NumMines'], array('Combat', 'Forces', 'Mines', 'Killed'), HOF_PUBLIC); |
| 984 | 984 | $thisPlayer->increaseHOF($results['Drones']['ActualDamage']['Mines'], array('Combat', 'Forces', 'Mines', 'Damage Done'), HOF_PUBLIC); |
@@ -1003,14 +1003,14 @@ discard block |
||
| 1003 | 1003 | } |
| 1004 | 1004 | $results['DeadBeforeShot'] = false; |
| 1005 | 1005 | foreach ($this->weapons as $orderID => $weapon) { |
| 1006 | - $results['Weapons'][$orderID] =& $weapon->shootPort($thisPlayer, $port); |
|
| 1006 | + $results['Weapons'][$orderID] = & $weapon->shootPort($thisPlayer, $port); |
|
| 1007 | 1007 | if ($results['Weapons'][$orderID]['Hit']) { |
| 1008 | 1008 | $results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; |
| 1009 | 1009 | } |
| 1010 | 1010 | } |
| 1011 | 1011 | if ($this->hasCDs()) { |
| 1012 | 1012 | $thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs()); |
| 1013 | - $results['Drones'] =& $thisCDs->shootPort($thisPlayer, $port); |
|
| 1013 | + $results['Drones'] = & $thisCDs->shootPort($thisPlayer, $port); |
|
| 1014 | 1014 | $results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage']; |
| 1015 | 1015 | } |
| 1016 | 1016 | $thisPlayer->increaseExperience(IRound($results['TotalDamage'] * self::EXP_PER_DAMAGE_PORT)); |
@@ -1041,14 +1041,14 @@ discard block |
||
| 1041 | 1041 | } |
| 1042 | 1042 | $results['DeadBeforeShot'] = false; |
| 1043 | 1043 | foreach ($this->weapons as $orderID => $weapon) { |
| 1044 | - $results['Weapons'][$orderID] =& $weapon->shootPlanet($thisPlayer, $planet, $delayed); |
|
| 1044 | + $results['Weapons'][$orderID] = & $weapon->shootPlanet($thisPlayer, $planet, $delayed); |
|
| 1045 | 1045 | if ($results['Weapons'][$orderID]['Hit']) { |
| 1046 | 1046 | $results['TotalDamage'] += $results['Weapons'][$orderID]['ActualDamage']['TotalDamage']; |
| 1047 | 1047 | } |
| 1048 | 1048 | } |
| 1049 | 1049 | if ($this->hasCDs()) { |
| 1050 | 1050 | $thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs()); |
| 1051 | - $results['Drones'] =& $thisCDs->shootPlanet($thisPlayer, $planet, $delayed); |
|
| 1051 | + $results['Drones'] = & $thisCDs->shootPlanet($thisPlayer, $planet, $delayed); |
|
| 1052 | 1052 | $results['TotalDamage'] += $results['Drones']['ActualDamage']['TotalDamage']; |
| 1053 | 1053 | } |
| 1054 | 1054 | $thisPlayer->increaseExperience(IRound($results['TotalDamage'] * self::EXP_PER_DAMAGE_PLANET)); |