We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -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::get('game_join')); |
| 5 | -$start = empty(Request::get('game_start')) ? $join : |
|
| 6 | - DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
| 5 | +$start = empty(Request::get('game_start')) ? $join : DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
| 7 | 6 | $end = DateTime::createFromFormat('d/m/Y|', Request::get('game_end')); |
| 8 | 7 | |
| 9 | 8 | $game = SmrGame::getGame($var['game_id']); |
@@ -20,13 +20,13 @@ |
||
| 20 | 20 | const USER_SCORE_NAME = 'User Score'; |
| 21 | 21 | $hofTypes = array(DONATION_NAME=>true, USER_SCORE_NAME=>true); |
| 22 | 22 | while ($db->nextRecord()) { |
| 23 | - $hof =& $hofTypes; |
|
| 23 | + $hof = & $hofTypes; |
|
| 24 | 24 | $typeList = explode(':', $db->getField('type')); |
| 25 | 25 | foreach ($typeList as $type) { |
| 26 | 26 | if (!isset($hof[$type])) { |
| 27 | 27 | $hof[$type] = array(); |
| 28 | 28 | } |
| 29 | - $hof =& $hof[$type]; |
|
| 29 | + $hof = & $hof[$type]; |
|
| 30 | 30 | } |
| 31 | 31 | $hof = true; |
| 32 | 32 | } |
@@ -19,8 +19,7 @@ discard block |
||
| 19 | 19 | $shareFrom[$fromAccountId] = array( |
| 20 | 20 | 'Player ID' => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(), |
| 21 | 21 | 'Player Name' => $otherPlayer == null ? |
| 22 | - '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofDisplayName() : |
|
| 23 | - $otherPlayer->getDisplayName(), |
|
| 22 | + '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofDisplayName() : $otherPlayer->getDisplayName(), |
|
| 24 | 23 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
| 25 | 24 | 'Game ID' => $gameId, |
| 26 | 25 | ); |
@@ -40,8 +39,7 @@ discard block |
||
| 40 | 39 | $shareTo[$toAccountId] = array( |
| 41 | 40 | 'Player ID' => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(), |
| 42 | 41 | 'Player Name' => $otherPlayer == null ? |
| 43 | - '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofDisplayName() : |
|
| 44 | - $otherPlayer->getDisplayName(), |
|
| 42 | + '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofDisplayName() : $otherPlayer->getDisplayName(), |
|
| 45 | 43 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
| 46 | 44 | 'Game ID' => $gameId, |
| 47 | 45 | ); |
@@ -20,13 +20,13 @@ |
||
| 20 | 20 | const USER_SCORE_NAME = 'User Score'; |
| 21 | 21 | $hofTypes = array(DONATION_NAME=>true, USER_SCORE_NAME=>true); |
| 22 | 22 | while ($db->nextRecord()) { |
| 23 | - $hof =& $hofTypes; |
|
| 23 | + $hof = & $hofTypes; |
|
| 24 | 24 | $typeList = explode(':', $db->getField('type')); |
| 25 | 25 | foreach ($typeList as $type) { |
| 26 | 26 | if (!isset($hof[$type])) { |
| 27 | 27 | $hof[$type] = array(); |
| 28 | 28 | } |
| 29 | - $hof =& $hof[$type]; |
|
| 29 | + $hof = & $hof[$type]; |
|
| 30 | 30 | } |
| 31 | 31 | $hof = true; |
| 32 | 32 | } |
@@ -9,10 +9,11 @@ discard block |
||
| 9 | 9 | $realAttackers = array(); |
| 10 | 10 | $attackers = array(); |
| 11 | 11 | $i=1; |
| 12 | -if(isset($_POST['attackers'])) |
|
| 12 | +if(isset($_POST['attackers'])) { |
|
| 13 | 13 | foreach($_POST['attackers'] as $attackerName) { |
| 14 | 14 | if($attackerName=='none') |
| 15 | 15 | continue; |
| 16 | +} |
|
| 16 | 17 | if(isset($usedNames[$attackerName])) { |
| 17 | 18 | $duplicates = true; |
| 18 | 19 | continue; |
@@ -24,17 +25,19 @@ discard block |
||
| 24 | 25 | ++$i; |
| 25 | 26 | } |
| 26 | 27 | |
| 27 | -for(;$i<=10;++$i) |
|
| 28 | +for(;$i<=10;++$i) { |
|
| 28 | 29 | $attackers[$i] = null; |
| 30 | +} |
|
| 29 | 31 | $template->assign('Attackers',$attackers); |
| 30 | 32 | |
| 31 | 33 | $i=1; |
| 32 | 34 | $realDefenders = array(); |
| 33 | 35 | $defenders = array(); |
| 34 | -if(isset($_POST['defenders'])) |
|
| 36 | +if(isset($_POST['defenders'])) { |
|
| 35 | 37 | foreach($_POST['defenders'] as $defenderName) { |
| 36 | 38 | if($defenderName=='none') |
| 37 | 39 | continue; |
| 40 | +} |
|
| 38 | 41 | if(isset($usedNames[$defenderName])) { |
| 39 | 42 | $duplicates = true; |
| 40 | 43 | continue; |
@@ -46,8 +49,9 @@ discard block |
||
| 46 | 49 | ++$i; |
| 47 | 50 | } |
| 48 | 51 | |
| 49 | -for(;$i<=10;++$i) |
|
| 52 | +for(;$i<=10;++$i) { |
|
| 50 | 53 | $defenders[$i] = null; |
| 54 | +} |
|
| 51 | 55 | $template->assign('Defenders',$defenders); |
| 52 | 56 | |
| 53 | 57 | $template->assign('Duplicates',$duplicates); |
@@ -62,12 +66,14 @@ discard block |
||
| 62 | 66 | while(count($realAttackers)>0 && count($realDefenders)>0) { |
| 63 | 67 | runAnAttack($realAttackers,$realDefenders); |
| 64 | 68 | foreach($realAttackers as $key => &$teamPlayer) { |
| 65 | - if($teamPlayer->isDead()) |
|
| 66 | - unset($realAttackers[$key]); |
|
| 69 | + if($teamPlayer->isDead()) { |
|
| 70 | + unset($realAttackers[$key]); |
|
| 71 | + } |
|
| 67 | 72 | } unset($teamPlayer); |
| 68 | 73 | foreach($realDefenders as $key => &$teamPlayer) { |
| 69 | - if($teamPlayer->isDead()) |
|
| 70 | - unset($realDefenders[$key]); |
|
| 74 | + if($teamPlayer->isDead()) { |
|
| 75 | + unset($realDefenders[$key]); |
|
| 76 | + } |
|
| 71 | 77 | } unset($teamPlayer); |
| 72 | 78 | } |
| 73 | 79 | } |
@@ -2,81 +2,81 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | $template = Smr\Template::getInstance(); |
| 4 | 4 | |
| 5 | -$template->assign('PageTopic','Combat Simulator'); |
|
| 5 | +$template->assign('PageTopic', 'Combat Simulator'); |
|
| 6 | 6 | |
| 7 | -$template->assign('EditDummysLink', Page::create('skeleton.php','edit_dummys.php')->href()); |
|
| 7 | +$template->assign('EditDummysLink', Page::create('skeleton.php', 'edit_dummys.php')->href()); |
|
| 8 | 8 | $template->assign('DummyNames', DummyPlayer::getDummyPlayerNames()); |
| 9 | 9 | |
| 10 | 10 | $duplicates = false; |
| 11 | 11 | $usedNames = array(); |
| 12 | 12 | $realAttackers = array(); |
| 13 | 13 | $attackers = array(); |
| 14 | -$i=1; |
|
| 15 | -if(isset($_POST['attackers'])) |
|
| 16 | - foreach($_POST['attackers'] as $attackerName) { |
|
| 17 | - if($attackerName=='none') |
|
| 14 | +$i = 1; |
|
| 15 | +if (isset($_POST['attackers'])) |
|
| 16 | + foreach ($_POST['attackers'] as $attackerName) { |
|
| 17 | + if ($attackerName == 'none') |
|
| 18 | 18 | continue; |
| 19 | - if(isset($usedNames[$attackerName])) { |
|
| 19 | + if (isset($usedNames[$attackerName])) { |
|
| 20 | 20 | $duplicates = true; |
| 21 | 21 | continue; |
| 22 | 22 | } |
| 23 | 23 | $usedNames[$attackerName] = true; |
| 24 | - $attackers[$i] =& DummyPlayer::getCachedDummyPlayer($attackerName); |
|
| 24 | + $attackers[$i] = & DummyPlayer::getCachedDummyPlayer($attackerName); |
|
| 25 | 25 | $attackers[$i]->setAllianceID(1); |
| 26 | - $realAttackers[$i] =& $attackers[$i]; |
|
| 26 | + $realAttackers[$i] = & $attackers[$i]; |
|
| 27 | 27 | ++$i; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | -for(;$i<=10;++$i) |
|
| 30 | +for (;$i <= 10; ++$i) |
|
| 31 | 31 | $attackers[$i] = null; |
| 32 | -$template->assign('Attackers',$attackers); |
|
| 32 | +$template->assign('Attackers', $attackers); |
|
| 33 | 33 | |
| 34 | -$i=1; |
|
| 34 | +$i = 1; |
|
| 35 | 35 | $realDefenders = array(); |
| 36 | 36 | $defenders = array(); |
| 37 | -if(isset($_POST['defenders'])) |
|
| 38 | - foreach($_POST['defenders'] as $defenderName) { |
|
| 39 | - if($defenderName=='none') |
|
| 37 | +if (isset($_POST['defenders'])) |
|
| 38 | + foreach ($_POST['defenders'] as $defenderName) { |
|
| 39 | + if ($defenderName == 'none') |
|
| 40 | 40 | continue; |
| 41 | - if(isset($usedNames[$defenderName])) { |
|
| 41 | + if (isset($usedNames[$defenderName])) { |
|
| 42 | 42 | $duplicates = true; |
| 43 | 43 | continue; |
| 44 | 44 | } |
| 45 | 45 | $usedNames[$attackerName] = true; |
| 46 | - $defenders[$i] =& DummyPlayer::getCachedDummyPlayer($defenderName); |
|
| 46 | + $defenders[$i] = & DummyPlayer::getCachedDummyPlayer($defenderName); |
|
| 47 | 47 | $defenders[$i]->setAllianceID(2); |
| 48 | - $realDefenders[$i] =& $defenders[$i]; |
|
| 48 | + $realDefenders[$i] = & $defenders[$i]; |
|
| 49 | 49 | ++$i; |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | -for(;$i<=10;++$i) |
|
| 52 | +for (;$i <= 10; ++$i) |
|
| 53 | 53 | $defenders[$i] = null; |
| 54 | -$template->assign('Defenders',$defenders); |
|
| 54 | +$template->assign('Defenders', $defenders); |
|
| 55 | 55 | |
| 56 | -$template->assign('Duplicates',$duplicates); |
|
| 56 | +$template->assign('Duplicates', $duplicates); |
|
| 57 | 57 | |
| 58 | -$template->assign('CombatSimHREF', Page::create('skeleton.php','combat_simulator.php')->href()); |
|
| 58 | +$template->assign('CombatSimHREF', Page::create('skeleton.php', 'combat_simulator.php')->href()); |
|
| 59 | 59 | |
| 60 | 60 | if (!empty($realAttackers) && !empty($realDefenders)) { |
| 61 | - if(isset($_REQUEST['run'])) { |
|
| 62 | - runAnAttack($realAttackers,$realDefenders); |
|
| 61 | + if (isset($_REQUEST['run'])) { |
|
| 62 | + runAnAttack($realAttackers, $realDefenders); |
|
| 63 | 63 | } |
| 64 | - if(isset($_REQUEST['death_run'])) { |
|
| 65 | - while(count($realAttackers)>0 && count($realDefenders)>0) { |
|
| 66 | - runAnAttack($realAttackers,$realDefenders); |
|
| 67 | - foreach($realAttackers as $key => &$teamPlayer) { |
|
| 68 | - if($teamPlayer->isDead()) |
|
| 64 | + if (isset($_REQUEST['death_run'])) { |
|
| 65 | + while (count($realAttackers) > 0 && count($realDefenders) > 0) { |
|
| 66 | + runAnAttack($realAttackers, $realDefenders); |
|
| 67 | + foreach ($realAttackers as $key => &$teamPlayer) { |
|
| 68 | + if ($teamPlayer->isDead()) |
|
| 69 | 69 | unset($realAttackers[$key]); |
| 70 | 70 | } unset($teamPlayer); |
| 71 | - foreach($realDefenders as $key => &$teamPlayer) { |
|
| 72 | - if($teamPlayer->isDead()) |
|
| 71 | + foreach ($realDefenders as $key => &$teamPlayer) { |
|
| 72 | + if ($teamPlayer->isDead()) |
|
| 73 | 73 | unset($realDefenders[$key]); |
| 74 | 74 | } unset($teamPlayer); |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | -function runAnAttack($realAttackers,$realDefenders) { |
|
| 79 | +function runAnAttack($realAttackers, $realDefenders) { |
|
| 80 | 80 | $results = array('Attackers' => array('Traders' => array(), 'TotalDamage' => 0), |
| 81 | 81 | 'Defenders' => array('Traders' => array(), 'TotalDamage' => 0)); |
| 82 | 82 | foreach ($realAttackers as $accountID => $teamPlayer) { |
@@ -86,10 +86,10 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | foreach ($realDefenders as $accountID => $teamPlayer) { |
| 88 | 88 | $playerResults = $teamPlayer->shootPlayers($realAttackers); |
| 89 | - $results['Defenders']['Traders'][] = $playerResults; |
|
| 89 | + $results['Defenders']['Traders'][] = $playerResults; |
|
| 90 | 90 | $results['Defenders']['TotalDamage'] += $playerResults['TotalDamage']; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | $template = Smr\Template::getInstance(); |
| 94 | - $template->assign('TraderCombatResults',$results); |
|
| 94 | + $template->assign('TraderCombatResults', $results); |
|
| 95 | 95 | } |
@@ -76,8 +76,13 @@ discard block |
||
| 76 | 76 | <input type="number" name="amount" value="0" min="<?php echo MIN_GLOBAL_RELATIONS; ?>" max="<?php echo MAX_GLOBAL_RELATIONS; ?>" style="width:75px" /> |
| 77 | 77 | <select name="race"><?php |
| 78 | 78 | foreach (Globals::getRaces() as $race) { |
| 79 | - if ($race['Race ID'] == $ThisPlayer->getRaceID()) continue; |
|
| 80 | - if ($race['Race ID'] == RACE_NEUTRAL) continue; ?> |
|
| 79 | + if ($race['Race ID'] == $ThisPlayer->getRaceID()) { |
|
| 80 | + continue; |
|
| 81 | + } |
|
| 82 | + if ($race['Race ID'] == RACE_NEUTRAL) { |
|
| 83 | + continue; |
|
| 84 | + } |
|
| 85 | + ?> |
|
| 81 | 86 | <option value="<?php echo $race['Race ID']; ?>"><?php echo $race['Race Name']; ?></option><?php |
| 82 | 87 | } ?> |
| 83 | 88 | </select> |
@@ -88,8 +93,13 @@ discard block |
||
| 88 | 93 | <form method="POST" action="<?php echo $ChangeRaceHREF; ?>"> |
| 89 | 94 | <select name="race"><?php |
| 90 | 95 | foreach (Globals::getRaces() as $race) { |
| 91 | - if ($race['Race ID'] == $ThisPlayer->getRaceID()) continue; |
|
| 92 | - if ($race['Race ID'] == RACE_NEUTRAL) continue; ?> |
|
| 96 | + if ($race['Race ID'] == $ThisPlayer->getRaceID()) { |
|
| 97 | + continue; |
|
| 98 | + } |
|
| 99 | + if ($race['Race ID'] == RACE_NEUTRAL) { |
|
| 100 | + continue; |
|
| 101 | + } |
|
| 102 | + ?> |
|
| 93 | 103 | <option value="<?php echo $race['Race ID']; ?>"><?php echo $race['Race Name']; ?></option><?php |
| 94 | 104 | } ?> |
| 95 | 105 | </select> |
@@ -10,7 +10,10 @@ |
||
| 10 | 10 | <td style="width: 80%" class="center"> |
| 11 | 11 | Local Map of the Known <span class="big bold"><?php echo $GalaxyName ?></span> Galaxy |
| 12 | 12 | <br /><br /> |
| 13 | - <?php if (isset($Error)) echo $Error; ?> |
|
| 13 | + <?php if (isset($Error)) { |
|
| 14 | + echo $Error; |
|
| 15 | +} |
|
| 16 | +?> |
|
| 14 | 17 | </td> |
| 15 | 18 | <td style="width: 10%"></td> |
| 16 | 19 | </tr> |
@@ -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) { |
@@ -1,5 +1,8 @@ |
||
| 1 | 1 | <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> |
| 2 | -<title><?php echo PAGE_TITLE; ?><?php if (isset($GameName)) echo ": $GameName"; ?></title> |
|
| 2 | +<title><?php echo PAGE_TITLE; ?><?php if (isset($GameName)) { |
|
| 3 | + echo ": $GameName"; |
|
| 4 | +} |
|
| 5 | +?></title> |
|
| 3 | 6 | <meta http-equiv="pragma" content="no-cache" /><?php |
| 4 | 7 | if (!is_object($ThisAccount) || $ThisAccount->isDefaultCSSEnabled()) { ?> |
| 5 | 8 | <link rel="stylesheet" type="text/css" href="<?php echo $CSSLink; ?>" /> |