Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Branch master (287493)
by Dan
06:08
created
engine/Default/sector_move_processing.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 if ($var['target_sector'] == $player->getSectorID())
4 4
 	forward(create_container('skeleton.php', $var['target_page']));
5 5
 
6
-if($sector->getWarp() == $var['target_sector'])
6
+if ($sector->getWarp() == $var['target_sector'])
7 7
 	$turns = TURNS_PER_WARP;
8 8
 else
9 9
 	$turns = TURNS_PER_SECTOR;
@@ -16,13 +16,13 @@  discard block
 block discarded – undo
16 16
 	$player->update();
17 17
 					
18 18
 	// get new sector object
19
-	$sector =& $player->getSector();
19
+	$sector = & $player->getSector();
20 20
 	$sector->markVisited($player);
21 21
 	forward(create_container('skeleton.php', $var['target_page']));
22 22
 }
23 23
 
24 24
 $action = '';
25
-if(isset($_REQUEST['action'])) {
25
+if (isset($_REQUEST['action'])) {
26 26
 	$action = $_REQUEST['action'];
27 27
 	if ($action == 'No')
28 28
 		forward(create_container('skeleton.php', $var['target_page']));
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
 // If you bump into mines in the sector you are trying to leave...
42 42
 if ($player->getLastSectorID() != $var['target_sector']) {
43 43
 	$sectorForces = $sector->getForces();
44
-	Sorter::sortByNumMethod($sectorForces,'getMines',true);
44
+	Sorter::sortByNumMethod($sectorForces, 'getMines', true);
45 45
 	$mine_owner_id = false;
46 46
 	foreach ($sectorForces as $forces) {
47
-		if(!$mine_owner_id && $forces->hasMines() && !$player->forceNAPAlliance($forces->getOwner())) {
47
+		if (!$mine_owner_id && $forces->hasMines() && !$player->forceNAPAlliance($forces->getOwner())) {
48 48
 			$mine_owner_id = $forces->getOwnerID();
49 49
 			break;
50 50
 		}
@@ -52,12 +52,12 @@  discard block
 block discarded – undo
52 52
 	// set last sector
53 53
 	$player->setLastSectorID($var['target_sector']);
54 54
 	
55
-	if($mine_owner_id) {
55
+	if ($mine_owner_id) {
56 56
 		if ($player->hasNewbieTurns()) {
57 57
 			$turns = $sectorForces[$mine_owner_id]->getBumpTurnCost($ship);
58
-			$player->takeTurns($turns,$turns);
58
+			$player->takeTurns($turns, $turns);
59 59
 			$container = create_container('skeleton.php', 'current_sector.php');
60
-			$container['msg']= 'You have just flown past a sprinkle of mines.<br />Because of your newbie status you have been spared from the harsh reality of the forces.<br />It has cost you ' . $turns.' turn'.($turns==1?'':'s') . ' to navigate the minefield safely';
60
+			$container['msg'] = 'You have just flown past a sprinkle of mines.<br />Because of your newbie status you have been spared from the harsh reality of the forces.<br />It has cost you ' . $turns . ' turn' . ($turns == 1 ? '' : 's') . ' to navigate the minefield safely';
61 61
 			forward($container);
62 62
 		}
63 63
 		else {
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
 $player->actionTaken('WalkSector', array('Sector' => $targetSector));
75 75
 
76 76
 // send scout msg
77
-$sector->leavingSector($player,MOVEMENT_WALK);
77
+$sector->leavingSector($player, MOVEMENT_WALK);
78 78
 
79 79
 // Move the user around
80 80
 // TODO: (Must be done while holding both sector locks)
81 81
 $player->setSectorID($var['target_sector']);
82
-$player->takeTurns($turns,$turns);
82
+$player->takeTurns($turns, $turns);
83 83
 $player->update();
84 84
 
85 85
 // We need to release the lock on our old sector
@@ -89,25 +89,25 @@  discard block
 block discarded – undo
89 89
 acquire_lock($var['target_sector']);
90 90
 
91 91
 // get new sector object
92
-$sector =& $player->getSector();
92
+$sector = & $player->getSector();
93 93
 
94 94
 //add that the player explored here if it hasnt been explored...for HoF
95 95
 if (!$sector->isVisited($player)) {
96 96
 	$player->increaseExperience(EXPLORATION_EXPERIENCE);
97
-	$player->increaseHOF(EXPLORATION_EXPERIENCE,array('Movement','Exploration Experience Gained'), HOF_ALLIANCE);
98
-	$player->increaseHOF(1,array('Movement','Sectors Explored'), HOF_ALLIANCE);
97
+	$player->increaseHOF(EXPLORATION_EXPERIENCE, array('Movement', 'Exploration Experience Gained'), HOF_ALLIANCE);
98
+	$player->increaseHOF(1, array('Movement', 'Sectors Explored'), HOF_ALLIANCE);
99 99
 }
100 100
 // make current sector visible to him
101 101
 $sector->markVisited($player);
102 102
 
103 103
 // send scout msgs
104
-$sector->enteringSector($player,MOVEMENT_WALK);
104
+$sector->enteringSector($player, MOVEMENT_WALK);
105 105
 
106 106
 $sectorForces = $sector->getForces();
107 107
 $mine_owner_id = false;
108
-Sorter::sortByNumMethod($sectorForces,'getMines',true);
108
+Sorter::sortByNumMethod($sectorForces, 'getMines', true);
109 109
 foreach ($sectorForces as $forces) {
110
-	if(!$mine_owner_id && $forces->hasMines() && !$player->forceNAPAlliance($forces->getOwner())) {
110
+	if (!$mine_owner_id && $forces->hasMines() && !$player->forceNAPAlliance($forces->getOwner())) {
111 111
 		$mine_owner_id = $forces->getOwnerID();
112 112
 		break;
113 113
 	}
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
 if ($mine_owner_id) {
118 118
 	if ($player->hasNewbieTurns()) {
119 119
 		$turns = $sectorForces[$mine_owner_id]->getBumpTurnCost($ship);
120
-		$player->takeTurns($turns,$turns);
120
+		$player->takeTurns($turns, $turns);
121 121
 		$container = create_container('skeleton.php', 'current_sector.php');
122
-		$container['msg']= 'You have just flown past a sprinkle of mines.<br />Because of your newbie status you have been spared from the harsh reality of the forces.<br />It has cost you ' . $turns.' turn'.($turns==1?'':'s') . ' to navigate the minefield safely.';
122
+		$container['msg'] = 'You have just flown past a sprinkle of mines.<br />Because of your newbie status you have been spared from the harsh reality of the forces.<br />It has cost you ' . $turns . ' turn' . ($turns == 1 ? '' : 's') . ' to navigate the minefield safely.';
123 123
 		forward($container);
124 124
 	}
125 125
 	else {
Please login to merge, or discard this patch.
engine/Default/galactic_post_view_members.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,40 +1,40 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$template->assign('PageTopic','Viewing Members');
3
+$template->assign('PageTopic', 'Viewing Members');
4 4
 Menu::galactic_post();
5 5
 
6 6
 $container = array();
7 7
 $container['url'] = 'skeleton.php';
8 8
 $container['body'] = 'galactic_post_view_members.php';
9 9
 if ($action == 'Remove')
10
-	$db->query('DELETE FROM galactic_post_writer WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND account_id = '.$db->escapeNumber($var['id']));
10
+	$db->query('DELETE FROM galactic_post_writer WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND account_id = ' . $db->escapeNumber($var['id']));
11 11
 
12 12
 $db->query('SELECT * FROM galactic_post_writer WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' AND account_id != ' . $db->escapeNumber($player->getAccountID()));
13 13
 if ($db->getNumRows()) {
14 14
 
15
-	$PHP_OUTPUT.=create_table();
16
-	$PHP_OUTPUT.=('<tr>');
17
-	$PHP_OUTPUT.=('<th align="center">Player Name</th>');
18
-	$PHP_OUTPUT.=('<th align="center">Last Wrote</th>');
19
-	$PHP_OUTPUT.=('<th align="center">Options</th>');
20
-	$PHP_OUTPUT.=('</tr>');
15
+	$PHP_OUTPUT .= create_table();
16
+	$PHP_OUTPUT .= ('<tr>');
17
+	$PHP_OUTPUT .= ('<th align="center">Player Name</th>');
18
+	$PHP_OUTPUT .= ('<th align="center">Last Wrote</th>');
19
+	$PHP_OUTPUT .= ('<th align="center">Options</th>');
20
+	$PHP_OUTPUT .= ('</tr>');
21 21
 
22 22
 	while ($db->nextRecord()) {
23 23
 
24
-		$curr_writter =& SmrPlayer::getPlayer($db->getField('account_id'), $player->getGameID());
24
+		$curr_writter = & SmrPlayer::getPlayer($db->getField('account_id'), $player->getGameID());
25 25
 		$time = $db->getField('last_wrote');
26
-		$PHP_OUTPUT.=('<tr>');
27
-		$PHP_OUTPUT.=('<td align="center">'.$curr_writter->getPlayerName().'</td>');
28
-		$PHP_OUTPUT.=('<td align="center"> ' . date(DATE_FULL_SHORT, $time) . '</td>');
26
+		$PHP_OUTPUT .= ('<tr>');
27
+		$PHP_OUTPUT .= ('<td align="center">' . $curr_writter->getPlayerName() . '</td>');
28
+		$PHP_OUTPUT .= ('<td align="center"> ' . date(DATE_FULL_SHORT, $time) . '</td>');
29 29
 		$container['id'] = $curr_writter->getAccountID();
30
-		$PHP_OUTPUT.=create_echo_form($container);
31
-		$PHP_OUTPUT.=('<td>');
32
-		$PHP_OUTPUT.=create_submit('Remove');
33
-		$PHP_OUTPUT.=('</td>');
34
-		$PHP_OUTPUT.=('</tr>');
35
-		$PHP_OUTPUT.=('</form>');
30
+		$PHP_OUTPUT .= create_echo_form($container);
31
+		$PHP_OUTPUT .= ('<td>');
32
+		$PHP_OUTPUT .= create_submit('Remove');
33
+		$PHP_OUTPUT .= ('</td>');
34
+		$PHP_OUTPUT .= ('</tr>');
35
+		$PHP_OUTPUT .= ('</form>');
36 36
 
37 37
 	}
38
-	$PHP_OUTPUT.=('</table>');
38
+	$PHP_OUTPUT .= ('</table>');
39 39
 
40 40
 }
Please login to merge, or discard this patch.
engine/Default/game_join_processing.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 // trim input now
4 4
 $player_name = trim($_REQUEST['player_name']);
5 5
 
6
-if(!defined('NPC_SCRIPT') && strpos($player_name,'NPC')===0)
6
+if (!defined('NPC_SCRIPT') && strpos($player_name, 'NPC') === 0)
7 7
 	create_error('Player names cannot begin with "NPC".');
8 8
 
9 9
 $limited_char = 0;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 $race_id = $_REQUEST['race_id'];
32 32
 if (empty($race_id) || $race_id == 1)
33 33
 	create_error('Please choose a race!');
34
-if(!is_numeric($var['game_id']))
34
+if (!is_numeric($var['game_id']))
35 35
 	create_error('Game ID is not numeric');
36 36
 
37 37
 $gameID = $var['game_id'];
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 // does it cost something to join that game?
50 50
 $credits = Globals::getGameCreditsRequired($gameID);
51 51
 if ($credits > 0) {
52
-	if($account->getTotalSmrCredits() < $credits) {
52
+	if ($account->getTotalSmrCredits() < $credits) {
53 53
 		create_error('You do not have enough credits to join this game!');
54 54
 	}
55 55
 	$account->decreaseTotalSmrCredits($credits);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
 }
69 69
 else {
70 70
 	$startingNewbieTurns = STARTING_NEWBIE_TURNS_VET;
71
-	switch($race_id) {
71
+	switch ($race_id) {
72 72
 		case RACE_ALSKANT:
73 73
 			$ship_id = SHIP_TYPE_SMALL_TIMER;
74 74
 		break;
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 
124 124
 // insert into player table.
125 125
 $db->query('INSERT INTO player (account_id, game_id, player_id, player_name, race_id, ship_type_id, credits, alliance_id, sector_id, last_turn_update, last_cpl_action, last_active, newbie_turns, npc, newbie_status)
126
-			VALUES(' . $db->escapeNumber($account->getAccountID()) . ', ' . $db->escapeNumber($gameID) . ', '.$db->escapeNumber($player_id).', ' . $db->escapeString($player_name) . ', '.$db->escapeNumber($race_id).', '.$db->escapeNumber($ship_id).', '.$db->escapeNumber(Globals::getStartingCredits($gameID)).', '.$db->escapeNumber($alliance_id).', '.$db->escapeNumber($home_sector_id).', '.$db->escapeNumber($last_turn_update).', ' . $db->escapeNumber(TIME) . ', ' . $db->escapeNumber(TIME) . ',' . $db->escapeNumber($startingNewbieTurns) . ',' . $db->escapeBoolean(defined('NPC_SCRIPT')) . ',' . $db->escapeBoolean($isNewbie) . ')');
126
+			VALUES(' . $db->escapeNumber($account->getAccountID()) . ', ' . $db->escapeNumber($gameID) . ', ' . $db->escapeNumber($player_id) . ', ' . $db->escapeString($player_name) . ', ' . $db->escapeNumber($race_id) . ', ' . $db->escapeNumber($ship_id) . ', ' . $db->escapeNumber(Globals::getStartingCredits($gameID)) . ', ' . $db->escapeNumber($alliance_id) . ', ' . $db->escapeNumber($home_sector_id) . ', ' . $db->escapeNumber($last_turn_update) . ', ' . $db->escapeNumber(TIME) . ', ' . $db->escapeNumber(TIME) . ',' . $db->escapeNumber($startingNewbieTurns) . ',' . $db->escapeBoolean(defined('NPC_SCRIPT')) . ',' . $db->escapeBoolean($isNewbie) . ')');
127 127
 
128 128
 $db->unlock();
129 129
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 $ship->setShields($amount_shields, true);
135 135
 $ship->setArmour($amount_armour, true);
136 136
 $ship->setCargoHolds(40);
137
-$ship->addWeapon(46);  // Laser
137
+$ship->addWeapon(46); // Laser
138 138
 
139 139
 // The `player_visited_sector` table holds *unvisited* sectors, so that once
140 140
 // all sectors are visited (the majority of the game), the table is empty.
@@ -150,14 +150,14 @@  discard block
 block discarded – undo
150 150
 	$player->joinAlliance(NHA_ID);
151 151
 
152 152
 	//we need to send them some messages
153
-	$message = 'Welcome to Space Merchant Realms! You have been automatically placed into the <u>[alliance='.NHA_ID.']</u>, which is led by a veteran player who can assist you while you learn the basics of the game. Your alliance leader is denoted with a star on your alliance roster.<br />
154
-	For more tips to help you get started with the game, check out your alliance message boards. These can be reached by clicking the "Alliance" link on the left side of the page, and then clicking the "Message Board" menu link. The <u><a href="'.WIKI_URL.'" target="_blank">SMR Wiki</a></u> also gives detailed information on all aspects of the game.<br />
153
+	$message = 'Welcome to Space Merchant Realms! You have been automatically placed into the <u>[alliance=' . NHA_ID . ']</u>, which is led by a veteran player who can assist you while you learn the basics of the game. Your alliance leader is denoted with a star on your alliance roster.<br />
154
+	For more tips to help you get started with the game, check out your alliance message boards. These can be reached by clicking the "Alliance" link on the left side of the page, and then clicking the "Message Board" menu link. The <u><a href="'.WIKI_URL . '" target="_blank">SMR Wiki</a></u> also gives detailed information on all aspects of the game.<br />
155 155
 	SMR is integrated with both IRC and Discord. These are free chat services where you can talk to other players and coordinate with your alliance. Simply click the "Join Chat" link at the bottom left panel of the page.';
156 156
 
157 157
 	SmrPlayer::sendMessageFromAdmin($gameID, $account->getAccountID(), $message);
158 158
 }
159 159
 
160
-if($race_id == RACE_ALSKANT) { // Give Alskants 250 personal relations to start.
160
+if ($race_id == RACE_ALSKANT) { // Give Alskants 250 personal relations to start.
161 161
 	foreach (Globals::getRaces() as $raceID => $raceInfo) {
162 162
 		$player->setRelations(250, $raceID);
163 163
 	}
Please login to merge, or discard this patch.
engine/Default/mission_claim_processing.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 if ($var['MissionID']) {
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
 $rewardText = $player->claimMissionReward($var['MissionID']);
Please login to merge, or discard this patch.
engine/Default/bank_anon_detail.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 SmrSession::getRequestVar('maxValue');
9 9
 SmrSession::getRequestVar('minValue');
10 10
 
11
-$template->assign('PageTopic', 'Anonymous Account #'.$account_num);
11
+$template->assign('PageTopic', 'Anonymous Account #' . $account_num);
12 12
 Menu::bank();
13 13
 
14 14
 $db->query('SELECT *
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	$minValue = max(1, $maxValue - 5);
49 49
 }
50 50
 
51
-if(isset($var['minValue'])
51
+if (isset($var['minValue'])
52 52
 	&& $var['minValue'] <= $maxValue
53 53
 	&& $var['minValue'] > 0
54 54
 	&& is_numeric($var['minValue'])) {
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 	$transactions = [];
86 86
 	while ($db->nextRecord()) {
87 87
 		$container['player_id'] = $db->getInt('player_id');
88
-		$link = create_link($container, get_colored_text($db->getInt('alignment'),$db->getField('player_name')));
88
+		$link = create_link($container, get_colored_text($db->getInt('alignment'), $db->getField('player_name')));
89 89
 		$transaction = $db->getField('transaction');
90 90
 		$amount = number_format($db->getInt('amount'));
91 91
 		$transactions[$db->getInt('transaction_id')] = [
Please login to merge, or discard this patch.
engine/Default/council_vote.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 	create_error('You have to be on the council in order to vote.');
5 5
 }
6 6
 
7
-$template->assign('PageTopic','Ruling Council Of '.$player->getRaceName());
7
+$template->assign('PageTopic', 'Ruling Council Of ' . $player->getRaceName());
8 8
 Menu::council($player->getRaceID());
9 9
 
10 10
 // determine for what we voted
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
 				AND game_id = ' . $db->escapeNumber($player->getGameID()));
14 14
 $votedForRace = -1;
15 15
 if ($db->nextRecord()) {
16
-	$votedForRace	= $db->getField('race_id_2');
17
-	$votedFor		= $db->getField('action');
16
+	$votedForRace = $db->getField('race_id_2');
17
+	$votedFor = $db->getField('action');
18 18
 }
19 19
 
20 20
 $voteRelations = array();
21 21
 $globalRelations = Globals::getRaceRelations($player->getGameID(), $player->getRaceID());
22 22
 foreach (Globals::getRaces() as $raceID => $raceInfo) {
23
-	if($raceID == RACE_NEUTRAL || $raceID == $player->getRaceID())
23
+	if ($raceID == RACE_NEUTRAL || $raceID == $player->getRaceID())
24 24
 		continue;
25 25
 	$container = create_container('council_vote_processing.php', '', array('race_id' => $raceID));
26 26
 	$voteRelations[$raceID] = array(
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 $voteTreaties = array();
36 36
 $db->query('SELECT * FROM race_has_voting
37
-			WHERE '.$db->escapeNumber(TIME).' < end_time
37
+			WHERE '.$db->escapeNumber(TIME) . ' < end_time
38 38
 			AND game_id = ' . $db->escapeNumber($player->getGameID()) . '
39 39
 			AND race_id_1 = ' . $db->escapeNumber($player->getRaceID()));
40 40
 if ($db->getNumRows() > 0) {
Please login to merge, or discard this patch.
engine/Default/death_processing.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,4 +3,4 @@
 block discarded – undo
3 3
 $player->deletePlottedCourse();
4 4
 
5 5
 $account->log(LOG_TYPE_TRADER_COMBAT, 'Player sees death screen', $player->getSectorID());
6
-forward(create_container('skeleton.php','death.php'));
6
+forward(create_container('skeleton.php', 'death.php'));
Please login to merge, or discard this patch.
engine/Default/course_destination_button_processing.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 $type = trim($_POST['type']);
4 4
 
5
-switch($type){
5
+switch ($type) {
6 6
 	case 'add':
7 7
 		$sectorId = trim($_POST['sectorId']);
8 8
 		$label = trim($_POST['label']);
Please login to merge, or discard this patch.
engine/Default/alliance_roles_save_processing.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(count($_REQUEST['role']) > 0) {
2
+if (count($_REQUEST['role']) > 0) {
3 3
 	foreach ($_REQUEST['role'] as $accountID => $roleID) {
4 4
 		$db->query('REPLACE INTO player_has_alliance_role
5 5
 					(account_id, game_id, role_id, alliance_id)
@@ -7,6 +7,6 @@  discard block
 block discarded – undo
7 7
 	}
8 8
 }
9 9
 
10
-$container=create_container('skeleton.php','alliance_roster.php');
10
+$container = create_container('skeleton.php', 'alliance_roster.php');
11 11
 $container['action'] = 'Show Alliance Roles';
12 12
 forward($container);
Please login to merge, or discard this patch.