@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | * @copyright 2008-2015 Gorlum for Project "SuperNova.WS" |
6 | 6 | */ |
7 | 7 | |
8 | -if(!defined('INSIDE')) { |
|
8 | +if (!defined('INSIDE')) { |
|
9 | 9 | die(); |
10 | 10 | } |
11 | 11 | |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | |
14 | 14 | function db_change_units_perform($query, $tablename, $object_id) { |
15 | 15 | $query = implode(',', $query); |
16 | - if($query && $object_id) { |
|
16 | + if ($query && $object_id) { |
|
17 | 17 | return SN::db_upd_record_by_id($tablename == 'users' ? LOC_USER : LOC_PLANET, $object_id, $query); |
18 | 18 | } |
19 | 19 | |
@@ -31,15 +31,15 @@ discard block |
||
31 | 31 | |
32 | 32 | $group = sn_get_groups('resources_loot'); |
33 | 33 | |
34 | - foreach($unit_list as $unit_id => $unit_amount) { |
|
35 | - if(!in_array($unit_id, $group)) { |
|
34 | + foreach ($unit_list as $unit_id => $unit_amount) { |
|
35 | + if (!in_array($unit_id, $group)) { |
|
36 | 36 | // TODO - remove later |
37 | 37 | print('<h1>СООБЩИТЕ ЭТО АДМИНУ: db_change_units() вызван для не-ресурсов!</h1>'); |
38 | 38 | pdump(debug_backtrace()); |
39 | 39 | die('db_change_units() вызван для не-ресурсов!'); |
40 | 40 | } |
41 | 41 | |
42 | - if(!$unit_amount) { |
|
42 | + if (!$unit_amount) { |
|
43 | 43 | continue; |
44 | 44 | } |
45 | 45 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $unit_location = sys_get_unit_location($user, $planet, $unit_id); |
49 | 49 | |
50 | 50 | // Changing value in object |
51 | - switch($unit_location) { |
|
51 | + switch ($unit_location) { |
|
52 | 52 | case LOC_USER: |
53 | 53 | $user[$unit_db_name] += $unit_amount; |
54 | 54 | break; |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @deprecated |
76 | 76 | */ |
77 | 77 | function doquery($query, $table = '', $fetch = false, $skip_query_check = false) { |
78 | - if(is_bool($table) || !is_string($table)) { |
|
78 | + if (is_bool($table) || !is_string($table)) { |
|
79 | 79 | $fetch = $table; |
80 | 80 | } |
81 | 81 | return SN::$db->doquery($query, $fetch, $skip_query_check); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if((!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) && (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)) { |
|
3 | +if ((!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) && (!defined('SN_IN_ALLY') || SN_IN_ALLY !== true)) { |
|
4 | 4 | $debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403); |
5 | 5 | } |
6 | 6 | |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | |
28 | 28 | // $dm_db_name = pname_resource_name(RES_DARK_MATTER); |
29 | 29 | $exchangeTo = in_array($exchangeTo = sys_get_param_int('exchangeTo'), sn_get_groups('resources_trader')) ? $exchangeTo : 0; |
30 | - if($exchangeTo && is_array($tradeList = $_POST['spend'])) { |
|
30 | + if ($exchangeTo && is_array($tradeList = $_POST['spend'])) { |
|
31 | 31 | $value = 0; |
32 | 32 | $qry = array(); |
33 | 33 | |
34 | 34 | SN::db_transaction_start(); |
35 | - if($planetrow['id_owner']) { |
|
35 | + if ($planetrow['id_owner']) { |
|
36 | 36 | $global_data = sys_o_get_updated($user, $planetrow, SN_TIME_NOW); |
37 | 37 | $planetrow = $global_data['planet']; |
38 | 38 | } |
@@ -41,27 +41,27 @@ discard block |
||
41 | 41 | $user = db_user_by_id($user['id'], true); |
42 | 42 | } |
43 | 43 | |
44 | - foreach(sn_get_groups('resources_trader') as $resource_id) { |
|
44 | + foreach (sn_get_groups('resources_trader') as $resource_id) { |
|
45 | 45 | $amount = floatval($tradeList[$resource_id]); |
46 | - if($amount < 0) { |
|
46 | + if ($amount < 0) { |
|
47 | 47 | $debug->error('Trying to supply negative resource amount on Black Market Page', 'Hack Attempt', 305); |
48 | 48 | } |
49 | 49 | |
50 | - if($resource_id == RES_DARK_MATTER && $exchangeTo == RES_DARK_MATTER) { |
|
50 | + if ($resource_id == RES_DARK_MATTER && $exchangeTo == RES_DARK_MATTER) { |
|
51 | 51 | continue; |
52 | 52 | } |
53 | 53 | |
54 | 54 | $resource_db_name = pname_resource_name($resource_id); |
55 | - if($exchangeTo == RES_DARK_MATTER) { |
|
55 | + if ($exchangeTo == RES_DARK_MATTER) { |
|
56 | 56 | $sign = '+'; |
57 | 57 | $amount = floor($tradeList[RES_DARK_MATTER] / 3 * $rates[RES_DARK_MATTER] / $rates[$resource_id]); |
58 | 58 | $value += $amount; |
59 | 59 | } else { |
60 | 60 | $value += floor($amount * $rates[$resource_id] / $rates[$exchangeTo]); |
61 | - if($resource_id == RES_DARK_MATTER) { |
|
61 | + if ($resource_id == RES_DARK_MATTER) { |
|
62 | 62 | $amount = 0; |
63 | 63 | } else { |
64 | - if(mrc_get_level($user, $planetrow, $resource_id, true) < $amount) { |
|
64 | + if (mrc_get_level($user, $planetrow, $resource_id, true) < $amount) { |
|
65 | 65 | $intError = MARKET_NO_RESOURCES; |
66 | 66 | break; |
67 | 67 | } |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
73 | - if($amount) { |
|
73 | + if ($amount) { |
|
74 | 74 | $qry[] = "`{$resource_db_name}` = `{$resource_db_name}` {$sign} {$amount}"; |
75 | 75 | } |
76 | 76 | } |
77 | 77 | |
78 | - if($exchangeTo != RES_DARK_MATTER) { |
|
78 | + if ($exchangeTo != RES_DARK_MATTER) { |
|
79 | 79 | $amount = floor($value); |
80 | 80 | $exchange_to_db_name = pname_resource_name($exchangeTo); |
81 | 81 | $qry[] = "`{$exchange_to_db_name}` = `{$exchange_to_db_name}` + {$amount}"; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $intError = $value <= 0 ? MARKET_ZERO_DEAL : $intError; |
87 | 87 | $intError = mrc_get_level($user, null, RES_DARK_MATTER) < $operation_cost ? MARKET_NO_DM : $intError; |
88 | 88 | |
89 | - if($intError == MARKET_DEAL) { |
|
89 | + if ($intError == MARKET_DEAL) { |
|
90 | 90 | $qry = implode(', ', $qry); |
91 | 91 | $table = $planetrow['id_owner'] ? 'planets' : 'users'; |
92 | 92 | |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | 'EXCHANGE_TO_RESOURCE_ID' => $exchangeTo, |
110 | 110 | )); |
111 | 111 | |
112 | - foreach(sn_get_groups('resources_trader') as $resource_id) { |
|
113 | - if($resource_id == RES_DARK_MATTER) { |
|
112 | + foreach (sn_get_groups('resources_trader') as $resource_id) { |
|
113 | + if ($resource_id == RES_DARK_MATTER) { |
|
114 | 114 | $amount = floor(mrc_get_level($user, null, RES_DARK_MATTER) - $config->rpg_cost_trader); |
115 | 115 | } else { |
116 | 116 | $amount = floor(mrc_get_level($user, $planetrow, $resource_id)); |
@@ -3,18 +3,18 @@ discard block |
||
3 | 3 | use Fleet\DbFleetStatic; |
4 | 4 | use Planet\DBStaticPlanet; |
5 | 5 | |
6 | -if(SN_IN_FLEET !== true) { |
|
6 | +if (SN_IN_FLEET !== true) { |
|
7 | 7 | $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403); |
8 | 8 | } |
9 | 9 | |
10 | 10 | $fleetid = sys_get_param_id('fleetid'); |
11 | 11 | |
12 | -if(!is_numeric($fleetid) || empty($fleetid)) { |
|
12 | +if (!is_numeric($fleetid) || empty($fleetid)) { |
|
13 | 13 | sys_redirect("fleet.php"); |
14 | 14 | } |
15 | 15 | |
16 | 16 | $fleet = DbFleetStatic::db_fleet_get($fleetid); |
17 | -if(!$fleet) { |
|
17 | +if (!$fleet) { |
|
18 | 18 | SnTemplate::messageBox($lang['fl_fleet_not_exists'], $lang['fl_error']); |
19 | 19 | } |
20 | 20 | |
@@ -22,8 +22,8 @@ discard block |
||
22 | 22 | SnTemplate::messageBox($lang['fl_isback'], $lang['fl_error']); |
23 | 23 | } |
24 | 24 | |
25 | -if($fleet['fleet_owner'] != $user['id']) { |
|
26 | - $debug->warning($lang['fl_aks_hack_wrong_fleet'],'Wrong Fleet Owner',301); |
|
25 | +if ($fleet['fleet_owner'] != $user['id']) { |
|
26 | + $debug->warning($lang['fl_aks_hack_wrong_fleet'], 'Wrong Fleet Owner', 301); |
|
27 | 27 | SnTemplate::messageBox($lang['fl_aks_hack_wrong_fleet'], $lang['fl_error']); |
28 | 28 | } |
29 | 29 | |
@@ -57,8 +57,8 @@ discard block |
||
57 | 57 | 'MISSION_NAME' => $lang['type_mission'][MT_AKS], |
58 | 58 | )); |
59 | 59 | |
60 | -if($aks['eingeladen'] && is_array($members = db_user_list("`id` in ({$aks['eingeladen']})")) && !empty($members)) { |
|
61 | - foreach($members as $row) { |
|
60 | +if ($aks['eingeladen'] && is_array($members = db_user_list("`id` in ({$aks['eingeladen']})")) && !empty($members)) { |
|
61 | + foreach ($members as $row) { |
|
62 | 62 | $template->assign_block_vars('invited', array( |
63 | 63 | 'NAME' => $row['username'], |
64 | 64 | )); |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | $i++; |
69 | 69 | $fleet_row = DbFleetStatic::db_fleet_get($fleetid); |
70 | 70 | |
71 | -if(is_array($fleet_row) && !empty($fleet_row)) { |
|
71 | +if (is_array($fleet_row) && !empty($fleet_row)) { |
|
72 | 72 | $planet_start = DBStaticPlanet::db_planet_by_id($fleet_row['fleet_start_planet_id']); |
73 | 73 | $fleet_row['fleet_start_name'] = !empty($planet_start['name']) ? $planet_start['name'] : ''; |
74 | 74 | $planet_end = DBStaticPlanet::db_planet_by_id($fleet_row['fleet_end_planet_id']); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | |
77 | 77 | $fleet_data = tpl_parse_fleet_db($fleet_row, $i, $user); |
78 | 78 | $template->assign_block_vars('fleets', $fleet_data['fleet']); |
79 | -foreach($fleet_data['ships'] as $ship_data) { |
|
79 | +foreach ($fleet_data['ships'] as $ship_data) { |
|
80 | 80 | $template->assign_block_vars('fleets.ships', $ship_data); |
81 | 81 | } |
82 | 82 | } |
@@ -4,18 +4,18 @@ discard block |
||
4 | 4 | use Fleet\FleetStatic; |
5 | 5 | use Planet\DBStaticPlanet; |
6 | 6 | |
7 | -if(SN_IN_FLEET !== true) { |
|
7 | +if (SN_IN_FLEET !== true) { |
|
8 | 8 | $debug->error("Attempt to call FLEET page mode {$mode} directly - not from fleet.php", 'Forbidden', 403); |
9 | 9 | } |
10 | 10 | |
11 | 11 | $template = SnTemplate::gettemplate('fleet1', true); |
12 | 12 | |
13 | 13 | $ships = sys_get_param('ships', array()); |
14 | -if(!is_array($ships)) { |
|
14 | +if (!is_array($ships)) { |
|
15 | 15 | $ships = array(); |
16 | 16 | } |
17 | 17 | |
18 | -foreach(array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) { |
|
18 | +foreach (array(PT_PLANET, PT_DEBRIS, PT_MOON) as $possible_planet_type_id) { |
|
19 | 19 | $template->assign_block_vars('possible_planet_type_id', array( |
20 | 20 | 'ID' => $possible_planet_type_id, |
21 | 21 | 'NAME' => $lang['sys_planet_type_sh'][$possible_planet_type_id], |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | 'START_NAME' => $planetrow['name'], |
29 | 29 | ); |
30 | 30 | |
31 | -if(!empty($TargetPlanet)) { |
|
31 | +if (!empty($TargetPlanet)) { |
|
32 | 32 | $template_route += array( |
33 | 33 | 'END_TYPE_TEXT_SH' => $lang['sys_planet_type_sh'][$TargetPlanet['planet_type']], |
34 | 34 | 'END_COORDS' => uni_render_coordinates($TargetPlanet), |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | $template->assign_block_vars('fleets', $template_route); |
40 | 40 | |
41 | 41 | $sn_groups_fleet = sn_get_groups('fleet'); |
42 | -foreach($ships as $ship_id => $ship_count) { |
|
43 | - if(in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
42 | +foreach ($ships as $ship_id => $ship_count) { |
|
43 | + if (in_array($ship_id, $sn_groups_fleet) && $ship_count) { |
|
44 | 44 | $ship_info = get_unit_param($ship_id); |
45 | - if($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) { |
|
45 | + if ($ship_count > mrc_get_level($user, $planetrow, $ship_id, false, true)) { |
|
46 | 46 | $page .= $lang['fl_noenought']; |
47 | 47 | } else { |
48 | 48 | $fleet['fleetarray'][$ship_id] = $ship_count; |
@@ -61,13 +61,13 @@ discard block |
||
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
64 | -if(empty($fleet['fleetarray'])) { |
|
64 | +if (empty($fleet['fleetarray'])) { |
|
65 | 65 | SnTemplate::messageBox($lang['fl_err_no_ships'], $lang['fl_error'], 'fleet' . DOT_PHP_EX, 5); |
66 | 66 | } |
67 | 67 | |
68 | 68 | // Building list of shortcuts |
69 | 69 | $query = doquery("SELECT * FROM {{notes}} WHERE `owner` = {$user['id']} AND `galaxy` <> 0 AND `system` <> 0 AND `planet` <> 0 ORDER BY `priority` DESC, `galaxy`, `system`, `planet`, `planet_type`;"); |
70 | -while($shortcut = db_fetch($query)) { |
|
70 | +while ($shortcut = db_fetch($query)) { |
|
71 | 71 | $template->assign_block_vars('shortcut', array( |
72 | 72 | 'NAME' => $shortcut['title'], |
73 | 73 | 'GALAXY' => $shortcut['galaxy'], |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | // Building list of own planets & moons |
84 | -$colonies = DBStaticPlanet::db_planet_list_sorted ( $user ); |
|
85 | -if(count($colonies) > 1) { |
|
84 | +$colonies = DBStaticPlanet::db_planet_list_sorted($user); |
|
85 | +if (count($colonies) > 1) { |
|
86 | 86 | // while($row = db_fetch($colonies)) |
87 | - foreach($colonies as $row) { |
|
87 | + foreach ($colonies as $row) { |
|
88 | 88 | $template->assign_block_vars('colonies', array( |
89 | 89 | 'NAME' => $row['name'], |
90 | 90 | 'GALAXY' => $row['galaxy'], |
@@ -99,9 +99,9 @@ discard block |
||
99 | 99 | //ACS Start |
100 | 100 | //Need to look for acs attacks. |
101 | 101 | $aks_madnessred = DbFleetStatic::dbAcsGetAll(); |
102 | -while($row = db_fetch($aks_madnessred)) { |
|
102 | +while ($row = db_fetch($aks_madnessred)) { |
|
103 | 103 | $members = explode(',', $row['eingeladen']); |
104 | - foreach($members as $a => $b) { |
|
104 | + foreach ($members as $a => $b) { |
|
105 | 105 | if ($b == $user['id']) { |
106 | 106 | $template->assign_block_vars('acss', array( |
107 | 107 | 'ID' => $row['id'], |
@@ -6,12 +6,12 @@ discard block |
||
6 | 6 | $uni_galaxy = sys_get_param_int('galaxy', $planetrow['galaxy']); |
7 | 7 | $uni_system = sys_get_param_int('system'); |
8 | 8 | |
9 | - if($uni_galaxy < 1 || $uni_galaxy > $config->game_maxGalaxy) |
|
9 | + if ($uni_galaxy < 1 || $uni_galaxy > $config->game_maxGalaxy) |
|
10 | 10 | { |
11 | 11 | throw new exception($lang['uni_msg_error_wrong_galaxy'], ERR_ERROR); |
12 | 12 | } |
13 | 13 | |
14 | - if($uni_system < 0 || $uni_system > $config->game_maxSystem) |
|
14 | + if ($uni_system < 0 || $uni_system > $config->game_maxSystem) |
|
15 | 15 | { |
16 | 16 | throw new exception($lang['uni_msg_error_wrong_system'], ERR_ERROR); |
17 | 17 | } |
@@ -20,12 +20,12 @@ discard block |
||
20 | 20 | $uni_row['universe_price'] += $uni_system ? $config->uni_price_system : $config->uni_price_galaxy; |
21 | 21 | $uni_row['universe_name'] = strip_tags($uni_row['universe_name'] ? $uni_row['universe_name'] : ($uni_system ? "{$lang['sys_system']} [{$uni_galaxy}:{$uni_system}]" : "{$lang['sys_galaxy']} {$uni_galaxy}")); |
22 | 22 | |
23 | - if(sys_get_param_str('uni_name_submit')) |
|
23 | + if (sys_get_param_str('uni_name_submit')) |
|
24 | 24 | { |
25 | 25 | $uni_row['universe_name'] = strip_tags(sys_get_param_str('uni_name')); |
26 | 26 | |
27 | 27 | $uni_price = sys_get_param_float('uni_price'); |
28 | - if($uni_price < $uni_row['universe_price']) |
|
28 | + if ($uni_price < $uni_row['universe_price']) |
|
29 | 29 | { |
30 | 30 | throw new exception($lang['uni_msg_error_low_price'], ERR_ERROR); |
31 | 31 | } |
@@ -34,12 +34,12 @@ discard block |
||
34 | 34 | SN::db_transaction_start(); |
35 | 35 | $user = db_user_by_id($user['id'], true); |
36 | 36 | // if($user[get_unit_param(RES_DARK_MATTER, P_NAME)] < $uni_price) |
37 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
37 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < $uni_price) |
|
38 | 38 | { |
39 | 39 | throw new exception($lang['uni_msg_error_no_dm'], ERR_ERROR); |
40 | 40 | } |
41 | 41 | |
42 | - if(!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name'))) |
|
42 | + if (!rpg_points_change($user['id'], RPG_RENAME, -$uni_price, "Renaming [{$uni_galaxy}:{$uni_system}] to " . sys_get_param_str_unsafe('uni_name'))) |
|
43 | 43 | { |
44 | 44 | throw new exception($lang['sys_msg_err_update_dm'], ERR_ERROR); |
45 | 45 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if(!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) |
|
3 | +if (!defined('SN_IN_MARKET') || SN_IN_MARKET !== true) |
|
4 | 4 | { |
5 | 5 | $debug->error("Attempt to call market page mode {$mode} directly - not from market.php", 'Forbidden', 403); |
6 | 6 | } |
@@ -15,50 +15,50 @@ discard block |
||
15 | 15 | )); |
16 | 16 | |
17 | 17 | $info_action = sys_get_param_int('action'); |
18 | -if($info_action) |
|
18 | +if ($info_action) |
|
19 | 19 | { |
20 | 20 | try |
21 | 21 | { |
22 | 22 | SN::db_transaction_start(); |
23 | 23 | |
24 | 24 | $user = db_user_by_id($user['id'], true); |
25 | - if(mrc_get_level($user, null, RES_DARK_MATTER) < $config->rpg_cost_info) |
|
25 | + if (mrc_get_level($user, null, RES_DARK_MATTER) < $config->rpg_cost_info) |
|
26 | 26 | { |
27 | 27 | throw new Exception(MARKET_NO_DM, ERR_ERROR); |
28 | 28 | } |
29 | 29 | |
30 | - switch($info_action) |
|
30 | + switch ($info_action) |
|
31 | 31 | { |
32 | 32 | case MARKET_INFO_PLAYER: |
33 | 33 | $user_info_name_unsafe = sys_get_param_str_unsafe('user_info_name'); |
34 | - if(!$user_info_name_unsafe) |
|
34 | + if (!$user_info_name_unsafe) |
|
35 | 35 | { |
36 | 36 | throw new Exception(MARKET_INFO_PLAYER_WRONG, ERR_ERROR); |
37 | 37 | } |
38 | 38 | |
39 | - if(is_id($user_info_name_unsafe)) |
|
39 | + if (is_id($user_info_name_unsafe)) |
|
40 | 40 | { |
41 | 41 | $user_info = db_user_by_id($user_info_name_unsafe, true, '`id`, `username`', true); |
42 | 42 | } |
43 | - if(!is_array($user_info)) |
|
43 | + if (!is_array($user_info)) |
|
44 | 44 | { |
45 | 45 | $user_info = db_user_by_username($user_info_name_unsafe, true); |
46 | 46 | } |
47 | - if(!is_array($user_info)) |
|
47 | + if (!is_array($user_info)) |
|
48 | 48 | { |
49 | 49 | throw new Exception(MARKET_INFO_PLAYER_NOT_FOUND, ERR_ERROR); |
50 | 50 | } |
51 | - if($user_info['id'] == $user['id']) |
|
51 | + if ($user_info['id'] == $user['id']) |
|
52 | 52 | { |
53 | 53 | throw new Exception(MARKET_INFO_PLAYER_SAME, ERR_ERROR); |
54 | 54 | } |
55 | 55 | |
56 | 56 | $msg_text = array(); |
57 | - foreach(sn_get_groups('mercenaries') as $mercenary_id) |
|
57 | + foreach (sn_get_groups('mercenaries') as $mercenary_id) |
|
58 | 58 | { |
59 | 59 | $msg_text[] = "{$lang['tech'][$mercenary_id]} - " . (($mercenary_level = mrc_get_level($user_info, false, $mercenary_id)) ? "{$lang['sys_level']} {$mercenary_level}" : $lang['eco_mrk_info_not_hired']); |
60 | 60 | } |
61 | - if($mercenary_level = mrc_get_level($user_info, false, UNIT_PREMIUM)) |
|
61 | + if ($mercenary_level = mrc_get_level($user_info, false, UNIT_PREMIUM)) |
|
62 | 62 | { |
63 | 63 | $msg_text[] = "{$lang['tech'][UNIT_PREMIUM]} - {$mercenary_level} {$lang['sys_level']}"; |
64 | 64 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | break; |
73 | 73 | } |
74 | 74 | |
75 | - if(!rpg_points_change($user['id'], RPG_MARKET_INFO_MERCENARY, -$config->rpg_cost_info, "Using Black Market page {$lang['eco_mrk_info']} - getting info about user ID {$user_info['id']}")) |
|
75 | + if (!rpg_points_change($user['id'], RPG_MARKET_INFO_MERCENARY, -$config->rpg_cost_info, "Using Black Market page {$lang['eco_mrk_info']} - getting info about user ID {$user_info['id']}")) |
|
76 | 76 | { |
77 | 77 | // TODO: throw new Exception(MARKET_INFO_PLAYER_SAME, ERR_ERROR); |
78 | 78 | } |
@@ -109,33 +109,33 @@ discard block |
||
109 | 109 | `ube_report_time_combat` = '" . date(FMT_DATE_TIME_SQL, $combat_data[UBE_TIME]) . "', |
110 | 110 | `ube_report_time_spent` = {$combat_data[UBE_TIME_SPENT]}, |
111 | 111 | |
112 | - `ube_report_combat_admin` = " . (int)$combat_data[UBE_OPTIONS][UBE_COMBAT_ADMIN] . ", |
|
112 | + `ube_report_combat_admin` = " . (int) $combat_data[UBE_OPTIONS][UBE_COMBAT_ADMIN] . ", |
|
113 | 113 | `ube_report_mission_type` = {$combat_data[UBE_OPTIONS][UBE_MISSION_TYPE]}, |
114 | 114 | |
115 | 115 | `ube_report_combat_result` = {$outcome[UBE_COMBAT_RESULT]}, |
116 | - `ube_report_combat_sfr` = " . (int)$outcome[UBE_SFR] . ", |
|
116 | + `ube_report_combat_sfr` = " . (int) $outcome[UBE_SFR] . ", |
|
117 | 117 | |
118 | - `ube_report_debris_metal` = " . (float)$outcome[UBE_DEBRIS][RES_METAL] . ", |
|
119 | - `ube_report_debris_crystal` = " . (float)$outcome[UBE_DEBRIS][RES_CRYSTAL] . ", |
|
118 | + `ube_report_debris_metal` = " . (float) $outcome[UBE_DEBRIS][RES_METAL] . ", |
|
119 | + `ube_report_debris_crystal` = " . (float) $outcome[UBE_DEBRIS][RES_CRYSTAL] . ", |
|
120 | 120 | `ube_report_debris_total_in_metal` = " . $ube_report_debris_total_in_metal . ", |
121 | 121 | |
122 | - `ube_report_planet_id` = " . (int)$outcome[UBE_PLANET][PLANET_ID] . ", |
|
122 | + `ube_report_planet_id` = " . (int) $outcome[UBE_PLANET][PLANET_ID] . ", |
|
123 | 123 | `ube_report_planet_name` = '" . SN::$db->db_escape($outcome[UBE_PLANET][PLANET_NAME]) . "', |
124 | - `ube_report_planet_size` = " . (int)$outcome[UBE_PLANET][PLANET_SIZE] . ", |
|
125 | - `ube_report_planet_galaxy` = " . (int)$outcome[UBE_PLANET][PLANET_GALAXY] . ", |
|
126 | - `ube_report_planet_system` = " . (int)$outcome[UBE_PLANET][PLANET_SYSTEM] . ", |
|
127 | - `ube_report_planet_planet` = " . (int)$outcome[UBE_PLANET][PLANET_PLANET] . ", |
|
128 | - `ube_report_planet_planet_type` = " . (int)$outcome[UBE_PLANET][PLANET_TYPE] . ", |
|
124 | + `ube_report_planet_size` = " . (int) $outcome[UBE_PLANET][PLANET_SIZE] . ", |
|
125 | + `ube_report_planet_galaxy` = " . (int) $outcome[UBE_PLANET][PLANET_GALAXY] . ", |
|
126 | + `ube_report_planet_system` = " . (int) $outcome[UBE_PLANET][PLANET_SYSTEM] . ", |
|
127 | + `ube_report_planet_planet` = " . (int) $outcome[UBE_PLANET][PLANET_PLANET] . ", |
|
128 | + `ube_report_planet_planet_type` = " . (int) $outcome[UBE_PLANET][PLANET_TYPE] . ", |
|
129 | 129 | |
130 | - `ube_report_moon` = " . (int)$outcome[UBE_MOON] . ", |
|
131 | - `ube_report_moon_chance` = " . (int)$outcome[UBE_MOON_CHANCE] . ", |
|
132 | - `ube_report_moon_size` = " . (float)$outcome[UBE_MOON_SIZE] . ", |
|
130 | + `ube_report_moon` = " . (int) $outcome[UBE_MOON] . ", |
|
131 | + `ube_report_moon_chance` = " . (int) $outcome[UBE_MOON_CHANCE] . ", |
|
132 | + `ube_report_moon_size` = " . (float) $outcome[UBE_MOON_SIZE] . ", |
|
133 | 133 | |
134 | - `ube_report_moon_reapers` = " . (int)$outcome[UBE_MOON_REAPERS] . ", |
|
135 | - `ube_report_moon_destroy_chance` = " . (int)$outcome[UBE_MOON_DESTROY_CHANCE] . ", |
|
136 | - `ube_report_moon_reapers_die_chance` = " . (int)$outcome[UBE_MOON_REAPERS_DIE_CHANCE] . ", |
|
134 | + `ube_report_moon_reapers` = " . (int) $outcome[UBE_MOON_REAPERS] . ", |
|
135 | + `ube_report_moon_destroy_chance` = " . (int) $outcome[UBE_MOON_DESTROY_CHANCE] . ", |
|
136 | + `ube_report_moon_reapers_die_chance` = " . (int) $outcome[UBE_MOON_REAPERS_DIE_CHANCE] . ", |
|
137 | 137 | |
138 | - `ube_report_capture_result` = " . (int)$outcome[UBE_CAPTURE_RESULT] . " |
|
138 | + `ube_report_capture_result` = " . (int) $outcome[UBE_CAPTURE_RESULT] . " |
|
139 | 139 | "); |
140 | 140 | $ube_report_id = $combat_data[UBE_REPORT_ID] = SN::$db->db_insert_id(); |
141 | 141 | |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | $player_id, |
147 | 147 | |
148 | 148 | "'" . SN::$db->db_escape($player_info[UBE_NAME]) . "'", |
149 | - (int)$player_info[UBE_ATTACKER], |
|
149 | + (int) $player_info[UBE_ATTACKER], |
|
150 | 150 | |
151 | - (float)$player_info[UBE_BONUSES][UBE_ATTACK], |
|
152 | - (float)$player_info[UBE_BONUSES][UBE_SHIELD], |
|
153 | - (float)$player_info[UBE_BONUSES][UBE_ARMOR], |
|
151 | + (float) $player_info[UBE_BONUSES][UBE_ATTACK], |
|
152 | + (float) $player_info[UBE_BONUSES][UBE_SHIELD], |
|
153 | + (float) $player_info[UBE_BONUSES][UBE_ARMOR], |
|
154 | 154 | ); |
155 | 155 | } |
156 | 156 | |
@@ -163,20 +163,20 @@ discard block |
||
163 | 163 | $fleet_info[UBE_OWNER], |
164 | 164 | $fleet_id, |
165 | 165 | |
166 | - (float)$fleet_info[UBE_PLANET][PLANET_ID], |
|
166 | + (float) $fleet_info[UBE_PLANET][PLANET_ID], |
|
167 | 167 | "'" . SN::$db->db_escape($fleet_info[UBE_PLANET][PLANET_NAME]) . "'", |
168 | - (int)$fleet_info[UBE_PLANET][PLANET_GALAXY], |
|
169 | - (int)$fleet_info[UBE_PLANET][PLANET_SYSTEM], |
|
170 | - (int)$fleet_info[UBE_PLANET][PLANET_PLANET], |
|
171 | - (int)$fleet_info[UBE_PLANET][PLANET_TYPE], |
|
172 | - |
|
173 | - (float)$fleet_info[UBE_RESOURCES][RES_METAL], |
|
174 | - (float)$fleet_info[UBE_RESOURCES][RES_CRYSTAL], |
|
175 | - (float)$fleet_info[UBE_RESOURCES][RES_DEUTERIUM], |
|
176 | - |
|
177 | - (float)$fleet_info[UBE_BONUSES][UBE_ATTACK], |
|
178 | - (float)$fleet_info[UBE_BONUSES][UBE_SHIELD], |
|
179 | - (float)$fleet_info[UBE_BONUSES][UBE_ARMOR], |
|
168 | + (int) $fleet_info[UBE_PLANET][PLANET_GALAXY], |
|
169 | + (int) $fleet_info[UBE_PLANET][PLANET_SYSTEM], |
|
170 | + (int) $fleet_info[UBE_PLANET][PLANET_PLANET], |
|
171 | + (int) $fleet_info[UBE_PLANET][PLANET_TYPE], |
|
172 | + |
|
173 | + (float) $fleet_info[UBE_RESOURCES][RES_METAL], |
|
174 | + (float) $fleet_info[UBE_RESOURCES][RES_CRYSTAL], |
|
175 | + (float) $fleet_info[UBE_RESOURCES][RES_DEUTERIUM], |
|
176 | + |
|
177 | + (float) $fleet_info[UBE_BONUSES][UBE_ATTACK], |
|
178 | + (float) $fleet_info[UBE_BONUSES][UBE_SHIELD], |
|
179 | + (float) $fleet_info[UBE_BONUSES][UBE_ARMOR], |
|
180 | 180 | ); |
181 | 181 | |
182 | 182 | // Сохраняем итоговую информацию по ресурсам флота - потеряно, выброшено, увезено |
@@ -185,19 +185,19 @@ discard block |
||
185 | 185 | $ube_report_id, |
186 | 186 | $fleet_id, |
187 | 187 | |
188 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_METAL], |
|
189 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_CRYSTAL], |
|
190 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST][RES_DEUTERIUM], |
|
188 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_METAL], |
|
189 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_CRYSTAL], |
|
190 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST][RES_DEUTERIUM], |
|
191 | 191 | |
192 | - (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_METAL], |
|
193 | - (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_CRYSTAL], |
|
194 | - (float)$fleet_outcome_data[UBE_CARGO_DROPPED][RES_DEUTERIUM], |
|
192 | + (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_METAL], |
|
193 | + (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_CRYSTAL], |
|
194 | + (float) $fleet_outcome_data[UBE_CARGO_DROPPED][RES_DEUTERIUM], |
|
195 | 195 | |
196 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_METAL], |
|
197 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_CRYSTAL], |
|
198 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_DEUTERIUM], |
|
196 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_METAL], |
|
197 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_CRYSTAL], |
|
198 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOOTED][RES_DEUTERIUM], |
|
199 | 199 | |
200 | - (float)$fleet_outcome_data[UBE_RESOURCES_LOST_IN_METAL][RES_METAL], |
|
200 | + (float) $fleet_outcome_data[UBE_RESOURCES_LOST_IN_METAL][RES_METAL], |
|
201 | 201 | ); |
202 | 202 | |
203 | 203 | // Сохраняем результаты по юнитам - потеряно и восстановлено |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | $fleet_id, |
210 | 210 | |
211 | 211 | $unit_id, |
212 | - (float)$fleet_outcome_data[UBE_DEFENCE_RESTORE][$unit_id], |
|
213 | - (float)$fleet_outcome_data[UBE_UNITS_LOST][$unit_id], |
|
212 | + (float) $fleet_outcome_data[UBE_DEFENCE_RESTORE][$unit_id], |
|
213 | + (float) $fleet_outcome_data[UBE_UNITS_LOST][$unit_id], |
|
214 | 214 | |
215 | 215 | $unit_sort_order, |
216 | 216 | ); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | |
234 | 234 | $unit_id, |
235 | 235 | $unit_count, |
236 | - (int)$fleet_data[UBE_UNITS_BOOM][$unit_id], |
|
236 | + (int) $fleet_data[UBE_UNITS_BOOM][$unit_id], |
|
237 | 237 | |
238 | 238 | $fleet_data[UBE_ATTACK][$unit_id], |
239 | 239 | $fleet_data[UBE_SHIELD][$unit_id], |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | $query = db_user_list_to_celebrate($config->user_birthday_range); |
10 | 10 | |
11 | - while($row = db_fetch($query)) |
|
11 | + while ($row = db_fetch($query)) |
|
12 | 12 | { |
13 | 13 | $row['username'] = SN::$db->db_escape($row['username']); |
14 | 14 | rpg_points_change($row['id'], RPG_BIRTHDAY, $config->user_birthday_gift, "Birthday gift for user {$row['username']} ID {$row['id']} on his birthday on {$row['user_birthday']}. Gift last gaved at {$row['user_birthday_celebrated']}"); |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | } |
238 | 238 | } |
239 | 239 | |
240 | - $updater->upd_alter_table('users', ["DROP COLUMN `dpath`",], $updater->isFieldExists('users', 'dpath')); |
|
240 | + $updater->upd_alter_table('users', ["DROP COLUMN `dpath`", ], $updater->isFieldExists('users', 'dpath')); |
|
241 | 241 | |
242 | 242 | // 2017-06-12 13:47:36 42c1 |
243 | 243 | $updater->new_version = 42; |
@@ -250,14 +250,14 @@ discard block |
||
250 | 250 | |
251 | 251 | // 2017-10-11 09:51:49 43a4.3 |
252 | 252 | $updater->upd_alter_table('messages', |
253 | - ["ADD COLUMN `message_json` tinyint(1) unsigned NOT NULL DEFAULT 0 AFTER `message_text`",], |
|
253 | + ["ADD COLUMN `message_json` tinyint(1) unsigned NOT NULL DEFAULT 0 AFTER `message_text`", ], |
|
254 | 254 | !$updater->isFieldExists('messages', 'message_json') |
255 | 255 | ); |
256 | 256 | |
257 | 257 | |
258 | 258 | // 2017-10-17 09:49:24 43a6.0 |
259 | 259 | // Removing old index i_user_id |
260 | - $updater->upd_alter_table('counter', ['DROP KEY `i_user_id`',], $updater->isIndexExists('counter', 'i_user_id')); |
|
260 | + $updater->upd_alter_table('counter', ['DROP KEY `i_user_id`', ], $updater->isIndexExists('counter', 'i_user_id')); |
|
261 | 261 | // Adding new index I_counter_user_id |
262 | 262 | $updater->upd_alter_table('counter', |
263 | 263 | [ |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | ); |
312 | 312 | } |
313 | 313 | |
314 | - $updater->updPatchApply(1, function () use ($updater) { |
|
314 | + $updater->updPatchApply(1, function() use ($updater) { |
|
315 | 315 | $q = $updater->upd_do_query("SELECT `messageid`, `user` FROM `{{chat}}`", true); |
316 | 316 | while ($row = db_fetch($q)) { |
317 | 317 | if (strpos($row['user'], 'a:') !== 0) { |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | }); |
334 | 334 | |
335 | 335 | // 2018-03-07 09:23:41 43a13.23 + 2018-03-07 12:00:47 43a13.24 |
336 | - $updater->updPatchApply(2, function () use ($updater) { |
|
336 | + $updater->updPatchApply(2, function() use ($updater) { |
|
337 | 337 | $updater->upd_alter_table('festival_gifts', [ |
338 | 338 | "ADD COLUMN `disclosure` tinyint(1) unsigned NOT NULL DEFAULT 0 AFTER `amount`", |
339 | 339 | "ADD COLUMN `message` VARCHAR(4096) CHARSET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' AFTER `disclosure`", |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | }); |
342 | 342 | |
343 | 343 | // 2018-03-12 13:23:10 43a13.33 |
344 | - $updater->updPatchApply(3, function () use ($updater) { |
|
344 | + $updater->updPatchApply(3, function() use ($updater) { |
|
345 | 345 | $updater->upd_alter_table('player_options', |
346 | 346 | [ |
347 | 347 | "MODIFY COLUMN `value` VARCHAR(16000) CHARSET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT ''", |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | }); |
352 | 352 | |
353 | 353 | // 2018-03-24 21:31:51 43a16.16 - OiS |
354 | - $updater->updPatchApply(4, function () use ($updater) { |
|
354 | + $updater->updPatchApply(4, function() use ($updater) { |
|
355 | 355 | if (!$updater->isTableExists('festival_ois_player')) { |
356 | 356 | $updater->upd_create_table( |
357 | 357 | 'festival_ois_player', |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | }); |
371 | 371 | |
372 | 372 | // 2018-03-25 08:11:39 43a16.21 |
373 | - $updater->updPatchApply(5, function () use ($updater) { |
|
373 | + $updater->updPatchApply(5, function() use ($updater) { |
|
374 | 374 | $updater->upd_alter_table( |
375 | 375 | 'que', |
376 | 376 | "ADD COLUMN `que_unit_one_time_raw` DECIMAL(20,5) NOT NULL DEFAULT 0", |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | $updater->upd_log_version_update(); |
388 | 388 | |
389 | 389 | // 2018-12-21 14:00:41 44a5 Module "ad_promo_code" support |
390 | - $updater->updPatchApply(6, function () use ($updater) { |
|
390 | + $updater->updPatchApply(6, function() use ($updater) { |
|
391 | 391 | if (!$updater->isTableExists('ad_promo_codes')) { |
392 | 392 | $updater->upd_create_table( |
393 | 393 | 'ad_promo_codes', |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | }); |
429 | 429 | |
430 | 430 | // 2018-12-22 11:42:20 44a12 |
431 | - $updater->updPatchApply(7, function () use ($updater) { |
|
431 | + $updater->updPatchApply(7, function() use ($updater) { |
|
432 | 432 | // Creating table for HTTP query strings |
433 | 433 | $updater->upd_create_table( |
434 | 434 | 'security_query_strings', |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | $updater->upd_log_version_update(); |
571 | 571 | |
572 | 572 | // 2019-08-15 00:10:48 45a8 |
573 | - $updater->updPatchApply(8, function () use ($updater) { |
|
573 | + $updater->updPatchApply(8, function() use ($updater) { |
|
574 | 574 | if (!$updater->isTableExists('player_ignore')) { |
575 | 575 | $updater->upd_create_table( |
576 | 576 | 'player_ignore', |
@@ -591,7 +591,7 @@ discard block |
||
591 | 591 | }, PATCH_REGISTER); |
592 | 592 | |
593 | 593 | // 2019-08-21 20:14:18 45a19 |
594 | - $updater->updPatchApply(9, function () use ($updater) { |
|
594 | + $updater->updPatchApply(9, function() use ($updater) { |
|
595 | 595 | $updater->upd_alter_table('payment', [ |
596 | 596 | 'ADD COLUMN `payment_method_id` smallint DEFAULT NULL AFTER `payment_module_name`', |
597 | 597 | 'ADD KEY `I_payment_method_id` (`payment_method_id`)', |
@@ -599,7 +599,7 @@ discard block |
||
599 | 599 | }, PATCH_REGISTER); |
600 | 600 | |
601 | 601 | // 2020-02-18 21:00:19 45a71 |
602 | - $updater->updPatchApply(10, function () use ($updater) { |
|
602 | + $updater->updPatchApply(10, function() use ($updater) { |
|
603 | 603 | $name = classConfig::FLEET_UPDATE_MAX_RUN_TIME; |
604 | 604 | if (!SN::$gc->config->pass()->$name) { |
605 | 605 | SN::$gc->config->pass()->$name = 30; |
@@ -615,7 +615,7 @@ discard block |
||
615 | 615 | $updater->upd_log_version_update(); |
616 | 616 | |
617 | 617 | // 2021-03-03 13:41:05 46a13 |
618 | - $updater->updPatchApply(11, function () use ($updater) { |
|
618 | + $updater->updPatchApply(11, function() use ($updater) { |
|
619 | 619 | $updater->upd_alter_table('festival_gifts', [ |
620 | 620 | 'ADD COLUMN `gift_unit_id` bigint(20) NOT NULL DEFAULT 0 AFTER `amount`', |
621 | 621 | ], !$updater->isFieldExists('festival_gifts', 'gift_unit_id')); |