@@ -15,12 +15,12 @@ discard block |
||
| 15 | 15 | $fleet_row = &$mission_data['fleet']; |
| 16 | 16 | $destination_planet = &$mission_data['dst_planet']; |
| 17 | 17 | |
| 18 | - if(!$fleet_row) |
|
| 18 | + if (!$fleet_row) |
|
| 19 | 19 | { |
| 20 | 20 | return CACHE_NOTHING; |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - if(!isset($destination_planet['id'])) |
|
| 23 | + if (!isset($destination_planet['id'])) |
|
| 24 | 24 | { |
| 25 | 25 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
| 26 | 26 | DbFleetStatic::fleet_send_back($mission_data['fleet']); |
@@ -32,12 +32,12 @@ discard block |
||
| 32 | 32 | $RecyclerCapacity = 0; |
| 33 | 33 | $OtherFleetCapacity = 0; |
| 34 | 34 | $fleet_array = sys_unit_str2arr($fleet_row['fleet_array']); |
| 35 | - foreach($fleet_array as $unit_id => $unit_count) |
|
| 35 | + foreach ($fleet_array as $unit_id => $unit_count) |
|
| 36 | 36 | { |
| 37 | - if(in_array($unit_id, sn_get_groups('fleet'))) |
|
| 37 | + if (in_array($unit_id, sn_get_groups('fleet'))) |
|
| 38 | 38 | { |
| 39 | 39 | $capacity = get_unit_param($unit_id, P_CAPACITY) * $unit_count; |
| 40 | - if(in_array($unit_id, sn_get_groups('flt_recyclers'))) |
|
| 40 | + if (in_array($unit_id, sn_get_groups('flt_recyclers'))) |
|
| 41 | 41 | { |
| 42 | 42 | $RecyclerCapacity += $capacity; |
| 43 | 43 | } |
@@ -49,19 +49,19 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | $IncomingFleetGoods = $fleet_row["fleet_resource_metal"] + $fleet_row["fleet_resource_crystal"] + $fleet_row["fleet_resource_deuterium"]; |
| 52 | - if($IncomingFleetGoods > $OtherFleetCapacity) |
|
| 52 | + if ($IncomingFleetGoods > $OtherFleetCapacity) |
|
| 53 | 53 | { |
| 54 | 54 | $RecyclerCapacity -= ($IncomingFleetGoods - $OtherFleetCapacity); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - if(($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) |
|
| 57 | + if (($destination_planet["debris_metal"] + $destination_planet["debris_crystal"]) <= $RecyclerCapacity) |
|
| 58 | 58 | { |
| 59 | 59 | $RecycledGoods["metal"] = $destination_planet["debris_metal"]; |
| 60 | 60 | $RecycledGoods["crystal"] = $destination_planet["debris_crystal"]; |
| 61 | 61 | } |
| 62 | 62 | else |
| 63 | 63 | { |
| 64 | - if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
| 64 | + if (($destination_planet["debris_metal"] > $RecyclerCapacity / 2) AND |
|
| 65 | 65 | ($destination_planet["debris_crystal"] > $RecyclerCapacity / 2)) |
| 66 | 66 | { |
| 67 | 67 | $RecycledGoods["metal"] = $RecyclerCapacity / 2; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | - $NewCargo['Metal'] = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"]; |
|
| 98 | + $NewCargo['Metal'] = $fleet_row["fleet_resource_metal"] + $RecycledGoods["metal"]; |
|
| 99 | 99 | $NewCargo['Crystal'] = $fleet_row["fleet_resource_crystal"] + $RecycledGoods["crystal"]; |
| 100 | 100 | $NewCargo['Deuterium'] = $fleet_row["fleet_resource_deuterium"]; |
| 101 | 101 | |
@@ -108,7 +108,7 @@ discard block |
||
| 108 | 108 | HelperString::numberFloorAndFormat($RecycledGoods["metal"]), $lang['Metal'], |
| 109 | 109 | HelperString::numberFloorAndFormat($RecycledGoods["crystal"]), $lang['Crystal'] |
| 110 | 110 | ); |
| 111 | - msg_send_simple_message ( $fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_RECYCLE, $lang['sys_mess_spy_control'], $lang['sys_recy_report'], $Message); |
|
| 111 | + msg_send_simple_message($fleet_row['fleet_owner'], '', $fleet_row['fleet_start_time'], MSG_TYPE_RECYCLE, $lang['sys_mess_spy_control'], $lang['sys_recy_report'], $Message); |
|
| 112 | 112 | |
| 113 | 113 | // $QryUpdateFleet = "UPDATE {{fleets}} SET `fleet_mess` = 1,`fleet_resource_metal` = '{$NewCargo['Metal']}',`fleet_resource_crystal` = '{$NewCargo['Crystal']}',`fleet_resource_deuterium` = '{$NewCargo['Deuterium']}' "; |
| 114 | 114 | // $QryUpdateFleet .= "WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;"; |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | function flt_mission_destroy($mission_data) { |
| 11 | 11 | $fleet_row = $mission_data['fleet']; |
| 12 | 12 | $destination_planet = $mission_data['dst_planet']; |
| 13 | - if(!$destination_planet || !is_array($destination_planet) || $destination_planet['planet_type'] != PT_MOON) { |
|
| 13 | + if (!$destination_planet || !is_array($destination_planet) || $destination_planet['planet_type'] != PT_MOON) { |
|
| 14 | 14 | DbFleetStatic::fleet_send_back($fleet_row); |
| 15 | 15 | |
| 16 | 16 | return CACHE_FLEET; |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | function flt_mission_hold(&$mission_data) |
| 6 | 6 | { |
| 7 | - if($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW) |
|
| 7 | + if ($mission_data['fleet']['fleet_end_stay'] < SN_TIME_NOW) |
|
| 8 | 8 | { |
| 9 | 9 | DbFleetStatic::fleet_send_back($mission_data['fleet']); |
| 10 | 10 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = '{$fleet_row['fleet_id']}' LIMIT 1;"); |
@@ -15,7 +15,7 @@ discard block |
||
| 15 | 15 | $fleet_row = &$mission_data['fleet']; |
| 16 | 16 | $destination_planet = &$mission_data['dst_planet']; |
| 17 | 17 | |
| 18 | - if(!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner']) |
|
| 18 | + if (!$destination_planet || !is_array($destination_planet) || $fleet_row['fleet_owner'] != $destination_planet['id_owner']) |
|
| 19 | 19 | { |
| 20 | 20 | // doquery("UPDATE {{fleets}} SET `fleet_mess` = 1 WHERE `fleet_id` = {$fleet_row['fleet_id']} LIMIT 1;"); |
| 21 | 21 | DbFleetStatic::fleet_send_back($mission_data['fleet']); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $mission_data['src_planet']['name'], uni_render_coordinates_href($fleet_row, 'fleet_start_', 3, ''), $destination_planet['name'], uni_render_coordinates_href($fleet_row, 'fleet_end_', 3, ''), |
| 29 | 29 | $fleet_row['fleet_resource_metal'], $lang['Metal'], $fleet_row['fleet_resource_crystal'], $lang['Crystal'], $fleet_row['fleet_resource_deuterium'], $lang['Deuterium']) . |
| 30 | 30 | '<br />' . $lang['sys_relocate_mess_user']; |
| 31 | - foreach(sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) |
|
| 31 | + foreach (sys_unit_str2arr($fleet_row['fleet_array']) as $ship_id => $ship_count) |
|
| 32 | 32 | { |
| 33 | 33 | $Message .= $lang['tech'][$ship_id] . ' - ' . $ship_count . '<br />'; |
| 34 | 34 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | * @inheritdoc |
| 90 | 90 | */ |
| 91 | 91 | public function update() { |
| 92 | - if($this->getShipCount() < 1) { |
|
| 92 | + if ($this->getShipCount() < 1) { |
|
| 93 | 93 | return $this->delete(); |
| 94 | 94 | } else { |
| 95 | 95 | return parent::update(); |
@@ -153,12 +153,12 @@ discard block |
||
| 153 | 153 | |
| 154 | 154 | $shipCount = floor($shipCount); |
| 155 | 155 | |
| 156 | - if($this->shipList[$shipSnId] + $shipCount < 0) { |
|
| 156 | + if ($this->shipList[$shipSnId] + $shipCount < 0) { |
|
| 157 | 157 | throw new \Exception("Trying to deduct more ships [{$shipSnId}] '{$shipCount}' when fleet [{$this->id}] has only {$this->shipList[$shipSnId]}"); |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | $this->shipList[$shipSnId] += $shipCount; |
| 161 | - if($this->shipList[$shipSnId] < 1) { |
|
| 161 | + if ($this->shipList[$shipSnId] < 1) { |
|
| 162 | 162 | unset($this->shipList[$shipSnId]); |
| 163 | 163 | } |
| 164 | 164 | |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | |
| 184 | 184 | $resourceCount = ceil($resourceCount); |
| 185 | 185 | |
| 186 | - if($this->resources[$resourceId] + $resourceCount < 0) { |
|
| 186 | + if ($this->resources[$resourceId] + $resourceCount < 0) { |
|
| 187 | 187 | throw new \Exception("FLEET ERROR! Trying to deduct more resources [{$resourceId}] '{$resourceCount}' when fleet [{$this->id}] has only {$this->resources[$resourceId]}"); |
| 188 | 188 | } |
| 189 | 189 | |
@@ -379,7 +379,7 @@ |
||
| 379 | 379 | public function dbLoadRecord($id) { |
| 380 | 380 | $result = parent::dbLoadRecord($id); |
| 381 | 381 | |
| 382 | - if(!$this->isNew()) { |
|
| 382 | + if (!$this->isNew()) { |
|
| 383 | 383 | $this->resources[RES_METAL] = $this->_getContainer()->metal; |
| 384 | 384 | $this->resources[RES_CRYSTAL] = $this->_getContainer()->crystal; |
| 385 | 385 | $this->resources[RES_DEUTERIUM] = $this->_getContainer()->deuterium; |
@@ -426,8 +426,8 @@ |
||
| 426 | 426 | protected function getTravelData() { |
| 427 | 427 | $travel_data = flt_travel_data( |
| 428 | 428 | $this->getFleetOwnerRecord(), |
| 429 | - ['galaxy' => $this->fleet_start_galaxy, 'system' => $this->fleet_start_system, 'planet' => $this->fleet_start_planet,], |
|
| 430 | - ['galaxy' => $this->fleet_end_galaxy, 'system' => $this->fleet_end_system, 'planet' => $this->fleet_end_planet,], |
|
| 429 | + ['galaxy' => $this->fleet_start_galaxy, 'system' => $this->fleet_start_system, 'planet' => $this->fleet_start_planet, ], |
|
| 430 | + ['galaxy' => $this->fleet_end_galaxy, 'system' => $this->fleet_end_system, 'planet' => $this->fleet_end_planet, ], |
|
| 431 | 431 | $this->getShipListArray(), |
| 432 | 432 | $this->speedPercentTenth |
| 433 | 433 | ); |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | function sys_user_vacation($user) { |
| 13 | 13 | global $config; |
| 14 | 14 | |
| 15 | - if(sys_get_param_str('vacation') == 'leave') { |
|
| 15 | + if (sys_get_param_str('vacation') == 'leave') { |
|
| 16 | 16 | if ($user['vacation'] < SN_TIME_NOW) { |
| 17 | 17 | $user['vacation'] = 0; |
| 18 | 18 | $user['vacation_next'] = SN_TIME_NOW + $config->player_vacation_timeout; |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | } |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | - if($user['vacation']) { |
|
| 23 | + if ($user['vacation']) { |
|
| 24 | 24 | // sn_sys_logout(false, true); |
| 25 | 25 | // core_auth::logout(false, true); |
| 26 | 26 | |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | \DBAL\DbQuery::build()->setTable('users')->setValues($field_set)->doInsert(); |
| 164 | 164 | $user_new = db_user_by_id(db_insert_id()); |
| 165 | 165 | |
| 166 | - if(!($options['galaxy'] && $options['system'] && $options['planet'])) { |
|
| 166 | + if (!($options['galaxy'] && $options['system'] && $options['planet'])) { |
|
| 167 | 167 | $options['galaxy'] = SN::$config->LastSettedGalaxyPos; |
| 168 | 168 | $options['system'] = SN::$config->LastSettedSystemPos; |
| 169 | 169 | $segment_size = floor(SN::$config->game_maxPlanet / 3); |
@@ -171,19 +171,19 @@ discard block |
||
| 171 | 171 | $segment++; |
| 172 | 172 | $options['planet'] = mt_rand(1 + $segment * $segment_size, ($segment + 1) * $segment_size); |
| 173 | 173 | |
| 174 | - while(true) { |
|
| 175 | - if($options['planet'] > SN::$config->game_maxPlanet) { |
|
| 174 | + while (true) { |
|
| 175 | + if ($options['planet'] > SN::$config->game_maxPlanet) { |
|
| 176 | 176 | $options['planet'] = mt_rand(0, $segment_size - 1) + 1; |
| 177 | 177 | $options['system']++; |
| 178 | 178 | } |
| 179 | - if($options['system'] > SN::$config->game_maxSystem) { |
|
| 179 | + if ($options['system'] > SN::$config->game_maxSystem) { |
|
| 180 | 180 | $options['system'] = 1; |
| 181 | 181 | $options['galaxy']++; |
| 182 | 182 | } |
| 183 | 183 | $options['galaxy'] > SN::$config->game_maxGalaxy ? $options['galaxy'] = 1 : false; |
| 184 | 184 | |
| 185 | 185 | $galaxy_row = DBStaticPlanet::db_planet_by_gspt($options['galaxy'], $options['system'], $options['planet'], PT_PLANET, true, 'id'); |
| 186 | - if(!$galaxy_row['id']) { |
|
| 186 | + if (!$galaxy_row['id']) { |
|
| 187 | 187 | SN::$config->db_saveItem(array( |
| 188 | 188 | 'LastSettedGalaxyPos' => $options['galaxy'], |
| 189 | 189 | 'LastSettedSystemPos' => $options['system'], |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | $username_safe = db_escape($username_unsafe); |
| 205 | 205 | doquery("REPLACE INTO `{{player_name_history}}` SET `player_id` = {$user_new['id']}, `player_name` = '{$username_safe}'"); |
| 206 | 206 | |
| 207 | - if(!empty($options['partner_id']) && ($referral_row = db_user_by_id($options['partner_id'], true))) { |
|
| 207 | + if (!empty($options['partner_id']) && ($referral_row = db_user_by_id($options['partner_id'], true))) { |
|
| 208 | 208 | doquery("INSERT INTO `{{referrals}}` SET `id` = {$user_new['id']}, `id_partner` = {$options['partner_id']}"); |
| 209 | 209 | } |
| 210 | 210 | |
@@ -92,8 +92,8 @@ discard block |
||
| 92 | 92 | $this->secret_word = SN::$sn_secret_word; |
| 93 | 93 | |
| 94 | 94 | $snTableNames = $this->db->schema()->getSnTables(); |
| 95 | - foreach($this->table_check as $table_name) { |
|
| 96 | - if(empty($snTableNames[$table_name])) { |
|
| 95 | + foreach ($this->table_check as $table_name) { |
|
| 96 | + if (empty($snTableNames[$table_name])) { |
|
| 97 | 97 | die('Если вы видите это сообщение первый раз после обновления релиза - просто перегрузите страницу.<br /> |
| 98 | 98 | В противном случае - сообщите Администрации сервера об ошибке.<br/> |
| 99 | 99 | Не хватает таблицы для работы системы авторизации: ' . $table_name); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | */ |
| 118 | 118 | // OK v4.6 |
| 119 | 119 | public function password_change($old_password_unsafe, $new_password_unsafe, $salt_unsafe = null) { |
| 120 | - if(!$this->password_check($old_password_unsafe)) { |
|
| 120 | + if (!$this->password_check($old_password_unsafe)) { |
|
| 121 | 121 | return false; |
| 122 | 122 | } |
| 123 | 123 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | // OK v4.5 |
| 139 | 139 | public function assign_from_db_row($row) { |
| 140 | 140 | $this->reset(); |
| 141 | - if(empty($row) || !is_array($row)) { |
|
| 141 | + if (empty($row) || !is_array($row)) { |
|
| 142 | 142 | return false; |
| 143 | 143 | } |
| 144 | 144 | $this->account_id = $row['account_id']; |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | $this->reset(); |
| 204 | 204 | |
| 205 | 205 | $email_safe = $this->db->db_escape($email_unsafe); |
| 206 | - if($email_safe) { |
|
| 206 | + if ($email_safe) { |
|
| 207 | 207 | $account_row = $this->db->doQueryAndFetch("SELECT * FROM `{{account}}` WHERE LOWER(`account_email`) = LOWER('{$email_safe}') FOR UPDATE;"); |
| 208 | 208 | |
| 209 | 209 | return $this->assign_from_db_row($account_row); |
@@ -283,11 +283,11 @@ discard block |
||
| 283 | 283 | `account_email` = LOWER('{$email_safe}'), |
| 284 | 284 | `account_language` = '{$language_safe}'" |
| 285 | 285 | ); |
| 286 | - if(!$result) { |
|
| 286 | + if (!$result) { |
|
| 287 | 287 | throw new Exception(REGISTER_ERROR_ACCOUNT_CREATE, ERR_ERROR); |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | - if(!($account_id = $this->db->db_insert_id())) { |
|
| 290 | + if (!($account_id = $this->db->db_insert_id())) { |
|
| 291 | 291 | throw new Exception(REGISTER_ERROR_ACCOUNT_CREATE, ERR_ERROR); |
| 292 | 292 | } |
| 293 | 293 | |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | WHERE `account_id` = '{$account_id_safe}'" |
| 318 | 318 | ) ? true : false; |
| 319 | 319 | |
| 320 | - if($result) { |
|
| 320 | + if ($result) { |
|
| 321 | 321 | $result = $this->db_get_by_id($this->account_id); |
| 322 | 322 | } |
| 323 | 323 | |
@@ -409,7 +409,7 @@ discard block |
||
| 409 | 409 | public function metamatter_change($change_type, $metamatter, $comment = false, $already_changed = false) { |
| 410 | 410 | global $debug, $mm_change_legit, $config; |
| 411 | 411 | |
| 412 | - if(!$this->is_exists || !($metamatter = round(floatval($metamatter)))) { |
|
| 412 | + if (!$this->is_exists || !($metamatter = round(floatval($metamatter)))) { |
|
| 413 | 413 | $debug->error('Ошибка при попытке манипуляции с ММ'); |
| 414 | 414 | return false; |
| 415 | 415 | } |
@@ -418,7 +418,7 @@ discard block |
||
| 418 | 418 | |
| 419 | 419 | $mm_change_legit = true; |
| 420 | 420 | // $sn_data_metamatter_db_name = pname_resource_name(RES_METAMATTER); |
| 421 | - if($already_changed) { |
|
| 421 | + if ($already_changed) { |
|
| 422 | 422 | $metamatter_total_delta = 0; |
| 423 | 423 | $result = -1; |
| 424 | 424 | } else { |
@@ -431,7 +431,7 @@ discard block |
||
| 431 | 431 | ($metamatter_total_delta ? ", `account_immortal` = IF(`account_metamatter_total` + '{$metamatter_total_delta}' >= {$config->player_metamatter_immortal} AND `account_immortal` IS NULL, NOW(), `account_immortal`), `account_metamatter_total` = `account_metamatter_total` + '{$metamatter_total_delta}'" : '') . |
| 432 | 432 | " WHERE `account_id` = {$account_id_safe}" |
| 433 | 433 | ); |
| 434 | - if(!$result) { |
|
| 434 | + if (!$result) { |
|
| 435 | 435 | $debug->error("Error adjusting Metamatter for player ID {$this->account_id} (Player Not Found?) with {$metamatter}. Reason: {$comment}", 'Metamatter Change', 402); |
| 436 | 436 | } |
| 437 | 437 | $result = SN::$db->db_affected_rows(); |
@@ -439,7 +439,7 @@ discard block |
||
| 439 | 439 | $this->awardImmortal($metamatter, $config); |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | - if(empty(core_auth::$user['id'])) { |
|
| 442 | + if (empty(core_auth::$user['id'])) { |
|
| 443 | 443 | $user_list = PlayerToAccountTranslate::db_translate_get_users_from_account_list(core_auth::$main_provider->provider_id, $this->account_id); |
| 444 | 444 | reset($user_list); |
| 445 | 445 | $user_id_unsafe = key($user_list); |
@@ -448,30 +448,30 @@ discard block |
||
| 448 | 448 | } |
| 449 | 449 | $user_id_safe = $this->db->db_escape($user_id_unsafe); |
| 450 | 450 | |
| 451 | - if(!$result) { |
|
| 451 | + if (!$result) { |
|
| 452 | 452 | $debug->error("Error adjusting Metamatter for player ID {$this->account_id} (Player Not Found?) with {$metamatter}. Reason: {$comment}", 'Metamatter Change', 402); |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | - if(!$already_changed) { |
|
| 455 | + if (!$already_changed) { |
|
| 456 | 456 | $this->account_metamatter += $metamatter; |
| 457 | 457 | $this->account_metamatter_total += $metamatter_total_delta; |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | - if(is_array($comment)) { |
|
| 460 | + if (is_array($comment)) { |
|
| 461 | 461 | $comment = call_user_func_array('sprintf', $comment); |
| 462 | 462 | } |
| 463 | 463 | |
| 464 | 464 | $result = $this->db_mm_log_insert($comment, $change_type, $metamatter, $user_id_unsafe); |
| 465 | 465 | |
| 466 | - if($metamatter > 0 && !empty($user_id_safe)) { |
|
| 466 | + if ($metamatter > 0 && !empty($user_id_safe)) { |
|
| 467 | 467 | $old_referral = doquery("SELECT * FROM `{{referrals}}` WHERE `id` = {$user_id_safe} LIMIT 1 FOR UPDATE;", '', true); |
| 468 | - if($old_referral['id']) { |
|
| 468 | + if ($old_referral['id']) { |
|
| 469 | 469 | $dark_matter_from_metamatter = $metamatter * AFFILIATE_MM_TO_REFERRAL_DM; |
| 470 | 470 | doquery("UPDATE `{{referrals}}` SET dark_matter = dark_matter + '{$dark_matter_from_metamatter}' WHERE `id` = {$user_id_safe} LIMIT 1;"); |
| 471 | 471 | $new_referral = doquery("SELECT * FROM `{{referrals}}` WHERE `id` = {$user_id_safe} LIMIT 1;", '', true); |
| 472 | 472 | |
| 473 | 473 | $partner_bonus = floor($new_referral['dark_matter'] / $config->rpg_bonus_divisor) - ($old_referral['dark_matter'] >= $config->rpg_bonus_minimum ? floor($old_referral['dark_matter'] / $config->rpg_bonus_divisor) : 0); |
| 474 | - if($partner_bonus > 0 && $new_referral['dark_matter'] >= $config->rpg_bonus_minimum) { |
|
| 474 | + if ($partner_bonus > 0 && $new_referral['dark_matter'] >= $config->rpg_bonus_minimum) { |
|
| 475 | 475 | rpg_points_change($new_referral['id_partner'], RPG_REFERRAL_BOUGHT_MM, $partner_bonus, "Incoming MM From Referral ID {$user_id_safe}"); |
| 476 | 476 | } |
| 477 | 477 | } |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | * @throws Exception |
| 488 | 488 | */ |
| 489 | 489 | public function cookieSet($rememberMe = false, $domain = null) { |
| 490 | - if(!$this->is_exists) { |
|
| 490 | + if (!$this->is_exists) { |
|
| 491 | 491 | throw new Exception(LOGIN_ERROR_NO_ACCOUNT_FOR_COOKIE_SET, ERR_ERROR); |
| 492 | 492 | } |
| 493 | 493 | |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | // OK v4.1 |
| 507 | 507 | public function cookieClear($domain = null) { |
| 508 | 508 | // Автоматически вообще-то - если установлена кука имперсонатора - то чистим обычную, а куку имперсонатора - копируем в неё |
| 509 | - if(!empty($_COOKIE[$this->cookie_name_impersonate])) { |
|
| 509 | + if (!empty($_COOKIE[$this->cookie_name_impersonate])) { |
|
| 510 | 510 | sn_setcookie($this->cookie_name, $_COOKIE[$this->cookie_name_impersonate], SN_TIME_NOW + PERIOD_YEAR, $this->sn_root_path, $domain); |
| 511 | 511 | sn_setcookie($this->cookie_name_impersonate, '', SN_TIME_NOW - PERIOD_WEEK, $this->sn_root_path, $domain); |
| 512 | 512 | } else { |
@@ -516,14 +516,14 @@ discard block |
||
| 516 | 516 | |
| 517 | 517 | public function cookieLogin(&$rememberMe = false) { |
| 518 | 518 | // Пытаемся войти по куке |
| 519 | - if(!empty($_COOKIE[$this->cookie_name])) { |
|
| 520 | - if(count(explode("/%/", $_COOKIE[$this->cookie_name])) < 4) { |
|
| 519 | + if (!empty($_COOKIE[$this->cookie_name])) { |
|
| 520 | + if (count(explode("/%/", $_COOKIE[$this->cookie_name])) < 4) { |
|
| 521 | 521 | list($account_id_unsafe, $cookie_password_hash_salted, $user_remember_me) = explode(AUTH_COOKIE_DELIMETER, $_COOKIE[$this->cookie_name]); |
| 522 | 522 | } else { |
| 523 | 523 | list($account_id_unsafe, $user_name, $cookie_password_hash_salted, $user_remember_me) = explode("/%/", $_COOKIE[$this->cookie_name]); |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | - if( |
|
| 526 | + if ( |
|
| 527 | 527 | $this->db_get_by_id($account_id_unsafe) |
| 528 | 528 | && ($this->password_encode_for_cookie($this->account_password) == $cookie_password_hash_salted) |
| 529 | 529 | ) { |
@@ -548,10 +548,10 @@ discard block |
||
| 548 | 548 | * @param classConfig $config |
| 549 | 549 | */ |
| 550 | 550 | protected function awardImmortal($metamatter, $config) { |
| 551 | - if(!is_object($awardModule = moduleAward())) { |
|
| 551 | + if (!is_object($awardModule = moduleAward())) { |
|
| 552 | 552 | return; |
| 553 | 553 | } |
| 554 | - if ($this->account_metamatter + $metamatter >= $config->player_metamatter_immortal ) { |
|
| 554 | + if ($this->account_metamatter + $metamatter >= $config->player_metamatter_immortal) { |
|
| 555 | 555 | $account_translation = PlayerToAccountTranslate::db_translate_get_users_from_account_list(ACCOUNT_PROVIDER_LOCAL, $this->account_id); |
| 556 | 556 | if (!empty($account_translation)) { |
| 557 | 557 | reset($account_translation); |
@@ -573,10 +573,10 @@ discard block |
||
| 573 | 573 | * @return bool|mysqli_result|null |
| 574 | 574 | */ |
| 575 | 575 | public function getMetamatterSum($where = '', $group = '') { |
| 576 | - if(is_array($where) && !empty($where)) { |
|
| 576 | + if (is_array($where) && !empty($where)) { |
|
| 577 | 577 | $where = implode(' AND ', $where); |
| 578 | 578 | } |
| 579 | - if(is_array($group) && !empty($group)) { |
|
| 579 | + if (is_array($group) && !empty($group)) { |
|
| 580 | 580 | $group = implode(',', $group); |
| 581 | 581 | } |
| 582 | 582 | |