@@ -31,7 +31,7 @@ |
||
| 31 | 31 | /** |
| 32 | 32 | * Fleet mission "Relocate" |
| 33 | 33 | * |
| 34 | - * @param $mission_data Mission |
|
| 34 | + * @param Mission $mission_data Mission |
|
| 35 | 35 | * |
| 36 | 36 | * @return int |
| 37 | 37 | * |
@@ -286,7 +286,6 @@ discard block |
||
| 286 | 286 | /** |
| 287 | 287 | * Функция пытается залогиниться по всем известным провайдерам |
| 288 | 288 | * |
| 289 | - * @param null $result |
|
| 290 | 289 | */ |
| 291 | 290 | public function login() { |
| 292 | 291 | if(empty(sn_module::$sn_module_list['auth'])) { |
@@ -823,10 +822,17 @@ discard block |
||
| 823 | 822 | |
| 824 | 823 | // OK v4.5 |
| 825 | 824 | // TODO - REMEMBER_ME |
| 825 | + |
|
| 826 | + /** |
|
| 827 | + * @param integer $period |
|
| 828 | + */ |
|
| 826 | 829 | protected static function cookie_set($value, $impersonate = false, $period = null) { |
| 827 | 830 | sn_setcookie($impersonate ? SN_COOKIE_U_I : SN_COOKIE_U, $value, $period === null ? SN_TIME_NOW + PERIOD_YEAR : $period, SN_ROOT_RELATIVE); |
| 828 | 831 | } |
| 829 | 832 | |
| 833 | + /** |
|
| 834 | + * @param string $message |
|
| 835 | + */ |
|
| 830 | 836 | protected static function flog($message, $die = false) { |
| 831 | 837 | if(!defined('DEBUG_AUTH') || !DEBUG_AUTH) { |
| 832 | 838 | return; |
@@ -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 | |
@@ -21,11 +21,19 @@ discard block |
||
| 21 | 21 | return empty($result) ? null : $result; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | + /** |
|
| 25 | + * @param integer $galaxy |
|
| 26 | + * @param integer $system |
|
| 27 | + * @param integer $planet |
|
| 28 | + */ |
|
| 24 | 29 | public static function db_planet_by_gspt_safe($galaxy, $system, $planet, $planet_type, $for_update = false, $fields = '*') { |
| 25 | 30 | return classSupernova::db_get_record_list(LOC_PLANET, |
| 26 | 31 | "{{planets}}.`galaxy` = {$galaxy} AND {{planets}}.`system` = {$system} AND {{planets}}.`planet` = {$planet} AND {{planets}}.`planet_type` = {$planet_type}", true); |
| 27 | 32 | } |
| 28 | 33 | |
| 34 | + /** |
|
| 35 | + * @param integer $planet_type |
|
| 36 | + */ |
|
| 29 | 37 | public static function db_planet_by_gspt($galaxy, $system, $planet, $planet_type, $for_update = false, $fields = '*') { |
| 30 | 38 | $galaxy = intval($galaxy); |
| 31 | 39 | $system = intval($system); |
@@ -120,6 +128,9 @@ discard block |
||
| 120 | 128 | "`id_owner` = '{$user_row['id']}' {$conditions} ORDER BY {$order_by}"); |
| 121 | 129 | } |
| 122 | 130 | |
| 131 | + /** |
|
| 132 | + * @param integer $planet_id |
|
| 133 | + */ |
|
| 123 | 134 | public static function db_planet_list_by_user_or_planet($user_id, $planet_id) { |
| 124 | 135 | if(!($user_id = idval($user_id)) && !($planet_id = idval($planet_id))) { |
| 125 | 136 | return false; |
@@ -138,6 +149,9 @@ discard block |
||
| 138 | 149 | return classSupernova::db_upd_record_by_id(LOC_PLANET, $planet_id, $set); |
| 139 | 150 | } |
| 140 | 151 | |
| 152 | + /** |
|
| 153 | + * @param integer $ui_planet_type |
|
| 154 | + */ |
|
| 141 | 155 | public static function db_planet_set_by_gspt($ui_galaxy, $ui_system, $ui_planet, $ui_planet_type = PT_ALL, $set) { |
| 142 | 156 | if(!($set = trim($set))) { |
| 143 | 157 | return false; |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | - * @param mixed $value |
|
| 29 | + * @param string $value |
|
| 30 | 30 | * |
| 31 | 31 | * @return $this |
| 32 | 32 | */ |
@@ -131,6 +131,9 @@ discard block |
||
| 131 | 131 | ); |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | + /** |
|
| 135 | + * @param integer $config_user_birthday_range |
|
| 136 | + */ |
|
| 134 | 137 | public static function db_user_list_to_celebrate($config_user_birthday_range) { |
| 135 | 138 | // $query = "SELECT |
| 136 | 139 | // `id`, `username`, `user_birthday`, `user_birthday_celebrated`, |
@@ -208,6 +211,9 @@ discard block |
||
| 208 | 211 | } |
| 209 | 212 | |
| 210 | 213 | |
| 214 | + /** |
|
| 215 | + * @param string $username_unsafe |
|
| 216 | + */ |
|
| 211 | 217 | public static function db_user_by_username($username_unsafe, $for_update = false, $fields = '*', $player = null, $like = false) { |
| 212 | 218 | return classSupernova::db_get_user_by_username($username_unsafe, $for_update, $fields, $player, $like); |
| 213 | 219 | } |
@@ -220,6 +226,9 @@ discard block |
||
| 220 | 226 | return classSupernova::db_upd_record_by_id(LOC_USER, $user_id, $set); |
| 221 | 227 | } |
| 222 | 228 | |
| 229 | + /** |
|
| 230 | + * @param boolean $player |
|
| 231 | + */ |
|
| 223 | 232 | public static function db_user_by_id($user_id_unsafe, $for_update = false, $fields = '*', $player = null) { |
| 224 | 233 | return classSupernova::db_get_user_by_id($user_id_unsafe, $for_update, $fields, $player); |
| 225 | 234 | } |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | * @param mixed $offset <p> |
| 119 | 119 | * The offset to assign the value to. |
| 120 | 120 | * </p> |
| 121 | - * @param mixed $value <p> |
|
| 121 | + * @param Unit $value <p> |
|
| 122 | 122 | * The value to set. |
| 123 | 123 | * </p> |
| 124 | 124 | * |
@@ -121,6 +121,9 @@ discard block |
||
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | + /** |
|
| 125 | + * @param string $filter |
|
| 126 | + */ |
|
| 124 | 127 | public static function queryCacheSetByFilter($location_type, $filter, $record_id) { |
| 125 | 128 | SnCache::$queries[$location_type][$filter][$record_id] = &SnCache::getDataRefByLocationAndId($location_type, $record_id); |
| 126 | 129 | } |
@@ -160,14 +163,23 @@ discard block |
||
| 160 | 163 | return true; // Не всегда - от результата |
| 161 | 164 | } |
| 162 | 165 | |
| 166 | + /** |
|
| 167 | + * @param integer $locationType |
|
| 168 | + */ |
|
| 163 | 169 | public static function getData($locationType = LOC_NONE) { |
| 164 | 170 | return $locationType == LOC_NONE ? static::$data : static::$data[$locationType]; |
| 165 | 171 | } |
| 166 | 172 | |
| 173 | + /** |
|
| 174 | + * @param integer $locationType |
|
| 175 | + */ |
|
| 167 | 176 | public static function cacheUnsetElement($locationType, $recordId) { |
| 168 | 177 | static::$data[$locationType][$recordId] = null; |
| 169 | 178 | } |
| 170 | 179 | |
| 180 | + /** |
|
| 181 | + * @param integer $locationType |
|
| 182 | + */ |
|
| 171 | 183 | public static function isArrayLocation($locationType) { |
| 172 | 184 | return is_array(static::$data[$locationType]); |
| 173 | 185 | } |
@@ -190,6 +202,9 @@ discard block |
||
| 190 | 202 | } |
| 191 | 203 | } |
| 192 | 204 | |
| 205 | + /** |
|
| 206 | + * @param integer $unit_snid |
|
| 207 | + */ |
|
| 193 | 208 | public static function getUnitLocator($location_type, $location_id, $unit_snid) { |
| 194 | 209 | return $unit_snid ? static::$locator[LOC_UNIT][$location_type][$location_id][$unit_snid] : static::$locator[LOC_UNIT][$location_type][$location_id]; |
| 195 | 210 | } |
@@ -222,14 +237,23 @@ discard block |
||
| 222 | 237 | return static::$locks; |
| 223 | 238 | } |
| 224 | 239 | |
| 240 | + /** |
|
| 241 | + * @param string $filter |
|
| 242 | + */ |
|
| 225 | 243 | public static function getQueriesByLocationAndFilter($locationType, $filter) { |
| 226 | 244 | return !empty(static::$queries[$locationType][$filter]) && is_array(static::$queries[$locationType][$filter]) ? static::$queries[$locationType][$filter] : array(); |
| 227 | 245 | } |
| 228 | 246 | |
| 247 | + /** |
|
| 248 | + * @param string $filter |
|
| 249 | + */ |
|
| 229 | 250 | public static function isQueryCacheByLocationAndFilterEmpty($locationType, $filter) { |
| 230 | 251 | return !isset(SnCache::$queries[$locationType][$filter]) || SnCache::$queries[$locationType][$filter] === null; |
| 231 | 252 | } |
| 232 | 253 | |
| 254 | + /** |
|
| 255 | + * @param string $filter |
|
| 256 | + */ |
|
| 233 | 257 | public static function queryCacheResetByLocationAndFilter($locationType, $filter) { |
| 234 | 258 | SnCache::$queries[$locationType][$filter] = array(); |
| 235 | 259 | } |
@@ -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: |