We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -$template->assign('PageTopic','Search Trader'); |
|
2 | +$template->assign('PageTopic', 'Search Trader'); |
|
3 | 3 | $template->assign('TraderSearchHREF', SmrSession::getNewHREF(create_container('skeleton.php', 'trader_search_result.php'))); |
4 | 4 | |
5 | 5 | if (isset($var['empty_result'])) { |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | if (count($player->getMissions()) >= 3) |
4 | - create_error('red','Error','You can only have 3 missions at a time.'); |
|
4 | + create_error('red', 'Error', 'You can only have 3 missions at a time.'); |
|
5 | 5 | |
6 | 6 | |
7 | 7 | $player->addMission($var['MissionID']); |
@@ -1,18 +1,18 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once(get_file_loc('message.functions.inc')); |
3 | 3 | |
4 | -if(isset($var['Message'])) { |
|
5 | - $template->assign('Message',$var['Message']); |
|
4 | +if (isset($var['Message'])) { |
|
5 | + $template->assign('Message', $var['Message']); |
|
6 | 6 | } |
7 | 7 | |
8 | -$template->assign('PageTopic','Message Notifications'); |
|
8 | +$template->assign('PageTopic', 'Message Notifications'); |
|
9 | 9 | |
10 | 10 | $container = create_container('buy_message_notifications_processing.php'); |
11 | 11 | |
12 | 12 | // Presently only player messages are eligible for notifications |
13 | 13 | $notifyTypeIDs = array(MSG_PLAYER); |
14 | 14 | |
15 | -$messageBoxes = array (); |
|
15 | +$messageBoxes = array(); |
|
16 | 16 | foreach ($notifyTypeIDs as $messageTypeID) { |
17 | 17 | $messageBox = array(); |
18 | 18 | $messageBox['Name'] = getMessageTypeNames($messageTypeID); |
@@ -26,7 +26,7 @@ |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | $gameId = (isset($_POST['all_games'])) ? '0' : $player->getGameID(); |
29 | - $db->query('INSERT INTO account_shares_info (to_account_id, from_account_id, game_id) VALUES ('. $db->escapeNumber($accountId) .','. $db->escapeNumber($player->getAccountID()) .','. $db->escapeNumber($gameId) .')'); |
|
29 | + $db->query('INSERT INTO account_shares_info (to_account_id, from_account_id, game_id) VALUES (' . $db->escapeNumber($accountId) . ',' . $db->escapeNumber($player->getAccountID()) . ',' . $db->escapeNumber($gameId) . ')'); |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | // Process removing a "share to" account |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$chessGames =& ChessGame::getOngoingAccountGames($player->getAccountID()); |
|
3 | +$chessGames = & ChessGame::getOngoingAccountGames($player->getAccountID()); |
|
4 | 4 | $template->assign('ChessGames', $chessGames); |
5 | 5 | |
6 | 6 | $playersChallenged = array($player->getAccountID() => true); |
7 | -foreach($chessGames as $chessGame) { |
|
7 | +foreach ($chessGames as $chessGame) { |
|
8 | 8 | $playersChallenged[$chessGame->getWhiteID()] = true; |
9 | 9 | $playersChallenged[$chessGame->getBlackID()] = true; |
10 | 10 | } |
@@ -14,13 +14,13 @@ discard block |
||
14 | 14 | while ($db->nextRecord()) { |
15 | 15 | $players[$db->getInt('player_id')] = $db->getField('player_name'); |
16 | 16 | } |
17 | -$template->assign('PlayerList',$players); |
|
17 | +$template->assign('PlayerList', $players); |
|
18 | 18 | |
19 | -if(ENABLE_NPCS_CHESS) { |
|
19 | +if (ENABLE_NPCS_CHESS) { |
|
20 | 20 | $npcs = array(); |
21 | 21 | $db->query('SELECT player_id, player.player_name FROM player JOIN account USING(account_id) JOIN npc_logins USING(login) WHERE validated = ' . $db->escapeBoolean(true) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND account_id NOT IN (' . $db->escapeArray(array_keys($playersChallenged)) . ') ORDER BY player_name'); |
22 | 22 | while ($db->nextRecord()) { |
23 | 23 | $npcs[$db->getInt('player_id')] = $db->getField('player_name'); |
24 | 24 | } |
25 | - $template->assign('NPCList',$npcs); |
|
25 | + $template->assign('NPCList', $npcs); |
|
26 | 26 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | if (!isset($var['alliance_id'])) { |
3 | - SmrSession::updateVar('alliance_id',$player->getAllianceID()); |
|
3 | + SmrSession::updateVar('alliance_id', $player->getAllianceID()); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | $alliance = SmrAlliance::getAlliance($var['alliance_id'], $player->getGameID()); |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(isset($var['results'])) { |
|
3 | +if (isset($var['results'])) { |
|
4 | 4 | $results = unserialize($var['results']); |
5 | - $template->assign('FullPortCombatResults',$results); |
|
6 | - $template->assign('AlreadyDestroyed',false); |
|
5 | + $template->assign('FullPortCombatResults', $results); |
|
6 | + $template->assign('AlreadyDestroyed', false); |
|
7 | 7 | } |
8 | 8 | else |
9 | - $template->assign('AlreadyDestroyed',true); |
|
10 | -$template->assign('MinimalDisplay',false); |
|
9 | + $template->assign('AlreadyDestroyed', true); |
|
10 | +$template->assign('MinimalDisplay', false); |
|
11 | 11 | |
12 | -if(isset($var['override_death'])) |
|
13 | - $template->assign('OverrideDeath',true); |
|
12 | +if (isset($var['override_death'])) |
|
13 | + $template->assign('OverrideDeath', true); |
|
14 | 14 | else |
15 | - $template->assign('OverrideDeath',false); |
|
16 | -$template->assign('Port',$sector->getPort()); |
|
15 | + $template->assign('OverrideDeath', false); |
|
16 | +$template->assign('Port', $sector->getPort()); |
@@ -4,15 +4,15 @@ |
||
4 | 4 | $subject = $_REQUEST['subject']; |
5 | 5 | $error_msg = $_REQUEST['error_msg']; |
6 | 6 | $description = $_REQUEST['description']; |
7 | -$new_sub = '[Bug] '.$subject; |
|
7 | +$new_sub = '[Bug] ' . $subject; |
|
8 | 8 | |
9 | -$message = 'Login: '.$account->getLogin().EOL.EOL.'-----------'.EOL.EOL. |
|
10 | - 'Account ID: '.$account->getAccountID().EOL.EOL.'-----------'.EOL.EOL. |
|
11 | - 'Description: '.$description.EOL.EOL.'-----------'.EOL.EOL. |
|
12 | - 'Steps to repeat: '.$steps.EOL.EOL.'-----------'.EOL.EOL. |
|
13 | - 'Error Message: '.$error_msg; |
|
9 | +$message = 'Login: ' . $account->getLogin() . EOL . EOL . '-----------' . EOL . EOL . |
|
10 | + 'Account ID: ' . $account->getAccountID() . EOL . EOL . '-----------' . EOL . EOL . |
|
11 | + 'Description: ' . $description . EOL . EOL . '-----------' . EOL . EOL . |
|
12 | + 'Steps to repeat: ' . $steps . EOL . EOL . '-----------' . EOL . EOL . |
|
13 | + 'Error Message: ' . $error_msg; |
|
14 | 14 | |
15 | -if(is_object($player)) { |
|
15 | +if (is_object($player)) { |
|
16 | 16 | $player->sendMessageToBox(BOX_BUGS_REPORTED, $message); |
17 | 17 | } |
18 | 18 | else { |
@@ -4,23 +4,23 @@ discard block |
||
4 | 4 | create_error('You are under newbie protection!'); |
5 | 5 | if ($player->hasFederalProtection()) |
6 | 6 | create_error('You are under federal protection!'); |
7 | -if($player->isLandedOnPlanet()) |
|
7 | +if ($player->isLandedOnPlanet()) |
|
8 | 8 | create_error('You cannot attack ports whilst on a planet!'); |
9 | 9 | if ($player->getTurns() < TURNS_TO_SHOOT_PORT) |
10 | 10 | create_error('You do not have enough turns to attack this port!'); |
11 | -if(!$ship->hasWeapons() && !$ship->hasCDs()) |
|
11 | +if (!$ship->hasWeapons() && !$ship->hasCDs()) |
|
12 | 12 | create_error('What are you going to do? Insult it to death?'); |
13 | -if(!$player->canFight()) |
|
13 | +if (!$player->canFight()) |
|
14 | 14 | create_error('You are not allowed to fight!'); |
15 | 15 | |
16 | 16 | $port = $sector->getPort(); |
17 | 17 | |
18 | -if(!$port->exists()) |
|
18 | +if (!$port->exists()) |
|
19 | 19 | create_error('This port does not exist.'); |
20 | 20 | |
21 | 21 | |
22 | 22 | if ($port->isDestroyed()) { |
23 | - forward(create_container('skeleton.php','port_attack.php')); |
|
23 | + forward(create_container('skeleton.php', 'port_attack.php')); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | |
@@ -36,41 +36,41 @@ discard block |
||
36 | 36 | |
37 | 37 | $attackers = $sector->getFightingTradersAgainstPort($player, $port); |
38 | 38 | |
39 | -$port->attackedBy($player,$attackers); |
|
39 | +$port->attackedBy($player, $attackers); |
|
40 | 40 | |
41 | 41 | // take the turns and decloak all attackers |
42 | -foreach($attackers as $attacker) { |
|
43 | - $attacker->takeTurns(TURNS_TO_SHOOT_PORT,0); |
|
42 | +foreach ($attackers as $attacker) { |
|
43 | + $attacker->takeTurns(TURNS_TO_SHOOT_PORT, 0); |
|
44 | 44 | $attacker->getShip()->decloak(); |
45 | 45 | } |
46 | 46 | |
47 | 47 | foreach ($attackers as $attacker) { |
48 | - $playerResults =& $attacker->shootPort($port); |
|
49 | - $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; |
|
48 | + $playerResults = & $attacker->shootPort($port); |
|
49 | + $results['Attackers']['Traders'][$attacker->getAccountID()] = & $playerResults; |
|
50 | 50 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; |
51 | 51 | } |
52 | 52 | $results['Attackers']['Downgrades'] = $port->checkForDowngrade($results['Attackers']['TotalDamage']); |
53 | -$results['Port'] =& $port->shootPlayers($attackers); |
|
53 | +$results['Port'] = & $port->shootPlayers($attackers); |
|
54 | 54 | |
55 | -$account->log(LOG_TYPE_PORT_RAIDING, 'Player attacks port, the port does '.$results['Port']['TotalDamage'].', their team does ' . $results['Attackers']['TotalDamage'] .' and downgrades '.$results['Attackers']['Downgrades'].' levels.', $port->getSectorID()); |
|
55 | +$account->log(LOG_TYPE_PORT_RAIDING, 'Player attacks port, the port does ' . $results['Port']['TotalDamage'] . ', their team does ' . $results['Attackers']['TotalDamage'] . ' and downgrades ' . $results['Attackers']['Downgrades'] . ' levels.', $port->getSectorID()); |
|
56 | 56 | |
57 | 57 | $ship->removeUnderAttack(); //Don't show attacker the under attack message. |
58 | 58 | $port->update(); |
59 | 59 | |
60 | 60 | $serializedResults = serialize($results); |
61 | -$db->query('INSERT INTO combat_logs VALUES(\'\',' . $db->escapeNumber($player->getGameID()) . ',\'PORT\',' . $db->escapeNumber($port->getSectorID()) . ',' . $db->escapeNumber(TIME) . ',' . $db->escapeNumber($player->getAccountID()) . ',' . $db->escapeNumber($player->getAllianceID()) . ','.$db->escapeNumber(ACCOUNT_ID_PORT).',' . $db->escapeNumber(PORT_ALLIANCE_ID) . ',' . $db->escapeBinary(gzcompress($serializedResults)) . ')'); |
|
61 | +$db->query('INSERT INTO combat_logs VALUES(\'\',' . $db->escapeNumber($player->getGameID()) . ',\'PORT\',' . $db->escapeNumber($port->getSectorID()) . ',' . $db->escapeNumber(TIME) . ',' . $db->escapeNumber($player->getAccountID()) . ',' . $db->escapeNumber($player->getAllianceID()) . ',' . $db->escapeNumber(ACCOUNT_ID_PORT) . ',' . $db->escapeNumber(PORT_ALLIANCE_ID) . ',' . $db->escapeBinary(gzcompress($serializedResults)) . ')'); |
|
62 | 62 | unserialize($serializedResults); //because of references we have to undo this. |
63 | -$logId = $db->escapeString('[ATTACK_RESULTS]'.$db->getInsertID()); |
|
63 | +$logId = $db->escapeString('[ATTACK_RESULTS]' . $db->getInsertID()); |
|
64 | 64 | foreach ($attackers as $attacker) { |
65 | - if(!$player->equals($attacker)) { |
|
66 | - $db->query('REPLACE INTO sector_message VALUES(' . $db->escapeNumber($attacker->getAccountID()) . ',' . $db->escapeNumber($attacker->getGameID()) . ','.$logId.')'); |
|
65 | + if (!$player->equals($attacker)) { |
|
66 | + $db->query('REPLACE INTO sector_message VALUES(' . $db->escapeNumber($attacker->getAccountID()) . ',' . $db->escapeNumber($attacker->getGameID()) . ',' . $logId . ')'); |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | -$container = create_container('skeleton.php','port_attack.php'); |
|
70 | +$container = create_container('skeleton.php', 'port_attack.php'); |
|
71 | 71 | |
72 | 72 | // If they died on the shot they get to see the results |
73 | -if($player->isDead()) { |
|
73 | +if ($player->isDead()) { |
|
74 | 74 | $container['override_death'] = TRUE; |
75 | 75 | } |
76 | 76 |