We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -68,9 +68,9 @@ discard block |
||
68 | 68 | if (!USING_AJAX) { |
69 | 69 | require_once(get_file_loc('smr.inc')); |
70 | 70 | create_error('Your browser lost the SN. Try to reload the page!'); |
71 | + } else { |
|
72 | + exit; |
|
71 | 73 | } |
72 | - else |
|
73 | - exit; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | // do we have such a container object in the db? |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | if (!USING_AJAX) { |
79 | 79 | require_once(get_file_loc('smr.inc')); |
80 | 80 | create_error('Please avoid using the back button!'); |
81 | + } else { |
|
82 | + exit; |
|
81 | 83 | } |
82 | - else |
|
83 | - exit; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | // Determine where to load game scripts from (in case we need a special |
@@ -88,9 +88,15 @@ discard block |
||
88 | 88 | // Must not call `get_file_loc` until after we have set $overrideGameID |
89 | 89 | // (unless we're exiting immediately with an error, as above). |
90 | 90 | $overrideGameID = 0; |
91 | - if (isset($var['game_id']) && is_numeric($var['game_id'])) $overrideGameID = $var['game_id']; |
|
92 | - if ($overrideGameID == 0 && isset($var['GameID']) && is_numeric($var['GameID'])) $overrideGameID = $var['GameID']; |
|
93 | - if ($overrideGameID == 0) $overrideGameID = SmrSession::getGameID(); |
|
91 | + if (isset($var['game_id']) && is_numeric($var['game_id'])) { |
|
92 | + $overrideGameID = $var['game_id']; |
|
93 | + } |
|
94 | + if ($overrideGameID == 0 && isset($var['GameID']) && is_numeric($var['GameID'])) { |
|
95 | + $overrideGameID = $var['GameID']; |
|
96 | + } |
|
97 | + if ($overrideGameID == 0) { |
|
98 | + $overrideGameID = SmrSession::getGameID(); |
|
99 | + } |
|
94 | 100 | |
95 | 101 | require_once(get_file_loc('smr.inc')); |
96 | 102 | |
@@ -106,22 +112,19 @@ discard block |
||
106 | 112 | } else { |
107 | 113 | forward(create_container('skeleton.php', 'invalid_email.php')); |
108 | 114 | } |
109 | - } |
|
110 | - else if ($disabled['Reason'] == CLOSE_ACCOUNT_BY_REQUEST_REASON) { |
|
115 | + } else if ($disabled['Reason'] == CLOSE_ACCOUNT_BY_REQUEST_REASON) { |
|
111 | 116 | if (isset($var['do_reopen_account'])) { |
112 | 117 | // The user has requested to reopen their account |
113 | 118 | $account->unbanAccount($account); |
114 | 119 | } else { |
115 | 120 | forward(create_container('skeleton.php', 'reopen_account.php')); |
116 | 121 | } |
117 | - } |
|
118 | - else { |
|
122 | + } else { |
|
119 | 123 | forward(create_container('disabled.php')); |
120 | 124 | } |
121 | 125 | } |
122 | 126 | |
123 | 127 | do_voodoo(); |
124 | -} |
|
125 | -catch (Throwable $e) { |
|
128 | +} catch (Throwable $e) { |
|
126 | 129 | handleException($e); |
127 | 130 | } |
@@ -68,8 +68,7 @@ |
||
68 | 68 | |
69 | 69 | </body> |
70 | 70 | </html><?php |
71 | -} |
|
72 | -catch (Throwable $e) { |
|
71 | +} catch (Throwable $e) { |
|
73 | 72 | handleException($e); |
74 | 73 | } |
75 | 74 | ?> |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $account->increaseSmrRewardCredits(2 * CREDITS_PER_DOLLAR); // Give $2 worth of "reward" credits for joining. |
158 | 158 | if ($socialLogin) { |
159 | 159 | $account->addAuthMethod($_SESSION['socialLogin']->getLoginType(), |
160 | - $_SESSION['socialLogin']->getUserID()); |
|
160 | + $_SESSION['socialLogin']->getUserID()); |
|
161 | 161 | if ($validatedBySocial) { |
162 | 162 | $account->setValidated(true); |
163 | 163 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | |
186 | 186 | // remember when we sent validation code |
187 | 187 | $db->query('INSERT INTO notification (notification_type, account_id, time) ' . |
188 | - 'VALUES(\'validation_code\', ' . $db->escapeNumber($account->getAccountID()) . ', ' . $db->escapeNumber(TIME) . ')'); |
|
188 | + 'VALUES(\'validation_code\', ' . $db->escapeNumber($account->getAccountID()) . ', ' . $db->escapeNumber(TIME) . ')'); |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | $container = create_container('login_processing.php'); |
@@ -41,8 +41,8 @@ |
||
41 | 41 | |
42 | 42 | function teamAttack(&$results, $fightingPlayers, $attack, $defend) { |
43 | 43 | foreach ($fightingPlayers[$attack] as $accountID => $teamPlayer) { |
44 | - $playerResults =& $teamPlayer->shootPlayers($fightingPlayers[$defend]); |
|
45 | - $results[$attack]['Traders'][$teamPlayer->getAccountID()] =& $playerResults; |
|
44 | + $playerResults = & $teamPlayer->shootPlayers($fightingPlayers[$defend]); |
|
45 | + $results[$attack]['Traders'][$teamPlayer->getAccountID()] = & $playerResults; |
|
46 | 46 | $results[$attack]['TotalDamage'] += $playerResults['TotalDamage']; |
47 | 47 | |
48 | 48 | // Award assists (if there are multiple attackers) |
@@ -72,18 +72,18 @@ |
||
72 | 72 | |
73 | 73 | // If mines are bumped, the forces shoot first. Otherwise player shoots first. |
74 | 74 | if ($bump) { |
75 | - $results['Forces'] =& $forces->shootPlayers($attackers, $bump); |
|
75 | + $results['Forces'] = & $forces->shootPlayers($attackers, $bump); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $results['Attackers'] = array('TotalDamage' => 0); |
79 | 79 | foreach ($attackers as $attacker) { |
80 | - $playerResults =& $attacker->shootForces($forces); |
|
81 | - $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; |
|
80 | + $playerResults = & $attacker->shootForces($forces); |
|
81 | + $results['Attackers']['Traders'][$attacker->getAccountID()] = & $playerResults; |
|
82 | 82 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; |
83 | 83 | } |
84 | 84 | |
85 | 85 | if (!$bump) { |
86 | - $results['Forces'] =& $forces->shootPlayers($attackers, $bump); |
|
86 | + $results['Forces'] = & $forces->shootPlayers($attackers, $bump); |
|
87 | 87 | $forces->updateExpire(); |
88 | 88 | } |
89 | 89 |
@@ -4,7 +4,9 @@ discard block |
||
4 | 4 | |
5 | 5 | $fn_seedlist = function($message) { |
6 | 6 | $link = new GameLink($message->channel, $message->author); |
7 | - if (!$link->valid) return; |
|
7 | + if (!$link->valid) { |
|
8 | + return; |
|
9 | + } |
|
8 | 10 | |
9 | 11 | // print the entire seedlist |
10 | 12 | $results = shared_channel_msg_seedlist($link->player); |
@@ -13,7 +15,9 @@ discard block |
||
13 | 15 | |
14 | 16 | $fn_seedlist_add = function($message, $sectors) { |
15 | 17 | $link = new GameLink($message->channel, $message->author); |
16 | - if (!$link->valid) return; |
|
18 | + if (!$link->valid) { |
|
19 | + return; |
|
20 | + } |
|
17 | 21 | |
18 | 22 | // add sectors to the seedlist |
19 | 23 | $results = shared_channel_msg_seedlist_add($link->player, $sectors); |
@@ -22,7 +26,9 @@ discard block |
||
22 | 26 | |
23 | 27 | $fn_seedlist_del = function($message, $sectors) { |
24 | 28 | $link = new GameLink($message->channel, $message->author); |
25 | - if (!$link->valid) return; |
|
29 | + if (!$link->valid) { |
|
30 | + return; |
|
31 | + } |
|
26 | 32 | |
27 | 33 | // delete sectors from the seedlist |
28 | 34 | $results = shared_channel_msg_seedlist_del($link->player, $sectors); |
@@ -23,7 +23,7 @@ |
||
23 | 23 | // Delete all tickets and re-insert the winning ticket |
24 | 24 | $db->query('DELETE FROM player_has_ticket WHERE game_id = ' . $db->escapeNumber($gameID)); |
25 | 25 | $db->query('INSERT INTO player_has_ticket (game_id, account_id, time, prize) ' |
26 | - .'VALUES (' . $db->escapeNumber($gameID) . ',' . $db->escapeNumber($winner_id) . ',\'0\',' . $db->escapeNumber($lottoInfo['Prize']) . ')'); |
|
26 | + .'VALUES (' . $db->escapeNumber($gameID) . ',' . $db->escapeNumber($winner_id) . ',\'0\',' . $db->escapeNumber($lottoInfo['Prize']) . ')'); |
|
27 | 27 | |
28 | 28 | //get around locked table problem |
29 | 29 | $lottoWon = true; |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | // Set the body of the e-mail |
37 | 37 | set_mail_body($mail, $var['newsletter_html'], $var['newsletter_text'], |
38 | - $_REQUEST['salutation']); |
|
38 | + $_REQUEST['salutation']); |
|
39 | 39 | |
40 | 40 | if ($_REQUEST['to_email'] == '*') { |
41 | 41 | // Send the newsletter to all players. |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> |
2 | -<title><?php echo PAGE_TITLE; ?><?php if (isset($GameName)) echo ": $GameName"; ?></title> |
|
2 | +<title><?php echo PAGE_TITLE; ?><?php if (isset($GameName)) { |
|
3 | + echo ": $GameName"; |
|
4 | +} |
|
5 | +?></title> |
|
3 | 6 | <meta http-equiv="pragma" content="no-cache" /><?php |
4 | 7 | if (!is_object($ThisAccount) || $ThisAccount->isDefaultCSSEnabled()) { ?> |
5 | 8 | <link rel="stylesheet" type="text/css" href="<?php echo $CSSLink; ?>" /> |