We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | $db = Smr\Database::getInstance(); |
| 18 | 18 | $db->switchDatabases($var['HistoryDatabase']); |
| 19 | 19 | $dbResult = $db->read('SELECT start_date, type, end_date, game_name, speed, game_id ' . |
| 20 | - 'FROM game WHERE game_id = ' . $db->escapeNumber($game_id)); |
|
| 20 | + 'FROM game WHERE game_id = ' . $db->escapeNumber($game_id)); |
|
| 21 | 21 | $dbRecord = $dbResult->record(); |
| 22 | 22 | $template->assign('GameName', $game_name); |
| 23 | 23 | $template->assign('Start', date($account->getDateFormat(), $dbRecord->getInt('start_date'))); |
@@ -19,8 +19,8 @@ discard block |
||
| 19 | 19 | 1 => array("pipe", "w") // stdout is a pipe that the child will write to |
| 20 | 20 | ); |
| 21 | 21 | $engine = proc_open(UCI_CHESS_ENGINE, $descriptorSpec, $pipes); |
| 22 | - $toEngine =& $pipes[0]; |
|
| 23 | - $fromEngine =& $pipes[1]; |
|
| 22 | + $toEngine = & $pipes[0]; |
|
| 23 | + $fromEngine = & $pipes[1]; |
|
| 24 | 24 | |
| 25 | 25 | function readFromEngine($block = true) { |
| 26 | 26 | global $fromEngine; |
@@ -84,5 +84,5 @@ discard block |
||
| 84 | 84 | function debug($message, $debugObject = null) { |
| 85 | 85 | echo date('Y-m-d H:i:s - ') . $message . ($debugObject !== null ? EOL . var_export($debugObject, true) : '') . EOL; |
| 86 | 86 | $db = Smr\Database::getInstance(); |
| 87 | - $db->write('INSERT INTO npc_logs (script_id, npc_id, time, message, debug_info, var) VALUES (' . (defined('SCRIPT_ID') ? SCRIPT_ID : 0) . ', 0, NOW(),' . $db->escapeString($message) . ',' . $db->escapeString(var_export($debugObject,true)) . ',' . $db->escapeString('') . ')'); |
|
| 87 | + $db->write('INSERT INTO npc_logs (script_id, npc_id, time, message, debug_info, var) VALUES (' . (defined('SCRIPT_ID') ? SCRIPT_ID : 0) . ', 0, NOW(),' . $db->escapeString($message) . ',' . $db->escapeString(var_export($debugObject, true)) . ',' . $db->escapeString('') . ')'); |
|
| 88 | 88 | } |
@@ -321,7 +321,7 @@ discard block |
||
| 321 | 321 | foreach ($dbResult->records() as $dbRecord) { |
| 322 | 322 | try { |
| 323 | 323 | $otherPlayer = SmrPlayer::getPlayer($dbRecord->getInt('from_account_id'), |
| 324 | - $this->getGameID(), $forceUpdate); |
|
| 324 | + $this->getGameID(), $forceUpdate); |
|
| 325 | 325 | } catch (PlayerNotFoundException $e) { |
| 326 | 326 | // Skip players that have not joined this game |
| 327 | 327 | continue; |
@@ -879,9 +879,9 @@ discard block |
||
| 879 | 879 | */ |
| 880 | 880 | public function canFight() : bool { |
| 881 | 881 | return !($this->hasNewbieTurns() || |
| 882 | - $this->isDead() || |
|
| 883 | - $this->isLandedOnPlanet() || |
|
| 884 | - $this->hasFederalProtection()); |
|
| 882 | + $this->isDead() || |
|
| 883 | + $this->isLandedOnPlanet() || |
|
| 884 | + $this->hasFederalProtection()); |
|
| 885 | 885 | } |
| 886 | 886 | |
| 887 | 887 | public function setDead(bool $bool) : void { |
@@ -1692,7 +1692,7 @@ discard block |
||
| 1692 | 1692 | create_error('The saved sector must be in the box!'); |
| 1693 | 1693 | } |
| 1694 | 1694 | |
| 1695 | - $storedDestinations =& $this->getStoredDestinations(); |
|
| 1695 | + $storedDestinations = & $this->getStoredDestinations(); |
|
| 1696 | 1696 | foreach ($storedDestinations as &$sd) { |
| 1697 | 1697 | if ($sd['SectorID'] == $sectorID) { |
| 1698 | 1698 | $sd['OffsetTop'] = $offsetTop; |
@@ -2019,13 +2019,13 @@ discard block |
||
| 2019 | 2019 | $dbResult = $this->db->read('SELECT type,amount FROM player_hof WHERE ' . $this->SQL); |
| 2020 | 2020 | $this->HOF = array(); |
| 2021 | 2021 | foreach ($dbResult->records() as $dbRecord) { |
| 2022 | - $hof =& $this->HOF; |
|
| 2022 | + $hof = & $this->HOF; |
|
| 2023 | 2023 | $typeList = explode(':', $dbRecord->getString('type')); |
| 2024 | 2024 | foreach ($typeList as $type) { |
| 2025 | 2025 | if (!isset($hof[$type])) { |
| 2026 | 2026 | $hof[$type] = array(); |
| 2027 | 2027 | } |
| 2028 | - $hof =& $hof[$type]; |
|
| 2028 | + $hof = & $hof[$type]; |
|
| 2029 | 2029 | } |
| 2030 | 2030 | $hof = $dbRecord->getFloat('amount'); |
| 2031 | 2031 | } |
@@ -2104,8 +2104,8 @@ discard block |
||
| 2104 | 2104 | } |
| 2105 | 2105 | self::$HOFVis[$hofType] = $visibility; |
| 2106 | 2106 | |
| 2107 | - $hof =& $this->HOF; |
|
| 2108 | - $hofChanged =& $this->hasHOFChanged; |
|
| 2107 | + $hof = & $this->HOF; |
|
| 2108 | + $hofChanged = & $this->hasHOFChanged; |
|
| 2109 | 2109 | $new = false; |
| 2110 | 2110 | foreach ($typeList as $type) { |
| 2111 | 2111 | if (!isset($hofChanged[$type])) { |
@@ -2115,8 +2115,8 @@ discard block |
||
| 2115 | 2115 | $hof[$type] = array(); |
| 2116 | 2116 | $new = true; |
| 2117 | 2117 | } |
| 2118 | - $hof =& $hof[$type]; |
|
| 2119 | - $hofChanged =& $hofChanged[$type]; |
|
| 2118 | + $hof = & $hof[$type]; |
|
| 2119 | + $hofChanged = & $hofChanged[$type]; |
|
| 2120 | 2120 | } |
| 2121 | 2121 | if ($hofChanged == null) { |
| 2122 | 2122 | $hofChanged = self::HOF_CHANGED; |
@@ -2784,7 +2784,7 @@ discard block |
||
| 2784 | 2784 | 'Starting Sector' => $this->getSectorID() |
| 2785 | 2785 | ); |
| 2786 | 2786 | |
| 2787 | - $this->missions[$missionID] =& $mission; |
|
| 2787 | + $this->missions[$missionID] = & $mission; |
|
| 2788 | 2788 | $this->setupMissionStep($missionID); |
| 2789 | 2789 | $this->rebuildMission($missionID); |
| 2790 | 2790 | |
@@ -2834,7 +2834,7 @@ discard block |
||
| 2834 | 2834 | |
| 2835 | 2835 | public function claimMissionReward(int $missionID) : string { |
| 2836 | 2836 | $this->getMissions(); |
| 2837 | - $mission =& $this->missions[$missionID]; |
|
| 2837 | + $mission = & $this->missions[$missionID]; |
|
| 2838 | 2838 | if ($mission === false) { |
| 2839 | 2839 | throw new Exception('Unknown mission: ' . $missionID); |
| 2840 | 2840 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | // Delete all tickets and re-insert the winning ticket |
| 32 | 32 | $db->write('DELETE FROM player_has_ticket WHERE game_id = ' . $db->escapeNumber($gameID)); |
| 33 | 33 | $db->write('INSERT INTO player_has_ticket (game_id, account_id, time, prize) ' |
| 34 | - .'VALUES (' . $db->escapeNumber($gameID) . ',' . $db->escapeNumber($winner_id) . ',\'0\',' . $db->escapeNumber($lottoInfo['Prize']) . ')'); |
|
| 34 | + .'VALUES (' . $db->escapeNumber($gameID) . ',' . $db->escapeNumber($winner_id) . ',\'0\',' . $db->escapeNumber($lottoInfo['Prize']) . ')'); |
|
| 35 | 35 | |
| 36 | 36 | $db->unlock(); |
| 37 | 37 | |
@@ -90,18 +90,22 @@ |
||
| 90 | 90 | |
| 91 | 91 | echo ('<tr>'); |
| 92 | 92 | echo ('<td colspan="5">'); |
| 93 | - if (isset($previous_topic_id) && $previous_topic_id > 0) |
|
| 94 | - echo ('<b>Previous:</b> <a href="/manual.php?' . $previous_topic_id . '">' . get_numbering($previous_topic_id) . $previous_topic . '</a> '); |
|
| 95 | - if (isset($up_topic_id) && $up_topic_id > 0) |
|
| 96 | - echo ('<b>Up:</b> <a href="/manual.php?' . $up_topic_id . '">' . get_numbering($up_topic_id) . $up_topic . '</a> '); |
|
| 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>'); |
|
| 93 | + if (isset($previous_topic_id) && $previous_topic_id > 0) { |
|
| 94 | + echo ('<b>Previous:</b> <a href="/manual.php?' . $previous_topic_id . '">' . get_numbering($previous_topic_id) . $previous_topic . '</a> '); |
|
| 95 | + } |
|
| 96 | + if (isset($up_topic_id) && $up_topic_id > 0) { |
|
| 97 | + echo ('<b>Up:</b> <a href="/manual.php?' . $up_topic_id . '">' . get_numbering($up_topic_id) . $up_topic . '</a> '); |
|
| 98 | + } |
|
| 99 | + if (isset($next_topic_id) && $next_topic_id > 0) { |
|
| 100 | + echo ('<b>Next:</b> <a href="/manual.php?' . $next_topic_id . '">' . get_numbering($next_topic_id) . $next_topic . '</a>'); |
|
| 101 | + } |
|
| 99 | 102 | echo ('</tr>'); |
| 100 | 103 | |
| 101 | 104 | echo ('</table>'); |
| 102 | - } else |
|
| 103 | - echo ('Invalid Topic!'); |
|
| 104 | -} |
|
| 105 | + } else { |
|
| 106 | + echo ('Invalid Topic!'); |
|
| 107 | + } |
|
| 108 | + } |
|
| 105 | 109 | |
| 106 | 110 | function echo_content($topic_id) { |
| 107 | 111 | // database object |
@@ -30,13 +30,13 @@ |
||
| 30 | 30 | const USER_SCORE_NAME = 'User Score'; |
| 31 | 31 | $hofTypes = array(DONATION_NAME=>true, USER_SCORE_NAME=>true); |
| 32 | 32 | foreach ($dbResult->records() as $dbRecord) { |
| 33 | - $hof =& $hofTypes; |
|
| 33 | + $hof = & $hofTypes; |
|
| 34 | 34 | $typeList = explode(':', $dbRecord->getString('type')); |
| 35 | 35 | foreach ($typeList as $type) { |
| 36 | 36 | if (!isset($hof[$type])) { |
| 37 | 37 | $hof[$type] = array(); |
| 38 | 38 | } |
| 39 | - $hof =& $hof[$type]; |
|
| 39 | + $hof = & $hof[$type]; |
|
| 40 | 40 | } |
| 41 | 41 | $hof = true; |
| 42 | 42 | } |
@@ -128,7 +128,7 @@ |
||
| 128 | 128 | AND receiver_delete = ' . $db->escapeBoolean(false) . ' |
| 129 | 129 | ORDER BY send_time DESC'); |
| 130 | 130 | foreach ($dbResult->records() as $dbRecord) { |
| 131 | - $groupBox =& $messageBox['GroupedMessages'][$dbRecord->getInt('sender_id')]; |
|
| 131 | + $groupBox = & $messageBox['GroupedMessages'][$dbRecord->getInt('sender_id')]; |
|
| 132 | 132 | // Limit the number of messages in each group |
| 133 | 133 | if (!isset($groupBox['Messages']) || count($groupBox['Messages']) < MESSAGE_SCOUT_GROUP_LIMIT) { |
| 134 | 134 | displayMessage($groupBox, $dbRecord->getInt('message_id'), $dbRecord->getInt('account_id'), $dbRecord->getInt('sender_id'), $player->getGameID(), stripslashes($dbRecord->getString('message_text')), $dbRecord->getInt('send_time'), $dbRecord->getBoolean('msg_read'), MSG_SCOUT, $player->getAccount()); |
@@ -36,13 +36,13 @@ |
||
| 36 | 36 | const USER_SCORE_NAME = 'User Score'; |
| 37 | 37 | $hofTypes = array(DONATION_NAME=>true, USER_SCORE_NAME=>true); |
| 38 | 38 | foreach ($dbResult->records() as $dbRecord) { |
| 39 | - $hof =& $hofTypes; |
|
| 39 | + $hof = & $hofTypes; |
|
| 40 | 40 | $typeList = explode(':', $dbRecord->getString('type')); |
| 41 | 41 | foreach ($typeList as $type) { |
| 42 | 42 | if (!isset($hof[$type])) { |
| 43 | 43 | $hof[$type] = array(); |
| 44 | 44 | } |
| 45 | - $hof =& $hof[$type]; |
|
| 45 | + $hof = & $hof[$type]; |
|
| 46 | 46 | } |
| 47 | 47 | $hof = true; |
| 48 | 48 | } |
@@ -387,13 +387,13 @@ |
||
| 387 | 387 | $dbResult = $this->db->read('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'); |
| 388 | 388 | $this->HOF = array(); |
| 389 | 389 | foreach ($dbResult->records() as $dbRecord) { |
| 390 | - $hof =& $this->HOF; |
|
| 390 | + $hof = & $this->HOF; |
|
| 391 | 391 | $typeList = explode(':', $dbRecord->getString('type')); |
| 392 | 392 | foreach ($typeList as $type) { |
| 393 | 393 | if (!isset($hof[$type])) { |
| 394 | 394 | $hof[$type] = array(); |
| 395 | 395 | } |
| 396 | - $hof =& $hof[$type]; |
|
| 396 | + $hof = & $hof[$type]; |
|
| 397 | 397 | } |
| 398 | 398 | $hof = $dbRecord->getFloat('amount'); |
| 399 | 399 | } |