@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | * @param string $title |
| 35 | 35 | * @param string $dest |
| 36 | 36 | * @param int $time |
| 37 | - * @param bool|true $show_header |
|
| 37 | + * @param boolean $show_header |
|
| 38 | 38 | */ |
| 39 | 39 | function message($mes, $title = 'Error', $dest = '', $time = 5, $show_header = true) { |
| 40 | 40 | $template = gettemplate('message_body', true); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | * @param bool|true $isDisplayTopNav |
| 196 | 196 | * @param string $metatags |
| 197 | 197 | * @param bool|false $AdminPage |
| 198 | - * @param bool|true $isDisplayMenu |
|
| 198 | + * @param boolean $isDisplayMenu |
|
| 199 | 199 | * |
| 200 | 200 | * @return mixed |
| 201 | 201 | */ |
@@ -208,7 +208,6 @@ discard block |
||
| 208 | 208 | * @param string $title |
| 209 | 209 | * @param bool|true $isDisplayTopNav |
| 210 | 210 | * @param string $metatags |
| 211 | - * @param bool|false $AdminPage |
|
| 212 | 211 | * @param bool|true $isDisplayMenu |
| 213 | 212 | * @param bool|int|string $exitStatus - Код или сообщение выхода |
| 214 | 213 | */ |
@@ -385,10 +384,10 @@ discard block |
||
| 385 | 384 | |
| 386 | 385 | /** |
| 387 | 386 | * @param $time |
| 388 | - * @param $event |
|
| 387 | + * @param integer $event |
|
| 389 | 388 | * @param $msg |
| 390 | 389 | * @param $coordinates |
| 391 | - * @param $is_decrease |
|
| 390 | + * @param boolean $is_decrease |
|
| 392 | 391 | * @param Fleet $objFleet |
| 393 | 392 | * @param $fleet_flying_sorter |
| 394 | 393 | * @param $fleet_flying_events |
@@ -708,7 +707,7 @@ discard block |
||
| 708 | 707 | } |
| 709 | 708 | |
| 710 | 709 | /** |
| 711 | - * @param array|string $files |
|
| 710 | + * @param string $files |
|
| 712 | 711 | * @param template|bool $template |
| 713 | 712 | * @param string|bool $template_path |
| 714 | 713 | * |
@@ -9,6 +9,9 @@ |
||
| 9 | 9 | * [+] Full rewrote and optimization |
| 10 | 10 | * |
| 11 | 11 | */ |
| 12 | +/** |
|
| 13 | + * @param integer $UpdateTime |
|
| 14 | + */ |
|
| 12 | 15 | function sys_o_get_updated($user, $planet, $UpdateTime, $simulation = false, $no_user_update = false) { |
| 13 | 16 | sn_db_transaction_check(true); |
| 14 | 17 | |
@@ -169,6 +169,11 @@ discard block |
||
| 169 | 169 | */ |
| 170 | 170 | // OK v4 |
| 171 | 171 | // TODO - вынести в отдельный класс |
| 172 | +/** |
|
| 173 | + * @param string $db_id_field_name |
|
| 174 | + * @param string $db_table_name |
|
| 175 | + * @param string $db_value_field_name |
|
| 176 | + */ |
|
| 172 | 177 | function db_get_set_unique_id_value($current_value_unsafe, $db_id_field_name, $db_table_name, $db_value_field_name) { |
| 173 | 178 | $current_value_safe = db_escape($current_value_unsafe); |
| 174 | 179 | $value_id = classSupernova::$db->doSelectFetch("SELECT `{$db_id_field_name}` FROM {{{$db_table_name}}} WHERE `{$db_value_field_name}` = '{$current_value_safe}' LIMIT 1 FOR UPDATE"); |
@@ -487,8 +492,8 @@ discard block |
||
| 487 | 492 | |
| 488 | 493 | |
| 489 | 494 | /** |
| 490 | - * @param $user_id |
|
| 491 | - * @param $change_type |
|
| 495 | + * @param integer $user_id |
|
| 496 | + * @param integer $change_type |
|
| 492 | 497 | * @param $dark_matter |
| 493 | 498 | * @param $comment_unsafe |
| 494 | 499 | * @param $rowUserNameUnsafe |
@@ -509,7 +514,7 @@ discard block |
||
| 509 | 514 | /** |
| 510 | 515 | * @param $user_id_safe |
| 511 | 516 | * |
| 512 | - * @return array|bool|mysqli_result|null |
|
| 517 | + * @return integer |
|
| 513 | 518 | */ |
| 514 | 519 | function db_referral_get_by_id($user_id_safe) { |
| 515 | 520 | $old_referral = classSupernova::$db->doSelectFetch("SELECT * FROM {{referrals}} WHERE `id` = {$user_id_safe} LIMIT 1 FOR UPDATE;"); |
@@ -540,9 +545,9 @@ discard block |
||
| 540 | 545 | |
| 541 | 546 | // Quests *********************************************************************************************************** |
| 542 | 547 | /** |
| 543 | - * @param $query_add_select |
|
| 548 | + * @param string $query_add_select |
|
| 544 | 549 | * @param $query_add_from |
| 545 | - * @param $query_add_where |
|
| 550 | + * @param string $query_add_where |
|
| 546 | 551 | * |
| 547 | 552 | * @return array|bool|mysqli_result|null |
| 548 | 553 | */ |
@@ -586,11 +591,11 @@ discard block |
||
| 586 | 591 | } |
| 587 | 592 | |
| 588 | 593 | /** |
| 589 | - * @param $quest_name_unsafe |
|
| 590 | - * @param $quest_type |
|
| 591 | - * @param $quest_description_unsafe |
|
| 594 | + * @param string $quest_name_unsafe |
|
| 595 | + * @param integer $quest_type |
|
| 596 | + * @param string $quest_description_unsafe |
|
| 592 | 597 | * @param $quest_conditions |
| 593 | - * @param $quest_rewards |
|
| 598 | + * @param string $quest_rewards |
|
| 594 | 599 | * @param $quest_id |
| 595 | 600 | */ |
| 596 | 601 | function db_quest_update($quest_name_unsafe, $quest_type, $quest_description_unsafe, $quest_conditions, $quest_rewards, $quest_id) { |
@@ -674,7 +679,7 @@ discard block |
||
| 674 | 679 | |
| 675 | 680 | /** |
| 676 | 681 | * @param $payment_id |
| 677 | - * @param $payment_status |
|
| 682 | + * @param integer $payment_status |
|
| 678 | 683 | * @param $comment_unsafe |
| 679 | 684 | */ |
| 680 | 685 | function db_payment_update($payment_id, $payment_status, $comment_unsafe) { |
@@ -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 | */ |
@@ -81,6 +81,10 @@ discard block |
||
| 81 | 81 | // ------------------------------------------------------------------------- |
| 82 | 82 | // Here comes low-level functions - those that directly works with cacher engines |
| 83 | 83 | // ------------------------------------------------------------------------- |
| 84 | + |
|
| 85 | + /** |
|
| 86 | + * @param string $name |
|
| 87 | + */ |
|
| 84 | 88 | public function __set($name, $value) { |
| 85 | 89 | switch ($name) { |
| 86 | 90 | case '_MODE': |
@@ -132,6 +136,9 @@ discard block |
||
| 132 | 136 | return null; |
| 133 | 137 | } |
| 134 | 138 | |
| 139 | + /** |
|
| 140 | + * @param string $name |
|
| 141 | + */ |
|
| 135 | 142 | public function __isset($name) { |
| 136 | 143 | switch (self::$mode) { |
| 137 | 144 | case CACHER_NO_CACHE: |
@@ -173,6 +173,9 @@ |
||
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
| 176 | + /** |
|
| 177 | + * @param string $path |
|
| 178 | + */ |
|
| 176 | 179 | protected function lng_try_filepath($path, $file_path_relative) { |
| 177 | 180 | $file_path = SN_ROOT_PHYSICAL . ($path && file_exists(SN_ROOT_PHYSICAL . $path . $file_path_relative) ? $path : '') . $file_path_relative; |
| 178 | 181 | return file_exists($file_path) ? $file_path : false; |