We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -3,11 +3,11 @@ discard block |
||
| 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 $user; // Discord user associated with the message |
|
| 8 | - public $account; // SmrAccount instance |
|
| 9 | - public $alliance; // SmrAlliance instance |
|
| 10 | - public $player; // SmrPlayer instance |
|
| 6 | + public $valid = false; // identifies if the message is linked to game data |
|
| 7 | + public $user; // Discord user associated with the message |
|
| 8 | + public $account; // SmrAccount instance |
|
| 9 | + public $alliance; // SmrAlliance instance |
|
| 10 | + public $player; // SmrPlayer instance |
|
| 11 | 11 | |
| 12 | 12 | // Takes the following arguments: |
| 13 | 13 | // channel = Discord\Parts\Channel\Channel instance |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | $this->player = SmrPlayer::getPlayer($this->account->getAccountID(), $this->alliance->getGameID(), true); |
| 62 | 62 | if ($this->player->getAllianceID() != $this->alliance->getAllianceID()) { |
| 63 | - $channel->sendMessage("Player `".$this->player->getPlayerName()."` is not a member of alliance `".$this->alliance->getAllianceName()."`"); |
|
| 63 | + $channel->sendMessage("Player `" . $this->player->getPlayerName() . "` is not a member of alliance `" . $this->alliance->getAllianceName() . "`"); |
|
| 64 | 64 | return; |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -21,6 +21,6 @@ |
||
| 21 | 21 | //} |
| 22 | 22 | |
| 23 | 23 | $db->query('SELECT result,log_id FROM combat_logs'); |
| 24 | -while($db->nextRecord()) { |
|
| 25 | - $db2->query('UPDATE combat_logs SET result='.$db2->escapeBinary(gzcompress(serialize(unserialize(gzuncompress($db->getField('result')))))).' WHERE log_id='.$db->getField('log_id')); |
|
| 24 | +while ($db->nextRecord()) { |
|
| 25 | + $db2->query('UPDATE combat_logs SET result=' . $db2->escapeBinary(gzcompress(serialize(unserialize(gzuncompress($db->getField('result')))))) . ' WHERE log_id=' . $db->getField('log_id')); |
|
| 26 | 26 | } |
@@ -2,8 +2,8 @@ |
||
| 2 | 2 | trait SmrMySqlSecrets { |
| 3 | 3 | protected static $databaseName = 'smr_live'; |
| 4 | 4 | private static $host = 'smr-mysql'; // must match MYSQL_HOST in .env |
| 5 | - private static $user = 'smr'; // must match MYSQL_USER in .env |
|
| 6 | - private static $password = 'smr'; // must match MYSQL_PASSWORD in .env |
|
| 5 | + private static $user = 'smr'; // must match MYSQL_USER in .env |
|
| 6 | + private static $password = 'smr'; // must match MYSQL_PASSWORD in .env |
|
| 7 | 7 | |
| 8 | 8 | // Set to null to use defaults |
| 9 | 9 | private static $port = null; |
@@ -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" class="InputFields"><?php if(isset($Preview)) { echo $Preview; } ?></textarea><br /> |
|
| 7 | + <textarea spellcheck="true" name="message" class="InputFields"><?php if (isset($Preview)) { echo $Preview; } ?></textarea><br /> |
|
| 8 | 8 | <br /> |
| 9 | 9 | <input type="submit" name="action" value="Send message" class="InputFields" /> <input type="submit" name="action" value="Preview message" class="InputFields" /> |
| 10 | 10 | </form> |
@@ -2,8 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | // Get the dates ("|" sets hr/min/sec to 0) |
| 4 | 4 | $join = DateTime::createFromFormat('d/m/Y|', $_REQUEST['game_join']); |
| 5 | -$start = empty($_REQUEST['game_start']) ? $join : |
|
| 6 | - DateTime::createFromFormat('d/m/Y|', $_REQUEST['game_start']); |
|
| 5 | +$start = empty($_REQUEST['game_start']) ? $join : DateTime::createFromFormat('d/m/Y|', $_REQUEST['game_start']); |
|
| 7 | 6 | $end = DateTime::createFromFormat('d/m/Y|', $_REQUEST['game_end']); |
| 8 | 7 | |
| 9 | 8 | $game = SmrGame::getGame($var['game_id']); |
@@ -49,12 +49,12 @@ |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | foreach ($attackers as $attacker) { |
| 52 | - $playerResults =& $attacker->shootPlanet($planet, false); |
|
| 53 | - $results['Attackers']['Traders'][$attacker->getAccountID()] =& $playerResults; |
|
| 52 | + $playerResults = & $attacker->shootPlanet($planet, false); |
|
| 53 | + $results['Attackers']['Traders'][$attacker->getAccountID()] = & $playerResults; |
|
| 54 | 54 | $results['Attackers']['TotalDamage'] += $playerResults['TotalDamage']; |
| 55 | 55 | } |
| 56 | 56 | $results['Attackers']['Downgrades'] = $planet->checkForDowngrade($results['Attackers']['TotalDamage']); |
| 57 | -$results['Planet'] =& $planet->shootPlayers($attackers); |
|
| 57 | +$results['Planet'] = & $planet->shootPlayers($attackers); |
|
| 58 | 58 | |
| 59 | 59 | $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()); |
| 60 | 60 | |
@@ -45,12 +45,12 @@ |
||
| 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 | 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 | |
@@ -41,8 +41,8 @@ |
||
| 41 | 41 | |
| 42 | 42 | function teamAttack(&$results, $fightingPlayers, $attack, $defend) { |
| 43 | 43 | foreach ($fightingPlayers[$attack] as $accountID => $teamPlayer) { |
| 44 | - $playerResults =& $teamPlayer->shootPlayers($fightingPlayers[$defend]); |
|
| 45 | - $results[$attack]['Traders'][$teamPlayer->getAccountID()] =& $playerResults; |
|
| 44 | + $playerResults = & $teamPlayer->shootPlayers($fightingPlayers[$defend]); |
|
| 45 | + $results[$attack]['Traders'][$teamPlayer->getAccountID()] = & $playerResults; |
|
| 46 | 46 | $results[$attack]['TotalDamage'] += $playerResults['TotalDamage']; |
| 47 | 47 | |
| 48 | 48 | // Award assists (if there are multiple attackers) |
@@ -72,18 +72,18 @@ |
||
| 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 | |