@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | "ally_id = '{$ally_id}'" . ($ally_rank_id >= 0 ? " AND ally_rank_id = {$ally_rank_id}" : ''), |
27 | 27 | false, 'id, username'); |
28 | 28 | // while ($u = db_fetch($query)) |
29 | - foreach($query as $u) |
|
29 | + foreach ($query as $u) |
|
30 | 30 | { |
31 | 31 | $sendList[] = $u['id']; |
32 | 32 | $list .= "<br>{$u['username']} "; |
@@ -53,19 +53,19 @@ discard block |
||
53 | 53 | { |
54 | 54 | global $config, $user, $sn_message_class_list; |
55 | 55 | |
56 | - if(!$owners) |
|
56 | + if (!$owners) |
|
57 | 57 | { |
58 | 58 | return; |
59 | 59 | } |
60 | 60 | |
61 | 61 | $timestamp = $timestamp ? $timestamp : SN_TIME_NOW; |
62 | 62 | $sender = intval($sender); |
63 | - if(!is_array($owners)) |
|
63 | + if (!is_array($owners)) |
|
64 | 64 | { |
65 | 65 | $owners = array($owners); |
66 | 66 | } |
67 | 67 | |
68 | - if($escaped == STRING_NEED_ESCAPING) |
|
68 | + if ($escaped == STRING_NEED_ESCAPING) |
|
69 | 69 | { |
70 | 70 | $from = db_escape($from); |
71 | 71 | $subject = db_escape($subject); |
@@ -81,9 +81,9 @@ discard block |
||
81 | 81 | |
82 | 82 | $message_class_name_total = $sn_message_class_list[MSG_TYPE_NEW]['name']; |
83 | 83 | |
84 | - if($owners[0] == '*') |
|
84 | + if ($owners[0] == '*') |
|
85 | 85 | { |
86 | - if($user['authlevel'] < 3) |
|
86 | + if ($user['authlevel'] < 3) |
|
87 | 87 | { |
88 | 88 | return false; |
89 | 89 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | |
100 | 100 | foreach ($owners as $owner) |
101 | 101 | { |
102 | - if($user['id'] != $owner) |
|
102 | + if ($user['id'] != $owner) |
|
103 | 103 | { |
104 | 104 | $owner_row = db_user_by_id($owner); |
105 | 105 | } |
@@ -109,14 +109,14 @@ discard block |
||
109 | 109 | } |
110 | 110 | sys_user_options_unpack($owner_row); |
111 | 111 | |
112 | - if($force || !$message_class_switchable || $owner_row["opt_{$message_class_name}"]) |
|
112 | + if ($force || !$message_class_switchable || $owner_row["opt_{$message_class_name}"]) |
|
113 | 113 | { |
114 | 114 | $insert_values[] = sprintf($insert_template, $owner); |
115 | 115 | } |
116 | 116 | |
117 | - if($message_class_email && $config->game_email_pm && $owner_row["opt_email_{$message_class_name}"]) |
|
117 | + if ($message_class_email && $config->game_email_pm && $owner_row["opt_email_{$message_class_name}"]) |
|
118 | 118 | { |
119 | - if($message_type == MSG_TYPE_SPY) { |
|
119 | + if ($message_type == MSG_TYPE_SPY) { |
|
120 | 120 | @$result = mymail($owner_row['email'], $subject, SN::$lang['sys_spy_activity'], '', true); |
121 | 121 | } else { |
122 | 122 | @$result = mymail($owner_row['email'], $subject, $text_unescaped, '', true); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | } |
126 | 126 | |
127 | - if(empty($insert_values)) |
|
127 | + if (empty($insert_values)) |
|
128 | 128 | { |
129 | 129 | return; |
130 | 130 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | db_user_list_set_mass_mail($owners, "`{$message_class_name}` = `{$message_class_name}` + 1, `{$message_class_name_total}` = `{$message_class_name_total}` + 1"); |
136 | 136 | |
137 | - if(in_array($user['id'], $owners) || $owners[0] == '*') |
|
137 | + if (in_array($user['id'], $owners) || $owners[0] == '*') |
|
138 | 138 | { |
139 | 139 | $user[$message_class_name]++; |
140 | 140 | $user[$message_class_name_total]++; |
@@ -22,28 +22,28 @@ discard block |
||
22 | 22 | function rpg_points_change($user_id, $change_type, $dark_matter, $comment = false, $already_changed = false) { |
23 | 23 | global $debug, $config, $dm_change_legit, $user; |
24 | 24 | |
25 | - if(!$user_id) { |
|
25 | + if (!$user_id) { |
|
26 | 26 | return false; |
27 | 27 | } |
28 | 28 | |
29 | 29 | $dm_change_legit = true; |
30 | 30 | $sn_data_dark_matter_db_name = pname_resource_name(RES_DARK_MATTER); |
31 | 31 | |
32 | - if($already_changed) { |
|
32 | + if ($already_changed) { |
|
33 | 33 | $rows_affected = 1; |
34 | 34 | } else { |
35 | 35 | $changeset = array(); |
36 | 36 | $a_user = db_user_by_id($user_id, true); |
37 | - if($dark_matter < 0) { |
|
37 | + if ($dark_matter < 0) { |
|
38 | 38 | $dark_matter_exists = mrc_get_level($a_user, null, RES_DARK_MATTER, false, true); |
39 | 39 | $dark_matter_exists < 0 ? $dark_matter_exists = 0 : false; |
40 | 40 | $metamatter_to_reduce = -$dark_matter - $dark_matter_exists; |
41 | - if($metamatter_to_reduce > 0) { |
|
41 | + if ($metamatter_to_reduce > 0) { |
|
42 | 42 | $metamatter_exists = mrc_get_level($a_user, null, RES_METAMATTER); |
43 | - if($metamatter_exists < $metamatter_to_reduce) { |
|
43 | + if ($metamatter_exists < $metamatter_to_reduce) { |
|
44 | 44 | $debug->error('Ошибка снятия ТМ - ММ+ТМ меньше, чем сумма для снятия!', 'Ошибка снятия ТМ', LOG_ERR_INT_NOT_ENOUGH_DARK_MATTER); |
45 | 45 | } |
46 | - if(is_array($comment)) { |
|
46 | + if (is_array($comment)) { |
|
47 | 47 | $comment = call_user_func_array('sprintf', $comment); |
48 | 48 | } |
49 | 49 | // mm_points_change($user_id, $change_type, -$metamatter_to_reduce, 'ММ в ТМ: ' . (-$dark_matter) . ' ТМ = ' . $dark_matter_exists . ' ТМ + ' . $metamatter_to_reduce . ' ММ. ' . $comment); |
@@ -58,9 +58,9 @@ discard block |
||
58 | 58 | $rows_affected = SN::$db->db_affected_rows(); |
59 | 59 | } |
60 | 60 | |
61 | - if($rows_affected || !$dark_matter) { |
|
61 | + if ($rows_affected || !$dark_matter) { |
|
62 | 62 | $page_url = db_escape($_SERVER['SCRIPT_NAME']); |
63 | - if(is_array($comment)) { |
|
63 | + if (is_array($comment)) { |
|
64 | 64 | $comment = call_user_func_array('sprintf', $comment); |
65 | 65 | } |
66 | 66 | $comment = db_escape($comment); |
@@ -74,18 +74,18 @@ discard block |
||
74 | 74 | {$dark_matter}, '{$comment}', '{$page_url}', {$user_id} |
75 | 75 | );"); |
76 | 76 | |
77 | - if($user['id'] == $user_id) { |
|
77 | + if ($user['id'] == $user_id) { |
|
78 | 78 | $user['dark_matter'] += $dark_matter; |
79 | 79 | } |
80 | 80 | |
81 | - if($dark_matter > 0) { |
|
81 | + if ($dark_matter > 0) { |
|
82 | 82 | $old_referral = doquery("SELECT * FROM {{referrals}} WHERE `id` = {$user_id} LIMIT 1 FOR UPDATE;", '', true); |
83 | - if($old_referral['id']) { |
|
83 | + if ($old_referral['id']) { |
|
84 | 84 | doquery("UPDATE {{referrals}} SET dark_matter = dark_matter + '{$dark_matter}' WHERE `id` = {$user_id} LIMIT 1;"); |
85 | 85 | $new_referral = doquery("SELECT * FROM {{referrals}} WHERE `id` = {$user_id} LIMIT 1;", '', true); |
86 | 86 | |
87 | 87 | $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); |
88 | - if($partner_bonus > 0 && $new_referral['dark_matter'] >= $config->rpg_bonus_minimum) { |
|
88 | + if ($partner_bonus > 0 && $new_referral['dark_matter'] >= $config->rpg_bonus_minimum) { |
|
89 | 89 | rpg_points_change($new_referral['id_partner'], RPG_REFERRAL, $partner_bonus, "Incoming From Referral ID {$user_id}"); |
90 | 90 | } |
91 | 91 | } |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | { |
103 | 103 | $q = 1.03; |
104 | 104 | |
105 | - switch($type) |
|
105 | + switch ($type) |
|
106 | 106 | { |
107 | 107 | case RPG_STRUCTURE: |
108 | 108 | $field_level = 'lvl_minier'; |
@@ -140,19 +140,19 @@ discard block |
||
140 | 140 | |
141 | 141 | $xp = &$user[$field_xp]; |
142 | 142 | |
143 | - if($xp_to_add) |
|
143 | + if ($xp_to_add) |
|
144 | 144 | { |
145 | 145 | $xp += $xp_to_add; |
146 | 146 | db_user_set_by_id($user['id'], "`{$field_xp}` = `{$field_xp}` + '{$xp_to_add}'"); |
147 | 147 | } |
148 | 148 | |
149 | 149 | $level = $user[$field_level]; |
150 | - while($xp > rpg_xp_for_level($level + 1, $b1, $q)) |
|
150 | + while ($xp > rpg_xp_for_level($level + 1, $b1, $q)) |
|
151 | 151 | { |
152 | 152 | $level++; |
153 | 153 | } |
154 | 154 | $level -= $user[$field_level]; |
155 | - if($level > 0) |
|
155 | + if ($level > 0) |
|
156 | 156 | { |
157 | 157 | db_user_set_by_id($user['id'], "`{$field_level}` = `{$field_level}` + '{$level}'"); |
158 | 158 | rpg_points_change($user['id'], $type, $level * 1000, $comment); |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | function rpg_xp_for_level($level, $b1, $q) |
164 | 164 | { |
165 | - return floor($b1 * (pow($q, $level) - 1)/($q - 1)); |
|
165 | + return floor($b1 * (pow($q, $level) - 1) / ($q - 1)); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | function rpg_get_miner_xp($level) |
@@ -46,8 +46,7 @@ |
||
46 | 46 | 'ANNOUNCE' => SN::$gc->bbCodeParser->expandBbCode($announce['strAnnounce'], intval($announce['authlevel'])), |
47 | 47 | 'DETAIL_URL' => $announce['detail_url'], |
48 | 48 | 'USER_NAME' => |
49 | - isset($users[$announce['user_id']]) && $users[$announce['user_id']] ? player_nick_render_to_html($users[$announce['user_id']], array('color' => true)) : |
|
50 | - js_safe_string($announce['user_name']), |
|
49 | + isset($users[$announce['user_id']]) && $users[$announce['user_id']] ? player_nick_render_to_html($users[$announce['user_id']], array('color' => true)) : js_safe_string($announce['user_name']), |
|
51 | 50 | 'NEW' => $announce['unix_time'] + $config->game_news_actual >= SN_TIME_NOW, |
52 | 51 | 'FUTURE' => $announce['unix_time'] > SN_TIME_NOW, |
53 | 52 | 'SURVEY_ID' => $announce['survey_id'], |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | |
273 | 273 | if (($options === true || isset($options['icons']) || isset($options['birthday'])) && (date('Y', SN_TIME_NOW) . date('-m-d', strtotime($render_user['user_birthday'])) == date('Y-m-d', SN_TIME_NOW))) { |
274 | - if(!empty($render_user['user_birthday'])) { |
|
274 | + if (!empty($render_user['user_birthday'])) { |
|
275 | 275 | $result[NICK_BIRTHDAY] = ''; |
276 | 276 | } |
277 | 277 | } |
@@ -283,13 +283,13 @@ discard block |
||
283 | 283 | } |
284 | 284 | |
285 | 285 | if (($options === true || (isset($options['icons']) && $options['icons']) || (isset($options['vacancy']) && $options['vacancy'])) && $render_user['vacation']) { |
286 | - if(isset($render_user['vacation'])) { |
|
286 | + if (isset($render_user['vacation'])) { |
|
287 | 287 | $result[NICK_VACATION] = $render_user['vacation']; |
288 | 288 | } |
289 | 289 | } |
290 | 290 | |
291 | 291 | if ($options === true || !empty($options['icons']) || !empty($options['player_rank'])) { |
292 | - if(isset($render_user['total_points'])) { |
|
292 | + if (isset($render_user['total_points'])) { |
|
293 | 293 | $result[NICK_RANK] = SN::$gc->playerLevelHelper->getPointLevel($render_user['total_points'], $render_user['authlevel']); |
294 | 294 | } |
295 | 295 | } |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | } |
314 | 314 | |
315 | 315 | if ($render_user['ally_tag'] && ($options === true || (isset($options['ally']) && $options['ally']))) { |
316 | - if(isset($render_user['ally_tag'])) { |
|
316 | + if (isset($render_user['ally_tag'])) { |
|
317 | 317 | $result[NICK_ALLY] = $render_user['ally_tag']; |
318 | 318 | } |
319 | 319 | } |
@@ -2,12 +2,12 @@ discard block |
||
2 | 2 | |
3 | 3 | include('common.' . substr(strrchr(__FILE__, '.'), 1)); |
4 | 4 | |
5 | -if($user['authlevel'] < AUTH_LEVEL_DEVELOPER) { |
|
5 | +if ($user['authlevel'] < AUTH_LEVEL_DEVELOPER) { |
|
6 | 6 | $error_message = SN::$config->game_mode == GAME_BLITZ ? 'sys_blitz_page_disabled' : ( |
7 | 7 | !SN::$config->game_blitz_register ? 'sys_blitz_registration_disabled' : '' |
8 | 8 | ); |
9 | 9 | |
10 | - if($error_message) { |
|
10 | + if ($error_message) { |
|
11 | 11 | messageBox($lang[$error_message], $lang['sys_error'], 'overview.php', 10); |
12 | 12 | die(); |
13 | 13 | } |
@@ -17,12 +17,12 @@ discard block |
||
17 | 17 | $current_round = intval(SN::$config->db_loadItem('game_blitz_register_round')); |
18 | 18 | $current_price = intval(SN::$config->db_loadItem('game_blitz_register_price')); |
19 | 19 | |
20 | -if(SN::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) { |
|
20 | +if (SN::$config->db_loadItem('game_blitz_register') == BLITZ_REGISTER_OPEN && (sys_get_param_str('register_me') || sys_get_param_str('register_me_not'))) { |
|
21 | 21 | sn_db_transaction_start(); |
22 | 22 | $user = db_user_by_id($user['id'], true); |
23 | 23 | $is_registered = doquery("SELECT `id` FROM {{blitz_registrations}} WHERE `user_id` = {$user['id']} AND `round_number` = {$current_round} FOR UPDATE;", true); |
24 | - if(sys_get_param_str('register_me')) { |
|
25 | - if(empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) { |
|
24 | + if (sys_get_param_str('register_me')) { |
|
25 | + if (empty($is_registered) && mrc_get_level($user, null, RES_METAMATTER) >= $current_price) { |
|
26 | 26 | doquery("INSERT IGNORE INTO {{blitz_registrations}} SET `user_id` = {$user['id']}, `round_number` = {$current_round};"); |
27 | 27 | //mm_points_change($user['id'], RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица"); |
28 | 28 | SN::$auth->account->metamatter_change(RPG_BLITZ_REGISTRATION, -$current_price, "Регистрация в раунде {$current_round} Блица"); |
@@ -43,17 +43,17 @@ discard block |
||
43 | 43 | $blitz_players = 0; |
44 | 44 | $blitz_prize_dark_matter = 0; |
45 | 45 | $blitz_prize_places = 0; |
46 | -if($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) { |
|
47 | - if(sys_get_param_str('generate')) { |
|
46 | +if ($user['authlevel'] >= AUTH_LEVEL_DEVELOPER) { |
|
47 | + if (sys_get_param_str('generate')) { |
|
48 | 48 | $next_id = 0; |
49 | 49 | $query = doquery("SELECT `id` FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY RAND();"); |
50 | - while($row = db_fetch($query)) { |
|
50 | + while ($row = db_fetch($query)) { |
|
51 | 51 | $next_id++; |
52 | 52 | $blitz_name = 'Игрок' . $next_id; |
53 | 53 | $blitz_password = sys_random_string(8); |
54 | 54 | doquery("UPDATE {{blitz_registrations}} SET blitz_name = '{$blitz_name}', blitz_password = '{$blitz_password}' WHERE `id` = {$row['id']} AND `round_number` = {$current_round};"); |
55 | 55 | } |
56 | - } elseif(sys_get_param_str('import_generated')) { |
|
56 | + } elseif (sys_get_param_str('import_generated')) { |
|
57 | 57 | // ЭТО НА БЛИЦЕ!!! |
58 | 58 | doquery("DELETE FROM {{users}} WHERE username like 'Игрок%';"); |
59 | 59 | doquery("DELETE FROM {{planets}} WHERE id_owner not in (SELECT `id` FROM {{users}});"); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $system = $system_step; |
76 | 76 | $planet = round(SN::$config->game_maxPlanet / 2); |
77 | 77 | |
78 | - foreach($imported_string as &$string_data) { |
|
78 | + foreach ($imported_string as &$string_data) { |
|
79 | 79 | $string_data = explode(',', $string_data); |
80 | 80 | $username_safe = $string_data[0]; |
81 | 81 | |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | $moon_row = uni_create_moon($galaxy, $system, $planet, $user_new['id'], Universe::MOON_MAX_SIZE, false); |
91 | 91 | |
92 | - if(($system += $system_step) >= SN::$config->game_maxSystem) { |
|
92 | + if (($system += $system_step) >= SN::$config->game_maxSystem) { |
|
93 | 93 | $galaxy++; |
94 | 94 | $system = $system_step; |
95 | 95 | } |
@@ -98,13 +98,13 @@ discard block |
||
98 | 98 | |
99 | 99 | SN::$config->db_saveItem('users_amount', SN::$config->users_amount + $new_players); |
100 | 100 | // generated_string |
101 | - } elseif(sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) { |
|
101 | + } elseif (sys_get_param_str('import_result') && ($blitz_result_string = sys_get_param_str('blitz_result_string'))) { |
|
102 | 102 | $blitz_result = explode(';', $blitz_result_string); |
103 | 103 | $blitz_last_update = $blitz_result[0]; // Пока не используется |
104 | 104 | unset($blitz_result[0]); |
105 | - foreach($blitz_result as $blitz_result_data) { |
|
105 | + foreach ($blitz_result as $blitz_result_data) { |
|
106 | 106 | $blitz_result_data = explode(',', $blitz_result_data); |
107 | - if(count($blitz_result_data) == 5) { |
|
107 | + if (count($blitz_result_data) == 5) { |
|
108 | 108 | $blitz_result_data[1] = db_escape($blitz_result_data[1]); |
109 | 109 | doquery( |
110 | 110 | "UPDATE `{{blitz_registrations}}` SET |
@@ -118,15 +118,15 @@ discard block |
||
118 | 118 | $blitz_result = array(); |
119 | 119 | } |
120 | 120 | |
121 | - if(SN::$config->game_mode == GAME_BLITZ) { |
|
121 | + if (SN::$config->game_mode == GAME_BLITZ) { |
|
122 | 122 | $blitz_result = array(SN::$config->db_loadItem('var_stat_update')); |
123 | 123 | $query = doquery("SELECT id, username, total_rank, total_points, onlinetime FROM {{users}} ORDER BY `id`;"); |
124 | - while($row = db_fetch($query)) { |
|
124 | + while ($row = db_fetch($query)) { |
|
125 | 125 | $blitz_result[] = "{$row['id']},{$row['username']},{$row['onlinetime']},{$row['total_rank']},{$row['total_points']}"; |
126 | 126 | } |
127 | 127 | } else { |
128 | 128 | $query = doquery("SELECT blitz_name, blitz_password, blitz_online FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY `id`;"); |
129 | - while($row = db_fetch($query)) { |
|
129 | + while ($row = db_fetch($query)) { |
|
130 | 130 | $blitz_generated[] = "{$row['blitz_name']},{$row['blitz_password']}"; |
131 | 131 | $row['blitz_online'] ? $blitz_prize_players_active++ : false; |
132 | 132 | $blitz_players++; |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | 'Игрок40' |
142 | 142 | */ |
143 | 143 | |
144 | - if(sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) { |
|
144 | + if (sys_get_param_str('prize_calculate') && $blitz_prize_players_active && ($blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'))) { |
|
145 | 145 | // $blitz_prize_dark_matter_actual = sys_get_param_int('blitz_prize_dark_matter'); |
146 | 146 | $blitz_prize_places_actual = sys_get_param_int('blitz_prize_places'); |
147 | 147 | sn_db_transaction_start(); |
148 | 148 | $query = doquery("SELECT * FROM {{blitz_registrations}} WHERE `round_number` = {$current_round} ORDER BY `blitz_place` FOR UPDATE;"); |
149 | - while($row = db_fetch($query)) { |
|
150 | - if(!$row['blitz_place']) { |
|
149 | + while ($row = db_fetch($query)) { |
|
150 | + if (!$row['blitz_place']) { |
|
151 | 151 | continue; |
152 | 152 | } |
153 | 153 | |
@@ -155,15 +155,15 @@ discard block |
||
155 | 155 | $blitz_prize_places_actual--; |
156 | 156 | |
157 | 157 | $reward = $blitz_prize_dark_matter_actual - $row['blitz_reward_dark_matter']; |
158 | -pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}",$row['id']); |
|
159 | - if($reward) { |
|
158 | +pdump("{{$row['id']}} {$row['blitz_name']}, Place {$row['blitz_place']}, Prize places {$blitz_prize_places_actual}, Prize {$reward}", $row['id']); |
|
159 | + if ($reward) { |
|
160 | 160 | rpg_points_change($row['user_id'], RPG_BLITZ, $reward, sprintf( |
161 | 161 | $lang['sys_blitz_reward_log_message'], $row['blitz_place'], $row['blitz_name'] |
162 | 162 | )); |
163 | 163 | doquery("UPDATE {{blitz_registrations}} SET blitz_reward_dark_matter = blitz_reward_dark_matter + ($reward) WHERE id = {$row['id']} AND `round_number` = {$current_round};"); |
164 | 164 | } |
165 | 165 | |
166 | - if(!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) { |
|
166 | + if (!$blitz_prize_places_actual || $blitz_prize_dark_matter_actual < 1000) { |
|
167 | 167 | break; |
168 | 168 | } |
169 | 169 | } |
@@ -183,12 +183,12 @@ discard block |
||
183 | 183 | JOIN {{users}} AS u ON u.id = br.user_id |
184 | 184 | WHERE br.`round_number` = {$current_round} |
185 | 185 | order by `blitz_place`, `timestamp`;"); |
186 | -while($row = db_fetch($query)) { |
|
186 | +while ($row = db_fetch($query)) { |
|
187 | 187 | $tpl_player_data = array( |
188 | 188 | 'NAME' => player_nick_render_to_html($row, array('icons' => true, 'color' => true, 'ally' => true)), |
189 | 189 | ); |
190 | 190 | |
191 | - if(SN::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) { |
|
191 | + if (SN::$config->game_blitz_register == BLITZ_REGISTER_DISCLOSURE_NAMES) { |
|
192 | 192 | // Вот так хитро, что бы не было не единого шанса попадания на страницу данных об игроках Блиц-сервера до закрытия раунда |
193 | 193 | $tpl_player_data = array_merge($tpl_player_data, array( |
194 | 194 | 'ID' => $row['id'], |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | } |
202 | 202 | |
203 | 203 | $template->assign_block_vars('registrations', $tpl_player_data); |
204 | - if($row['id'] == $user['id']) { |
|
204 | + if ($row['id'] == $user['id']) { |
|
205 | 205 | $player_registered = $row; |
206 | 206 | } |
207 | 207 | } |
@@ -401,7 +401,7 @@ discard block |
||
401 | 401 | unset($player_options[PLAYER_OPTION_TUTORIAL_CURRENT]); |
402 | 402 | } |
403 | 403 | |
404 | - array_walk($player_options, function (&$value) { |
|
404 | + array_walk($player_options, function(&$value) { |
|
405 | 405 | // TODO - Когда будет больше параметров - сделать больше проверок |
406 | 406 | $value = intval($value); |
407 | 407 | }); |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | $user['id'], |
451 | 451 | RPG_NAME_CHANGE, |
452 | 452 | -$config->game_user_changename_cost, |
453 | - vsprintf('Пользователь ID %1$d сменил имя с "%2$s" на "%3$s"', [$user['id'], $user['username'], $username,]) |
|
453 | + vsprintf('Пользователь ID %1$d сменил имя с "%2$s" на "%3$s"', [$user['id'], $user['username'], $username, ]) |
|
454 | 454 | ); |
455 | 455 | |
456 | 456 | case SERVER_PLAYER_NAME_CHANGE_FREE: |
@@ -112,10 +112,10 @@ discard block |
||
112 | 112 | $rexep = "#" . strtr(preg_quote($format), $masks) . "#"; |
113 | 113 | if (preg_match($rexep, $date, $out)) { |
114 | 114 | $ret = array( |
115 | - "tm_sec" => (int)$out['S'], |
|
116 | - "tm_min" => (int)$out['M'], |
|
117 | - "tm_hour" => (int)$out['H'], |
|
118 | - "tm_mday" => (int)$out['d'], |
|
115 | + "tm_sec" => (int) $out['S'], |
|
116 | + "tm_min" => (int) $out['M'], |
|
117 | + "tm_hour" => (int) $out['H'], |
|
118 | + "tm_mday" => (int) $out['d'], |
|
119 | 119 | "tm_mon" => $out['m'] ? $out['m'] - 1 : 0, |
120 | 120 | "tm_year" => $out['Y'] > 1900 ? $out['Y'] - 1900 : 0, |
121 | 121 | ); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | * @return int |
151 | 151 | */ |
152 | 152 | function datePart($fullDate) { |
153 | - return (int)strtotime(date('Y-m-d', $fullDate)); |
|
153 | + return (int) strtotime(date('Y-m-d', $fullDate)); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * @return bool |
179 | 179 | * @throws ErrorException |
180 | 180 | */ |
181 | - function ($errno, $errstr, $errfile, $errline) { |
|
181 | + function($errno, $errstr, $errfile, $errline) { |
|
182 | 182 | throw new ErrorException($errstr, 0, $errno, $errfile, $errline); |
183 | 183 | } |
184 | 184 | ); |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | protected static $autoloaderRegistered = false; |
25 | 25 | |
26 | 26 | protected static function _constructorStatic() { |
27 | - if(!static::$autoloaderRegistered) { |
|
27 | + if (!static::$autoloaderRegistered) { |
|
28 | 28 | spl_autoload_register(array(__CLASS__, 'autoloader')); |
29 | 29 | static::$autoloaderRegistered = true; |
30 | 30 | } |
@@ -36,17 +36,17 @@ discard block |
||
36 | 36 | public static function autoloader($class) { |
37 | 37 | static::_constructorStatic(); |
38 | 38 | |
39 | - foreach(static::$folders as $data) { |
|
39 | + foreach (static::$folders as $data) { |
|
40 | 40 | $theClassFile = $class; |
41 | 41 | |
42 | - if($data[static::P_PREFIX] && strrpos($class, $data[static::P_PREFIX]) !== false) { |
|
42 | + if ($data[static::P_PREFIX] && strrpos($class, $data[static::P_PREFIX]) !== false) { |
|
43 | 43 | $theClassFile = substr($class, strlen($data[static::P_PREFIX])); |
44 | 44 | } |
45 | 45 | |
46 | 46 | $classFullFileName = str_replace('\\', '/', $data[static::P_FOLDER] . $theClassFile) . DOT_PHP_EX; |
47 | - if(file_exists($classFullFileName) && is_file($classFullFileName)) { |
|
47 | + if (file_exists($classFullFileName) && is_file($classFullFileName)) { |
|
48 | 48 | require_once($classFullFileName); |
49 | - if(method_exists($class, '_constructorStatic')) { |
|
49 | + if (method_exists($class, '_constructorStatic')) { |
|
50 | 50 | $class::_constructorStatic(); |
51 | 51 | } |
52 | 52 | } |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | |
63 | 63 | $absoluteClassRoot = str_replace('\\', '/', SN_ROOT_PHYSICAL . $absoluteClassRoot); |
64 | 64 | |
65 | - if(!($absoluteClassRoot = realpath($absoluteClassRoot))) { |
|
65 | + if (!($absoluteClassRoot = realpath($absoluteClassRoot))) { |
|
66 | 66 | // TODO - throw new \Exception("There is some error when installing autoloader for '{$absoluteClassRoot}' class prefix '{$classPrefix}'"); |
67 | 67 | return; |
68 | 68 | } |
69 | 69 | $absoluteClassRoot = str_replace('\\', '/', $absoluteClassRoot) . '/'; |
70 | 70 | |
71 | - if($classPrefix && strrpos($classPrefix, 1) != '\\') { |
|
71 | + if ($classPrefix && strrpos($classPrefix, 1) != '\\') { |
|
72 | 72 | $classPrefix .= '\\'; |
73 | 73 | } |
74 | 74 |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | |
114 | 114 | $payment_methods_available = array_combine(array_keys(sn_module_payment::$payment_methods), array_fill(0, count(sn_module_payment::$payment_methods), null)); |
115 | -array_walk($payment_methods_available, function (&$value, $index) { |
|
115 | +array_walk($payment_methods_available, function(&$value, $index) { |
|
116 | 116 | $value = !empty(sn_module_payment::$payment_methods[$index]) ? array_combine(array_keys(sn_module_payment::$payment_methods[$index]), array_fill(0, count(sn_module_payment::$payment_methods[$index]), null)) : $value; |
117 | 117 | }); |
118 | 118 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | if ($request['metamatter'] && $payment_module_request) { |
224 | 224 | try { |
225 | 225 | $paymentModuleReal = SN::$gc->modules->getModule($payment_module_request); |
226 | - if(!is_object($paymentModuleReal)) { |
|
226 | + if (!is_object($paymentModuleReal)) { |
|
227 | 227 | throw new Exception('{ Менеджер модулей вернул null вместо платёжного модуля для }' . $payment_module_request, ERR_ERROR); |
228 | 228 | } |
229 | 229 | /** |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | 'PLAYER_CURRENCY' => $player_currency, |
313 | 313 | 'PLAYER_CURRENCY_PRICE_PER_MM' => sn_module_payment::currency_convert(1, $player_currency, 'MM_', 10), |
314 | 314 | |
315 | - 'UNIT_AMOUNT' => (float)$request['metamatter'], |
|
315 | + 'UNIT_AMOUNT' => (float) $request['metamatter'], |
|
316 | 316 | 'UNIT_AMOUNT_TEXT' => HelperString::numberFloorAndFormat($request['metamatter']), |
317 | 317 | 'UNIT_AMOUNT_BONUS_PERCENT' => $bonus_percent, |
318 | 318 | 'UNIT_AMOUNT_TEXT_DISCOUNTED' => $income_metamatter_text, |