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
Branch master (0a752f)
by Dan
03:57
created
tools/discord/GameLink.inc 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,11 +3,11 @@  discard block
 block discarded – undo
3 3
 // Holds information linking the received message and the game data
4 4
 class GameLink
5 5
 {
6
-	public $valid = false;  // identifies if the message is linked to game data
7
-	public $user;           // Discord user associated with the message
8
-	public $account;        // SmrAccount instance
9
-	public $alliance;       // SmrAlliance instance
10
-	public $player;         // SmrPlayer instance
6
+	public $valid = false; // identifies if the message is linked to game data
7
+	public $user; // Discord user associated with the message
8
+	public $account; // SmrAccount instance
9
+	public $alliance; // SmrAlliance instance
10
+	public $player; // SmrPlayer instance
11 11
 
12 12
 	// Takes the following arguments:
13 13
 	//	channel = Discord\Parts\Channel\Channel instance
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
 
61 61
 			$this->player = SmrPlayer::getPlayer($this->account->getAccountID(), $this->alliance->getGameID(), true);
62 62
 			if ($this->player->getAllianceID() != $this->alliance->getAllianceID()) {
63
-				$channel->sendMessage("Player `".$this->player->getPlayerName()."` is not a member of alliance `".$this->alliance->getAllianceName()."`");
63
+				$channel->sendMessage("Player `" . $this->player->getPlayerName() . "` is not a member of alliance `" . $this->alliance->getAllianceName() . "`");
64 64
 				return;
65 65
 			}
66 66
 		}
Please login to merge, or discard this patch.
tools/reserializeCombatLogs.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,6 +21,6 @@
 block discarded – undo
21 21
 //}
22 22
 
23 23
 $db->query('SELECT result,log_id FROM combat_logs');
24
-while($db->nextRecord()) {
25
-	$db2->query('UPDATE combat_logs SET result='.$db2->escapeBinary(gzcompress(serialize(unserialize(gzuncompress($db->getField('result')))))).' WHERE log_id='.$db->getField('log_id'));
24
+while ($db->nextRecord()) {
25
+	$db2->query('UPDATE combat_logs SET result=' . $db2->escapeBinary(gzcompress(serialize(unserialize(gzuncompress($db->getField('result')))))) . ' WHERE log_id=' . $db->getField('log_id'));
26 26
 }
Please login to merge, or discard this patch.
engine/Default/chat_sharing.php 1 patch
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@  discard block
 block discarded – undo
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)->getHofName() :
23
-		                 $otherPlayer->getPlayerName(),
22
+		                 '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofName() : $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
 block discarded – undo
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)->getHofName() :
44
-		                 $otherPlayer->getPlayerName(),
42
+		                 '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofName() : $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
 	);
