@@ -46,8 +46,7 @@ |
||
46 | 46 | sn_db_transaction_commit(); |
47 | 47 | sys_redirect("galaxy.php?mode=name&galaxy={$uni_galaxy}&system={$uni_system}"); |
48 | 48 | } |
49 | - } |
|
50 | - catch (exception $e) |
|
49 | + } catch (exception $e) |
|
51 | 50 | { |
52 | 51 | sn_db_transaction_rollback(); |
53 | 52 | $template->assign_block_vars('result', array( |
@@ -79,8 +79,7 @@ |
||
79 | 79 | |
80 | 80 | sn_db_transaction_commit(); |
81 | 81 | throw new Exception($info_action, ERR_NONE); |
82 | - } |
|
83 | - catch (Exception $e) |
|
82 | + } catch (Exception $e) |
|
84 | 83 | { |
85 | 84 | sn_db_transaction_rollback(); |
86 | 85 |
@@ -13,15 +13,15 @@ |
||
13 | 13 | . '&id=' . urlencode(classSupernova::$config->server_updater_id); |
14 | 14 | |
15 | 15 | switch($mode) { |
16 | - case SNC_MODE_REGISTER: |
|
17 | - if(classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id) { |
|
18 | - if($ajax) { |
|
19 | - print(SNC_VER_REGISTER_ERROR_REGISTERED); |
|
16 | + case SNC_MODE_REGISTER: |
|
17 | + if(classSupernova::$config->server_updater_key || classSupernova::$config->server_updater_id) { |
|
18 | + if($ajax) { |
|
19 | + print(SNC_VER_REGISTER_ERROR_REGISTERED); |
|
20 | + } |
|
21 | + die(); |
|
20 | 22 | } |
21 | - die(); |
|
22 | - } |
|
23 | - $url .= "&name=" . urlencode(classSupernova::$config->game_name) . "&url=" . urlencode(SN_ROOT_VIRTUAL); |
|
24 | - break; |
|
23 | + $url .= "&name=" . urlencode(classSupernova::$config->game_name) . "&url=" . urlencode(SN_ROOT_VIRTUAL); |
|
24 | + break; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | $check_result = sn_get_url_contents($url); |
@@ -34,69 +34,69 @@ |
||
34 | 34 | } |
35 | 35 | |
36 | 36 | switch($mode) { |
37 | - case ADM_TOOL_CONFIG_RELOAD: |
|
38 | - classSupernova::$config->db_loadAll(); |
|
39 | - sys_refresh_tablelist(); |
|
40 | - |
|
41 | - classSupernova::$config->db_loadItem('game_watchlist'); |
|
42 | - if(classSupernova::$config->game_watchlist) { |
|
43 | - classSupernova::$config->game_watchlist_array = explode(';', classSupernova::$config->game_watchlist); |
|
44 | - } else { |
|
45 | - unset(classSupernova::$config->game_watchlist_array); |
|
46 | - } |
|
47 | - break; |
|
48 | - |
|
49 | - case ADM_TOOL_MD5: |
|
50 | - $template = gettemplate("admin/md5enc", true); |
|
51 | - $password_seed = sys_get_param_str_unsafe('seed', SN_SYS_SEC_CHARS_ALLOWED); |
|
52 | - $password_length = sys_get_param_int('length', 16); |
|
53 | - $string = ($string = sys_get_param_str_unsafe('string')) ? $string : sys_random_string($password_length, $password_seed); |
|
54 | - |
|
55 | - $template->assign_vars(array( |
|
56 | - 'SEED' => $password_seed, |
|
57 | - 'LENGTH' => $password_length, |
|
58 | - 'STRING' => htmlentities($string), |
|
59 | - 'MD5' => md5($string), |
|
60 | - )); |
|
61 | - display($template, classLocale::$lang['adm_tools_md5_header'], false, '', true); |
|
62 | - break; |
|
63 | - |
|
64 | - case ADM_TOOL_FORCE_ALL: |
|
65 | - classSupernova::$config->db_saveItem('db_version', 0); |
|
66 | - require_once('../includes/update.php'); |
|
67 | - break; |
|
68 | - |
|
69 | - case ADM_TOOL_FORCE_LAST: |
|
70 | - classSupernova::$config->db_saveItem('db_version', floor(classSupernova::$config->db_version - 1)); |
|
71 | - require_once('../includes/update.php'); |
|
72 | - break; |
|
73 | - |
|
74 | - case ADM_TOOL_INFO_PHP: |
|
75 | - phpinfo(); |
|
76 | - break; |
|
77 | - |
|
78 | - case ADM_TOOL_INFO_SQL: |
|
79 | - $template = gettemplate("simple_table", true); |
|
80 | - |
|
81 | - $status = array( |
|
82 | - classLocale::$lang['adm_tool_sql_server_version'] => classSupernova::$db->db_get_server_info(), |
|
83 | - classLocale::$lang['adm_tool_sql_client_version'] => classSupernova::$db->db_get_client_info(), |
|
84 | - classLocale::$lang['adm_tool_sql_host_info'] => classSupernova::$db->db_get_host_info(), |
|
85 | - ); |
|
86 | - templateAssignTable($template, 'server', $status); |
|
87 | - |
|
88 | - templateAssignTable($template, 'status', classSupernova::$db->db_get_server_stat()); |
|
89 | - templateAssignTable($template, 'params', classSupernova::$db->db_core_show_status()); |
|
90 | - |
|
91 | - $template->assign_vars(array( |
|
92 | - 'PAGE_HEADER' => classLocale::$lang['adm_tool_sql_page_header'], |
|
93 | - 'COLUMN_NAME_1' => classLocale::$lang['adm_tool_sql_param_name'], |
|
94 | - 'COLUMN_NAME_2' => classLocale::$lang['adm_tool_sql_param_value'], |
|
95 | - 'TABLE_FOOTER' => 'test', |
|
96 | - )); |
|
97 | - |
|
98 | - display($template, classLocale::$lang['adm_bn_ttle'], false, '', true); |
|
99 | - break; |
|
37 | + case ADM_TOOL_CONFIG_RELOAD: |
|
38 | + classSupernova::$config->db_loadAll(); |
|
39 | + sys_refresh_tablelist(); |
|
40 | + |
|
41 | + classSupernova::$config->db_loadItem('game_watchlist'); |
|
42 | + if(classSupernova::$config->game_watchlist) { |
|
43 | + classSupernova::$config->game_watchlist_array = explode(';', classSupernova::$config->game_watchlist); |
|
44 | + } else { |
|
45 | + unset(classSupernova::$config->game_watchlist_array); |
|
46 | + } |
|
47 | + break; |
|
48 | + |
|
49 | + case ADM_TOOL_MD5: |
|
50 | + $template = gettemplate("admin/md5enc", true); |
|
51 | + $password_seed = sys_get_param_str_unsafe('seed', SN_SYS_SEC_CHARS_ALLOWED); |
|
52 | + $password_length = sys_get_param_int('length', 16); |
|
53 | + $string = ($string = sys_get_param_str_unsafe('string')) ? $string : sys_random_string($password_length, $password_seed); |
|
54 | + |
|
55 | + $template->assign_vars(array( |
|
56 | + 'SEED' => $password_seed, |
|
57 | + 'LENGTH' => $password_length, |
|
58 | + 'STRING' => htmlentities($string), |
|
59 | + 'MD5' => md5($string), |
|
60 | + )); |
|
61 | + display($template, classLocale::$lang['adm_tools_md5_header'], false, '', true); |
|
62 | + break; |
|
63 | + |
|
64 | + case ADM_TOOL_FORCE_ALL: |
|
65 | + classSupernova::$config->db_saveItem('db_version', 0); |
|
66 | + require_once('../includes/update.php'); |
|
67 | + break; |
|
68 | + |
|
69 | + case ADM_TOOL_FORCE_LAST: |
|
70 | + classSupernova::$config->db_saveItem('db_version', floor(classSupernova::$config->db_version - 1)); |
|
71 | + require_once('../includes/update.php'); |
|
72 | + break; |
|
73 | + |
|
74 | + case ADM_TOOL_INFO_PHP: |
|
75 | + phpinfo(); |
|
76 | + break; |
|
77 | + |
|
78 | + case ADM_TOOL_INFO_SQL: |
|
79 | + $template = gettemplate("simple_table", true); |
|
80 | + |
|
81 | + $status = array( |
|
82 | + classLocale::$lang['adm_tool_sql_server_version'] => classSupernova::$db->db_get_server_info(), |
|
83 | + classLocale::$lang['adm_tool_sql_client_version'] => classSupernova::$db->db_get_client_info(), |
|
84 | + classLocale::$lang['adm_tool_sql_host_info'] => classSupernova::$db->db_get_host_info(), |
|
85 | + ); |
|
86 | + templateAssignTable($template, 'server', $status); |
|
87 | + |
|
88 | + templateAssignTable($template, 'status', classSupernova::$db->db_get_server_stat()); |
|
89 | + templateAssignTable($template, 'params', classSupernova::$db->db_core_show_status()); |
|
90 | + |
|
91 | + $template->assign_vars(array( |
|
92 | + 'PAGE_HEADER' => classLocale::$lang['adm_tool_sql_page_header'], |
|
93 | + 'COLUMN_NAME_1' => classLocale::$lang['adm_tool_sql_param_name'], |
|
94 | + 'COLUMN_NAME_2' => classLocale::$lang['adm_tool_sql_param_value'], |
|
95 | + 'TABLE_FOOTER' => 'test', |
|
96 | + )); |
|
97 | + |
|
98 | + display($template, classLocale::$lang['adm_bn_ttle'], false, '', true); |
|
99 | + break; |
|
100 | 100 | |
101 | 101 | } |
102 | 102 |
@@ -1,8 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function dump($value,$varname = "",$level=0,$dumper = "") |
|
4 | -{ |
|
5 | - if ($varname) $varname .= " = "; |
|
3 | +function dump($value,$varname = "",$level=0,$dumper = "") { |
|
4 | + if ($varname) { |
|
5 | + $varname .= " = "; |
|
6 | + } |
|
6 | 7 | |
7 | 8 | if ($level==-1) |
8 | 9 | { |
@@ -13,7 +14,9 @@ discard block |
||
13 | 14 | $trans["\0"]='⊕'; |
14 | 15 | return strtr(htmlspecialchars($value),$trans); |
15 | 16 | } |
16 | - if ($level==0) $dumper = '<pre>' . $varname; |
|
17 | + if ($level==0) { |
|
18 | + $dumper = '<pre>' . $varname; |
|
19 | + } |
|
17 | 20 | |
18 | 21 | $type = gettype($value); |
19 | 22 | $dumper .= $type; |
@@ -22,9 +25,9 @@ discard block |
||
22 | 25 | { |
23 | 26 | $dumper .= '('.strlen($value).')'; |
24 | 27 | $value = dump($value,"",-1); |
25 | - } |
|
26 | - elseif ($type=='boolean') $value= ($value?'true':'false'); |
|
27 | - elseif ($type=='object') |
|
28 | + } elseif ($type=='boolean') { |
|
29 | + $value= ($value?'true':'false'); |
|
30 | + } elseif ($type=='object') |
|
28 | 31 | { |
29 | 32 | $props= get_class_vars(get_class($value)); |
30 | 33 | $dumper .= '('.count($props).') <u>'.get_class($value).'</u>'; |
@@ -34,8 +37,7 @@ discard block |
||
34 | 37 | $dumper .= dump($value->$key,"",$level+1); |
35 | 38 | } |
36 | 39 | $value= ''; |
37 | - } |
|
38 | - elseif ($type=='array') |
|
40 | + } elseif ($type=='array') |
|
39 | 41 | { |
40 | 42 | $dumper .= '('.count($value).')'; |
41 | 43 | foreach($value as $key=>$val) |
@@ -46,22 +48,21 @@ discard block |
||
46 | 48 | $value= ''; |
47 | 49 | } |
48 | 50 | $dumper .= " <b>$value</b>"; |
49 | - if ($level==0) $dumper .= '</pre>'; |
|
51 | + if ($level==0) { |
|
52 | + $dumper .= '</pre>'; |
|
53 | + } |
|
50 | 54 | return $dumper; |
51 | 55 | } |
52 | 56 | |
53 | -function pdump($value, $varname = '') |
|
54 | -{ |
|
57 | +function pdump($value, $varname = '') { |
|
55 | 58 | print('<span style="text-align: left">' . dump($value, $varname) . '</span>'); |
56 | 59 | } |
57 | 60 | |
58 | -function debug($value, $varname = '') |
|
59 | -{ |
|
61 | +function debug($value, $varname = '') { |
|
60 | 62 | return pdump($value, $varname); |
61 | 63 | } |
62 | 64 | |
63 | -function buf_print($string) |
|
64 | -{ |
|
65 | +function buf_print($string) { |
|
65 | 66 | global $output_buffer; |
66 | 67 | |
67 | 68 | $output_buffer .= $string; |
@@ -70,8 +71,7 @@ discard block |
||
70 | 71 | if(substr(getcwd(), -4) != 'docs') |
71 | 72 | { |
72 | 73 | $path_prefix = 'docs/'; |
73 | -} |
|
74 | -else |
|
74 | +} else |
|
75 | 75 | { |
76 | 76 | $path_prefix = ''; |
77 | 77 | } |
@@ -119,8 +119,7 @@ discard block |
||
119 | 119 | $buffer['name'] = $chapter[0]; |
120 | 120 | } |
121 | 121 | $prev_chapter_is_header = true; |
122 | - } |
|
123 | - else |
|
122 | + } else |
|
124 | 123 | { |
125 | 124 | $prev_chapter_is_header = false; |
126 | 125 | foreach($chapter as &$note) |
@@ -150,8 +149,7 @@ discard block |
||
150 | 149 | if(!isset($note_out['name'])) |
151 | 150 | { |
152 | 151 | $note_out['name'] = $buf_str; |
153 | - } |
|
154 | - else |
|
152 | + } else |
|
155 | 153 | { |
156 | 154 | $note_out['lines'][] = $buf_str; |
157 | 155 | } |
@@ -228,36 +226,31 @@ discard block |
||
228 | 226 | if($matches[2]) |
229 | 227 | { |
230 | 228 | buf_print("<ol>\r\n"); |
231 | - } |
|
232 | - else |
|
229 | + } else |
|
233 | 230 | { |
234 | 231 | buf_print("<ul>\r\n"); |
235 | 232 | } |
236 | 233 | buf_print('<li>'); |
237 | 234 | $last_spaces = $matches[1]; |
238 | 235 | $depth[] = $matches[2]; |
239 | - } |
|
240 | - elseif(strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
236 | + } elseif(strlen($matches[1]) < strlen($last_spaces) && count($depth)) |
|
241 | 237 | { |
242 | 238 | if(array_pop($depth)) |
243 | 239 | { |
244 | 240 | buf_print("</ol>\r\n"); |
245 | - } |
|
246 | - else |
|
241 | + } else |
|
247 | 242 | { |
248 | 243 | buf_print("</ul>\r\n"); |
249 | 244 | } |
250 | 245 | $last_spaces = $matches[1]; |
251 | 246 | buf_print('<li>'); |
252 | - } |
|
253 | - elseif(strlen($last_spaces) == strlen($matches[1])) |
|
247 | + } elseif(strlen($last_spaces) == strlen($matches[1])) |
|
254 | 248 | { |
255 | 249 | if($matches[2] == '' && $depth[count($depth) - 1] != '') |
256 | 250 | { |
257 | 251 | buf_print("</ol>\r\n"); |
258 | 252 | buf_print("<ul>\r\n"); |
259 | - } |
|
260 | - elseif($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
253 | + } elseif($matches[2] != '' && $depth[count($depth) - 1] == '') |
|
261 | 254 | { |
262 | 255 | buf_print("</ul>\r\n"); |
263 | 256 | buf_print("<ol>\r\n"); |
@@ -274,8 +267,7 @@ discard block |
||
274 | 267 | if(array_pop($depth)) |
275 | 268 | { |
276 | 269 | buf_print("</ol>\r\n"); |
277 | - } |
|
278 | - else |
|
270 | + } else |
|
279 | 271 | { |
280 | 272 | buf_print("</ul>\r\n"); |
281 | 273 | } |
@@ -8,8 +8,7 @@ |
||
8 | 8 | |
9 | 9 | classSupernova::$sn_mvc['view']['techtree'][] = 'sn_techtree_view'; |
10 | 10 | |
11 | -function sn_techtree_view($template = null) |
|
12 | -{ |
|
11 | +function sn_techtree_view($template = null) { |
|
13 | 12 | global $user, $planetrow; |
14 | 13 | |
15 | 14 | $tech_tree = array(); |
@@ -2,8 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | // Эти функции будут переписаны по добавлению инфы в БД |
4 | 4 | |
5 | -function pname_factory_production_field_name($factory_unit_id) |
|
6 | -{ |
|
5 | +function pname_factory_production_field_name($factory_unit_id) { |
|
7 | 6 | return get_unit_param($factory_unit_id, P_NAME) . '_porcent'; |
8 | 7 | } |
9 | 8 | |
@@ -14,7 +13,6 @@ discard block |
||
14 | 13 | * |
15 | 14 | * @return mixed |
16 | 15 | */ |
17 | -function pname_resource_name($resource_id) |
|
18 | -{ |
|
16 | +function pname_resource_name($resource_id) { |
|
19 | 17 | return get_unit_param($resource_id, P_NAME); |
20 | 18 | } |
21 | 19 | \ No newline at end of file |
@@ -1,7 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function sn_ube_combat_helper_round_header($round) |
|
4 | -{ |
|
3 | +function sn_ube_combat_helper_round_header($round) { |
|
5 | 4 | $header = array( |
6 | 5 | 'ИД1', |
7 | 6 | 'ИД2', |
@@ -40,13 +39,11 @@ discard block |
||
40 | 39 | print('</tr>'); |
41 | 40 | } |
42 | 41 | |
43 | -function sn_ube_combat_helper_round_footer($round = 0) |
|
44 | -{ |
|
42 | +function sn_ube_combat_helper_round_footer($round = 0) { |
|
45 | 43 | print('</table>'); |
46 | 44 | } |
47 | 45 | |
48 | -function sn_ube_combat_helper_round_row(&$unit_crossfire_result) |
|
49 | -{ |
|
46 | +function sn_ube_combat_helper_round_row(&$unit_crossfire_result) { |
|
50 | 47 | $SN = array( |
51 | 48 | SHIP_CARGO_SMALL => 'МаТр', SHIP_CARGO_BIG => 'БоТр', SHIP_CARGO_SUPER => 'СуТр', SHIP_CARGO_HYPER => 'ГпТр', |
52 | 49 | SHIP_SATTELITE_SOLAR => 'СоСп', |
@@ -1,7 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -function sn_ube_simulator_encode_replay($combat, $type) |
|
4 | -{ |
|
3 | +function sn_ube_simulator_encode_replay($combat, $type) { |
|
5 | 4 | $strPacked = "{$type}!"; |
6 | 5 | |
7 | 6 | foreach($combat as $fleetID => $fleetCompress) |
@@ -17,8 +16,7 @@ discard block |
||
17 | 16 | return $strPacked; |
18 | 17 | } |
19 | 18 | |
20 | -function sn_ube_simulator_decode_replay($str_data) |
|
21 | -{ |
|
19 | +function sn_ube_simulator_decode_replay($str_data) { |
|
22 | 20 | $fleet_id = 0; |
23 | 21 | |
24 | 22 | $arr_data_unpacked = explode('!', $str_data); |