@@ -151,6 +151,9 @@ |
||
151 | 151 | } |
152 | 152 | |
153 | 153 | |
154 | + /** |
|
155 | + * @param integer $user_id |
|
156 | + */ |
|
154 | 157 | public function __construct($user_id) { |
155 | 158 | $this->user_change($user_id); |
156 | 159 | } |
@@ -11,6 +11,9 @@ discard block |
||
11 | 11 | |
12 | 12 | require_once('db/db_queries.php'); |
13 | 13 | |
14 | +/** |
|
15 | + * @param string $tablename |
|
16 | + */ |
|
14 | 17 | function db_change_units_perform($query, $tablename, $object_id) { |
15 | 18 | $query = implode(',', $query); |
16 | 19 | if($query && $object_id) { |
@@ -63,6 +66,9 @@ discard block |
||
63 | 66 | db_change_units_perform($query[LOC_USER], 'users', $user['id']); |
64 | 67 | db_change_units_perform($query[LOC_PLANET], 'planets', $planet['id']); |
65 | 68 | } |
69 | +/** |
|
70 | + * @param string $table |
|
71 | + */ |
|
66 | 72 | function sn_db_perform($table, $values, $type = 'insert', $options = false) { |
67 | 73 | $mass_perform = false; |
68 | 74 | |
@@ -171,11 +177,8 @@ discard block |
||
171 | 177 | /** |
172 | 178 | * Функция проверяет статус транзакции |
173 | 179 | * |
174 | - * @param null|true|false $status Должна ли быть запущена транзакция в момент проверки |
|
175 | - * <p>null - транзакция НЕ должна быть запущена</p> |
|
176 | - * <p>true - транзакция должна быть запущена - для совместимости с $for_update</p> |
|
177 | - * <p>false - всё равно - для совместимости с $for_update</p> |
|
178 | - * @return bool Текущий статус транзакции |
|
180 | + * @param boolean $transaction_should_be_started |
|
181 | + * @return null|boolean Текущий статус транзакции |
|
179 | 182 | */ |
180 | 183 | function sn_db_transaction_check($transaction_should_be_started = null) { |
181 | 184 | return classSupernova::db_transaction_check($transaction_should_be_started); |
@@ -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 |