Please login to merge, or discard this patch.
config/SmrMySqlSecrets.sample.inc 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 trait SmrMySqlSecrets {
3 3
 	protected static $databaseName = 'smr_live';
4 4
 	private static $host = 'smr-mysql'; // must match MYSQL_HOST in .env
5
-	private static $user = 'smr';       // must match MYSQL_USER in .env
6
-	private static $password = 'smr';   // must match MYSQL_PASSWORD in .env
5
+	private static $user = 'smr'; // must match MYSQL_USER in .env
6
+	private static $password = 'smr'; // must match MYSQL_PASSWORD in .env
7 7
 
8 8
 	// Set to null to use defaults
9 9
 	private static $port = null;
Please login to merge, or discard this patch.
templates/Default/engine/Default/includes/CommonMessageSend.inc 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1
-<?php if(isset($Preview)) { ?><table class="standard"><tr><td><?php echo bbifyMessage($Preview); ?></td></tr></table><?php } ?>
1
+<?php if (isset($Preview)) { ?><table class="standard"><tr><td><?php echo bbifyMessage($Preview); ?></td></tr></table><?php } ?>
2 2
 <form name="MessageSendForm" method="POST" action="<?php echo $MessageSendFormHref; ?>">
3 3
 	<p>
4 4
 		<b>From: </b><?php echo $ThisPlayer->getDisplayName(); ?><br />
5
-		<b>To: </b><?php if(isset($Receiver) && is_object($Receiver)) {	echo $Receiver->getDisplayName(); } else { echo $Receiver; } ?>
5
+		<b>To: </b><?php if (isset($Receiver) && is_object($Receiver)) {	echo $Receiver->getDisplayName(); } else { echo $Receiver; } ?>
6 6
 	</p>
7
-	<textarea spellcheck="true" name="message" class="InputFields"><?php if(isset($Preview)) { echo $Preview; } ?></textarea><br />
7
+	<textarea spellcheck="true" name="message" class="InputFields"><?php if (isset($Preview)) { echo $Preview; } ?></textarea><br />
8 8
 	<br />
9 9
 	<input type="submit" name="action" value="Send message" class="InputFields" />&nbsp;<input type="submit" name="action" value="Preview message" class="InputFields" />
10 10
 </form>
Please login to merge, or discard this patch.
tools/testRouteGen.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -19,15 +19,15 @@  discard block
 block discarded – undo
19 19
 }
20 20
 
21 21
 $maxNumberOfPorts = 2;
22
-$goods = array(true,true,true,true,false,false,false,false,false,false,false,false,false);
23
-$races = array(true,true,true,true,false,false,false,false,false,false,false,false,false,false);
22
+$goods = array(true, true, true, true, false, false, false, false, false, false, false, false, false);
23
+$races = array(true, true, true, true, false, false, false, false, false, false, false, false, false, false);
24 24
 
25 25
 //$distances =& Plotter::calculatePortToPortDistances($allSectors,10,0,1440);
26
-$distances =& Plotter::calculatePortToPortDistances($allSectors,10,0,14);
26
+$distances = & Plotter::calculatePortToPortDistances($allSectors, 10, 0, 14);
27 27
 //var_dump($distances);
28 28
 
29
-$routesForPort=-1;
30
-$numberOfRoutes=5;
29
+$routesForPort = -1;
30
+$numberOfRoutes = 5;
31 31
 
32 32
 if ($maxNumberOfPorts == 1)
33 33
 	$allRoutes = RouteGenerator::generateOneWayRoutes($allSectors, $distances, $goods, $races, $routesForPort);
@@ -36,10 +36,10 @@  discard block
 block discarded – undo
36 36
 
37 37
 //var_dump($allRoutes);
38 38
 
