We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | // now transfer |
32 | 32 | $planet->decreaseShields($amount); |
33 | 33 | $ship->increaseShields($amount); |
34 | - $account->log(LOG_TYPE_PLANETS, 'Player takes '.$amount.' shields from planet.', $player->getSectorID()); |
|
34 | + $account->log(LOG_TYPE_PLANETS, 'Player takes ' . $amount . ' shields from planet.', $player->getSectorID()); |
|
35 | 35 | } |
36 | 36 | else if ($type_id == HARDWARE_COMBAT) { |
37 | 37 | // do we want transfer more than we have? |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | // now transfer |
46 | 46 | $planet->decreaseCDs($amount); |
47 | 47 | $ship->increaseCDs($amount); |
48 | - $account->log(LOG_TYPE_PLANETS, 'Player takes '.$amount.' drones from planet.', $player->getSectorID()); |
|
48 | + $account->log(LOG_TYPE_PLANETS, 'Player takes ' . $amount . ' drones from planet.', $player->getSectorID()); |
|
49 | 49 | } |
50 | 50 | else if ($type_id == HARDWARE_ARMOUR) { |
51 | 51 | // do we want transfer more than we have? |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | // now transfer |
60 | 60 | $planet->decreaseArmour($amount); |
61 | 61 | $ship->increaseArmour($amount); |
62 | - $account->log(LOG_TYPE_PLANETS, 'Player takes '.$amount.' armour from planet.', $player->getSectorID()); |
|
62 | + $account->log(LOG_TYPE_PLANETS, 'Player takes ' . $amount . ' armour from planet.', $player->getSectorID()); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | } |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | // now transfer |
78 | 78 | $planet->increaseShields($amount); |
79 | 79 | $ship->decreaseShields($amount); |
80 | - $account->log(LOG_TYPE_PLANETS, 'Player puts '.$amount.' shields on planet.', $player->getSectorID()); |
|
80 | + $account->log(LOG_TYPE_PLANETS, 'Player puts ' . $amount . ' shields on planet.', $player->getSectorID()); |
|
81 | 81 | // does the user wants to transfer drones? |
82 | 82 | } |
83 | 83 | else if ($type_id == HARDWARE_COMBAT) { |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | // now transfer |
93 | 93 | $planet->increaseCDs($amount); |
94 | 94 | $ship->decreaseCDs($amount); |
95 | - $account->log(LOG_TYPE_PLANETS, 'Player puts '.$amount.' drones on planet.', $player->getSectorID()); |
|
95 | + $account->log(LOG_TYPE_PLANETS, 'Player puts ' . $amount . ' drones on planet.', $player->getSectorID()); |
|
96 | 96 | } |
97 | 97 | // does the user wish to transfare armour? |
98 | 98 | else if ($type_id == HARDWARE_ARMOUR) { |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | // now transfer |
108 | 108 | $planet->increaseArmour($amount); |
109 | 109 | $ship->decreaseArmour($amount); |
110 | - $account->log(LOG_TYPE_PLANETS, 'Player puts '.$amount.' armour on planet.', $player->getSectorID()); |
|
110 | + $account->log(LOG_TYPE_PLANETS, 'Player puts ' . $amount . ' armour on planet.', $player->getSectorID()); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | } |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | $results = unserialize($var['results']); |
3 | -$template->assign('TraderCombatResults',$results); |
|
4 | -if($var['target']) |
|
5 | - $template->assign('Target',SmrPlayer::getPlayer($var['target'],$player->getGameID())); |
|
6 | -if(isset($var['override_death'])) |
|
7 | - $template->assign('OverrideDeath',true); |
|
3 | +$template->assign('TraderCombatResults', $results); |
|
4 | +if ($var['target']) |
|
5 | + $template->assign('Target', SmrPlayer::getPlayer($var['target'], $player->getGameID())); |
|
6 | +if (isset($var['override_death'])) |
|
7 | + $template->assign('OverrideDeath', true); |
|
8 | 8 | else |
9 | - $template->assign('OverrideDeath',false); |
|
9 | + $template->assign('OverrideDeath', false); |
@@ -1,10 +1,10 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!isset($var['GameID'])) SmrSession::updateVar('GameID',$player->getGameID()); |
|
2 | +if (!isset($var['GameID'])) SmrSession::updateVar('GameID', $player->getGameID()); |
|
3 | 3 | $gameID = $var['GameID']; |
4 | 4 | |
5 | 5 | $basicContainer = array('GameID'=>$gameID); |
6 | 6 | |
7 | -$template->assign('PageTopic','Advanced News'); |
|
7 | +$template->assign('PageTopic', 'Advanced News'); |
|
8 | 8 | Menu::news($template); |
9 | 9 | |
10 | 10 | //$db->query(' |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | |
34 | 34 | $newsAlliances = array(); |
35 | 35 | $newsAlliances[0] = array('ID' => 0, 'Name' => 'None'); |
36 | -while($db->nextRecord()) { |
|
36 | +while ($db->nextRecord()) { |
|
37 | 37 | $newsAlliances[$db->getField('alliance_id')] = array('ID' => $db->getField('alliance_id'), 'Name' => $db->getField('alliance_name')); |
38 | 38 | } |
39 | -$template->assign('NewsAlliances',$newsAlliances); |
|
39 | +$template->assign('NewsAlliances', $newsAlliances); |
|
40 | 40 | |
41 | -$template->assign('AdvancedNewsFormHref',SmrSession::getNewHREF(create_container('skeleton.php','news_read_advanced.php',$basicContainer))); |
|
41 | +$template->assign('AdvancedNewsFormHref', SmrSession::getNewHREF(create_container('skeleton.php', 'news_read_advanced.php', $basicContainer))); |
|
42 | 42 | |
43 | 43 | |
44 | 44 | if (isset($_REQUEST['submit'])) $submit_value = $_REQUEST['submit']; |
@@ -49,30 +49,30 @@ discard block |
||
49 | 49 | if (isset($_REQUEST['playerName'])) $p_name = $_REQUEST['playerName']; |
50 | 50 | else $p_name = $var['playerName']; |
51 | 51 | $template->assign('ResultsFor', $p_name); |
52 | - $db->query('SELECT * FROM player WHERE player_name LIKE ' . $db->escapeString('%'.$p_name.'%') . ' AND game_id = ' . $db->escapeNumber($gameID).' LIMIT 3'); |
|
52 | + $db->query('SELECT * FROM player WHERE player_name LIKE ' . $db->escapeString('%' . $p_name . '%') . ' AND game_id = ' . $db->escapeNumber($gameID) . ' LIMIT 3'); |
|
53 | 53 | $IDs = array(0); |
54 | - while($db->nextRecord()) { |
|
54 | + while ($db->nextRecord()) { |
|
55 | 55 | $IDs[] = $db->getInt('account_id'); |
56 | 56 | } |
57 | 57 | $db->query('SELECT * FROM news WHERE game_id = ' . $db->escapeNumber($gameID) . ' AND (killer_id IN (' . $db->escapeArray($IDs) . ') OR dead_id IN (' . $db->escapeArray($IDs) . ')) ORDER BY news_id DESC'); |
58 | 58 | } |
59 | 59 | elseif ($submit_value == 'Search For Alliance') { |
60 | - if (isset($_REQUEST['allianceID'])) SmrSession::updateVar('AllianceID',$_REQUEST['allianceID']); |
|
61 | - if(!isset($var['AllianceID'])) create_error('No alliance was specified!'); |
|
60 | + if (isset($_REQUEST['allianceID'])) SmrSession::updateVar('AllianceID', $_REQUEST['allianceID']); |
|
61 | + if (!isset($var['AllianceID'])) create_error('No alliance was specified!'); |
|
62 | 62 | $allianceID = $var['AllianceID']; |
63 | 63 | $template->assign('ResultsFor', $newsAlliances[$allianceID]['Name']); |
64 | - $db->query('SELECT * FROM news WHERE game_id = ' . $db->escapeNumber($gameID) . ' AND ((killer_alliance = ' . $db->escapeNumber($allianceID) . ' AND killer_id != '.$db->escapeNumber(ACCOUNT_ID_PORT).') OR (dead_alliance = ' . $db->escapeNumber($allianceID) . ' AND dead_id != '.$db->escapeNumber(ACCOUNT_ID_PORT).')) ORDER BY news_id DESC'); |
|
64 | + $db->query('SELECT * FROM news WHERE game_id = ' . $db->escapeNumber($gameID) . ' AND ((killer_alliance = ' . $db->escapeNumber($allianceID) . ' AND killer_id != ' . $db->escapeNumber(ACCOUNT_ID_PORT) . ') OR (dead_alliance = ' . $db->escapeNumber($allianceID) . ' AND dead_id != ' . $db->escapeNumber(ACCOUNT_ID_PORT) . ')) ORDER BY news_id DESC'); |
|
65 | 65 | } |
66 | 66 | elseif ($submit_value == 'Search For Players') { |
67 | 67 | $template->assign('ResultsFor', $_REQUEST['player1'] . ' vs. ' . $_REQUEST['player2']); |
68 | - $db->query('SELECT * FROM player WHERE player_name LIKE ' . $db->escapeString('%'.$_REQUEST['player1'].'%') . ' AND game_id = ' . $db->escapeNumber($gameID).' LIMIT 3'); |
|
68 | + $db->query('SELECT * FROM player WHERE player_name LIKE ' . $db->escapeString('%' . $_REQUEST['player1'] . '%') . ' AND game_id = ' . $db->escapeNumber($gameID) . ' LIMIT 3'); |
|
69 | 69 | $IDs = array(0); |
70 | - while($db->nextRecord()) { |
|
70 | + while ($db->nextRecord()) { |
|
71 | 71 | $IDs[] = $db->getInt('account_id'); |
72 | 72 | } |
73 | - $db->query('SELECT * FROM player WHERE player_name LIKE ' . $db->escapeString('%'.$_REQUEST['player2'].'%') . ' AND game_id = ' . $db->escapeNumber($gameID).' LIMIT 3'); |
|
73 | + $db->query('SELECT * FROM player WHERE player_name LIKE ' . $db->escapeString('%' . $_REQUEST['player2'] . '%') . ' AND game_id = ' . $db->escapeNumber($gameID) . ' LIMIT 3'); |
|
74 | 74 | $IDs2 = array(0); |
75 | - while($db->nextRecord()) { |
|
75 | + while ($db->nextRecord()) { |
|
76 | 76 | $IDs2[] = $db->getInt('account_id'); |
77 | 77 | } |
78 | 78 | $db->query('SELECT * FROM news |
@@ -102,5 +102,5 @@ discard block |
||
102 | 102 | while ($db->nextRecord()) { |
103 | 103 | $NewsItems[] = array('Time' => $db->getField('time'), 'Message' => bbifyMessage($db->getField('news_message'))); |
104 | 104 | } |
105 | - $template->assign('NewsItems',$NewsItems); |
|
105 | + $template->assign('NewsItems', $NewsItems); |
|
106 | 106 | } |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -$template->assign('PageTopic','Preferences'); |
|
2 | +$template->assign('PageTopic', 'Preferences'); |
|
3 | 3 | |
4 | 4 | if (isset($var['reason'])) |
5 | - $template->assign('Reason',$var['reason']); |
|
5 | + $template->assign('Reason', $var['reason']); |
|
6 | 6 | |
7 | 7 | $template->assign('PreferencesFormHREF', SmrSession::getNewHREF(create_container('preferences_processing.php', ''))); |
8 | 8 | |
@@ -23,4 +23,4 @@ discard block |
||
23 | 23 | $transferAccounts[$db->getField('account_id')] = $db->getField('hof_name'); |
24 | 24 | } |
25 | 25 | //} |
26 | -$template->assign('TransferAccounts',$transferAccounts); |
|
26 | +$template->assign('TransferAccounts', $transferAccounts); |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | AND send_time >= ' . $db->escapeNumber($temp[1]) . ' |
16 | 16 | AND send_time <= ' . $db->escapeNumber($temp[2]) . ' |
17 | 17 | AND account_id = ' . $db->escapeNumber($player->getAccountID()) . ' |
18 | - AND message_type_id = ' . $db->escapeNumber(MSG_SCOUT).' AND receiver_delete = ' . $db->escapeBoolean(false)); |
|
18 | + AND message_type_id = ' . $db->escapeNumber(MSG_SCOUT) . ' AND receiver_delete = ' . $db->escapeBoolean(false)); |
|
19 | 19 | while ($db->nextRecord()) { |
20 | 20 | $message_id_list[] = $db->getInt('message_id'); |
21 | 21 | } |
@@ -24,16 +24,16 @@ discard block |
||
24 | 24 | $message_id_list[] = $id; |
25 | 25 | } |
26 | 26 | } |
27 | - if($var['folder_id']==MSG_SENT) |
|
28 | - $db->query('UPDATE message SET sender_delete = ' . $db->escapeBoolean(true) . ' WHERE message_id IN ('.$db->escapeArray($message_id_list).')'); |
|
27 | + if ($var['folder_id'] == MSG_SENT) |
|
28 | + $db->query('UPDATE message SET sender_delete = ' . $db->escapeBoolean(true) . ' WHERE message_id IN (' . $db->escapeArray($message_id_list) . ')'); |
|
29 | 29 | else |
30 | - $db->query('UPDATE message SET receiver_delete = ' . $db->escapeBoolean(true) . ' WHERE message_id IN ('.$db->escapeArray($message_id_list).')'); |
|
30 | + $db->query('UPDATE message SET receiver_delete = ' . $db->escapeBoolean(true) . ' WHERE message_id IN (' . $db->escapeArray($message_id_list) . ')'); |
|
31 | 31 | } |
32 | 32 | else { |
33 | 33 | if ($var['folder_id'] == MSG_SCOUT) { |
34 | 34 | $db->query('UPDATE message SET receiver_delete = ' . $db->escapeBoolean(true) . ' |
35 | 35 | WHERE account_id = ' . $db->escapeNumber($player->getAccountID()) . ' |
36 | - AND message_type_id = '.$db->escapeNumber($var['folder_id']).' |
|
36 | + AND message_type_id = '.$db->escapeNumber($var['folder_id']) . ' |
|
37 | 37 | AND game_id = ' . $db->escapeNumber($player->getGameID())); |
38 | 38 | } |
39 | 39 | else if ($var['folder_id'] == MSG_SENT) { |
@@ -18,21 +18,21 @@ discard block |
||
18 | 18 | if ($action == 'Buy') { |
19 | 19 | // do we have enough cash? |
20 | 20 | if ($player->getCredits() < $cost * $amount) { |
21 | - create_error('You don\'t have enough credits to buy '.$amount.' items!'); |
|
21 | + create_error('You don\'t have enough credits to buy ' . $amount . ' items!'); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | // chec for max. we can hold! |
25 | 25 | if ($amount > $ship->getMaxHardware($hardware_id) - $ship->getHardware($hardware_id)) { |
26 | - create_error('You can\'t buy more '.$hardware_name.' than you can transport!'); |
|
26 | + create_error('You can\'t buy more ' . $hardware_name . ' than you can transport!'); |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | $player->decreaseCredits($cost * $amount); |
30 | 30 | $ship->increaseHardware($hardware_id, $amount); |
31 | 31 | |
32 | 32 | //HoF |
33 | - if ($hardware_id == HARDWARE_COMBAT) $player->increaseHOF($amount,array('Forces','Bought','Combat Drones'), HOF_ALLIANCE); |
|
34 | - if ($hardware_id == HARDWARE_SCOUT) $player->increaseHOF($amount,array('Forces','Bought','Scout Drones'), HOF_ALLIANCE); |
|
35 | - if ($hardware_id == HARDWARE_MINE) $player->increaseHOF($amount,array('Forces','Bought','Mines'), HOF_ALLIANCE); |
|
33 | + if ($hardware_id == HARDWARE_COMBAT) $player->increaseHOF($amount, array('Forces', 'Bought', 'Combat Drones'), HOF_ALLIANCE); |
|
34 | + if ($hardware_id == HARDWARE_SCOUT) $player->increaseHOF($amount, array('Forces', 'Bought', 'Scout Drones'), HOF_ALLIANCE); |
|
35 | + if ($hardware_id == HARDWARE_MINE) $player->increaseHOF($amount, array('Forces', 'Bought', 'Mines'), HOF_ALLIANCE); |
|
36 | 36 | } |
37 | 37 | else if ($action == 'Sell') { |
38 | 38 | // We only allow selling combat drones |
@@ -42,17 +42,17 @@ discard block |
||
42 | 42 | |
43 | 43 | // Make sure we have the specified amount to sell |
44 | 44 | if ($amount > $ship->getCDs()) { |
45 | - create_error('You can\'t sell more '.$hardware_name.' than you have aboard your ship!'); |
|
45 | + create_error('You can\'t sell more ' . $hardware_name . ' than you have aboard your ship!'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | $player->increaseCredits(round($cost * CDS_REFUND_PERCENT) * $amount); |
49 | - $ship->decreaseCDs($amount, true); // 2nd arg avoids under attack warning |
|
49 | + $ship->decreaseCDs($amount, true); // 2nd arg avoids under attack warning |
|
50 | 50 | } |
51 | 51 | else { |
52 | 52 | throw new Exception('Action must be either Buy or Sell.'); |
53 | 53 | } |
54 | 54 | |
55 | -$account->log(LOG_TYPE_HARDWARE, 'Player '.$action.'s '.$amount.' '.$hardware_name, $player->getSectorID()); |
|
55 | +$account->log(LOG_TYPE_HARDWARE, 'Player ' . $action . 's ' . $amount . ' ' . $hardware_name, $player->getSectorID()); |
|
56 | 56 | |
57 | 57 | $player->update(); |
58 | 58 | $ship->updateHardware(); |
@@ -1,6 +1,6 @@ discard block |
||
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()); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $db->query('SELECT * FROM alliance_has_roles WHERE alliance_id = ' . $db->escapeNumber($player->getAllianceID()) . ' AND game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND role_id = ' . $db->escapeNumber($role_id)); |
39 | 39 | $db->nextRecord(); |
40 | 40 | if ($db->getBoolean('change_mod') || $db->getBoolean('change_pass')) { |
41 | - $container=create_container('skeleton.php','alliance_stat.php'); |
|
41 | + $container = create_container('skeleton.php', 'alliance_stat.php'); |
|
42 | 42 | $container['alliance_id'] = $alliance->getAllianceID(); |
43 | 43 | $template->assign('EditHREF', SmrSession::getNewHREF($container)); |
44 | 44 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$template->assign('PageTopic','Death Rankings'); |
|
3 | +$template->assign('PageTopic', 'Death Rankings'); |
|
4 | 4 | |
5 | 5 | Menu::rankings(0, 3); |
6 | 6 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | $voting = '<b><span class="red">v</span>o<span class="blue">t</span><span class="red">i</span>n<span class="blue">g</span></b>'; |
16 | 16 | $container['msg'] = "Thank you for $voting! You will receive bonus turns once your vote is processed."; |
17 | 17 | } else { |
18 | - create_error('You cannot gain bonus turns in this game yet, please wait '.format_time($startFreeTurnsDate - min(TIME, $player->getLastTurnUpdate())).'.'); |
|
18 | + create_error('You cannot gain bonus turns in this game yet, please wait ' . format_time($startFreeTurnsDate - min(TIME, $player->getLastTurnUpdate())) . '.'); |
|
19 | 19 | } |
20 | 20 | } |
21 | 21 |