We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | $amount = $_REQUEST['amount']; |
5 | 5 | if (empty($exp) || empty($message) || empty($amount)) |
6 | 6 | create_error('You left some value blank.'); |
7 | -if(!is_numeric($amount)) { |
|
7 | +if (!is_numeric($amount)) { |
|
8 | 8 | create_error('Articles per day must be a number.'); |
9 | 9 | } |
10 | 10 | if ($exp == 1) |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | if ($db->nextRecord()) |
16 | 16 | create_error('You have already applied once. Please be patient and your application will be answered at a later time.'); |
17 | 17 | |
18 | -$db->query('INSERT INTO galactic_post_applications (game_id, account_id, description, written_before, articles_per_day) VALUES (' . $db->escapeNumber($player->getGameID()) . ', ' . $db->escapeNumber($player->getAccountID()) . ', ' . $db->escapeString($message) . ', '.$db->escapeString($value).', '.$db->escapeNumber($amount).')'); |
|
18 | +$db->query('INSERT INTO galactic_post_applications (game_id, account_id, description, written_before, articles_per_day) VALUES (' . $db->escapeNumber($player->getGameID()) . ', ' . $db->escapeNumber($player->getAccountID()) . ', ' . $db->escapeString($message) . ', ' . $db->escapeString($value) . ', ' . $db->escapeNumber($amount) . ')'); |
|
19 | 19 | |
20 | 20 | $container = create_container('skeleton.php', 'current_sector.php'); |
21 | 21 | $container['msg'] = 'Thank you for your application. It has been sent to the main editor and he will let you know if you have been accepted.'; |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$account->log(LOG_TYPE_LOGIN, 'logged off from '.getIpAddress()); |
|
3 | +$account->log(LOG_TYPE_LOGIN, 'logged off from ' . getIpAddress()); |
|
4 | 4 | |
5 | 5 | // Remove the lock if we're holding one (ie logged off from game screen) |
6 | -if($lock) { |
|
6 | +if ($lock) { |
|
7 | 7 | release_lock(); |
8 | 8 | } |
9 | 9 | SmrSession::destroy(); |
@@ -5,11 +5,11 @@ discard block |
||
5 | 5 | |
6 | 6 | if ($player->hasNewbieTurns()) |
7 | 7 | create_error('You are under newbie protection!'); |
8 | -if($player->hasFederalProtection()) |
|
8 | +if ($player->hasFederalProtection()) |
|
9 | 9 | create_error('You are under federal protection.'); |
10 | -if($player->isLandedOnPlanet()) |
|
10 | +if ($player->isLandedOnPlanet()) |
|
11 | 11 | create_error('You cannot attack forces whilst on a planet!'); |
12 | -if(!$player->canFight()) |
|
12 | +if (!$player->canFight()) |
|
13 | 13 | create_error('You are not allowed to fight!'); |
14 | 14 | if ($player->forceNAPAlliance($forceOwner)) |
15 | 15 | create_error('You cannot attack allied forces!'); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | if (!$forces->hasMines()) |
29 | 29 | create_error('No mines in sector!'); |
30 | 30 | } else { |
31 | - if(!$forces->exists()) |
|
31 | + if (!$forces->exists()) |
|
32 | 32 | create_error('These forces no longer exist.'); |
33 | 33 | if ($player->getTurns() < $forces->getAttackTurnCost($ship)) |
34 | 34 | create_error('You do not have enough turns to attack these forces!'); |
@@ -72,18 +72,18 @@ discard block |
||
72 | 72 | |
73 | 73 | // If mines are bumped, the forces shoot first. Otherwise player shoots first. |
74 | 74 | if ($bump) { |
75 | - $results['Forces'] =& $forces->shootPlayers($attackers, $bump); |
|
75 | + $results['Forces'] = & $forces->shootPlayers($attackers, $bump); |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | $results['Attackers'] = array('TotalDamage' => 0); |
79 | 79 | foreach ($attackers as $attacker) { |
80 | - $playerResults =& $attacker->shootForces($forces); |
|
81 | - $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; |
|
80 | + $playerResults = & $attacker->shootForces($forces); |
|
81 | + $results['Attackers']['Traders'][$attacker->getAccountID()] = & $playerResults; |
|
82 | 82 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; |
83 | 83 | } |
84 | 84 | |
85 | 85 | if (!$bump) { |
86 | - $results['Forces'] =& $forces->shootPlayers($attackers, $bump); |
|
86 | + $results['Forces'] = & $forces->shootPlayers($attackers, $bump); |
|
87 | 87 | $forces->updateExpire(); |
88 | 88 | } |
89 | 89 | |
@@ -96,20 +96,20 @@ discard block |
||
96 | 96 | $logId = $db->getInsertID(); |
97 | 97 | |
98 | 98 | if ($sendMessage) { |
99 | - $message = 'Your forces in sector '.Globals::getSectorBBLink($forces->getSectorID()).' are under <span class="red">attack</span> by '.$player->getBBLink().'! [combatlog='.$logId.']'; |
|
99 | + $message = 'Your forces in sector ' . Globals::getSectorBBLink($forces->getSectorID()) . ' are under <span class="red">attack</span> by ' . $player->getBBLink() . '! [combatlog=' . $logId . ']'; |
|
100 | 100 | $forces->ping($message, $player, true); |
101 | 101 | } |
102 | 102 | |
103 | 103 | $container = create_container('skeleton.php', 'forces_attack.php'); |
104 | 104 | |
105 | 105 | // If their target is dead there is no continue attack button |
106 | -if($forces->exists()) |
|
106 | +if ($forces->exists()) |
|
107 | 107 | $container['owner_id'] = $forces->getOwnerID(); |
108 | 108 | else |
109 | 109 | $container['owner_id'] = 0; |
110 | 110 | |
111 | 111 | // If they died on the shot they get to see the results |
112 | -if($player->isDead()) { |
|
112 | +if ($player->isDead()) { |
|
113 | 113 | $container['override_death'] = TRUE; |
114 | 114 | $container['owner_id'] = 0; |
115 | 115 | } |
@@ -10,9 +10,9 @@ |
||
10 | 10 | $game_id = $var['view_game_id']; |
11 | 11 | $id = $var['alliance_id']; |
12 | 12 | $db = new $var['HistoryDatabase'](); |
13 | -$db->query('SELECT * FROM alliance WHERE alliance_id = '.$db->escapeNumber($id).' AND game_id = '.$db->escapeNumber($game_id)); |
|
13 | +$db->query('SELECT * FROM alliance WHERE alliance_id = ' . $db->escapeNumber($id) . ' AND game_id = ' . $db->escapeNumber($game_id)); |
|
14 | 14 | $db->nextRecord(); |
15 | -$template->assign('PageTopic','Alliance Roster - ' . stripslashes($db->getField('alliance_name'))); |
|
15 | +$template->assign('PageTopic', 'Alliance Roster - ' . stripslashes($db->getField('alliance_name'))); |
|
16 | 16 | |
17 | 17 | //get alliance members |
18 | 18 | $db->query('SELECT * FROM player WHERE alliance_id = ' . $db->escapeNumber($id) . ' AND game_id = ' . $db->escapeNumber($game_id) . ' ORDER BY experience DESC'); |
@@ -9,14 +9,14 @@ |
||
9 | 9 | $NHLAmount = ($prize - 1000000) / 9; |
10 | 10 | $db->query('UPDATE player SET bank = bank + ' . $db->escapeNumber($NHLAmount) . ' WHERE account_id = ' . $db->escapeNumber(ACCOUNT_ID_NHL) . ' AND game_id = ' . $db->escapeNumber($player->getGameID())); |
11 | 11 | $player->increaseCredits($prize); |
12 | - $player->increaseHOF($prize,array('Bar','Lotto','Money','Claimed'), HOF_PUBLIC); |
|
13 | - $player->increaseHOF(1,array('Bar','Lotto','Results','Claims'), HOF_PUBLIC); |
|
12 | + $player->increaseHOF($prize, array('Bar', 'Lotto', 'Money', 'Claimed'), HOF_PUBLIC); |
|
13 | + $player->increaseHOF(1, array('Bar', 'Lotto', 'Results', 'Claims'), HOF_PUBLIC); |
|
14 | 14 | $message .= '<div align="center">You have claimed <span class="red">$' . number_format($prize) . '</span>!<br /></div><br />'; |
15 | 15 | $db->query('DELETE FROM player_has_ticket WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' |
16 | 16 | AND account_id = ' . $db->escapeNumber($player->getAccountID()) . ' AND prize = ' . $db->escapeNumber($prize) . ' AND time = 0 LIMIT 1'); |
17 | - $db->query('DELETE FROM news WHERE type = \'lotto\' AND game_id = '.$db->escapeNumber($player->getGameID())); |
|
17 | + $db->query('DELETE FROM news WHERE type = \'lotto\' AND game_id = ' . $db->escapeNumber($player->getGameID())); |
|
18 | 18 | } |
19 | 19 | //offer another drink and such |
20 | -$container=create_container('skeleton.php','bar_main.php'); |
|
20 | +$container = create_container('skeleton.php', 'bar_main.php'); |
|
21 | 21 | $container['message'] = $message; |
22 | 22 | forward($container); |
@@ -1,4 +1,4 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -$template->assign('ChessGame',ChessGame::getChessGame($var['ChessGameID'])); |
|
4 | -$template->assign('ChessMoveHREF',SmrSession::getNewHREF(create_container('chess_move_processing.php','',array('AJAX' => true, 'ChessGameID' => $var['ChessGameID'])))); |
|
3 | +$template->assign('ChessGame', ChessGame::getChessGame($var['ChessGameID'])); |
|
4 | +$template->assign('ChessMoveHREF', SmrSession::getNewHREF(create_container('chess_move_processing.php', '', array('AJAX' => true, 'ChessGameID' => $var['ChessGameID'])))); |
@@ -1,19 +1,19 @@ 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 | -$template->assign('PageTopic','Current News'); |
|
5 | +$template->assign('PageTopic', 'Current News'); |
|
6 | 6 | Menu::news($template); |
7 | 7 | |
8 | 8 | require_once(get_file_loc('news.functions.inc')); |
9 | -doBreakingNewsAssign($gameID,$template); |
|
10 | -doLottoNewsAssign($gameID,$template); |
|
9 | +doBreakingNewsAssign($gameID, $template); |
|
10 | +doLottoNewsAssign($gameID, $template); |
|
11 | 11 | |
12 | 12 | |
13 | -if(!isset($var['LastNewsUpdate'])) |
|
14 | - SmrSession::updateVar('LastNewsUpdate',$player->getLastNewsUpdate()); |
|
13 | +if (!isset($var['LastNewsUpdate'])) |
|
14 | + SmrSession::updateVar('LastNewsUpdate', $player->getLastNewsUpdate()); |
|
15 | 15 | |
16 | -$db->query('SELECT * FROM news WHERE game_id = '.$db->escapeNumber($gameID).' AND time > '.$db->escapeNumber($var['LastNewsUpdate']).' AND type != \'lotto\' ORDER BY news_id DESC'); |
|
16 | +$db->query('SELECT * FROM news WHERE game_id = ' . $db->escapeNumber($gameID) . ' AND time > ' . $db->escapeNumber($var['LastNewsUpdate']) . ' AND type != \'lotto\' ORDER BY news_id DESC'); |
|
17 | 17 | $player->updateLastNewsUpdate(); |
18 | 18 | |
19 | 19 | if ($db->getNumRows()) { |
@@ -21,5 +21,5 @@ discard block |
||
21 | 21 | while ($db->nextRecord()) { |
22 | 22 | $NewsItems[] = array('Time' => $db->getField('time'), 'Message' => bbifyMessage($db->getField('news_message'))); |
23 | 23 | } |
24 | - $template->assign('NewsItems',$NewsItems); |
|
24 | + $template->assign('NewsItems', $NewsItems); |
|
25 | 25 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!$player->getSector()->hasLocation($var['LocationID'])) { |
|
3 | +if (!$player->getSector()->hasLocation($var['LocationID'])) { |
|
4 | 4 | create_error('That location does not exist in this sector'); |
5 | 5 | } |
6 | 6 | |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | $container['body'] = 'government.php'; |
12 | 12 | $type = 'HQ'; |
13 | 13 | } |
14 | -else if($location->isUG()) { |
|
14 | +else if ($location->isUG()) { |
|
15 | 15 | $container['body'] = 'underground.php'; |
16 | 16 | $type = 'UG'; |
17 | 17 | } |
@@ -41,16 +41,16 @@ discard block |
||
41 | 41 | $player->decreaseCredits($amount); |
42 | 42 | $account->decreaseSmrCredits($smrCredits); |
43 | 43 | |
44 | -$player->increaseHOF($smrCredits,array('Bounties','Placed','SMR Credits'), HOF_PUBLIC); |
|
45 | -$player->increaseHOF($amount,array('Bounties','Placed','Money'), HOF_PUBLIC); |
|
46 | -$player->increaseHOF(1,array('Bounties','Placed','Number'), HOF_PUBLIC); |
|
44 | +$player->increaseHOF($smrCredits, array('Bounties', 'Placed', 'SMR Credits'), HOF_PUBLIC); |
|
45 | +$player->increaseHOF($amount, array('Bounties', 'Placed', 'Money'), HOF_PUBLIC); |
|
46 | +$player->increaseHOF(1, array('Bounties', 'Placed', 'Number'), HOF_PUBLIC); |
|
47 | 47 | |
48 | 48 | $placed = SmrPlayer::getPlayer($account_id, $player->getGameID()); |
49 | -$placed->increaseCurrentBountyAmount($type,$amount); |
|
50 | -$placed->increaseCurrentBountySmrCredits($type,$smrCredits); |
|
51 | -$placed->increaseHOF($smrCredits,array('Bounties','Received','SMR Credits'), HOF_PUBLIC); |
|
52 | -$placed->increaseHOF($amount,array('Bounties','Received','Money'), HOF_PUBLIC); |
|
53 | -$placed->increaseHOF(1,array('Bounties','Received','Number'), HOF_PUBLIC); |
|
49 | +$placed->increaseCurrentBountyAmount($type, $amount); |
|
50 | +$placed->increaseCurrentBountySmrCredits($type, $smrCredits); |
|
51 | +$placed->increaseHOF($smrCredits, array('Bounties', 'Received', 'SMR Credits'), HOF_PUBLIC); |
|
52 | +$placed->increaseHOF($amount, array('Bounties', 'Received', 'Money'), HOF_PUBLIC); |
|
53 | +$placed->increaseHOF(1, array('Bounties', 'Received', 'Number'), HOF_PUBLIC); |
|
54 | 54 | |
55 | 55 | //Update for top bounties list |
56 | 56 | $player->update(); |
@@ -4,11 +4,11 @@ discard block |
||
4 | 4 | if ($player->getAlignment() <= ALIGNMENT_EVIL) { |
5 | 5 | create_error('You are not allowed to enter our Government HQ!'); |
6 | 6 | } |
7 | -if(!$player->getSector()->hasLocation($var['LocationID'])) { |
|
7 | +if (!$player->getSector()->hasLocation($var['LocationID'])) { |
|
8 | 8 | create_error('That location does not exist in this sector'); |
9 | 9 | } |
10 | 10 | $location = SmrLocation::getLocation($var['LocationID']); |
11 | -if(!$location->isHQ()) { |
|
11 | +if (!$location->isHQ()) { |
|
12 | 12 | create_error('There is no headquarters. Obviously.'); |
13 | 13 | } |
14 | 14 | $raceID = $location->getRaceID(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | if ($raceID != RACE_NEUTRAL) { |
29 | 29 | $races = Globals::getRaces(); |
30 | 30 | $raceRelations = Globals::getRaceRelations($player->getGameID(), $raceID); |
31 | - foreach($raceRelations as $otherRaceID => $relation) { |
|
31 | + foreach ($raceRelations as $otherRaceID => $relation) { |
|
32 | 32 | if ($relation <= RELATIONS_WAR) { |
33 | 33 | $warRaces[] = $races[$otherRaceID]['Race Name']; |
34 | 34 | } |