@@ -69,8 +69,8 @@ |
||
69 | 69 | |
70 | 70 | /** |
71 | 71 | * @param Fleet $objFleet |
72 | - * @param $ov_label |
|
73 | - * @param $planet_end_type |
|
72 | + * @param integer $ov_label |
|
73 | + * @param integer $planet_end_type |
|
74 | 74 | * |
75 | 75 | * @return mixed |
76 | 76 | */ |
@@ -185,6 +185,9 @@ |
||
185 | 185 | return $result; |
186 | 186 | } |
187 | 187 | |
188 | +/** |
|
189 | + * @param integer $que_id |
|
190 | + */ |
|
188 | 191 | function tpl_parse_planet_que($que, $planet, $que_id) { |
189 | 192 | $hangar_que = array(); |
190 | 193 | $que_hangar = $que['ques'][$que_id][$planet['id_owner']][$planet['id']]; |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | +/** |
|
4 | + * @param string $type |
|
5 | + */ |
|
3 | 6 | function sn_ube_simulator_encode_replay($combat, $type) |
4 | 7 | { |
5 | 8 | $strPacked = "{$type}!"; |
@@ -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 |
@@ -16,7 +16,6 @@ discard block |
||
16 | 16 | * @param $user |
17 | 17 | * @param $planet |
18 | 18 | * @param array $unit_list |
19 | - * @param null $query |
|
20 | 19 | */ |
21 | 20 | function db_change_resources(&$user, &$planet, $unit_list) { |
22 | 21 | $group = sn_get_groups('resources_loot'); |
@@ -56,6 +55,9 @@ discard block |
||
56 | 55 | |
57 | 56 | } |
58 | 57 | |
58 | +/** |
|
59 | + * @param boolean $transaction_should_be_started |
|
60 | + */ |
|
59 | 61 | function sn_db_transaction_check($transaction_should_be_started = null) { |
60 | 62 | return classSupernova::$gc->db->getTransaction()->check($transaction_should_be_started); |
61 | 63 | } |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | require_once('general_pname.php'); |
12 | 12 | |
13 | 13 | /** |
14 | - * @param $func_name |
|
14 | + * @param string $func_name |
|
15 | 15 | * @param array $func_arg |
16 | 16 | * |
17 | 17 | * @return mixed |
@@ -62,6 +62,9 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | // ---------------------------------------------------------------------------------------------------------------- |
65 | +/** |
|
66 | + * @param string $filename |
|
67 | + */ |
|
65 | 68 | function sys_file_read($filename) { |
66 | 69 | return @file_get_contents($filename); |
67 | 70 | } |
@@ -104,7 +107,7 @@ discard block |
||
104 | 107 | /** |
105 | 108 | * Получение курса обмены валюты в серверную валюту |
106 | 109 | * |
107 | - * @param $currency_symbol |
|
110 | + * @param string $currency_symbol |
|
108 | 111 | * |
109 | 112 | * @return float |
110 | 113 | */ |
@@ -130,7 +133,7 @@ discard block |
||
130 | 133 | * - true - colors number to green if positive or zero; red if negative |
131 | 134 | * - 0 |
132 | 135 | * - numeric - colors number to green if less then $color; red if greater |
133 | - * @param int|bool $limit - generally converts "15000" to "15k", "2000000" to "2kk" etc |
|
136 | + * @param boolean $limit - generally converts "15000" to "15k", "2000000" to "2kk" etc |
|
134 | 137 | * - 0/false - proceed with $floor |
135 | 138 | * - numeric - divides number to segments by power of $limit and adds 'k' for each segment |
136 | 139 | * - makes sense for 1000, but works with any number |
@@ -229,6 +232,9 @@ discard block |
||
229 | 232 | return preg_replace($ListCensure, '*', $String); |
230 | 233 | } |
231 | 234 | |
235 | +/** |
|
236 | + * @param string $email |
|
237 | + */ |
|
232 | 238 | function is_email($email) { |
233 | 239 | return (preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i", $email)); |
234 | 240 | } |
@@ -266,6 +272,9 @@ discard block |
||
266 | 272 | return floatval(sys_get_param($param_name, $default)); |
267 | 273 | } |
268 | 274 | |
275 | +/** |
|
276 | + * @param string $param_name |
|
277 | + */ |
|
269 | 278 | function sys_get_param_escaped($param_name, $default = '') { |
270 | 279 | return db_escape(sys_get_param($param_name, $default)); |
271 | 280 | } |
@@ -434,6 +443,9 @@ discard block |
||
434 | 443 | } |
435 | 444 | |
436 | 445 | // Generates random string of $length symbols from $allowed_chars charset |
446 | +/** |
|
447 | + * @param string $allowed_chars |
|
448 | + */ |
|
437 | 449 | function sys_random_string($length = 16, $allowed_chars = SN_SYS_SEC_CHARS_ALLOWED) { |
438 | 450 | $allowed_length = strlen($allowed_chars); |
439 | 451 | |
@@ -538,6 +550,10 @@ discard block |
||
538 | 550 | return implode(';', $fleet_string); |
539 | 551 | } |
540 | 552 | |
553 | +/** |
|
554 | + * @param string $title |
|
555 | + * @param string $body |
|
556 | + */ |
|
541 | 557 | function mymail($email_unsafe, $title, $body, $from = '', $html = false) { |
542 | 558 | $from = trim($from ? $from : classSupernova::$config->game_adminEmail); |
543 | 559 | |
@@ -803,6 +819,9 @@ discard block |
||
803 | 819 | return serialize($nick_array); |
804 | 820 | } |
805 | 821 | |
822 | +/** |
|
823 | + * @param string $nick_string |
|
824 | + */ |
|
806 | 825 | function player_nick_uncompact($nick_string) { |
807 | 826 | try { |
808 | 827 | $result = unserialize($nick_string); |
@@ -990,6 +1009,9 @@ discard block |
||
990 | 1009 | return $result; |
991 | 1010 | } |
992 | 1011 | |
1012 | +/** |
|
1013 | + * @param string $groups |
|
1014 | + */ |
|
993 | 1015 | function isInGroup($groups, $unitId) { |
994 | 1016 | $group = sn_get_groups($groups); |
995 | 1017 | |
@@ -1058,6 +1080,9 @@ discard block |
||
1058 | 1080 | return $ranks; |
1059 | 1081 | } |
1060 | 1082 | |
1083 | +/** |
|
1084 | + * @param boolean $planet_id |
|
1085 | + */ |
|
1061 | 1086 | function sys_player_new_adjust($user_id, $planet_id) { return sn_function_call(__FUNCTION__, array($user_id, $planet_id, &$result)); } |
1062 | 1087 | |
1063 | 1088 | function sn_sys_player_new_adjust($user_id, $planet_id, &$result) { |
@@ -1216,6 +1241,9 @@ discard block |
||
1216 | 1241 | return $rates; |
1217 | 1242 | } |
1218 | 1243 | |
1244 | +/** |
|
1245 | + * @param integer $in_resource |
|
1246 | + */ |
|
1219 | 1247 | function get_unit_cost_in(&$cost, $in_resource = RES_METAL) { |
1220 | 1248 | static $rates; |
1221 | 1249 | |
@@ -1382,6 +1410,9 @@ discard block |
||
1382 | 1410 | return version_compare(sn_version_compare_extra($ver1), sn_version_compare_extra($ver2)); |
1383 | 1411 | } |
1384 | 1412 | |
1413 | +/** |
|
1414 | + * @param string $name |
|
1415 | + */ |
|
1385 | 1416 | function sn_setcookie($name, $value = null, $expire = null, $path = SN_ROOT_RELATIVE, $domain = null, $secure = null, $httponly = null) { |
1386 | 1417 | $_COOKIE[$name] = $value; |
1387 | 1418 |
@@ -134,7 +134,6 @@ discard block |
||
134 | 134 | /** |
135 | 135 | * Попытка залогиниться с использованием метода $method |
136 | 136 | * |
137 | - * @param string $method_name |
|
138 | 137 | */ |
139 | 138 | public function login() { |
140 | 139 | // TODO Проверяем поддерживаемость метода |
@@ -162,6 +161,10 @@ discard block |
||
162 | 161 | * @return array|bool|resource |
163 | 162 | */ |
164 | 163 | // OK v4.5 |
164 | + |
|
165 | + /** |
|
166 | + * @param string $salt_unsafe |
|
167 | + */ |
|
165 | 168 | public function password_change($old_password_unsafe, $new_password_unsafe, $salt_unsafe = null) { |
166 | 169 | $result = parent::password_change($old_password_unsafe, $new_password_unsafe, $salt_unsafe); |
167 | 170 | if($result) { |
@@ -171,6 +174,9 @@ discard block |
||
171 | 174 | return $result; |
172 | 175 | } |
173 | 176 | |
177 | + /** |
|
178 | + * @param Account $account_to_impersonate |
|
179 | + */ |
|
174 | 180 | public function impersonate($account_to_impersonate) { |
175 | 181 | $this->cookie_set($account_to_impersonate); |
176 | 182 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | /** |
25 | 25 | * Добавляет юнит к списку бонусов |
26 | 26 | * |
27 | - * @param $unit_id |
|
27 | + * @param integer $unit_id |
|
28 | 28 | * @param $unit_level |
29 | 29 | */ |
30 | 30 | public function add_unit_by_snid($unit_id, $unit_level) { |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | * |
68 | 68 | * Выдает финальный бонус в виде множителя |
69 | 69 | * |
70 | - * @param string|int $param - ИД бонуса |
|
70 | + * @param string $param - ИД бонуса |
|
71 | 71 | * |
72 | 72 | * @return float |
73 | 73 | */ |