@@ -4,11 +4,20 @@ discard block |
||
4 | 4 | { |
5 | 5 | return classSupernova::db_get_record_by_id(LOC_PLANET, $planet_id, $for_update, $fields); |
6 | 6 | } |
7 | +/** |
|
8 | + * @param integer $galaxy |
|
9 | + * @param integer $system |
|
10 | + * @param integer $planet |
|
11 | + * @param integer $planet_type |
|
12 | + */ |
|
7 | 13 | function db_planet_by_gspt_safe($galaxy, $system, $planet, $planet_type, $for_update = false, $fields = '*') |
8 | 14 | { |
9 | 15 | return classSupernova::db_get_record_list(LOC_PLANET, |
10 | 16 | "{{planets}}.`galaxy` = {$galaxy} AND {{planets}}.`system` = {$system} AND {{planets}}.`planet` = {$planet} AND {{planets}}.`planet_type` = {$planet_type}", true); |
11 | 17 | } |
18 | +/** |
|
19 | + * @param integer $planet_type |
|
20 | + */ |
|
12 | 21 | function db_planet_by_gspt($galaxy, $system, $planet, $planet_type, $for_update = false, $fields = '*') |
13 | 22 | { |
14 | 23 | $galaxy = intval($galaxy); |
@@ -79,6 +88,9 @@ discard block |
||
79 | 88 | return classSupernova::db_get_record_list(LOC_PLANET, |
80 | 89 | "`id_owner` = '{$user_row['id']}' {$conditions} ORDER BY {$order_by}"); |
81 | 90 | } |
91 | +/** |
|
92 | + * @param integer $planet_id |
|
93 | + */ |
|
82 | 94 | function db_planet_list_by_user_or_planet($user_id, $planet_id) { |
83 | 95 | if(!($user_id = idval($user_id)) && !($planet_id = idval($planet_id))) return false; |
84 | 96 | |
@@ -92,6 +104,9 @@ discard block |
||
92 | 104 | if(!($planet_id = idval($planet_id))) return false; |
93 | 105 | return classSupernova::db_upd_record_by_id(LOC_PLANET, $planet_id, $set); |
94 | 106 | } |
107 | +/** |
|
108 | + * @param integer $ui_planet_type |
|
109 | + */ |
|
95 | 110 | function db_planet_set_by_gspt($ui_galaxy, $ui_system, $ui_planet, $ui_planet_type = PT_ALL, $set) |
96 | 111 | { |
97 | 112 | if(!($set = trim($set))) return false; |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | +/** |
|
4 | + * @param boolean $player |
|
5 | + */ |
|
3 | 6 | function db_user_by_id($user_id_unsafe, $for_update = false, $fields = '*', $player = null) { |
4 | 7 | return classSupernova::db_get_user_by_id($user_id_unsafe, $for_update, $fields, $player); |
5 | 8 | } |
@@ -10,6 +10,7 @@ discard block |
||
10 | 10 | * |
11 | 11 | * 1.0 - copyright (c) 2010 by Gorlum for http://supernova.ws |
12 | 12 | * @version 1.0 |
13 | + * @param integer $lab_require |
|
13 | 14 | */ |
14 | 15 | function eco_get_lab_max_effective_level(&$user, $lab_require) |
15 | 16 | { |
@@ -193,6 +194,9 @@ discard block |
||
193 | 194 | return $result; |
194 | 195 | } |
195 | 196 | |
197 | +/** |
|
198 | + * @param integer[] $unit_list |
|
199 | + */ |
|
196 | 200 | function eco_is_builds_in_que($planet_que, $unit_list) |
197 | 201 | { |
198 | 202 | $eco_is_builds_in_que = false; |
@@ -55,6 +55,9 @@ discard block |
||
55 | 55 | } |
56 | 56 | |
57 | 57 | |
58 | +/** |
|
59 | + * @param integer $build_mode |
|
60 | + */ |
|
58 | 61 | function que_build($user, $planet, $build_mode = BUILD_CREATE, $redirect = true) { |
59 | 62 | global $lang, $config; |
60 | 63 | |
@@ -378,6 +381,9 @@ discard block |
||
378 | 381 | return classSupernova::db_que_list_by_type_location($user_id, $planet_id, $que_type, $for_update); |
379 | 382 | } |
380 | 383 | |
384 | +/** |
|
385 | + * @param integer $unit_id |
|
386 | + */ |
|
381 | 387 | function que_add_unit($unit_id, $user = array(), $planet = array(), $build_data, $unit_level = 0, $unit_amount = 1, $build_mode = BUILD_CREATE) { |
382 | 388 | // TODO Унифицировать проверки |
383 | 389 |
@@ -37,6 +37,9 @@ |
||
37 | 37 | return $list; |
38 | 38 | } |
39 | 39 | |
40 | +/** |
|
41 | + * @param integer $message_type |
|
42 | + */ |
|
40 | 43 | function msg_send_simple_message($owners, $sender, $timestamp, $message_type, $from, $subject, $text, $escaped = false, $force = false) |
41 | 44 | { |
42 | 45 | global $config, $user, $sn_message_class_list; |
@@ -161,6 +161,9 @@ discard block |
||
161 | 161 | return $rows_affected; |
162 | 162 | } |
163 | 163 | |
164 | +/** |
|
165 | + * @param integer $type |
|
166 | + */ |
|
164 | 167 | function rpg_level_up(&$user, $type, $xp_to_add = 0) |
165 | 168 | { |
166 | 169 | $q = 1.03; |
@@ -223,6 +226,10 @@ discard block |
||
223 | 226 | } |
224 | 227 | } |
225 | 228 | |
229 | +/** |
|
230 | + * @param integer $b1 |
|
231 | + * @param double $q |
|
232 | + */ |
|
226 | 233 | function rpg_xp_for_level($level, $b1, $q) |
227 | 234 | { |
228 | 235 | return floor($b1 * (pow($q, $level) - 1)/($q - 1)); |
@@ -233,6 +240,9 @@ discard block |
||
233 | 240 | return rpg_xp_for_level($level, 50, 1.03); |
234 | 241 | } |
235 | 242 | |
243 | +/** |
|
244 | + * @param integer $level |
|
245 | + */ |
|
236 | 246 | function RPG_get_raider_xp($level) |
237 | 247 | { |
238 | 248 | return rpg_xp_for_level($level, 10, 1.03); |
@@ -141,6 +141,9 @@ |
||
141 | 141 | "); |
142 | 142 | } |
143 | 143 | |
144 | +/** |
|
145 | + * @param string $email_unsafe |
|
146 | + */ |
|
144 | 147 | function player_create($username_unsafe, $email_unsafe, $options) { |
145 | 148 | sn_db_transaction_check(true); |
146 | 149 |
@@ -1,5 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | +/** |
|
4 | + * @param double $planet_sectors |
|
5 | + */ |
|
3 | 6 | function uni_create_planet_get_density($position_data, $user_row, $planet_sectors) { |
4 | 7 | $density_list = sn_get_groups('planet_density'); |
5 | 8 | $density_min = reset($density_list); |
@@ -11,6 +11,9 @@ discard block |
||
11 | 11 | require_once('general/math.php'); |
12 | 12 | require_once('general_pname.php'); |
13 | 13 | |
14 | +/** |
|
15 | + * @param string $func_name |
|
16 | + */ |
|
14 | 17 | function sn_function_call($func_name, $func_arg = array()) |
15 | 18 | { |
16 | 19 | global $functions; // All data in $functions should be normalized to valid 'callable' state: '<function_name>'|array('<object_name>', '<method_name>') |
@@ -58,6 +61,9 @@ discard block |
||
58 | 61 | |
59 | 62 | // ---------------------------------------------------------------------------------------------------------------- |
60 | 63 | // Fonction de lecture / ecriture / exploitation de templates |
64 | +/** |
|
65 | + * @param string $filename |
|
66 | + */ |
|
61 | 67 | function sys_file_read($filename) |
62 | 68 | { |
63 | 69 | return @file_get_contents($filename); |
@@ -106,7 +112,7 @@ discard block |
||
106 | 112 | /** |
107 | 113 | * Получение курса обмены валюты в серверную валюту |
108 | 114 | * |
109 | - * @param $currency_symbol |
|
115 | + * @param string $currency_symbol |
|
110 | 116 | * |
111 | 117 | * @return float |
112 | 118 | */ |
@@ -143,6 +149,7 @@ discard block |
||
143 | 149 | null - standard result |
144 | 150 | true - return only style class for current params |
145 | 151 | false - return array('text' => $ret, 'class' => $class), where $ret - unstyled |
152 | + * @param boolean $style |
|
146 | 153 | */ |
147 | 154 | |
148 | 155 | function pretty_number($n, $floor = true, $color = false, $limit = false, $style = null) |
@@ -262,6 +269,9 @@ discard block |
||
262 | 269 | return preg_replace($ListCensure, '*', $String); |
263 | 270 | } |
264 | 271 | |
272 | +/** |
|
273 | + * @param string $email |
|
274 | + */ |
|
265 | 275 | function is_email($email) { |
266 | 276 | 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)); |
267 | 277 | } |
@@ -298,6 +308,9 @@ discard block |
||
298 | 308 | return floatval(sys_get_param($param_name, $default)); |
299 | 309 | } |
300 | 310 | |
311 | +/** |
|
312 | + * @param string $param_name |
|
313 | + */ |
|
301 | 314 | function sys_get_param_escaped($param_name, $default = '') |
302 | 315 | { |
303 | 316 | return db_escape(sys_get_param($param_name, $default)); |
@@ -542,6 +555,9 @@ discard block |
||
542 | 555 | } |
543 | 556 | |
544 | 557 | // Generates random string of $length symbols from $allowed_chars charset |
558 | +/** |
|
559 | + * @param string $allowed_chars |
|
560 | + */ |
|
545 | 561 | function sys_random_string($length = 16, $allowed_chars = SN_SYS_SEC_CHARS_ALLOWED) { |
546 | 562 | $allowed_length = strlen($allowed_chars); |
547 | 563 | |
@@ -667,6 +683,9 @@ discard block |
||
667 | 683 | return implode(';', $fleet_string); |
668 | 684 | } |
669 | 685 | |
686 | +/** |
|
687 | + * @param string $body |
|
688 | + */ |
|
670 | 689 | function mymail($email_unsafe, $title, $body, $from = '', $html = false) { |
671 | 690 | global $config, $lang; |
672 | 691 | |
@@ -954,6 +973,9 @@ discard block |
||
954 | 973 | return serialize($nick_array); |
955 | 974 | } |
956 | 975 | |
976 | +/** |
|
977 | + * @param string $nick_string |
|
978 | + */ |
|
957 | 979 | function player_nick_uncompact($nick_string) { |
958 | 980 | try { |
959 | 981 | $result = unserialize($nick_string); |
@@ -1237,6 +1259,9 @@ discard block |
||
1237 | 1259 | return $ranks; |
1238 | 1260 | } |
1239 | 1261 | |
1262 | +/** |
|
1263 | + * @param boolean $planet_id |
|
1264 | + */ |
|
1240 | 1265 | function sys_player_new_adjust($user_id, $planet_id){return sn_function_call('sys_player_new_adjust', array($user_id, $planet_id, &$result));} |
1241 | 1266 | function sn_sys_player_new_adjust($user_id, $planet_id, &$result) { |
1242 | 1267 | return $result; |
@@ -1589,6 +1614,9 @@ discard block |
||
1589 | 1614 | return version_compare(sn_version_compare_extra($ver1), sn_version_compare_extra($ver2)); |
1590 | 1615 | } |
1591 | 1616 | |
1617 | +/** |
|
1618 | + * @param string $name |
|
1619 | + */ |
|
1592 | 1620 | function sn_setcookie($name, $value = null, $expire = null, $path = SN_ROOT_RELATIVE, $domain = null, $secure = null, $httponly = null) { |
1593 | 1621 | $_COOKIE[$name] = $value; |
1594 | 1622 | return setcookie($name, $value, $expire, $path, $domain, $secure, $httponly); |