@@ -22,6 +22,10 @@ discard block |
||
22 | 22 | doquery('DELETE FROM `{{aks}}` WHERE `id` NOT IN (SELECT DISTINCT `fleet_group` FROM `{{fleets}}`);'); |
23 | 23 | } |
24 | 24 | |
25 | +/** |
|
26 | + * @param double $arrival |
|
27 | + * @param integer $target_structure |
|
28 | + */ |
|
25 | 29 | function db_missile_insert($target_coord, $user, $planetrow, $arrival, $fleet_ship_count, $target_structure) { |
26 | 30 | doquery( |
27 | 31 | "INSERT INTO `{{iraks}}` SET |
@@ -52,7 +56,7 @@ discard block |
||
52 | 56 | /** |
53 | 57 | * @param $user |
54 | 58 | * @param $planet_dst |
55 | - * @param $time_limit |
|
59 | + * @param integer $time_limit |
|
56 | 60 | * |
57 | 61 | * @return array|bool|mysqli_result|null |
58 | 62 | */ |
@@ -113,14 +117,14 @@ discard block |
||
113 | 117 | |
114 | 118 | |
115 | 119 | /** |
116 | - * @param $fleet_group_id_list |
|
120 | + * @param string $fleet_group_id_list |
|
117 | 121 | */ |
118 | 122 | function db_acs_delete_by_list($fleet_group_id_list) { |
119 | 123 | doquery("DELETE FROM {{aks}} WHERE `id` IN ({$fleet_group_id_list})"); |
120 | 124 | } |
121 | 125 | |
122 | 126 | /** |
123 | - * @param $bashing_list |
|
127 | + * @param string $bashing_list |
|
124 | 128 | */ |
125 | 129 | function db_bashing_insert($bashing_list) { |
126 | 130 | doquery("INSERT INTO {{bashing}} (bashing_user_id, bashing_planet_id, bashing_time) VALUES {$bashing_list};"); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | } |
125 | 125 | |
126 | 126 | /** |
127 | - * @param $query |
|
127 | + * @param string $query |
|
128 | 128 | * |
129 | 129 | * @return mixed |
130 | 130 | */ |
@@ -140,8 +140,8 @@ discard block |
||
140 | 140 | } |
141 | 141 | |
142 | 142 | /** |
143 | - * @param $query |
|
144 | - * @param $fetch |
|
143 | + * @param string $query |
|
144 | + * @param boolean $fetch |
|
145 | 145 | */ |
146 | 146 | public function logQuery($query, $fetch) { |
147 | 147 | if(!classSupernova::$config->debug) { |
@@ -204,6 +204,10 @@ discard block |
||
204 | 204 | |
205 | 205 | |
206 | 206 | // TODO Заменить это на новый логгер |
207 | + |
|
208 | + /** |
|
209 | + * @param string $query |
|
210 | + */ |
|
207 | 211 | function security_watch_user_queries($query) { |
208 | 212 | global $user; |
209 | 213 | |
@@ -227,6 +231,9 @@ discard block |
||
227 | 231 | } |
228 | 232 | |
229 | 233 | |
234 | + /** |
|
235 | + * @param string $query |
|
236 | + */ |
|
230 | 237 | function security_query_check_bad_words($query) { |
231 | 238 | global $user, $dm_change_legit, $mm_change_legit; |
232 | 239 |
@@ -10,8 +10,8 @@ |
||
10 | 10 | /** |
11 | 11 | * UniverseVector constructor. |
12 | 12 | * |
13 | - * @param int|string $galaxy |
|
14 | - * @param int|Vector|array $system |
|
13 | + * @param integer $galaxy |
|
14 | + * @param integer $system |
|
15 | 15 | * @param int $planet |
16 | 16 | * @param int $type |
17 | 17 | */ |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | require_once('general_pname.php'); |
13 | 13 | |
14 | 14 | /** |
15 | - * @param $func_name |
|
15 | + * @param string $func_name |
|
16 | 16 | * @param array $func_arg |
17 | 17 | * |
18 | 18 | * @return mixed |
@@ -63,6 +63,9 @@ discard block |
||
63 | 63 | |
64 | 64 | // ---------------------------------------------------------------------------------------------------------------- |
65 | 65 | // Fonction de lecture / ecriture / exploitation de templates |
66 | +/** |
|
67 | + * @param string $filename |
|
68 | + */ |
|
66 | 69 | function sys_file_read($filename) { |
67 | 70 | return @file_get_contents($filename); |
68 | 71 | } |
@@ -105,7 +108,7 @@ discard block |
||
105 | 108 | /** |
106 | 109 | * Получение курса обмены валюты в серверную валюту |
107 | 110 | * |
108 | - * @param $currency_symbol |
|
111 | + * @param string $currency_symbol |
|
109 | 112 | * |
110 | 113 | * @return float |
111 | 114 | */ |
@@ -146,7 +149,7 @@ discard block |
||
146 | 149 | * @param float $n |
147 | 150 | * @param int|bool $floor |
148 | 151 | * @param int|bool $color |
149 | - * @param int|bool $limit |
|
152 | + * @param boolean $limit |
|
150 | 153 | * @param bool|null $style |
151 | 154 | * |
152 | 155 | * @return array|float|string |
@@ -247,6 +250,9 @@ discard block |
||
247 | 250 | return preg_replace($ListCensure, '*', $String); |
248 | 251 | } |
249 | 252 | |
253 | +/** |
|
254 | + * @param string $email |
|
255 | + */ |
|
250 | 256 | function is_email($email) { |
251 | 257 | 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)); |
252 | 258 | } |
@@ -283,6 +289,9 @@ discard block |
||
283 | 289 | return floatval(sys_get_param($param_name, $default)); |
284 | 290 | } |
285 | 291 | |
292 | +/** |
|
293 | + * @param string $param_name |
|
294 | + */ |
|
286 | 295 | function sys_get_param_escaped($param_name, $default = '') { |
287 | 296 | return db_escape(sys_get_param($param_name, $default)); |
288 | 297 | } |
@@ -515,6 +524,9 @@ discard block |
||
515 | 524 | } |
516 | 525 | |
517 | 526 | // Generates random string of $length symbols from $allowed_chars charset |
527 | +/** |
|
528 | + * @param string $allowed_chars |
|
529 | + */ |
|
518 | 530 | function sys_random_string($length = 16, $allowed_chars = SN_SYS_SEC_CHARS_ALLOWED) { |
519 | 531 | $allowed_length = strlen($allowed_chars); |
520 | 532 | |
@@ -619,6 +631,9 @@ discard block |
||
619 | 631 | return implode(';', $fleet_string); |
620 | 632 | } |
621 | 633 | |
634 | +/** |
|
635 | + * @param string $body |
|
636 | + */ |
|
622 | 637 | function mymail($email_unsafe, $title, $body, $from = '', $html = false) { |
623 | 638 | $from = trim($from ? $from : classSupernova::$config->game_adminEmail); |
624 | 639 | |
@@ -873,6 +888,9 @@ discard block |
||
873 | 888 | return serialize($nick_array); |
874 | 889 | } |
875 | 890 | |
891 | +/** |
|
892 | + * @param string $nick_string |
|
893 | + */ |
|
876 | 894 | function player_nick_uncompact($nick_string) { |
877 | 895 | try { |
878 | 896 | $result = unserialize($nick_string); |
@@ -1120,6 +1138,9 @@ discard block |
||
1120 | 1138 | return $ranks; |
1121 | 1139 | } |
1122 | 1140 | |
1141 | +/** |
|
1142 | + * @param boolean $planet_id |
|
1143 | + */ |
|
1123 | 1144 | function sys_player_new_adjust($user_id, $planet_id) { return sn_function_call(__FUNCTION__, array($user_id, $planet_id, &$result)); } |
1124 | 1145 | |
1125 | 1146 | function sn_sys_player_new_adjust($user_id, $planet_id, &$result) { |
@@ -1430,6 +1451,9 @@ discard block |
||
1430 | 1451 | return version_compare(sn_version_compare_extra($ver1), sn_version_compare_extra($ver2)); |
1431 | 1452 | } |
1432 | 1453 | |
1454 | +/** |
|
1455 | + * @param string $name |
|
1456 | + */ |
|
1433 | 1457 | function sn_setcookie($name, $value = null, $expire = null, $path = SN_ROOT_RELATIVE, $domain = null, $secure = null, $httponly = null) { |
1434 | 1458 | $_COOKIE[$name] = $value; |
1435 | 1459 |
@@ -972,7 +972,7 @@ discard block |
||
972 | 972 | /** |
973 | 973 | * Set current resource list from array of units |
974 | 974 | * |
975 | - * @param array $resource_list |
|
975 | + * @param integer[] $resource_list |
|
976 | 976 | */ |
977 | 977 | public function resourcesSet($resource_list) { |
978 | 978 | if (!empty($this->propertiesAdjusted['resource_list'])) { |
@@ -1020,7 +1020,7 @@ discard block |
||
1020 | 1020 | } |
1021 | 1021 | |
1022 | 1022 | /** |
1023 | - * @param array $rate |
|
1023 | + * @param integer[] $rate |
|
1024 | 1024 | * |
1025 | 1025 | * @return float |
1026 | 1026 | */ |
@@ -1051,7 +1051,6 @@ discard block |
||
1051 | 1051 | * Restores fleet or resources to planet |
1052 | 1052 | * |
1053 | 1053 | * @param bool $start |
1054 | - * @param bool $only_resources |
|
1055 | 1054 | * @param int $result |
1056 | 1055 | * |
1057 | 1056 | * @return int |
@@ -1205,6 +1204,9 @@ discard block |
||
1205 | 1204 | } |
1206 | 1205 | |
1207 | 1206 | |
1207 | + /** |
|
1208 | + * @param integer $missionStartTimeStamp |
|
1209 | + */ |
|
1208 | 1210 | protected function renderFleetCoordinates($missionStartTimeStamp = SN_TIME_NOW, $timeMissionJob = 0) { |
1209 | 1211 | $timeToReturn = $this->travelData['duration'] * 2 + $timeMissionJob; |
1210 | 1212 |
@@ -70,6 +70,9 @@ discard block |
||
70 | 70 | $this->numqueries = 0; |
71 | 71 | } |
72 | 72 | |
73 | + /** |
|
74 | + * @param string $mes |
|
75 | + */ |
|
73 | 76 | function add($mes) { |
74 | 77 | $this->log .= $mes; |
75 | 78 | $this->numqueries++; |
@@ -185,6 +188,9 @@ discard block |
||
185 | 188 | return $error_backtrace; |
186 | 189 | } |
187 | 190 | |
191 | + /** |
|
192 | + * @param string $die_message |
|
193 | + */ |
|
188 | 194 | function error_fatal($die_message, $details = 'There is a fatal error on page') { |
189 | 195 | // TODO - Записывать детали ошибки в лог-файл |
190 | 196 | die($die_message); |
@@ -96,8 +96,8 @@ |
||
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
99 | - * @param int|string $user_id |
|
100 | - * @param array $fieldList |
|
99 | + * @param integer $user_id |
|
100 | + * @param string[] $fieldList |
|
101 | 101 | * @param bool $for_update |
102 | 102 | * |
103 | 103 | * @return array|null |
@@ -90,6 +90,9 @@ discard block |
||
90 | 90 | |
91 | 91 | |
92 | 92 | |
93 | + /** |
|
94 | + * @param boolean $player |
|
95 | + */ |
|
93 | 96 | public static function db_user_by_id($user_id_unsafe, $for_update = false, $fields = '*', $player = null) { |
94 | 97 | return classSupernova::db_get_user_by_id($user_id_unsafe, $for_update, $fields, $player); |
95 | 98 | } |
@@ -126,6 +129,9 @@ discard block |
||
126 | 129 | |
127 | 130 | |
128 | 131 | |
132 | + /** |
|
133 | + * @param integer $config_user_birthday_range |
|
134 | + */ |
|
129 | 135 | public static function db_user_list_to_celebrate($config_user_birthday_range) { |
130 | 136 | return doquery( |
131 | 137 | "SELECT |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | * <p>null - транзакция НЕ должна быть запущена</p> |
324 | 324 | * <p>true - транзакция должна быть запущена - для совместимости с $for_update</p> |
325 | 325 | * <p>false - всё равно - для совместимости с $for_update</p> |
326 | - * @return bool Текущий статус транзакции |
|
326 | + * @return null|boolean Текущий статус транзакции |
|
327 | 327 | */ |
328 | 328 | public static function db_transaction_check($status = null) { |
329 | 329 | $error_msg = false; |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | /** |
400 | 400 | * Блокирует указанные таблицу/список таблиц |
401 | 401 | * |
402 | - * @param string|array $tables Таблица/список таблиц для блокировки. Названия таблиц - без префиксов |
|
402 | + * @param string $tables Таблица/список таблиц для блокировки. Названия таблиц - без префиксов |
|
403 | 403 | * <p>string - название таблицы для блокировки</p> |
404 | 404 | * <p>array - массив, где ключ - имя таблицы, а значение - условия блокировки элементов</p> |
405 | 405 | */ |
@@ -587,6 +587,9 @@ discard block |
||
587 | 587 | return $result; |
588 | 588 | } |
589 | 589 | |
590 | + /** |
|
591 | + * @param integer $location_type |
|
592 | + */ |
|
590 | 593 | public static function db_ins_field_set($location_type, $field_set, $serialize = false) { |
591 | 594 | // TODO multiinsert |
592 | 595 | !sn_db_field_set_is_safe($field_set) ? $field_set = sn_db_field_set_make_safe($field_set, $serialize) : false; |
@@ -809,7 +812,7 @@ discard block |
||
809 | 812 | * @param $location_type |
810 | 813 | * @param $location_id |
811 | 814 | * |
812 | - * @return array|bool |
|
815 | + * @return boolean |
|
813 | 816 | */ |
814 | 817 | public static function db_get_unit_list_by_location($user_id = 0, $location_type, $location_id) |
815 | 818 | { |