We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | create_error('Join Date is not valid!'); |
| 20 | 20 | } |
| 21 | 21 | $start = empty(Request::get('game_start')) ? $join : |
| 22 | - DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
| 22 | + DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
| 23 | 23 | if ($start === false) { |
| 24 | 24 | create_error('Start Date is not valid!'); |
| 25 | 25 | } |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | |
| 88 | 88 | // Form to make location changes |
| 89 | 89 | $container = create_container('1.6/universe_create_save_processing.php', |
| 90 | - '1.6/universe_create_sectors.php', $var); |
|
| 90 | + '1.6/universe_create_sectors.php', $var); |
|
| 91 | 91 | $template->assign('CreateLocationsFormHREF', SmrSession::getNewHREF($container)); |
| 92 | 92 | |
| 93 | 93 | // HREF to cancel and return to the previous page |
@@ -3,7 +3,7 @@ |
||
| 3 | 3 | // Get the dates ("|" sets hr/min/sec to 0) |
| 4 | 4 | $join = DateTime::createFromFormat('d/m/Y|', Request::get('game_join')); |
| 5 | 5 | $start = empty(Request::get('game_start')) ? $join : |
| 6 | - DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
| 6 | + DateTime::createFromFormat('d/m/Y|', Request::get('game_start')); |
|
| 7 | 7 | $end = DateTime::createFromFormat('d/m/Y|', Request::get('game_end')); |
| 8 | 8 | |
| 9 | 9 | $game = SmrGame::getGame($var['game_id']); |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | |
| 30 | 30 | // Form to make planet changes |
| 31 | 31 | $container = create_container('1.6/universe_create_save_processing.php', |
| 32 | - '1.6/universe_create_sectors.php', $var); |
|
| 32 | + '1.6/universe_create_sectors.php', $var); |
|
| 33 | 33 | $template->assign('CreatePlanetsFormHREF', SmrSession::getNewHREF($container)); |
| 34 | 34 | |
| 35 | 35 | // HREF to cancel and return to the previous page |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | } |
| 21 | 21 | } |
| 22 | 22 | $missingLocs = array_diff(array_keys(SmrLocation::getAllLocations()), |
| 23 | - array_keys($existingLocs)); |
|
| 23 | + array_keys($existingLocs)); |
|
| 24 | 24 | $missingLocNames = []; |
| 25 | 25 | foreach ($missingLocs as $locID) { |
| 26 | 26 | $missingLocNames[] = SmrLocation::getLocation($locID)->getName(); |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | $template->assign('SelectedPortRaceID', $selectedPortRaceID); |
| 26 | 26 | |
| 27 | 27 | $sectorLocationIDs = array_pad(array_keys($editSector->getLocations()), |
| 28 | - UNI_GEN_LOCATION_SLOTS, 0); |
|
| 28 | + UNI_GEN_LOCATION_SLOTS, 0); |
|
| 29 | 29 | $template->assign('SectorLocationIDs', $sectorLocationIDs); |
| 30 | 30 | |
| 31 | 31 | if ($editSector->hasWarp()) { |
@@ -35,7 +35,7 @@ |
||
| 35 | 35 | |
| 36 | 36 | // Set the body of the e-mail |
| 37 | 37 | set_mail_body($mail, $var['newsletter_html'], $var['newsletter_text'], |
| 38 | - Request::get('salutation')); |
|
| 38 | + Request::get('salutation')); |
|
| 39 | 39 | |
| 40 | 40 | if (Request::get('to_email') == '*') { |
| 41 | 41 | // Send the newsletter to all players. |
@@ -7,4 +7,4 @@ |
||
| 7 | 7 | $msg = '<span class="green">SUCCESS: </span>Enabled game ' . $game->getDisplayName(); |
| 8 | 8 | |
| 9 | 9 | forward(create_container('skeleton.php', 'enable_game.php', |
| 10 | - array('processing_msg' => $msg))); |
|
| 10 | + array('processing_msg' => $msg))); |
|
@@ -11,8 +11,7 @@ discard block |
||
| 11 | 11 | $action = Request::get('action'); |
| 12 | 12 | if (Request::get('save') == 'Yes') { |
| 13 | 13 | $save = true; |
| 14 | -} |
|
| 15 | -else { |
|
| 14 | +} else { |
|
| 16 | 15 | $save = false; |
| 17 | 16 | } |
| 18 | 17 | |
@@ -42,8 +41,7 @@ discard block |
||
| 42 | 41 | $mines = $db2->getInt('sum_m'); |
| 43 | 42 | $cds = $db2->getInt('cds'); |
| 44 | 43 | $sds = $db2->getInt('sds'); |
| 45 | - } |
|
| 46 | - else { |
|
| 44 | + } else { |
|
| 47 | 45 | $mines = 0; |
| 48 | 46 | $cds = 0; |
| 49 | 47 | $sds = 0; |
@@ -143,16 +141,25 @@ discard block |
||
| 143 | 141 | $owner = $db->getInt('owner_id'); |
| 144 | 142 | |
| 145 | 143 | $db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 1'); |
| 146 | - if ($db2->nextRecord()) $gens = $db2->getInt('amount'); |
|
| 147 | - else $gens = 0; |
|
| 144 | + if ($db2->nextRecord()) { |
|
| 145 | + $gens = $db2->getInt('amount'); |
|
| 146 | + } else { |
|
| 147 | + $gens = 0; |
|
| 148 | + } |
|
| 148 | 149 | |
| 149 | 150 | $db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 2'); |
| 150 | - if ($db2->nextRecord()) $hangs = $db2->getInt('amount'); |
|
| 151 | - else $hangs = 0; |
|
| 151 | + if ($db2->nextRecord()) { |
|
| 152 | + $hangs = $db2->getInt('amount'); |
|
| 153 | + } else { |
|
| 154 | + $hangs = 0; |
|
| 155 | + } |
|
| 152 | 156 | |
| 153 | 157 | $db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 3'); |
| 154 | - if ($db2->nextRecord()) $turs = $db2->getInt('amount'); |
|
| 155 | - else $turs = 0; |
|
| 158 | + if ($db2->nextRecord()) { |
|
| 159 | + $turs = $db2->getInt('amount'); |
|
| 160 | + } else { |
|
| 161 | + $turs = 0; |
|
| 162 | + } |
|
| 156 | 163 | |
| 157 | 164 | // insert into history db |
| 158 | 165 | $history_db_sql[] = 'INSERT INTO planet (game_id, sector_id, owner_id, generators, hangers, turrets) VALUES ' . |
@@ -189,14 +196,21 @@ discard block |
||
| 189 | 196 | $smrCredits = 0; |
| 190 | 197 | $db2->query('SELECT sum(amount) as bounty_am, sum(smr_credits) as bounty_cred FROM bounty WHERE game_id = '.$game_id.' AND account_id = '.$acc_id.' AND claimer_id = 0'); |
| 191 | 198 | if ($db2->nextRecord()) { |
| 192 | - if (is_int($db2->getField('bounty_am'))) $amount = $db2->getInt('bounty_am'); |
|
| 193 | - if (is_int($db2->getField('bounty_cred'))) $smrCredits = $db2->getInt('bounty_cred'); |
|
| 199 | + if (is_int($db2->getField('bounty_am'))) { |
|
| 200 | + $amount = $db2->getInt('bounty_am'); |
|
| 201 | + } |
|
| 202 | + if (is_int($db2->getField('bounty_cred'))) { |
|
| 203 | + $smrCredits = $db2->getInt('bounty_cred'); |
|
| 204 | + } |
|
| 194 | 205 | |
| 195 | 206 | } |
| 196 | 207 | |
| 197 | 208 | $db2->query('SELECT * FROM ship_has_name WHERE game_id = '.$game_id.' AND account_id = '.$acc_id); |
| 198 | - if ($db2->nextRecord()) $ship_name = $db2->getField('ship_name'); |
|
| 199 | - else $ship_name = 'None'; |
|
| 209 | + if ($db2->nextRecord()) { |
|
| 210 | + $ship_name = $db2->getField('ship_name'); |
|
| 211 | + } else { |
|
| 212 | + $ship_name = 'None'; |
|
| 213 | + } |
|
| 200 | 214 | |
| 201 | 215 | // insert into history db |
| 202 | 216 | $history_db_sql[] = 'INSERT INTO player (account_id, game_id, player_name, player_id, experience, ship, race, alignment, alliance_id, kills, deaths, bounty, bounty_cred, ship_name) ' . |
@@ -244,9 +258,15 @@ discard block |
||
| 244 | 258 | $mines = $db2->getInt('sum_mines'); |
| 245 | 259 | $cds = $db2->getInt('cds'); |
| 246 | 260 | $sds = $db2->getInt('sds'); |
| 247 | - if (!is_numeric($mines)) $mines = 0; |
|
| 248 | - if (!is_numeric($cds)) $cds = 0; |
|
| 249 | - if (!is_numeric($sds)) $sds = 0; |
|
| 261 | + if (!is_numeric($mines)) { |
|
| 262 | + $mines = 0; |
|
| 263 | + } |
|
| 264 | + if (!is_numeric($cds)) { |
|
| 265 | + $cds = 0; |
|
| 266 | + } |
|
| 267 | + if (!is_numeric($sds)) { |
|
| 268 | + $sds = 0; |
|
| 269 | + } |
|
| 250 | 270 | |
| 251 | 271 | } else { |
| 252 | 272 | |