We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -1,30 +1,30 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | 3 | class DummyPlayer extends AbstractSmrPlayer { |
4 | - public function __construct($gameID=0,$playerName='Dummy',$raceID=1,$experience=1000,$alignment=100,$allianceID=0,$shipTypeID=60) { |
|
4 | + public function __construct($gameID = 0, $playerName = 'Dummy', $raceID = 1, $experience = 1000, $alignment = 100, $allianceID = 0, $shipTypeID = 60) { |
|
5 | 5 | $this->accountID = 0; |
6 | - $this->gameID = (int) $gameID; |
|
7 | - $this->playerName = (string) $playerName; |
|
6 | + $this->gameID = (int)$gameID; |
|
7 | + $this->playerName = (string)$playerName; |
|
8 | 8 | $this->playerID = 0; |
9 | 9 | $this->sectorID = 0; |
10 | - $this->lastSectorID = 0; |
|
10 | + $this->lastSectorID = 0; |
|
11 | 11 | $this->turns = 1000; |
12 | - $this->newbieTurns = 0; |
|
12 | + $this->newbieTurns = 0; |
|
13 | 13 | $this->lastNewsUpdate = 0; |
14 | 14 | $this->dead = false; |
15 | 15 | $this->landedOnPlanet = false; |
16 | - $this->lastActive = 0; |
|
17 | - $this->lastCPLAction = 0; |
|
18 | - $this->raceID = (int) $raceID; |
|
19 | - $this->credits = 0; |
|
20 | - $this->experience = (int) $experience; |
|
21 | - $this->alignment = (int) $alignment; |
|
22 | - $this->militaryPayment = 0; |
|
23 | - $this->allianceID = (int) $allianceID; |
|
24 | - $this->shipID = (int) $shipTypeID; |
|
16 | + $this->lastActive = 0; |
|
17 | + $this->lastCPLAction = 0; |
|
18 | + $this->raceID = (int)$raceID; |
|
19 | + $this->credits = 0; |
|
20 | + $this->experience = (int)$experience; |
|
21 | + $this->alignment = (int)$alignment; |
|
22 | + $this->militaryPayment = 0; |
|
23 | + $this->allianceID = (int)$allianceID; |
|
24 | + $this->shipID = (int)$shipTypeID; |
|
25 | 25 | $this->kills = 0; |
26 | 26 | $this->deaths = 0; |
27 | - $this->lastPort = 0; |
|
27 | + $this->lastPort = 0; |
|
28 | 28 | $this->bank = 0; |
29 | 29 | $this->zoom = 0; |
30 | 30 | |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | public function setAllianceID($ID) { |
51 | - if($this->allianceID == $ID) |
|
51 | + if ($this->allianceID == $ID) |
|
52 | 52 | return; |
53 | - $this->allianceID=$ID; |
|
53 | + $this->allianceID = $ID; |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | public function &killPlayerByPlayer(AbstractSmrPlayer $killer) { |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | $db = new SmrMySqlDatabase(); |
77 | 77 | $db->query('REPLACE INTO cached_dummys ' . |
78 | 78 | '(type, id, info) ' . |
79 | - 'VALUES (\'DummyPlayer\', '.$db->escapeString($this->getPlayerName()).', '.$db->escapeString($cache).')'); |
|
79 | + 'VALUES (\'DummyPlayer\', ' . $db->escapeString($this->getPlayerName()) . ', ' . $db->escapeString($cache) . ')'); |
|
80 | 80 | unserialize($cache); |
81 | 81 | } |
82 | 82 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $db->query('SELECT info FROM cached_dummys |
86 | 86 | WHERE type = \'DummyPlayer\' |
87 | 87 | AND id = ' . $db->escapeString($name) . ' LIMIT 1'); |
88 | - if($db->nextRecord()) { |
|
88 | + if ($db->nextRecord()) { |
|
89 | 89 | $return = unserialize($db->getField('info')); |
90 | 90 | return $return; |
91 | 91 | } |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | $db->query('SELECT id FROM cached_dummys |
101 | 101 | WHERE type = \'DummyPlayer\''); |
102 | 102 | $dummyNames = array(); |
103 | - while($db->nextRecord()) { |
|
103 | + while ($db->nextRecord()) { |
|
104 | 104 | $dummyNames[] = $db->getField('id'); |
105 | 105 | } |
106 | 106 | return $dummyNames; |
@@ -266,7 +266,7 @@ discard block |
||
266 | 266 | /** |
267 | 267 | * Insert a new player into the database. Returns the new player object. |
268 | 268 | */ |
269 | - public static function createPlayer($accountID, $gameID, $playerName, $raceID, $isNewbie, $npc=false) { |
|
269 | + public static function createPlayer($accountID, $gameID, $playerName, $raceID, $isNewbie, $npc = false) { |
|
270 | 270 | $db = new SmrMySqlDatabase(); |
271 | 271 | $db->lockTable('player'); |
272 | 272 | |
@@ -1646,7 +1646,7 @@ discard block |
||
1646 | 1646 | create_error('The saved sector must be in the box!'); |
1647 | 1647 | } |
1648 | 1648 | |
1649 | - $storedDestinations =& $this->getStoredDestinations(); |
|
1649 | + $storedDestinations = & $this->getStoredDestinations(); |
|
1650 | 1650 | foreach ($storedDestinations as &$sd) { |
1651 | 1651 | if ($sd['SectorID'] == $sectorID) { |
1652 | 1652 | $sd['OffsetTop'] = $offsetTop; |
@@ -1973,13 +1973,13 @@ discard block |
||
1973 | 1973 | $this->db->query('SELECT type,amount FROM player_hof WHERE ' . $this->SQL); |
1974 | 1974 | $this->HOF = array(); |
1975 | 1975 | while ($this->db->nextRecord()) { |
1976 | - $hof =& $this->HOF; |
|
1976 | + $hof = & $this->HOF; |
|
1977 | 1977 | $typeList = explode(':', $this->db->getField('type')); |
1978 | 1978 | foreach ($typeList as $type) { |
1979 | 1979 | if (!isset($hof[$type])) { |
1980 | 1980 | $hof[$type] = array(); |
1981 | 1981 | } |
1982 | - $hof =& $hof[$type]; |
|
1982 | + $hof = & $hof[$type]; |
|
1983 | 1983 | } |
1984 | 1984 | $hof = $this->db->getFloat('amount'); |
1985 | 1985 | } |
@@ -2058,8 +2058,8 @@ discard block |
||
2058 | 2058 | } |
2059 | 2059 | self::$HOFVis[$hofType] = $visibility; |
2060 | 2060 | |
2061 | - $hof =& $this->HOF; |
|
2062 | - $hofChanged =& $this->hasHOFChanged; |
|
2061 | + $hof = & $this->HOF; |
|
2062 | + $hofChanged = & $this->hasHOFChanged; |
|
2063 | 2063 | $new = false; |
2064 | 2064 | foreach ($typeList as $type) { |
2065 | 2065 | if (!isset($hofChanged[$type])) { |
@@ -2069,8 +2069,8 @@ discard block |
||
2069 | 2069 | $hof[$type] = array(); |
2070 | 2070 | $new = true; |
2071 | 2071 | } |
2072 | - $hof =& $hof[$type]; |
|
2073 | - $hofChanged =& $hofChanged[$type]; |
|
2072 | + $hof = & $hof[$type]; |
|
2073 | + $hofChanged = & $hofChanged[$type]; |
|
2074 | 2074 | } |
2075 | 2075 | if ($hofChanged == null) { |
2076 | 2076 | $hofChanged = self::HOF_CHANGED; |
@@ -2681,7 +2681,7 @@ discard block |
||
2681 | 2681 | } |
2682 | 2682 | |
2683 | 2683 | private function setupMissionStep($missionID) { |
2684 | - $mission =& $this->missions[$missionID]; |
|
2684 | + $mission = & $this->missions[$missionID]; |
|
2685 | 2685 | if ($mission['On Step'] >= count(MISSIONS[$missionID]['Steps'])) { |
2686 | 2686 | // Nothing to do if this mission is already completed |
2687 | 2687 | return; |
@@ -2726,7 +2726,7 @@ discard block |
||
2726 | 2726 | 'Starting Sector' => $this->getSectorID() |
2727 | 2727 | ); |
2728 | 2728 | |
2729 | - $this->missions[$missionID] =& $mission; |
|
2729 | + $this->missions[$missionID] = & $mission; |
|
2730 | 2730 | $this->setupMissionStep($missionID); |
2731 | 2731 | $this->rebuildMission($missionID); |
2732 | 2732 | |
@@ -2783,7 +2783,7 @@ discard block |
||
2783 | 2783 | |
2784 | 2784 | public function claimMissionReward($missionID) { |
2785 | 2785 | $this->getMissions(); |
2786 | - $mission =& $this->missions[$missionID]; |
|
2786 | + $mission = & $this->missions[$missionID]; |
|
2787 | 2787 | if ($mission === false) { |
2788 | 2788 | throw new Exception('Unknown mission: ' . $missionID); |
2789 | 2789 | } |
@@ -1,10 +1,10 @@ |
||
1 | -<?php if(isset($Preview)) { ?><table class="standard"><tr><td><?php echo bbifyMessage($Preview); ?></td></tr></table><?php } ?> |
|
1 | +<?php if (isset($Preview)) { ?><table class="standard"><tr><td><?php echo bbifyMessage($Preview); ?></td></tr></table><?php } ?> |
|
2 | 2 | <form name="MessageSendForm" method="POST" action="<?php echo $MessageSendFormHref; ?>"> |
3 | 3 | <p> |
4 | 4 | <b>From: </b><?php echo $ThisPlayer->getDisplayName(); ?><br /> |
5 | - <b>To: </b><?php if(isset($Receiver) && is_object($Receiver)) { echo $Receiver->getDisplayName(); } else { echo $Receiver; } ?> |
|
5 | + <b>To: </b><?php if (isset($Receiver) && is_object($Receiver)) { echo $Receiver->getDisplayName(); } else { echo $Receiver; } ?> |
|
6 | 6 | </p> |
7 | - <textarea spellcheck="true" name="message" required><?php if(isset($Preview)) { echo $Preview; } ?></textarea><br /> |
|
7 | + <textarea spellcheck="true" name="message" required><?php if (isset($Preview)) { echo $Preview; } ?></textarea><br /> |
|
8 | 8 | <br /> |
9 | 9 | <input type="submit" name="action" value="Send message" /> <input type="submit" name="action" value="Preview message" /> |
10 | 10 | </form> |
@@ -3,10 +3,10 @@ |
||
3 | 3 | // Holds information linking the received message and the game data |
4 | 4 | class GameLink |
5 | 5 | { |
6 | - public $valid = false; // identifies if the message is linked to game data |
|
7 | - public $account; // SmrAccount instance |
|
8 | - public $alliance; // SmrAlliance instance |
|
9 | - public $player; // SmrPlayer instance |
|
6 | + public $valid = false; // identifies if the message is linked to game data |
|
7 | + public $account; // SmrAccount instance |
|
8 | + public $alliance; // SmrAlliance instance |
|
9 | + public $player; // SmrPlayer instance |
|
10 | 10 | |
11 | 11 | // $author can be either Discord\Parts\User\{User,Member} |
12 | 12 | function __construct(Discord\Parts\Channel\Channel $channel, $author) { |
@@ -33,7 +33,7 @@ |
||
33 | 33 | $query = "SELECT table_name FROM information_schema.tables WHERE table_rows > 0 AND TABLE_SCHEMA='smr_live'"; |
34 | 34 | $rs = self::$conn->query($query); |
35 | 35 | $all = $rs->fetch_all(); |
36 | - array_walk_recursive($all, function ($a) { |
|
36 | + array_walk_recursive($all, function($a) { |
|
37 | 37 | self::$defaultPopulatedTables[] = "'" . $a . "'"; |
38 | 38 | }); |
39 | 39 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | public function __construct() { |
11 | 11 | if (!self::$dbConn) { |
12 | 12 | // Set the mysqli driver to raise exceptions on errors |
13 | - if (!mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT)) { |
|
13 | + if (!mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT)) { |
|
14 | 14 | $this->error('Failed to enable mysqli error reporting'); |
15 | 15 | } |
16 | 16 | $mysqlProperties = new MySqlProperties(); |
@@ -58,8 +58,8 @@ discard block |
||
58 | 58 | |
59 | 59 | $totalShieldDamage = 0; |
60 | 60 | foreach ($attackers as $attacker) { |
61 | - $playerResults =& $attacker->shootPlanet($planet, false); |
|
62 | - $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; |
|
61 | + $playerResults = & $attacker->shootPlanet($planet, false); |
|
62 | + $results['Attackers']['Traders'][$attacker->getAccountID()] = & $playerResults; |
|
63 | 63 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; |
64 | 64 | foreach ($playerResults['Weapons'] as $weapon) { |
65 | 65 | if (isset($weapon['ActualDamage'])) { // Only set if the weapon hits |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $downgradeDamage = $results['Attackers']['TotalDamage'] - $totalShieldDamage; |
73 | 73 | $results['Attackers']['Downgrades'] = $planet->checkForDowngrade($downgradeDamage); |
74 | 74 | |
75 | -$results['Planet'] =& $planet->shootPlayers($attackers); |
|
75 | +$results['Planet'] = & $planet->shootPlayers($attackers); |
|
76 | 76 | |
77 | 77 | $account->log(LOG_TYPE_PLANET_BUSTING, 'Player attacks planet, the planet does ' . $results['Planet']['TotalDamage'] . ', their team does ' . $results['Attackers']['TotalDamage'] . ' and downgrades: ' . var_export($results['Attackers']['Downgrades'], true), $planet->getSectorID()); |
78 | 78 |
@@ -53,8 +53,8 @@ discard block |
||
53 | 53 | |
54 | 54 | $totalShieldDamage = 0; |
55 | 55 | foreach ($attackers as $attacker) { |
56 | - $playerResults =& $attacker->shootPort($port); |
|
57 | - $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; |
|
56 | + $playerResults = & $attacker->shootPort($port); |
|
57 | + $results['Attackers']['Traders'][$attacker->getAccountID()] = & $playerResults; |
|
58 | 58 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; |
59 | 59 | foreach ($playerResults['Weapons'] as $weapon) { |
60 | 60 | if (isset($weapon['ActualDamage'])) { // Only set if the weapon hits |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $downgradeDamage = $results['Attackers']['TotalDamage'] - $totalShieldDamage; |
68 | 68 | $results['Attackers']['Downgrades'] = $port->checkForDowngrade($downgradeDamage); |
69 | 69 | |
70 | -$results['Port'] =& $port->shootPlayers($attackers); |
|
70 | +$results['Port'] = & $port->shootPlayers($attackers); |
|
71 | 71 | |
72 | 72 | $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()); |
73 | 73 |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php declare(strict_types=1); |
2 | 2 | |
3 | 3 | //first create the game |
4 | -$db->query('SELECT game_id FROM game WHERE game_name='.$db->escapeString(Request::get('game_name')).' LIMIT 1'); |
|
4 | +$db->query('SELECT game_id FROM game WHERE game_name=' . $db->escapeString(Request::get('game_name')) . ' LIMIT 1'); |
|
5 | 5 | if ($db->nextRecord()) { |
6 | 6 | create_error('That game name is already taken.'); |
7 | 7 | } |
8 | 8 | |
9 | 9 | $db->query('SELECT game_id FROM game ORDER BY game_id DESC LIMIT 1'); |
10 | 10 | if ($db->nextRecord()) { |
11 | - $newID = $db->getInt('game_id')+1; |
|
11 | + $newID = $db->getInt('game_id') + 1; |
|
12 | 12 | } else { |
13 | 13 | $newID = 1; |
14 | 14 | } |
@@ -18,8 +18,7 @@ discard block |
||
18 | 18 | if ($join === false) { |
19 | 19 | create_error('Join Date is not valid!'); |
20 | 20 | } |
21 | -$start = empty(Request::get('game_start')) ? $join : |
|
22 | - DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
21 | +$start = empty(Request::get('game_start')) ? $join : DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
23 | 22 | if ($start === false) { |
24 | 23 | create_error('Start Date is not valid!'); |
25 | 24 | } |