Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — master (#1006)
by Dan
15:04
created
src/admin/Default/ip_view_results.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@
 block discarded – undo
96 96
 	}
97 97
 	$accountID = (int)$variable;
98 98
 	$template->assign('BanAccountID', $accountID);
99
-	$summary = 'Account ' . $accountID. ' has had the following IPs at the following times.';
99
+	$summary = 'Account ' . $accountID . ' has had the following IPs at the following times.';
100 100
 	$template->assign('Summary', $summary);
101 101
 	$db2->query('SELECT * FROM account_exceptions WHERE account_id = ' . $db->escapeNumber($variable));
102 102
 	if ($db2->nextRecord()) {
Please login to merge, or discard this patch.
src/lib/Default/ChessPiece.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 	}
235 235
 
236 236
 	public static function getLetterForPiece(int $pieceID, string $colour) : string {
237
-		$letter = match ($pieceID) {
237
+		$letter = match($pieceID) {
238 238
 			self::KING => 'k',
239 239
 			self::QUEEN => 'q',
240 240
 			self::ROOK => 'r',
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 	}
250 250
 
251 251
 	public static function getPieceForLetter(string $letter) : int {
252
-		return match (strtolower($letter)) {
252
+		return match(strtolower($letter)) {
253 253
 			'k' => self::KING,
254 254
 			'q' => self::QUEEN,
255 255
 			'r' => self::ROOK,
Please login to merge, or discard this patch.
src/lib/Default/AbstractSmrAccount.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
 	/**
247 247
 	 * Check if the account is disabled.
248 248
 	 */
249
-	public function isDisabled() : array | false {
249
+	public function isDisabled() : array|false {
250 250
 		$this->db->query('SELECT * FROM account_is_closed JOIN closing_reason USING(reason_id) ' .
251 251
 			'WHERE ' . $this->SQL . ' LIMIT 1');
252 252
 		if ($this->db->nextRecord()) {
@@ -377,13 +377,13 @@  discard block
 block discarded – undo
377 377
 			$this->db->query('SELECT type,sum(amount) as amount FROM player_hof WHERE ' . $this->SQL . ' AND game_id IN (SELECT game_id FROM game WHERE ignore_stats = \'FALSE\') GROUP BY type');
378 378
 			$this->HOF = array();
379 379
 			while ($this->db->nextRecord()) {
380
-				$hof =& $this->HOF;
380
+				$hof = & $this->HOF;
381 381
 				$typeList = explode(':', $this->db->getField('type'));
382 382
 				foreach ($typeList as $type) {
383 383
 					if (!isset($hof[$type])) {
384 384
 						$hof[$type] = array();
385 385
 					}
386
-					$hof =& $hof[$type];
386
+					$hof = & $hof[$type];
387 387
 				}
388 388
 				$hof = $this->db->getFloat('amount');
389 389
 			}
@@ -1125,7 +1125,7 @@  discard block
 block discarded – undo
1125 1125
 		}
1126 1126
 	}
1127 1127
 
1128
-	public function addPoints(int $numPoints, SmrAccount $admin, int $reasonID, string $suspicion) : int | false {
1128
+	public function addPoints(int $numPoints, SmrAccount $admin, int $reasonID, string $suspicion) : int|false {
1129 1129
 		//do we have points
1130 1130
 		$this->setPoints($this->getPoints() + $numPoints, SmrSession::getTime());
1131 1131
 		$totalPoints = $this->getPoints();
Please login to merge, or discard this patch.
src/lib/Default/DummyShip.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 	}
17 17
 
18 18
 	protected function doFullUNO() {
19
-		foreach($this->getMaxHardware() as $hardwareTypeID => $max) {
19
+		foreach ($this->getMaxHardware() as $hardwareTypeID => $max) {
20 20
 			$this->hardware[$hardwareTypeID] = $max;
21 21
 			$this->oldHardware[$hardwareTypeID] = $max;
22 22
 		}
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 	}
47 47
 
48 48
 	public function getIllusionShip() {
49
-		if(!isset($this->illusionShip)) {
50
-			$this->illusionShip=false;
49
+		if (!isset($this->illusionShip)) {
50
+			$this->illusionShip = false;
51 51
 		}
52 52
 		return $this->illusionShip;
53 53
 	}
@@ -57,20 +57,20 @@  discard block
 block discarded – undo
57 57
 		$db = MySqlDatabase::getInstance();
58 58
 		$db->query('REPLACE INTO cached_dummys ' .
59 59
 					'(type, id, info) ' .
60
-					'VALUES (\'DummyShip\', '.$db->escapeString($this->getPlayer()->getPlayerName()).', '.$db->escapeString($cache).')');
60
+					'VALUES (\'DummyShip\', ' . $db->escapeString($this->getPlayer()->getPlayerName()) . ', ' . $db->escapeString($cache) . ')');
61 61
 		unserialize($cache);
62 62
 	}
63 63
 
64 64
 	public static function getCachedDummyShip(AbstractSmrPlayer $player) {
65
-		if(!isset(self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()])) {
65
+		if (!isset(self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()])) {
66 66
 			$db = MySqlDatabase::getInstance();
67 67
 			$db->query('SELECT info FROM cached_dummys
68 68
 						WHERE type = \'DummyShip\'
69 69
 						AND id = ' . $db->escapeString($player->getPlayerName()) . ' LIMIT 1');
70
-			if($db->nextRecord()) {
70
+			if ($db->nextRecord()) {
71 71
 				$return = unserialize($db->getField('info'));
72 72
 				$return->regenerate($player);
73
-				self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] =& $return;
73
+				self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] = & $return;
74 74
 			} else {
75 75
 				self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] = new DummyShip($player);
76 76
 			}
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 		$db->query('SELECT id FROM cached_dummys
84 84
 					WHERE type = \'DummyShip\'');
85 85
 		$dummyNames = array();
86
-		while($db->nextRecord()) {
86
+		while ($db->nextRecord()) {
87 87
 			$dummyNames[] = $db->getField('id');
88 88
 		}
89 89
 		return $dummyNames;
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
 
93 93
 
94 94
 	public function __sleep() {
95
-		return array('gameID','weapons');
95
+		return array('gameID', 'weapons');
96 96
 	}
97 97
 
98 98
 	public function __wakeup() {
Please login to merge, or discard this patch.
src/lib/Default/DummyPlayer.class.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@  discard block
 block discarded – undo
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
 		$this->accountID				= 0;
6
-		$this->gameID					= (int) $gameID;
7
-		$this->playerName				= (string) $playerName;
6
+		$this->gameID = (int)$gameID;
7
+		$this->playerName = (string)$playerName;
8 8
 		$this->playerID					= 0;
9 9
 		$this->sectorID					= 0;
10
-		$this->lastSectorID				= 0;
10
+		$this->lastSectorID = 0;
11 11
 		$this->turns					= 1000;
12
-		$this->newbieTurns				= 0;
12
+		$this->newbieTurns = 0;
13 13
 		$this->lastNewsUpdate			= 0;
14 14
 		$this->dead						= false;
15 15
 		$this->landedOnPlanet			= false;
16
-		$this->lastActive				= 0;
17
-		$this->lastCPLAction			= 0;
18
-		$this->raceID					= (int) $raceID;
19
-		$this->credits					= 0;
20
-		$this->experience				= (int) $experience;
21
-		$this->alignment				= (int) $alignment;
22
-		$this->militaryPayment			= 0;
23
-		$this->allianceID				= (int) $allianceID;
24
-		$this->shipID					= (int) $shipTypeID;
16
+		$this->lastActive = 0;
17
+		$this->lastCPLAction = 0;
18
+		$this->raceID = (int)$raceID;
19
+		$this->credits = 0;
20
+		$this->experience				= (int)$experience;
21
+		$this->alignment = (int)$alignment;
22
+		$this->militaryPayment = 0;
23
+		$this->allianceID				= (int)$allianceID;
24
+		$this->shipID					= (int)$shipTypeID;
25 25
 		$this->kills					= 0;
26 26
 		$this->deaths					= 0;
27
-		$this->lastPort					= 0;
27
+		$this->lastPort = 0;
28 28
 		$this->bank						= 0;
29 29
 		$this->zoom						= 0;
30 30
 
@@ -48,9 +48,9 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 
50 50
 	public function setAllianceID($ID) {
51
-		if($this->allianceID == $ID)
51
+		if ($this->allianceID == $ID)
52 52
 			return;
53
-		$this->allianceID=$ID;
53
+		$this->allianceID = $ID;
54 54
 	}
55 55
 
56 56
 	public function killPlayerByPlayer(AbstractSmrPlayer $killer) {
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 		$db = MySqlDatabase::getInstance();
77 77
 		$db->query('REPLACE INTO cached_dummys ' .
78 78
 					'(type, id, info) ' .
79
-					'VALUES (\'DummyPlayer\', '.$db->escapeString($this->getPlayerName()).', '.$db->escapeString($cache).')');
79
+					'VALUES (\'DummyPlayer\', ' . $db->escapeString($this->getPlayerName()) . ', ' . $db->escapeString($cache) . ')');
80 80
 		 unserialize($cache);
81 81
 	}
82 82
 
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		$db->query('SELECT info FROM cached_dummys
86 86
 					WHERE type = \'DummyPlayer\'
87 87
 						AND id = ' . $db->escapeString($name) . ' LIMIT 1');
88
-		if($db->nextRecord()) {
88
+		if ($db->nextRecord()) {
89 89
 			$return = unserialize($db->getField('info'));
90 90
 			return $return;
91 91
 		}
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 		$db->query('SELECT id FROM cached_dummys
101 101
 					WHERE type = \'DummyPlayer\'');
102 102
 		$dummyNames = array();
103
-		while($db->nextRecord()) {
103
+		while ($db->nextRecord()) {
104 104
 			$dummyNames[] = $db->getField('id');
105 105
 		}
106 106
 		return $dummyNames;
Please login to merge, or discard this patch.
src/lib/Default/AbstractSmrCombatWeapon.class.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	abstract public function getModifiedPlanetDamageAgainstPlayer(SmrPlanet $planet, AbstractSmrPlayer $targetPlayer);
68 68
 
69 69
 	protected function doPlayerDamageToForce(array $return, AbstractSmrPlayer $weaponPlayer, SmrForce $forces) {
70
-		$return['WeaponDamage'] = $this->getModifiedDamageAgainstForces($weaponPlayer,$forces);
70
+		$return['WeaponDamage'] = $this->getModifiedDamageAgainstForces($weaponPlayer, $forces);
71 71
 		$return['ActualDamage'] = $forces->doWeaponDamage($return['WeaponDamage']);
72 72
 		if ($return['ActualDamage']['KillingShot']) {
73 73
 			$return['KillResults'] = $forces->killForcesByPlayer($weaponPlayer);
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	}
77 77
 
78 78
 	protected function doPlayerDamageToPlayer(array $return, AbstractSmrPlayer $weaponPlayer, AbstractSmrPlayer $targetPlayer) {
79
-		$return['WeaponDamage'] = $this->getModifiedDamageAgainstPlayer($weaponPlayer,$targetPlayer);
79
+		$return['WeaponDamage'] = $this->getModifiedDamageAgainstPlayer($weaponPlayer, $targetPlayer);
80 80
 		$return['ActualDamage'] = $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
81 81
 
82 82
 		if ($return['ActualDamage']['KillingShot']) {
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 	}
87 87
 
88 88
 	protected function doPlayerDamageToPort(array $return, AbstractSmrPlayer $weaponPlayer, SmrPort $port) {
89
-		$return['WeaponDamage'] = $this->getModifiedDamageAgainstPort($weaponPlayer,$port);
89
+		$return['WeaponDamage'] = $this->getModifiedDamageAgainstPort($weaponPlayer, $port);
90 90
 		$return['ActualDamage'] = $port->doWeaponDamage($return['WeaponDamage']);
91 91
 		if ($return['ActualDamage']['KillingShot']) {
92 92
 			$return['KillResults'] = $port->killPortByPlayer($weaponPlayer);
@@ -95,8 +95,8 @@  discard block
 block discarded – undo
95 95
 	}
96 96
 
97 97
 	protected function doPlayerDamageToPlanet(array $return, AbstractSmrPlayer $weaponPlayer, SmrPlanet $planet, $delayed) {
98
-		$return['WeaponDamage'] = $this->getModifiedDamageAgainstPlanet($weaponPlayer,$planet);
99
-		$return['ActualDamage'] = $planet->doWeaponDamage($return['WeaponDamage'],$delayed);
98
+		$return['WeaponDamage'] = $this->getModifiedDamageAgainstPlanet($weaponPlayer, $planet);
99
+		$return['ActualDamage'] = $planet->doWeaponDamage($return['WeaponDamage'], $delayed);
100 100
 		if ($return['ActualDamage']['KillingShot']) {
101 101
 			$return['KillResults'] = $planet->killPlanetByPlayer($weaponPlayer);
102 102
 		}
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	}
105 105
 
106 106
 	protected function doPortDamageToPlayer(array $return, SmrPort $port, AbstractSmrPlayer $targetPlayer) {
107
-		$return['WeaponDamage'] = $this->getModifiedPortDamageAgainstPlayer($port,$targetPlayer);
107
+		$return['WeaponDamage'] = $this->getModifiedPortDamageAgainstPlayer($port, $targetPlayer);
108 108
 		$return['ActualDamage'] = $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
109 109
 
110 110
 		if ($return['ActualDamage']['KillingShot']) {
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	}
115 115
 
116 116
 	protected function doPlanetDamageToPlayer(array $return, SmrPlanet $planet, AbstractSmrPlayer $targetPlayer) {
117
-		$return['WeaponDamage'] = $this->getModifiedPlanetDamageAgainstPlayer($planet,$targetPlayer);
117
+		$return['WeaponDamage'] = $this->getModifiedPlanetDamageAgainstPlayer($planet, $targetPlayer);
118 118
 		$return['ActualDamage'] = $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
119 119
 
120 120
 		if ($return['ActualDamage']['KillingShot']) {
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
 	}
125 125
 
126 126
 	protected function doForceDamageToPlayer(array $return, SmrForce $forces, AbstractSmrPlayer $targetPlayer) {
127
-		$return['WeaponDamage'] = $this->getModifiedForceDamageAgainstPlayer($forces,$targetPlayer);
127
+		$return['WeaponDamage'] = $this->getModifiedForceDamageAgainstPlayer($forces, $targetPlayer);
128 128
 		$return['ActualDamage'] = $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
129 129
 
130 130
 		if ($return['ActualDamage']['KillingShot']) {
Please login to merge, or discard this patch.
src/lib/Default/AbstractSmrPlayer.class.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1711,7 +1711,7 @@  discard block
 block discarded – undo
1711 1711
 			create_error('The saved sector must be in the box!');
1712 1712
 		}
1713 1713
 
1714
-		$storedDestinations =& $this->getStoredDestinations();
1714
+		$storedDestinations = & $this->getStoredDestinations();
1715 1715
 		foreach ($storedDestinations as &$sd) {
1716 1716
 			if ($sd['SectorID'] == $sectorID) {
1717 1717
 				$sd['OffsetTop'] = $offsetTop;
@@ -2034,13 +2034,13 @@  discard block
 block discarded – undo
2034 2034
 			$this->db->query('SELECT type,amount FROM player_hof WHERE ' . $this->SQL);
2035 2035
 			$this->HOF = array();
2036 2036
 			while ($this->db->nextRecord()) {
2037
-				$hof =& $this->HOF;
2037
+				$hof = & $this->HOF;
2038 2038
 				$typeList = explode(':', $this->db->getField('type'));
2039 2039
 				foreach ($typeList as $type) {
2040 2040
 					if (!isset($hof[$type])) {
2041 2041
 						$hof[$type] = array();
2042 2042
 					}
2043
-					$hof =& $hof[$type];
2043
+					$hof = & $hof[$type];
2044 2044
 				}
2045 2045
 				$hof = $this->db->getFloat('amount');
2046 2046
 			}
@@ -2119,8 +2119,8 @@  discard block
 block discarded – undo
2119 2119
 		}
2120 2120
 		self::$HOFVis[$hofType] = $visibility;
2121 2121
 
2122
-		$hof =& $this->HOF;
2123
-		$hofChanged =& $this->hasHOFChanged;
2122
+		$hof = & $this->HOF;
2123
+		$hofChanged = & $this->hasHOFChanged;
2124 2124
 		$new = false;
2125 2125
 		foreach ($typeList as $type) {
2126 2126
 			if (!isset($hofChanged[$type])) {
@@ -2130,8 +2130,8 @@  discard block
 block discarded – undo
2130 2130
 				$hof[$type] = array();
2131 2131
 				$new = true;
2132 2132
 			}
2133
-			$hof =& $hof[$type];
2134
-			$hofChanged =& $hofChanged[$type];
2133
+			$hof = & $hof[$type];
2134
+			$hofChanged = & $hofChanged[$type];
2135 2135
 		}
2136 2136
 		if ($hofChanged == null) {
2137 2137
 			$hofChanged = self::HOF_CHANGED;
@@ -2780,7 +2780,7 @@  discard block
 block discarded – undo
2780 2780
 			'Starting Sector' => $this->getSectorID()
2781 2781
 		);
2782 2782
 
2783
-		$this->missions[$missionID] =& $mission;
2783
+		$this->missions[$missionID] = & $mission;
2784 2784
 		$this->setupMissionStep($missionID);
2785 2785
 		$this->rebuildMission($missionID);
2786 2786
 
@@ -2830,7 +2830,7 @@  discard block
 block discarded – undo
2830 2830
 
2831 2831
 	public function claimMissionReward($missionID) {
2832 2832
 		$this->getMissions();
2833
-		$mission =& $this->missions[$missionID];
2833
+		$mission = & $this->missions[$missionID];
2834 2834
 		if ($mission === false) {
2835 2835
 			throw new Exception('Unknown mission: ' . $missionID);
2836 2836
 		}
Please login to merge, or discard this patch.
src/engine/Default/combat_simulator.php 1 patch
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -1,79 +1,79 @@  discard block
 block discarded – undo
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));
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
 	}
85 85
 	foreach ($realDefenders as $accountID => $teamPlayer) {
86 86
 		$playerResults = $teamPlayer->shootPlayers($realAttackers);
87
-		$results['Defenders']['Traders'][]  = $playerResults;
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
 }
Please login to merge, or discard this patch.
Default/engine/Default/includes/ForceTraderTeamCombatResults.inc.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -16,24 +16,24 @@  discard block
 block discarded – undo
16 16
 						$WeaponDamage = $WeaponResults['WeaponDamage'];
17 17
 					}
18 18
 
19
-					echo $ShootingPlayer->getDisplayName() ?> fires their <?php echo $ShootingWeapon->getName() ?> at<?php if ($ShotHit && $ActualDamage['TargetAlreadyDead']){ ?> the debris that was once<?php } ?> the forces<?php
19
+					echo $ShootingPlayer->getDisplayName() ?> fires their <?php echo $ShootingWeapon->getName() ?> at<?php if ($ShotHit && $ActualDamage['TargetAlreadyDead']) { ?> the debris that was once<?php } ?> the forces<?php
20 20
 					if (!$ShotHit || !$ActualDamage['TargetAlreadyDead']) {
21 21
 						if (!$ShotHit) {
22 22
 							?> and misses<?php
23 23
 						} elseif ($ActualDamage['TotalDamage'] == 0) {
24 24
 							if ($WeaponDamage['Shield'] > 0) {
25
-								?> which proves ineffective against the <?php if ($ActualDamage['HasMines']){ ?>mines<?php } elseif ($ActualDamage['HasCDs']){ ?>combat drones<?php } else{ ?>scout drones<?php }
25
+								?> which proves ineffective against the <?php if ($ActualDamage['HasMines']) { ?>mines<?php } elseif ($ActualDamage['HasCDs']) { ?>combat drones<?php } else { ?>scout drones<?php }
26 26
 							} elseif ($WeaponDamage['Armour'] > 0) {
27
-								?> which is deflected by the <?php if ($ActualDamage['HasMines']){ ?>mines<?php } elseif ($ActualDamage['HasCDs']){ ?>combat drones<?php } else{ ?>scout drones<?php } ?> shields<?php
27
+								?> which is deflected by the <?php if ($ActualDamage['HasMines']) { ?>mines<?php } elseif ($ActualDamage['HasCDs']) { ?>combat drones<?php } else { ?>scout drones<?php } ?> shields<?php
28 28
 							} else {
29 29
 								?> but it cannot do any damage<?php
30 30
 							}
31 31
 						} else {
32 32
 							?> destroying <?php
33 33
 							$DamageTypes = 0;
34
-							if ($ActualDamage['NumMines'] > 0){ $DamageTypes = $DamageTypes+1; }
35
-							if ($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; }
36
-							if ($ActualDamage['NumSDs'] > 0){ $DamageTypes = $DamageTypes+1; }
34
+							if ($ActualDamage['NumMines'] > 0) { $DamageTypes = $DamageTypes + 1; }
35
+							if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; }
36
+							if ($ActualDamage['NumSDs'] > 0) { $DamageTypes = $DamageTypes + 1; }
37 37
 
38 38
 							if ($ActualDamage['NumMines'] > 0) {
39 39
 								?><span class="red"><?php echo number_format($ActualDamage['NumMines']) ?></span> mines<?php
@@ -63,22 +63,22 @@  discard block
 block discarded – undo
63 63
 				if ($WeaponDamage['Launched'] == 0) {
64 64
 					?> fails to launch their combat drones<?php
65 65
 				} else {
66
-					?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at<?php if ($ActualDamage['TargetAlreadyDead']){ ?> the debris that was once <?php } ?> the forces<?php
66
+					?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at<?php if ($ActualDamage['TargetAlreadyDead']) { ?> the debris that was once <?php } ?> the forces<?php
67 67
 					if (!$ActualDamage['TargetAlreadyDead']) {
68 68
 						if ($ActualDamage['TotalDamage'] == 0) {
69 69
 							if ($WeaponDamage['Shield'] > 0) {
70
-								?> which prove ineffective against the <?php if ($ActualDamage['HasMines']){ ?>mines<?php } elseif ($ActualDamage['HasCDs']){ ?>combat drones<?php } else{ ?>scout drones<?php }
70
+								?> which prove ineffective against the <?php if ($ActualDamage['HasMines']) { ?>mines<?php } elseif ($ActualDamage['HasCDs']) { ?>combat drones<?php } else { ?>scout drones<?php }
71 71
 							} elseif ($WeaponDamage['Armour'] > 0) {
72 72
 								?> which is deflected by the <?php
73
-								if ($ActualDamage['HasMines']){ ?>mines<?php } elseif ($ActualDamage['HasCDs']){ ?>combat drones<?php } else{ ?>scout drones<?php } ?> shields<?php
73
+								if ($ActualDamage['HasMines']) { ?>mines<?php } elseif ($ActualDamage['HasCDs']) { ?>combat drones<?php } else { ?>scout drones<?php } ?> shields<?php
74 74
 							} else {
75 75
 								?> but they cannot do any damage<?php
76 76
 							}
77 77
 						} else {
78 78
 							$DamageTypes = 0;
79
-							if ($ActualDamage['NumMines'] > $WeaponDamage['Kamikaze']) { $DamageTypes = $DamageTypes+1; }
80
-							if ($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; }
81
-							if ($ActualDamage['NumSDs'] > 0){ $DamageTypes = $DamageTypes+1; }
79
+							if ($ActualDamage['NumMines'] > $WeaponDamage['Kamikaze']) { $DamageTypes = $DamageTypes + 1; }
80
+							if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; }
81
+							if ($ActualDamage['NumSDs'] > 0) { $DamageTypes = $DamageTypes + 1; }
82 82
 
83 83
 							if ($WeaponDamage['Kamikaze'] == 0) {
84 84
 								?> destroying <?php
@@ -120,4 +120,4 @@  discard block
 block discarded – undo
120 120
 	}
121 121
 }
122 122
 $TotalDamage = $TraderTeamCombatResults['TotalDamage']; ?>
123
-This fleet <?php if ($TotalDamage > 0){ ?>hits for a total of <span class="red"><?php echo $TotalDamage ?></span> damage in this round of combat<?php } else{ ?>does no damage this round. You call that a fleet? They need a better recruiter<?php } ?>.
123
+This fleet <?php if ($TotalDamage > 0) { ?>hits for a total of <span class="red"><?php echo $TotalDamage ?></span> damage in this round of combat<?php } else { ?>does no damage this round. You call that a fleet? They need a better recruiter<?php } ?>.
Please login to merge, or discard this patch.