Completed
Branch work-fleets (4d76fa)
by SuperNova.WS
05:23
created
includes/vars.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -333,26 +333,26 @@  discard block
 block discarded – undo
333 333
     // Each mission will filter only necessary checks and do it in this order
334 334
     'mission_checks' => array(
335 335
       // Cheap checks - class Fleet already have all this info internally
336
-      'checkSenderNoVacation'        => FLIGHT_PLAYER_VACATION_OWN,                           //+
337
-      'checkTargetNoVacation'        => FLIGHT_PLAYER_VACATION,                                  //+
338
-      'checkFleetNotEmpty'           => FLIGHT_SHIPS_NO_SHIPS,                                //+
336
+      'checkSenderNoVacation'        => FLIGHT_PLAYER_VACATION_OWN, //+
337
+      'checkTargetNoVacation'        => FLIGHT_PLAYER_VACATION, //+
338
+      'checkFleetNotEmpty'           => FLIGHT_SHIPS_NO_SHIPS, //+
339 339
       // FLIGHT_MISSION_UNKNOWN
340 340
       // FLIGHT_RESOURCES_FORBIDDEN
341
-      'checkSpeedPercentOld'         => FLIGHT_FLEET_SPEED_WRONG,                             //+
342
-      'checkTargetNotSource'         => FLIGHT_VECTOR_SAME_SOURCE,                            //+
341
+      'checkSpeedPercentOld'         => FLIGHT_FLEET_SPEED_WRONG, //+
342
+      'checkTargetNotSource'         => FLIGHT_VECTOR_SAME_SOURCE, //+
343 343
       'checkTargetInUniverse'        => FLIGHT_VECTOR_BEYOND_UNIVERSE,
344
-      'checkUnitsPositive'           => FLIGHT_SHIPS_NEGATIVE,                                //+
344
+      'checkUnitsPositive'           => FLIGHT_SHIPS_NEGATIVE, //+
345 345
       'checkOnlyFleetUnits'          => FLIGHT_SHIPS_UNIT_WRONG,
346
-      'checkOnlyFlyingUnits'         => FLIGHT_SHIPS_UNMOVABLE,                               //+
347
-      'checkResourcesPositive'       => FLIGHT_RESOURCES_NEGATIVE,                            //+
348
-      'checkNotTooFar'               => FLIGHT_FLEET_TOO_FAR,                                //+
349
-      'checkEnoughCapacity'          => FLIGHT_FLEET_OVERLOAD,                                //+
346
+      'checkOnlyFlyingUnits'         => FLIGHT_SHIPS_UNMOVABLE, //+
347
+      'checkResourcesPositive'       => FLIGHT_RESOURCES_NEGATIVE, //+
348
+      'checkNotTooFar'               => FLIGHT_FLEET_TOO_FAR, //+
349
+      'checkEnoughCapacity'          => FLIGHT_FLEET_OVERLOAD, //+
350 350
       // Medium checks - currently requires access to DB but potentially doesn't
351
-      'checkSourceEnoughShips'       => FLIGHT_SHIPS_NOT_ENOUGH,                              //+
352
-      'checkSourceEnoughFuel'        => FLIGHT_RESOURCES_FUEL_NOT_ENOUGH,                     //+
353
-      'checkSourceEnoughResources'   => FLIGHT_RESOURCES_NOT_ENOUGH,                          //+
351
+      'checkSourceEnoughShips'       => FLIGHT_SHIPS_NOT_ENOUGH, //+
352
+      'checkSourceEnoughFuel'        => FLIGHT_RESOURCES_FUEL_NOT_ENOUGH, //+
353
+      'checkSourceEnoughResources'   => FLIGHT_RESOURCES_NOT_ENOUGH, //+
354 354
       // Heavy checks - will absolutely require DB access
355
-      'checkEnoughFleetSlots'        => FLIGHT_FLEET_NO_SLOTS,                                //+
355
+      'checkEnoughFleetSlots'        => FLIGHT_FLEET_NO_SLOTS, //+
356 356
 
357 357
       // Vector targeting space beyond MaxPlanet forces MT_EXPLORE mission
358 358
       'checkKnownSpace'              => array(
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
           'checkNotOnlySpies'   => FLIGHT_SHIPS_NOT_ONLY_SPIES,
363 363
           'checkNoMissiles'     => FLIGHT_SHIPS_NO_MISSILES,
364 364
           'forceMissionExplore' => array(
365
-            true  => FLIGHT_ALLOWED,                                                         //+
365
+            true  => FLIGHT_ALLOWED, //+
366 366
             false => FLIGHT_VECTOR_BEYOND_SYSTEM,
367 367
           ),
368 368
         ),
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
           'checkNoMissiles'      => FLIGHT_SHIPS_NO_MISSILES,
378 378
           'checkTargetIsPlanet'  => FLIGHT_MISSION_COLONIZE_NOT_PLANET,
379 379
           'forceMissionColonize' => array(
380
-            true  => FLIGHT_ALLOWED,                                                         //+
380
+            true  => FLIGHT_ALLOWED, //+
381 381
             false => FLIGHT_VECTOR_NO_TARGET,
382 382
           ),
383 383
         ),
@@ -388,11 +388,11 @@  discard block
 block discarded – undo
388 388
       'checkTargetIsDebris'          => array(
389 389
         true => array(
390 390
           // Recycle mission checks
391
-          'checkHaveRecyclers'  => FLIGHT_SHIPS_NO_RECYCLERS,             //+
391
+          'checkHaveRecyclers'  => FLIGHT_SHIPS_NO_RECYCLERS, //+
392 392
           'checkNoMissiles'     => FLIGHT_SHIPS_NO_MISSILES,
393
-          'checkDebrisExists'   => FLIGHT_MISSION_RECYCLE_NO_DEBRIS,    //+
393
+          'checkDebrisExists'   => FLIGHT_MISSION_RECYCLE_NO_DEBRIS, //+
394 394
           'forceMissionRecycle' => array(
395
-            true  => FLIGHT_ALLOWED,                                                                           //+
395
+            true  => FLIGHT_ALLOWED, //+
396 396
             false => FLIGHT_VECTOR_TARGET_DEBRIS,
397 397
           ),
398 398
         ),
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
 
489 489
 
490 490
       // Check for multiaccount
491
-      'checkMultiAccount'            => FLIGHT_PLAYER_SAME_IP,                                  //+
491
+      'checkMultiAccount'            => FLIGHT_PLAYER_SAME_IP, //+
492 492
       // TODO - check for moratorium
493 493
 
494 494
 
Please login to merge, or discard this patch.
includes/classes/Fleet.php 1 patch
Doc Comments   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -972,7 +972,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
includes/classes/FleetValidator.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -190,8 +190,8 @@
 block discarded – undo
190 190
 
191 191
 
192 192
     /**
193
-   * @return bool
194
-   */
193
+     * @return bool
194
+     */
195 195
   protected function checkEnoughCapacity($includeResources = true) {
196 196
     $checkVia = $this->fleet->travelData['consumption'];
197 197
     $checkVia = ceil(($includeResources ? array_sum($this->fleet->resource_list) : 0) + $checkVia);
Please login to merge, or discard this patch.