We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -102,7 +102,7 @@ |
||
102 | 102 | if (!$UniGen) { |
103 | 103 | $CanScanSector = ($ThisShip->hasScanner() && $isLinkedSector) || $isCurrentSector; |
104 | 104 | $ShowFriendlyForces = isset($HideAlliedForces) && $HideAlliedForces ? |
105 | - $Sector->hasPlayerForces($MapPlayer) : $Sector->hasFriendlyForces($MapPlayer); |
|
105 | + $Sector->hasPlayerForces($MapPlayer) : $Sector->hasFriendlyForces($MapPlayer); |
|
106 | 106 | if (($CanScanSector && ($Sector->hasForces() || $Sector->hasPlayers())) || $ShowFriendlyForces || $Sector->hasFriendlyTraders($MapPlayer)) { ?> |
107 | 107 | <div class="lmtf"><?php |
108 | 108 | if ($CanScanSector && $Sector->hasEnemyTraders($MapPlayer)) { |
@@ -44,7 +44,10 @@ |
||
44 | 44 | <td> |
45 | 45 | <select name="game_type"><?php |
46 | 46 | foreach (SmrGame::GAME_TYPES as $GameTypeID => $GameType) { |
47 | - ?><option value="<?php echo $GameTypeID; ?>" <?php if ($GameType == $Game['gameType']) echo 'selected'; ?>><?php echo $GameType; ?></option><?php |
|
47 | + ?><option value="<?php echo $GameTypeID; ?>" <?php if ($GameType == $Game['gameType']) { |
|
48 | + echo 'selected'; |
|
49 | + } |
|
50 | + ?>><?php echo $GameType; ?></option><?php |
|
48 | 51 | } ?> |
49 | 52 | </select> |
50 | 53 | </td> |
@@ -374,13 +374,13 @@ |
||
374 | 374 | $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'); |
375 | 375 | $this->HOF = array(); |
376 | 376 | while ($this->db->nextRecord()) { |
377 | - $hof =& $this->HOF; |
|
377 | + $hof = & $this->HOF; |
|
378 | 378 | $typeList = explode(':', $this->db->getField('type')); |
379 | 379 | foreach ($typeList as $type) { |
380 | 380 | if (!isset($hof[$type])) { |
381 | 381 | $hof[$type] = array(); |
382 | 382 | } |
383 | - $hof =& $hof[$type]; |
|
383 | + $hof = & $hof[$type]; |
|
384 | 384 | } |
385 | 385 | $hof = $this->db->getFloat('amount'); |
386 | 386 | } |
@@ -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 | } |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | foreach (\Globals::getGoods() as $goodId => $value) { |
91 | 91 | if ($goods[$goodId] === true) { |
92 | 92 | if ($sectors[$currentSectorId]->getPort()->getGoodTransaction($goodId) === TRADER_SELLS && |
93 | - $sectors[$targetSectorId]->getPort()->getGoodTransaction($goodId) === TRADER_BUYS) { |
|
93 | + $sectors[$targetSectorId]->getPort()->getGoodTransaction($goodId) === TRADER_BUYS) { |
|
94 | 94 | $rl[] = new OneWayRoute($currentSectorId, $targetSectorId, $raceID, $sectors[$targetSectorId]->getPort()->getRaceID(), $sectors[$currentSectorId]->getPort()->getGoodDistance($goodId), $sectors[$targetSectorId]->getPort()->getGoodDistance($goodId), $distance, $goodId); |
95 | 95 | } |
96 | 96 | } |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | foreach (\Globals::getGoods() as $goodId => $value) { |
119 | 119 | if ($goods[$goodId] === true) { |
120 | 120 | if ($sectors[$currentSectorId]->getPort()->getGoodTransaction($goodId) === TRADER_SELLS && |
121 | - $sectors[$targetSectorId]->getPort()->getGoodTransaction($goodId) === TRADER_BUYS) { |
|
121 | + $sectors[$targetSectorId]->getPort()->getGoodTransaction($goodId) === TRADER_BUYS) { |
|
122 | 122 | $owr = new OneWayRoute($currentSectorId, $targetSectorId, $sectors[$currentSectorId]->getPort()->getRaceID(), $sectors[$targetSectorId]->getPort()->getRaceID(), $sectors[$currentSectorId]->getPort()->getGoodDistance($goodId), $sectors[$targetSectorId]->getPort()->getGoodDistance($goodId), $distance, $goodId); |
123 | 123 | $fakeReturn = new OneWayRoute($targetSectorId, $currentSectorId, $sectors[$targetSectorId]->getPort()->getRaceID(), $sectors[$currentSectorId]->getPort()->getRaceID(), 0, 0, $distance, GOODS_NOTHING); |
124 | 124 | $mpr = new MultiplePortRoute($owr, $fakeReturn); |
@@ -35,7 +35,7 @@ |
||
35 | 35 | } |
36 | 36 | $helper = self::getTwitterObj($_SESSION['TwitterToken']); |
37 | 37 | $accessToken = $helper->oauth('oauth/access_token', |
38 | - ['oauth_verifier' => \Request::get('oauth_verifier')]); |
|
38 | + ['oauth_verifier' => \Request::get('oauth_verifier')]); |
|
39 | 39 | $auth = self::getTwitterObj($accessToken); |
40 | 40 | $userInfo = $auth->get('account/verify_credentials', ['include_email' => 'true']); |
41 | 41 | if ($auth->getLastHttpCode() == 200) { |
@@ -32,7 +32,7 @@ |
||
32 | 32 | // Delete all tickets and re-insert the winning ticket |
33 | 33 | $db->query('DELETE FROM player_has_ticket WHERE game_id = ' . $db->escapeNumber($gameID)); |
34 | 34 | $db->query('INSERT INTO player_has_ticket (game_id, account_id, time, prize) ' |
35 | - .'VALUES (' . $db->escapeNumber($gameID) . ',' . $db->escapeNumber($winner_id) . ',\'0\',' . $db->escapeNumber($lottoInfo['Prize']) . ')'); |
|
35 | + .'VALUES (' . $db->escapeNumber($gameID) . ',' . $db->escapeNumber($winner_id) . ',\'0\',' . $db->escapeNumber($lottoInfo['Prize']) . ')'); |
|
36 | 36 | |
37 | 37 | $db->unlock(); |
38 | 38 |
@@ -141,16 +141,25 @@ discard block |
||
141 | 141 | $owner = $db->getInt('owner_id'); |
142 | 142 | |
143 | 143 | $db2->query('SELECT * FROM planet_has_building WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector . ' AND construction_id = 1'); |
144 | - if ($db2->nextRecord()) $gens = $db2->getInt('amount'); |
|
145 | - else $gens = 0; |
|
144 | + if ($db2->nextRecord()) { |
|
145 | + $gens = $db2->getInt('amount'); |
|
146 | + } else { |
|
147 | + $gens = 0; |
|
148 | + } |
|
146 | 149 | |
147 | 150 | $db2->query('SELECT * FROM planet_has_building WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector . ' AND construction_id = 2'); |
148 | - if ($db2->nextRecord()) $hangs = $db2->getInt('amount'); |
|
149 | - else $hangs = 0; |
|
151 | + if ($db2->nextRecord()) { |
|
152 | + $hangs = $db2->getInt('amount'); |
|
153 | + } else { |
|
154 | + $hangs = 0; |
|
155 | + } |
|
150 | 156 | |
151 | 157 | $db2->query('SELECT * FROM planet_has_building WHERE game_id = ' . $game_id . ' AND sector_id = ' . $sector . ' AND construction_id = 3'); |
152 | - if ($db2->nextRecord()) $turs = $db2->getInt('amount'); |
|
153 | - else $turs = 0; |
|
158 | + if ($db2->nextRecord()) { |
|
159 | + $turs = $db2->getInt('amount'); |
|
160 | + } else { |
|
161 | + $turs = 0; |
|
162 | + } |
|
154 | 163 | |
155 | 164 | // insert into history db |
156 | 165 | $history_db_sql[] = 'INSERT INTO planet (game_id, sector_id, owner_id, generators, hangers, turrets) VALUES ' . |
@@ -187,14 +196,21 @@ discard block |
||
187 | 196 | $smrCredits = 0; |
188 | 197 | $db2->query('SELECT sum(amount) as bounty_am, sum(smr_credits) as bounty_cred FROM bounty WHERE game_id = ' . $game_id . ' AND account_id = ' . $acc_id . ' AND claimer_id = 0'); |
189 | 198 | if ($db2->nextRecord()) { |
190 | - if (is_int($db2->getField('bounty_am'))) $amount = $db2->getInt('bounty_am'); |
|
191 | - if (is_int($db2->getField('bounty_cred'))) $smrCredits = $db2->getInt('bounty_cred'); |
|
199 | + if (is_int($db2->getField('bounty_am'))) { |
|
200 | + $amount = $db2->getInt('bounty_am'); |
|
201 | + } |
|
202 | + if (is_int($db2->getField('bounty_cred'))) { |
|
203 | + $smrCredits = $db2->getInt('bounty_cred'); |
|
204 | + } |
|
192 | 205 | |
193 | 206 | } |
194 | 207 | |
195 | 208 | $db2->query('SELECT * FROM ship_has_name WHERE game_id = ' . $game_id . ' AND account_id = ' . $acc_id); |
196 | - if ($db2->nextRecord()) $ship_name = $db2->getField('ship_name'); |
|
197 | - else $ship_name = 'None'; |
|
209 | + if ($db2->nextRecord()) { |
|
210 | + $ship_name = $db2->getField('ship_name'); |
|
211 | + } else { |
|
212 | + $ship_name = 'None'; |
|
213 | + } |
|
198 | 214 | |
199 | 215 | // insert into history db |
200 | 216 | $history_db_sql[] = 'INSERT INTO player (account_id, game_id, player_name, player_id, experience, ship, race, alignment, alliance_id, kills, deaths, bounty, bounty_cred, ship_name) ' . |
@@ -22,16 +22,18 @@ discard block |
||
22 | 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 | - if (!$db2->getNumRows()) |
|
26 | - $db2->query('SELECT * FROM manual WHERE topic_id = ' . $db2->escapeNumber($parent_topic_id)); |
|
25 | + if (!$db2->getNumRows()) { |
|
26 | + $db2->query('SELECT * FROM manual WHERE topic_id = ' . $db2->escapeNumber($parent_topic_id)); |
|
27 | + } |
|
27 | 28 | |
28 | 29 | echo ('<th width="32">'); |
29 | 30 | if ($db2->nextRecord()) { |
30 | 31 | $previous_topic_id = $db2->getInt('topic_id'); |
31 | 32 | $previous_topic = stripslashes($db2->getField('topic')); |
32 | 33 | echo ('<a href="/manual.php?' . $previous_topic_id . '"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>'); |
33 | - } else |
|
34 | - echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
34 | + } else { |
|
35 | + echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
36 | + } |
|
35 | 37 | echo ('</th>'); |
36 | 38 | |
37 | 39 | // ************************** |
@@ -43,8 +45,9 @@ discard block |
||
43 | 45 | $up_topic_id = $db2->getInt('topic_id'); |
44 | 46 | $up_topic = stripslashes($db2->getField('topic')); |
45 | 47 | echo ('<a href="/manual.php?' . $up_topic_id . '"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>'); |
46 | - } else |
|
47 | - echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
48 | + } else { |
|
49 | + echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
|
50 | + } |
|
48 | 51 | echo ('</th>'); |
49 | 52 | |
50 | 53 | // ************************** |
@@ -52,8 +55,9 @@ discard block |
||
52 | 55 | // ************************** |
53 | 56 | $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($topic_id) . ' AND order_id = 1'); |
54 | 57 | |
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)); |
|
58 | + if (!$db2->getNumRows()) { |
|
59 | + $db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($order_id + 1)); |
|
60 | + } |
|
57 | 61 | |
58 | 62 | $seenParentIDs = array(0); |
59 | 63 | $curr_parent_topic_id = $parent_topic_id; |
@@ -72,8 +76,7 @@ discard block |
||
72 | 76 | $next_topic_id = $db2->getInt('topic_id'); |
73 | 77 | $next_topic = stripslashes($db2->getField('topic')); |
74 | 78 | echo ('<a href="/manual.php?' . $next_topic_id . '"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>'); |
75 | - } |
|
76 | - else { |
|
79 | + } else { |
|
77 | 80 | echo ('<img src="/images/help/empty.jpg" width="32" height="32">'); |
78 | 81 | } |
79 | 82 | echo ('</th>'); |
@@ -85,18 +88,22 @@ discard block |
||
85 | 88 | |
86 | 89 | echo ('<tr>'); |
87 | 90 | echo ('<td colspan="5">'); |
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> '); |
|
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> '); |
|
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>'); |
|
91 | + if (isset($previous_topic_id) && $previous_topic_id > 0) { |
|
92 | + echo ('<b>Previous:</b> <a href="/manual.php?' . $previous_topic_id . '">' . get_numbering($previous_topic_id) . $previous_topic . '</a> '); |
|
93 | + } |
|
94 | + if (isset($up_topic_id) && $up_topic_id > 0) { |
|
95 | + echo ('<b>Up:</b> <a href="/manual.php?' . $up_topic_id . '">' . get_numbering($up_topic_id) . $up_topic . '</a> '); |
|
96 | + } |
|
97 | + if (isset($next_topic_id) && $next_topic_id > 0) { |
|
98 | + echo ('<b>Next:</b> <a href="/manual.php?' . $next_topic_id . '">' . get_numbering($next_topic_id) . $next_topic . '</a>'); |
|
99 | + } |
|
94 | 100 | echo ('</tr>'); |
95 | 101 | |
96 | 102 | echo ('</table>'); |
97 | - } else |
|
98 | - echo ('Invalid Topic!'); |
|
99 | -} |
|
103 | + } else { |
|
104 | + echo ('Invalid Topic!'); |
|
105 | + } |
|
106 | + } |
|
100 | 107 | |
101 | 108 | function echo_content($topic_id) { |
102 | 109 | // database object |
@@ -114,9 +121,10 @@ discard block |
||
114 | 121 | echo ('<h1>' . get_numbering($topic_id) . $topic . '</h1>'); |
115 | 122 | echo ('<p>' . $text . '<p>'); |
116 | 123 | echo ('</div>'); |
117 | - } else |
|
118 | - echo ('Invalid Topic!'); |
|
119 | -} |
|
124 | + } else { |
|
125 | + echo ('Invalid Topic!'); |
|
126 | + } |
|
127 | + } |
|
120 | 128 | |
121 | 129 | function echo_subsection($topic_id) { |
122 | 130 | // database object |