We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | exit; |
| 89 | 89 | } |
| 90 | 90 | $account->addAuthMethod($_SESSION['socialLogin']->getLoginType(), |
| 91 | - $_SESSION['socialLogin']->getUserID()); |
|
| 91 | + $_SESSION['socialLogin']->getUserID()); |
|
| 92 | 92 | session_destroy(); |
| 93 | 93 | } |
| 94 | 94 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | // save session (incase we forward) |
| 114 | 114 | SmrSession::update(); |
| 115 | 115 | if (($disabled['Reason'] != CLOSE_ACCOUNT_INVALID_EMAIL_REASON) && |
| 116 | - ($disabled['Reason'] != CLOSE_ACCOUNT_BY_REQUEST_REASON)) { |
|
| 116 | + ($disabled['Reason'] != CLOSE_ACCOUNT_BY_REQUEST_REASON)) { |
|
| 117 | 117 | forward(create_container('disabled.php')); |
| 118 | 118 | } |
| 119 | 119 | } |
@@ -31,8 +31,7 @@ discard block |
||
| 31 | 31 | header('Location: /login_social_create.php'); |
| 32 | 32 | exit; |
| 33 | 33 | } |
| 34 | - } |
|
| 35 | - else { |
|
| 34 | + } else { |
|
| 36 | 35 | $login = (isset($_REQUEST['login']) ? $_REQUEST['login'] : (isset($var['login']) ? $var['login'] : '')); |
| 37 | 36 | $password = (isset($_REQUEST['password']) ? $_REQUEST['password'] : (isset($var['password']) ? $var['password'] : '')); |
| 38 | 37 | |
@@ -46,8 +45,7 @@ discard block |
||
| 46 | 45 | $account = SmrAccount::getAccountByName($login); |
| 47 | 46 | if (is_object($account) && $account->checkPassword($password)) { |
| 48 | 47 | SmrSession::setAccount($account); |
| 49 | - } |
|
| 50 | - else { |
|
| 48 | + } else { |
|
| 51 | 49 | $msg = 'Password is incorrect!'; |
| 52 | 50 | header('Location: /login.php?msg=' . rawurlencode(htmlspecialchars($msg, ENT_QUOTES))); |
| 53 | 51 | exit; |
@@ -142,38 +140,54 @@ discard block |
||
| 142 | 140 | //convert to array |
| 143 | 141 | $old = explode('-', $db->getField('array')); |
| 144 | 142 | //get rid of old version cookie since it isn't optimal. |
| 145 | - if ($old[0] != MULTI_CHECKING_COOKIE_VERSION) $old = array(); |
|
| 146 | - } else $old = array(); |
|
| 143 | + if ($old[0] != MULTI_CHECKING_COOKIE_VERSION) { |
|
| 144 | + $old = array(); |
|
| 145 | + } |
|
| 146 | + } else { |
|
| 147 | + $old = array(); |
|
| 148 | + } |
|
| 147 | 149 | $old[0] = MULTI_CHECKING_COOKIE_VERSION; |
| 148 | - if (!in_array($account->getAccountID(), $old)) $old[] = $account->getAccountID(); |
|
| 149 | - } |
|
| 150 | - else { |
|
| 150 | + if (!in_array($account->getAccountID(), $old)) { |
|
| 151 | + $old[] = $account->getAccountID(); |
|
| 152 | + } |
|
| 153 | + } else { |
|
| 151 | 154 | |
| 152 | 155 | //we have a cookie so we see if we add to it etc |
| 153 | 156 | //break cookie into array |
| 154 | 157 | $cookie = explode('-', $_COOKIE['Session_Info']); |
| 155 | 158 | //check for current version |
| 156 | - if ($cookie[0] != MULTI_CHECKING_COOKIE_VERSION) $cookie = array(); |
|
| 159 | + if ($cookie[0] != MULTI_CHECKING_COOKIE_VERSION) { |
|
| 160 | + $cookie = array(); |
|
| 161 | + } |
|
| 157 | 162 | $cookie[0] = MULTI_CHECKING_COOKIE_VERSION; |
| 158 | 163 | //add this acc to the cookie if it isn't there |
| 159 | - if (!in_array($account->getAccountID(), $cookie)) $cookie[] = $account->getAccountID(); |
|
| 164 | + if (!in_array($account->getAccountID(), $cookie)) { |
|
| 165 | + $cookie[] = $account->getAccountID(); |
|
| 166 | + } |
|
| 160 | 167 | |
| 161 | 168 | $db->query('SELECT * FROM multi_checking_cookie WHERE account_id = ' . $account->getAccountID()); |
| 162 | 169 | if ($db->nextRecord()) { |
| 163 | 170 | //convert to array |
| 164 | 171 | $old = explode('-', $db->getField('array')); |
| 165 | - if ($old[0] != MULTI_CHECKING_COOKIE_VERSION) $old = array(); |
|
| 166 | - } else $old = array(); |
|
| 172 | + if ($old[0] != MULTI_CHECKING_COOKIE_VERSION) { |
|
| 173 | + $old = array(); |
|
| 174 | + } |
|
| 175 | + } else { |
|
| 176 | + $old = array(); |
|
| 177 | + } |
|
| 167 | 178 | $old[0] = MULTI_CHECKING_COOKIE_VERSION; |
| 168 | 179 | //merge arrays...but keys are all different so we go through each value |
| 169 | - foreach ($cookie as $value) |
|
| 170 | - if (!in_array($value, $old)) $old[] = $value; |
|
| 180 | + foreach ($cookie as $value) { |
|
| 181 | + if (!in_array($value, $old)) $old[] = $value; |
|
| 182 | + } |
|
| 171 | 183 | } |
| 172 | 184 | $use = (count($old) <= 2) ? 'FALSE' : 'TRUE'; |
| 173 | 185 | //check that each value is legit and add it to db string |
| 174 | 186 | $new = MULTI_CHECKING_COOKIE_VERSION; |
| 175 | 187 | foreach ($old as $accID) { |
| 176 | - if (is_numeric($accID)) $new .= '-' . $accID; |
|
| 188 | + if (is_numeric($accID)) { |
|
| 189 | + $new .= '-' . $accID; |
|
| 190 | + } |
|
| 177 | 191 | } |
| 178 | 192 | $db->query('REPLACE INTO multi_checking_cookie (account_id, array, `use`) VALUES (' . $db->escapeNumber($account->getAccountID()) . ', ' . $db->escapeString($new) . ', ' . $db->escapeString($use) . ')'); |
| 179 | 193 | //now we update their cookie with the newest info |
@@ -193,7 +207,6 @@ discard block |
||
| 193 | 207 | |
| 194 | 208 | header('Location: ' . $href); |
| 195 | 209 | exit; |
| 196 | -} |
|
| 197 | -catch (Throwable $e) { |
|
| 210 | +} catch (Throwable $e) { |
|
| 198 | 211 | handleException($e); |
| 199 | 212 | } |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | function get_turns_message($player) { |
| 4 | 4 | // turns only update when the player is active, so calculate current turns |
| 5 | 5 | $turns = min($player->getTurns() + $player->getTurnsGained(time(), true), |
| 6 | - $player->getMaxTurns()); |
|
| 6 | + $player->getMaxTurns()); |
|
| 7 | 7 | $msg = $player->getPlayerName() . " has $turns/" . $player->getMaxTurns() . " turns."; |
| 8 | 8 | |
| 9 | 9 | // Calculate time to max turns if under the max |
@@ -17,7 +17,9 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | $fn_turns = function($message) { |
| 19 | 19 | $link = new GameLink($message->channel, $message->author); |
| 20 | - if (!$link->valid) return; |
|
| 20 | + if (!$link->valid) { |
|
| 21 | + return; |
|
| 22 | + } |
|
| 21 | 23 | |
| 22 | 24 | $msg = get_turns_message($link->player); |
| 23 | 25 | $message->channel->sendMessage($msg); |
@@ -25,7 +27,9 @@ discard block |
||
| 25 | 27 | |
| 26 | 28 | $fn_turns_all = function($message) { |
| 27 | 29 | $link = new GameLink($message->channel, $message->author); |
| 28 | - if (!$link->valid) return; |
|
| 30 | + if (!$link->valid) { |
|
| 31 | + return; |
|
| 32 | + } |
|
| 29 | 33 | $player = $link->player; |
| 30 | 34 | |
| 31 | 35 | $results = array_map('get_turns_message', $player->getSharingPlayers(true)); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | continue; |
| 25 | 25 | } |
| 26 | 26 | $turns = min($attendeePlayer->getTurns() + $attendeePlayer->getTurnsGained(time(), true), |
| 27 | - $attendeePlayer->getMaxTurns()); |
|
| 27 | + $attendeePlayer->getMaxTurns()); |
|
| 28 | 28 | $oppers[$attendeePlayer->getPlayerName()] = $turns; |
| 29 | 29 | } |
| 30 | 30 | |
@@ -79,8 +79,7 @@ |
||
| 79 | 79 | fclose($toEngine); |
| 80 | 80 | fclose($fromEngine); |
| 81 | 81 | proc_close($engine); |
| 82 | -} |
|
| 83 | -catch(Throwable $e) { |
|
| 82 | +} catch(Throwable $e) { |
|
| 84 | 83 | logException($e); |
| 85 | 84 | exit; |
| 86 | 85 | } |
@@ -100,7 +100,7 @@ |
||
| 100 | 100 | |
| 101 | 101 | safefputs($fp, 'NICKSERV IDENTIFY ' . IRC_BOT_PASS . EOL); |
| 102 | 102 | |
| 103 | - sleep(5); |
|
| 103 | + sleep(5); |
|
| 104 | 104 | |
| 105 | 105 | // join our public channel |
| 106 | 106 | if (!IRC_DEBUGGING) { |
@@ -6,12 +6,13 @@ discard block |
||
| 6 | 6 | function echo_r($message) |
| 7 | 7 | { |
| 8 | 8 | if (is_array($message)) { |
| 9 | - foreach ($message as $msg) |
|
| 10 | - echo_r($msg); |
|
| 9 | + foreach ($message as $msg) { |
|
| 10 | + echo_r($msg); |
|
| 11 | + } |
|
| 12 | + } else { |
|
| 13 | + echo date("d.m.Y H:i:s => ") . $message . EOL; |
|
| 14 | + } |
|
| 11 | 15 | } |
| 12 | - else |
|
| 13 | - echo date("d.m.Y H:i:s => ") . $message . EOL; |
|
| 14 | -} |
|
| 15 | 16 | |
| 16 | 17 | // not keeping the filehandle might not be the wisest idea. |
| 17 | 18 | function write_log_message($msg) |
@@ -144,8 +145,7 @@ discard block |
||
| 144 | 145 | sleep(60); |
| 145 | 146 | |
| 146 | 147 | } |
| 147 | - } |
|
| 148 | - catch (TimeoutException $e) { |
|
| 148 | + } catch (TimeoutException $e) { |
|
| 149 | 149 | // Ignore the timeout exception, we'll loop round and reconnect. |
| 150 | 150 | } |
| 151 | 151 | } // end of while running |
@@ -164,12 +164,14 @@ discard block |
||
| 164 | 164 | $rdata = preg_replace('/\s+/', ' ', $rdata); |
| 165 | 165 | |
| 166 | 166 | // log for reports (if enabled via command line (-log) |
| 167 | - if (IRC_LOGGING && strlen($rdata) > 0) |
|
| 168 | - write_log_message($rdata); |
|
| 167 | + if (IRC_LOGGING && strlen($rdata) > 0) { |
|
| 168 | + write_log_message($rdata); |
|
| 169 | + } |
|
| 169 | 170 | |
| 170 | 171 | // remember the last time we got something from the server |
| 171 | - if (strlen($rdata) > 0) |
|
| 172 | - $last_ping = time(); |
|
| 172 | + if (strlen($rdata) > 0) { |
|
| 173 | + $last_ping = time(); |
|
| 174 | + } |
|
| 173 | 175 | |
| 174 | 176 | // timeout detection! |
| 175 | 177 | if ($last_ping < time() - 300) { |
@@ -186,76 +188,102 @@ discard block |
||
| 186 | 188 | } |
| 187 | 189 | |
| 188 | 190 | // required!!! otherwise timeout! |
| 189 | - if (server_ping($fp, $rdata)) |
|
| 190 | - return; |
|
| 191 | + if (server_ping($fp, $rdata)) { |
|
| 192 | + return; |
|
| 193 | + } |
|
| 191 | 194 | |
| 192 | 195 | // server msg |
| 193 | - if (server_msg_307($fp, $rdata)) |
|
| 194 | - return; |
|
| 195 | - if (server_msg_318($fp, $rdata)) |
|
| 196 | - return; |
|
| 197 | - if (server_msg_352($fp, $rdata)) |
|
| 198 | - return; |
|
| 199 | - if (server_msg_401($fp, $rdata)) |
|
| 200 | - return; |
|
| 196 | + if (server_msg_307($fp, $rdata)) { |
|
| 197 | + return; |
|
| 198 | + } |
|
| 199 | + if (server_msg_318($fp, $rdata)) { |
|
| 200 | + return; |
|
| 201 | + } |
|
| 202 | + if (server_msg_352($fp, $rdata)) { |
|
| 203 | + return; |
|
| 204 | + } |
|
| 205 | + if (server_msg_401($fp, $rdata)) { |
|
| 206 | + return; |
|
| 207 | + } |
|
| 201 | 208 | |
| 202 | 209 | //Are they using a linked nick instead |
| 203 | - if (notice_nickserv_registered_user($fp, $rdata)) |
|
| 204 | - return; |
|
| 205 | - if (notice_nickserv_unknown_user($fp, $rdata)) |
|
| 206 | - return; |
|
| 210 | + if (notice_nickserv_registered_user($fp, $rdata)) { |
|
| 211 | + return; |
|
| 212 | + } |
|
| 213 | + if (notice_nickserv_unknown_user($fp, $rdata)) { |
|
| 214 | + return; |
|
| 215 | + } |
|
| 207 | 216 | |
| 208 | 217 | // some nice things |
| 209 | - if (ctcp_version($fp, $rdata)) |
|
| 210 | - return; |
|
| 211 | - if (ctcp_finger($fp, $rdata)) |
|
| 212 | - return; |
|
| 213 | - if (ctcp_time($fp, $rdata)) |
|
| 214 | - return; |
|
| 215 | - if (ctcp_ping($fp, $rdata)) |
|
| 216 | - return; |
|
| 218 | + if (ctcp_version($fp, $rdata)) { |
|
| 219 | + return; |
|
| 220 | + } |
|
| 221 | + if (ctcp_finger($fp, $rdata)) { |
|
| 222 | + return; |
|
| 223 | + } |
|
| 224 | + if (ctcp_time($fp, $rdata)) { |
|
| 225 | + return; |
|
| 226 | + } |
|
| 227 | + if (ctcp_ping($fp, $rdata)) { |
|
| 228 | + return; |
|
| 229 | + } |
|
| 217 | 230 | |
| 218 | - if (invite($fp, $rdata)) |
|
| 219 | - return; |
|
| 231 | + if (invite($fp, $rdata)) { |
|
| 232 | + return; |
|
| 233 | + } |
|
| 220 | 234 | |
| 221 | 235 | // join and part |
| 222 | - if (channel_join($fp, $rdata)) |
|
| 223 | - return; |
|
| 224 | - if (channel_part($fp, $rdata)) |
|
| 225 | - return; |
|
| 236 | + if (channel_join($fp, $rdata)) { |
|
| 237 | + return; |
|
| 238 | + } |
|
| 239 | + if (channel_part($fp, $rdata)) { |
|
| 240 | + return; |
|
| 241 | + } |
|
| 226 | 242 | |
| 227 | 243 | // nick change and quit |
| 228 | - if (user_nick($fp, $rdata)) |
|
| 229 | - return; |
|
| 230 | - if (user_quit($fp, $rdata)) |
|
| 231 | - return; |
|
| 244 | + if (user_nick($fp, $rdata)) { |
|
| 245 | + return; |
|
| 246 | + } |
|
| 247 | + if (user_quit($fp, $rdata)) { |
|
| 248 | + return; |
|
| 249 | + } |
|
| 232 | 250 | |
| 233 | - if (channel_action_slap($fp, $rdata)) |
|
| 234 | - return; |
|
| 251 | + if (channel_action_slap($fp, $rdata)) { |
|
| 252 | + return; |
|
| 253 | + } |
|
| 235 | 254 | |
| 236 | 255 | // channel msg (!xyz) without registration |
| 237 | - if (channel_msg_help($fp, $rdata)) |
|
| 238 | - return; |
|
| 239 | - if (channel_msg_seedlist($fp, $rdata)) |
|
| 240 | - return; |
|
| 241 | - if (channel_msg_op($fp, $rdata)) |
|
| 242 | - return; |
|
| 243 | - if (channel_msg_timer($fp, $rdata)) |
|
| 244 | - return; |
|
| 245 | - if (channel_msg_8ball($fp, $rdata)) |
|
| 246 | - return; |
|
| 247 | - if (channel_msg_seen($fp, $rdata)) |
|
| 248 | - return; |
|
| 249 | - if (channel_msg_sd($fp, $rdata)) |
|
| 250 | - return; |
|
| 256 | + if (channel_msg_help($fp, $rdata)) { |
|
| 257 | + return; |
|
| 258 | + } |
|
| 259 | + if (channel_msg_seedlist($fp, $rdata)) { |
|
| 260 | + return; |
|
| 261 | + } |
|
| 262 | + if (channel_msg_op($fp, $rdata)) { |
|
| 263 | + return; |
|
| 264 | + } |
|
| 265 | + if (channel_msg_timer($fp, $rdata)) { |
|
| 266 | + return; |
|
| 267 | + } |
|
| 268 | + if (channel_msg_8ball($fp, $rdata)) { |
|
| 269 | + return; |
|
| 270 | + } |
|
| 271 | + if (channel_msg_seen($fp, $rdata)) { |
|
| 272 | + return; |
|
| 273 | + } |
|
| 274 | + if (channel_msg_sd($fp, $rdata)) { |
|
| 275 | + return; |
|
| 276 | + } |
|
| 251 | 277 | |
| 252 | 278 | // channel msg (!xyz) with registration |
| 253 | - if (channel_msg_with_registration($fp, $rdata)) |
|
| 254 | - return; |
|
| 279 | + if (channel_msg_with_registration($fp, $rdata)) { |
|
| 280 | + return; |
|
| 281 | + } |
|
| 255 | 282 | |
| 256 | 283 | // MrSpock can use this to send commands as caretaker |
| 257 | - if (query_command($fp, $rdata)) |
|
| 258 | - return; |
|
| 284 | + if (query_command($fp, $rdata)) { |
|
| 285 | + return; |
|
| 286 | + } |
|
| 259 | 287 | |
| 260 | 288 | |
| 261 | 289 | // debug |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | foreach ($alliance_vs_ids as $id) { |
| 53 | 53 | $row_alliance = SmrAlliance::getAlliance($id, $player->getGameID()); |
| 54 | 54 | $showRed = (!$curr_alliance->isNone() && $curr_alliance->hasDisbanded()) || |
| 55 | - (!$row_alliance->isNone() && $row_alliance->hasDisbanded()); |
|
| 55 | + (!$row_alliance->isNone() && $row_alliance->hasDisbanded()); |
|
| 56 | 56 | $showBold = $curr_id == $player->getAllianceID() || $id == $player->getAllianceID(); |
| 57 | 57 | $style = ''; |
| 58 | 58 | if ($curr_id == $id && !$row_alliance->isNone()) { |
@@ -62,8 +62,7 @@ discard block |
||
| 62 | 62 | } elseif ($showBold) { |
| 63 | 63 | $style = 'class="bold"'; |
| 64 | 64 | } |
| 65 | - } |
|
| 66 | - else { |
|
| 65 | + } else { |
|
| 67 | 66 | $db2->query('SELECT kills FROM alliance_vs_alliance |
| 68 | 67 | WHERE alliance_id_2 = ' . $db2->escapeNumber($curr_id) . ' |
| 69 | 68 | AND alliance_id_1 = ' . $db2->escapeNumber($id) . ' |
@@ -104,11 +103,15 @@ discard block |
||
| 104 | 103 | if ($id > 0) { |
| 105 | 104 | $killer_alliance = SmrAlliance::getAlliance($id, $player->getGameID()); |
| 106 | 105 | $alliance_name = $killer_alliance->getAllianceDisplayName(); |
| 106 | + } elseif ($id == 0) { |
|
| 107 | + $alliance_name = 'No Alliance'; |
|
| 108 | + } elseif ($id == ALLIANCE_VS_FORCES) { |
|
| 109 | + $alliance_name = '<span class="yellow">Forces</span>'; |
|
| 110 | + } elseif ($id == ALLIANCE_VS_PLANETS) { |
|
| 111 | + $alliance_name = '<span class="yellow">Planets</span>'; |
|
| 112 | + } elseif ($id == ALLIANCE_VS_PORTS) { |
|
| 113 | + $alliance_name = '<span class="yellow">Ports</span>'; |
|
| 107 | 114 | } |
| 108 | - elseif ($id == 0) $alliance_name = 'No Alliance'; |
|
| 109 | - elseif ($id == ALLIANCE_VS_FORCES) $alliance_name = '<span class="yellow">Forces</span>'; |
|
| 110 | - elseif ($id == ALLIANCE_VS_PLANETS) $alliance_name = '<span class="yellow">Planets</span>'; |
|
| 111 | - elseif ($id == ALLIANCE_VS_PORTS) $alliance_name = '<span class="yellow">Ports</span>'; |
|
| 112 | 115 | |
| 113 | 116 | $kills[] = [ |
| 114 | 117 | 'Name' => $alliance_name, |
@@ -126,11 +129,15 @@ discard block |
||
| 126 | 129 | if ($id > 0) { |
| 127 | 130 | $killer_alliance = SmrAlliance::getAlliance($id, $player->getGameID()); |
| 128 | 131 | $alliance_name = $killer_alliance->getAllianceDisplayName(); |
| 132 | + } elseif ($id == 0) { |
|
| 133 | + $alliance_name = 'No Alliance'; |
|
| 134 | + } elseif ($id == ALLIANCE_VS_FORCES) { |
|
| 135 | + $alliance_name = '<span class="yellow">Forces</span>'; |
|
| 136 | + } elseif ($id == ALLIANCE_VS_PLANETS) { |
|
| 137 | + $alliance_name = '<span class="yellow">Planets</span>'; |
|
| 138 | + } elseif ($id == ALLIANCE_VS_PORTS) { |
|
| 139 | + $alliance_name = '<span class="yellow">Ports</span>'; |
|
| 129 | 140 | } |
| 130 | - elseif ($id == 0) $alliance_name = 'No Alliance'; |
|
| 131 | - elseif ($id == ALLIANCE_VS_FORCES) $alliance_name = '<span class="yellow">Forces</span>'; |
|
| 132 | - elseif ($id == ALLIANCE_VS_PLANETS) $alliance_name = '<span class="yellow">Planets</span>'; |
|
| 133 | - elseif ($id == ALLIANCE_VS_PORTS) $alliance_name = '<span class="yellow">Ports</span>'; |
|
| 134 | 141 | |
| 135 | 142 | $deaths[] = [ |
| 136 | 143 | 'Name' => $alliance_name, |
@@ -33,12 +33,24 @@ |
||
| 33 | 33 | $template->assign('HardwareHREF', SmrSession::getNewHREF($container)); |
| 34 | 34 | |
| 35 | 35 | $hardware = []; |
| 36 | -if ($ship->canHaveScanner()) $hardware[] = 'Scanner'; |
|
| 37 | -if ($ship->canHaveIllusion()) $hardware[] = 'Illusion Generator'; |
|
| 38 | -if ($ship->canHaveCloak()) $hardware[] = 'Cloaking Device'; |
|
| 39 | -if ($ship->canHaveJump()) $hardware[] = 'Jump Drive'; |
|
| 40 | -if ($ship->canHaveDCS()) $hardware[] = 'Drone Scrambler'; |
|
| 41 | -if (empty($hardware)) $hardware[] = 'none'; |
|
| 36 | +if ($ship->canHaveScanner()) { |
|
| 37 | + $hardware[] = 'Scanner'; |
|
| 38 | +} |
|
| 39 | +if ($ship->canHaveIllusion()) { |
|
| 40 | + $hardware[] = 'Illusion Generator'; |
|
| 41 | +} |
|
| 42 | +if ($ship->canHaveCloak()) { |
|
| 43 | + $hardware[] = 'Cloaking Device'; |
|
| 44 | +} |
|
| 45 | +if ($ship->canHaveJump()) { |
|
| 46 | + $hardware[] = 'Jump Drive'; |
|
| 47 | +} |
|
| 48 | +if ($ship->canHaveDCS()) { |
|
| 49 | + $hardware[] = 'Drone Scrambler'; |
|
| 50 | +} |
|
| 51 | +if (empty($hardware)) { |
|
| 52 | + $hardware[] = 'none'; |
|
| 53 | +} |
|
| 42 | 54 | $template->assign('Hardware', $hardware); |
| 43 | 55 | |
| 44 | 56 | $db->query('SELECT level_name,requirement FROM level WHERE requirement>' . $db->escapeNumber($player->getExperience()) . ' ORDER BY requirement ASC LIMIT 1'); |
@@ -15,4 +15,4 @@ |
||
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | $template->assign('AllClaims', array($player->getClaimableBounties('HQ'), |
| 18 | - $player->getClaimableBounties('UG'))); |
|
| 18 | + $player->getClaimableBounties('UG'))); |
|
@@ -17,21 +17,23 @@ discard block |
||
| 17 | 17 | // iterate over all forces in the target sector |
| 18 | 18 | foreach ($scanSector->getForces() as $scanSectorForces) { |
| 19 | 19 | // decide if it's a friendly or enemy stack |
| 20 | - if ($player->sameAlliance($scanSectorForces->getOwner())) |
|
| 21 | - $friendly_forces += $scanSectorForces->getMines() * 3 + $scanSectorForces->getCDs() * 2 + $scanSectorForces->getSDs(); |
|
| 22 | - else |
|
| 23 | - $enemy_forces += $scanSectorForces->getMines() * 3 + $scanSectorForces->getCDs() * 2 + $scanSectorForces->getSDs(); |
|
| 24 | -} |
|
| 20 | + if ($player->sameAlliance($scanSectorForces->getOwner())) { |
|
| 21 | + $friendly_forces += $scanSectorForces->getMines() * 3 + $scanSectorForces->getCDs() * 2 + $scanSectorForces->getSDs(); |
|
| 22 | + } else { |
|
| 23 | + $enemy_forces += $scanSectorForces->getMines() * 3 + $scanSectorForces->getCDs() * 2 + $scanSectorForces->getSDs(); |
|
| 24 | + } |
|
| 25 | + } |
|
| 25 | 26 | |
| 26 | 27 | foreach ($scanSector->getOtherTraders($player) as $scanSectorPlayer) { |
| 27 | 28 | $scanSectorShip = $scanSectorPlayer->getShip(); |
| 28 | 29 | |
| 29 | 30 | // he's a friend if he's in our alliance (and we are not in a 0 alliance |
| 30 | - if ($player->traderMAPAlliance($scanSectorPlayer)) |
|
| 31 | - $friendly_vessel += $scanSectorShip->getAttackRating(); |
|
| 32 | - else |
|
| 33 | - $enemy_vessel += $scanSectorShip->getDefenseRating() * 10; |
|
| 34 | -} |
|
| 31 | + if ($player->traderMAPAlliance($scanSectorPlayer)) { |
|
| 32 | + $friendly_vessel += $scanSectorShip->getAttackRating(); |
|
| 33 | + } else { |
|
| 34 | + $enemy_vessel += $scanSectorShip->getDefenseRating() * 10; |
|
| 35 | + } |
|
| 36 | + } |
|
| 35 | 37 | |
| 36 | 38 | $template->assign('FriendlyVessel', $friendly_vessel); |
| 37 | 39 | $template->assign('FriendlyForces', $friendly_forces); |
@@ -39,10 +41,11 @@ discard block |
||
| 39 | 41 | $template->assign('EnemyForces', $enemy_forces); |
| 40 | 42 | |
| 41 | 43 | // is it a warp or a normal move? |
| 42 | -if ($sector->getWarp() == $var['target_sector']) |
|
| 44 | +if ($sector->getWarp() == $var['target_sector']) { |
|
| 43 | 45 | $turns = TURNS_PER_WARP; |
| 44 | -else |
|
| 46 | +} else { |
|
| 45 | 47 | $turns = TURNS_PER_SECTOR; |
| 48 | +} |
|
| 46 | 49 | |
| 47 | 50 | $template->assign('ScanSector', $scanSector); |
| 48 | 51 | $template->assign('Turns', $turns); |