39
-foreach($allRoutes as $routeType)
39
+foreach ($allRoutes as $routeType)
40 40
 {
41 41
 	$c = 0;
42
-	foreach($routeType as $routeMulti)
42
+	foreach ($routeType as $routeMulti)
43 43
 	{
44 44
 		$c += (count($routeMulti));
45 45
 //		foreach($routeMulti as $multi => $route) {
Please login to merge, or discard this patch.
engine/Default/help.inc 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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->getField('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
 block discarded – undo
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
 block discarded – undo
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->getField('order_id');
65 65
 			$curr_parent_topic_id = $db3->getField('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
 block discarded – undo
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>&nbsp;&nbsp;&nbsp;');
89
+			echo ('<b>Previous:</b> <a href="/manual.php?' . $previous_topic_id . '">' . get_numbering($previous_topic_id) . $previous_topic . '</a>&nbsp;&nbsp;&nbsp;');
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>&nbsp;&nbsp;&nbsp;');
91
+			echo ('<b>Up:</b> <a href="/manual.php?' . $up_topic_id . '">' . get_numbering($up_topic_id) . $up_topic . '</a>&nbsp;&nbsp;&nbsp;');
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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');
Please login to merge, or discard this patch.
templates/Default/engine/Default/includes/PlanetCombatResults.inc 1 patch
Spacing   +45 added lines, -45 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 $CombatPlanet = $PlanetCombatResults['Planet'];
3 3
 $TotalDamage = $PlanetCombatResults['TotalDamage'];
4
-if($MinimalDisplay) {
4
+if ($MinimalDisplay) {
5 5
 	echo $CombatPlanet->getDisplayName();
6
-	if($TotalDamage > 0) {
6
+	if ($TotalDamage > 0) {
7 7
 		?> hit for a total of <span class="red"><?php echo $TotalDamage; ?></span> damage in this round of combat of which <span class="red"><?php echo $PlanetCombatResults['TotalDamagePerTargetPlayer'][$ThisPlayer->getAccountID()]; ?></span> was done to you<?php
8 8
 	}
9 9
 	else {
@@ -11,33 +11,33 @@  discard block
 block discarded – undo
11 11
 	} ?>. <?php echo $AttackLogLink;
12 12
 	return;
13 13
 }
14
-if(isset($PlanetCombatResults['Weapons']) && is_array($PlanetCombatResults['Weapons'])) {
15
-	foreach($PlanetCombatResults['Weapons'] as $WeaponResults) {
16
-		$ShootingWeapon =& $WeaponResults['Weapon'];
17
-		$ShotHit =& $WeaponResults['Hit'];
18
-		$ActualDamage =& $WeaponResults['ActualDamage'];
19
-		$WeaponDamage =& $WeaponResults['WeaponDamage'];
20
-		$TargetPlayer =& $WeaponResults['TargetPlayer'];
14
+if (isset($PlanetCombatResults['Weapons']) && is_array($PlanetCombatResults['Weapons'])) {
15
+	foreach ($PlanetCombatResults['Weapons'] as $WeaponResults) {
16
+		$ShootingWeapon = & $WeaponResults['Weapon'];
17
+		$ShotHit = & $WeaponResults['Hit'];
18
+		$ActualDamage = & $WeaponResults['ActualDamage'];
19
+		$WeaponDamage = & $WeaponResults['WeaponDamage'];
20
+		$TargetPlayer = & $WeaponResults['TargetPlayer'];
21 21
 		$DamageTypes = 0;
22
-		if($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; }
23
-		if($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; }
24
-		if($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; }
22
+		if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; }
23
+		if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; }
24
+		if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; }
25 25
 		
26
-		echo $CombatPlanet->getDisplayName() ?> fires a <?php echo $ShootingWeapon->getName(); ?> at <?php if($ShotHit && $ActualDamage['TargetAlreadyDead']){ ?> the debris that was once <?php } echo $TargetPlayer->getDisplayName();
27
-		if(!$ActualDamage['TargetAlreadyDead']) {
28
-			if(!$ShotHit) {
26
+		echo $CombatPlanet->getDisplayName() ?> fires a <?php echo $ShootingWeapon->getName(); ?> at <?php if ($ShotHit && $ActualDamage['TargetAlreadyDead']) { ?> the debris that was once <?php } echo $TargetPlayer->getDisplayName();
27
+		if (!$ActualDamage['TargetAlreadyDead']) {
28
+			if (!$ShotHit) {
29 29
 				?> and misses<?php
30 30
 			}
31
-			else if($ActualDamage['TotalDamage'] == 0) {
32
-				if($WeaponDamage['Shield'] > 0) {
33
-					if($ActualDamage['HasCDs']) {
31
+			else if ($ActualDamage['TotalDamage'] == 0) {
32
+				if ($WeaponDamage['Shield'] > 0) {
33
+					if ($ActualDamage['HasCDs']) {
34 34
 						?> which proves ineffective against their combat drones<?php
35 35
 					}
36 36
 					else {
37 37
 						?> which washes harmlessly over their hull<?php
38 38
 					}
39 39
 				}
40
-				else if($WeaponDamage['Armour'] > 0) {
40
+				else if ($WeaponDamage['Armour'] > 0) {
41 41
 					?> which is deflected by their shields<?php
42 42
 				}
43 43
 				else {
@@ -46,52 +46,52 @@  discard block
 block discarded – undo
46 46
 			}
47 47
 			else {
48 48
 				?> destroying <?php
49
-				if($ActualDamage['Shield'] > 0) {
49
+				if ($ActualDamage['Shield'] > 0) {
50 50
 					?><span class="shields"><?php echo number_format($ActualDamage['Shield']); ?></span> shields<?php
51 51
 					$this->doDamageTypeReductionDisplay($DamageTypes);
52 52
 				}
53
-				if($ActualDamage['NumCDs'] > 0) {
53
+				if ($ActualDamage['NumCDs'] > 0) {
54 54
 					?><span class="cds"><?php echo number_format($ActualDamage['NumCDs']); ?></span> combat drones<?php
55 55
 					$this->doDamageTypeReductionDisplay($DamageTypes);
56 56
 				}
57
-				if($ActualDamage['Armour'] > 0) {
57
+				if ($ActualDamage['Armour'] > 0) {
58 58
 					?><span class="red"><?php echo number_format($ActualDamage['Armour']); ?></span> plates of armour<?php
59 59
 				}
60 60
 			}
61 61
 		} ?>.
62 62
 		<br /><?php
63
-		if($ActualDamage['KillingShot']) {
64
-			$this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$WeaponResults['KillResults'],'TargetPlayer'=>$TargetPlayer));
63
+		if ($ActualDamage['KillingShot']) {
64
+			$this->includeTemplate('includes/TraderCombatKillMessage.inc', array('KillResults'=>$WeaponResults['KillResults'], 'TargetPlayer'=>$TargetPlayer));
65 65
 		}
66 66
 	}
67 67
 }
68
-if(isset($PlanetCombatResults['Drones'])) {
69
-	$Drones =& $PlanetCombatResults['Drones'];
70
-	$ActualDamage =& $Drones['ActualDamage'];
71
-	$WeaponDamage =& $Drones['WeaponDamage'];
72
-	$TargetPlayer =& $Drones['TargetPlayer'];
68
+if (isset($PlanetCombatResults['Drones'])) {
69
+	$Drones = & $PlanetCombatResults['Drones'];
70
+	$ActualDamage = & $Drones['ActualDamage'];
71
+	$WeaponDamage = & $Drones['WeaponDamage'];
72
+	$TargetPlayer = & $Drones['TargetPlayer'];
73 73
 	$DamageTypes = 0;
74
-	if($ActualDamage['Shield'] > 0){ $DamageTypes = $DamageTypes+1; }
75
-	if($ActualDamage['NumCDs'] > 0){ $DamageTypes = $DamageTypes+1; }
76
-	if($ActualDamage['Armour'] > 0){ $DamageTypes = $DamageTypes+1; }
74
+	if ($ActualDamage['Shield'] > 0) { $DamageTypes = $DamageTypes + 1; }
75
+	if ($ActualDamage['NumCDs'] > 0) { $DamageTypes = $DamageTypes + 1; }
76
+	if ($ActualDamage['Armour'] > 0) { $DamageTypes = $DamageTypes + 1; }
77 77
 	
78 78
 	echo $CombatPlanet->getDisplayName();
79
-	if($WeaponDamage['Launched'] == 0) {
79
+	if ($WeaponDamage['Launched'] == 0) {
80 80
 		?> fails to launch it's combat drones<?php
81 81
 	}
82 82
 	else {
83
-		?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at <?php if($ActualDamage['TargetAlreadyDead']){ ?>the debris that was once <?php } echo $TargetPlayer->getDisplayName();
84
-		if(!$ActualDamage['TargetAlreadyDead']) {
85
-			if($ActualDamage['TotalDamage'] == 0) {
86
-				if($WeaponDamage['Shield'] > 0) {
87
-					if($ActualDamage['HasCDs']) {
83
+		?> launches <span class="cds"><?php echo $WeaponDamage['Launched'] ?></span> combat drones at <?php if ($ActualDamage['TargetAlreadyDead']) { ?>the debris that was once <?php } echo $TargetPlayer->getDisplayName();
84
+		if (!$ActualDamage['TargetAlreadyDead']) {
85
+			if ($ActualDamage['TotalDamage'] == 0) {
86
+				if ($WeaponDamage['Shield'] > 0) {
87
+					if ($ActualDamage['HasCDs']) {
88 88
 						?> which prove ineffective against their combat drones<?php
89 89
 					}
90 90
 					else {
91 91
 						?> which washes harmlessly over their hull<?php
92 92
 					}
93 93
 				}
94
-				else if($WeaponDamage['Armour'] > 0) {
94
+				else if ($WeaponDamage['Armour'] > 0) {
95 95
 					?> which is deflected by their shields<?php
96 96
 				}
97 97
 				else {
@@ -100,28 +100,28 @@  discard block
 block discarded – undo
100 100
 			}
101 101
 			else {
102 102
 				?> destroying <?php
103
-				if($ActualDamage['Shield'] > 0) {
103
+				if ($ActualDamage['Shield'] > 0) {
104 104
 					?><span class="shields"><?php echo number_format($ActualDamage['Shield']); ?></span> shields<?php
105 105
 					$this->doDamageTypeReductionDisplay($DamageTypes);
106 106
 				}
107
-				if($ActualDamage['NumCDs'] > 0) {
107
+				if ($ActualDamage['NumCDs'] > 0) {
108 108
 					?><span class="cds"><?php echo number_format($ActualDamage['NumCDs']); ?></span> combat drones<?php
109 109
 					$this->doDamageTypeReductionDisplay($DamageTypes);
110 110
 				}
111
-				if($ActualDamage['Armour'] > 0) {
111
+				if ($ActualDamage['Armour'] > 0) {
112 112
 					?><span class="red"><?php echo number_format($ActualDamage['Armour']); ?></span> plates of armour<?php
113 113
 				}
114 114
 			}
115 115
 		}
116 116
 	} ?>.
117 117
 	<br /><?php
118
-	if($ActualDamage['KillingShot']) {
119
-		$this->includeTemplate('includes/TraderCombatKillMessage.inc',array('KillResults'=>$Drones['KillResults'],'TargetPlayer'=>$TargetPlayer));
118
+	if ($ActualDamage['KillingShot']) {
119
+		$this->includeTemplate('includes/TraderCombatKillMessage.inc', array('KillResults'=>$Drones['KillResults'], 'TargetPlayer'=>$TargetPlayer));
120 120
 	}
121 121
 }
122 122
 
123 123
 echo $CombatPlanet->getDisplayName();
124
-if($TotalDamage > 0) {
124
+if ($TotalDamage > 0) {
125 125
 	?> hit for a total of <span class="red"><?php echo $TotalDamage; ?></span> damage in this round of combat<?php
126 126
 }
127 127
 else {
Please login to merge, or discard this patch.
admin/Default/1.6/game_edit_processing.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,7 @@
 block discarded – undo
2 2
 
3 3
 // Get the dates ("|" sets hr/min/sec to 0)
4 4
 $join = DateTime::createFromFormat('d/m/Y|', $_REQUEST['game_join']);
5
-$start = empty($_REQUEST['game_start']) ? $join :
6
-         DateTime::createFromFormat('d/m/Y|', $_REQUEST['game_start']);
5
+$start = empty($_REQUEST['game_start']) ? $join : DateTime::createFromFormat('d/m/Y|', $_REQUEST['game_start']);
7 6
 $end = DateTime::createFromFormat('d/m/Y|', $_REQUEST['game_end']);
8 7
 
9 8
 $game = SmrGame::getGame($var['game_id']);
Please login to merge, or discard this patch.