Limit expedition by day

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • This will be my last response on this community before i leave till maybe the summer or later.

      Find this code at the bottom of this file

      PHP Source Code: ShowFleetStep1Page.class.php

      1. if ($USER[$resource[124]] == 0)
      2. {
      3. $this->sendJSON($LNG['fl_target_not_exists']);
      4. }
      add to this the following

      PHP Source Code: ShowFleetStep1Page.class.php

      1. elseif(FleetFunctions::CheckExpeDay($USER['id']))
      2. {
      3. $this->sendJSON('You exceed the limit of expeditions per day allowed');
      4. }
      Add in the following file this code

      PHP Source Code: constants.php

      1. define('MAX_EXPEDITIONS_PER_DAY' , 100);
      Add in the following file this cod

      PHP Source Code: class.FleetFunctions.php

      1. public static function CheckExpeDay($ID)
      2. {
      3. $sql = 'SELECT COUNT(*) as state
      4. FROM %%LOG_FLEETS%%
      5. WHERE fleet_owner = :fleetOwner
      6. AND fleet_start_time > :fleetStartTime
      7. AND expeEvent != 0
      8. AND fleet_mission = 18;';
      9. $Count = Database::get()->selectSingle($sql, array(
      10. ':fleetOwner' => $ID,
      11. ':fleetStartTime' => (TIMESTAMP - 24*3600),
      12. ));
      13. return $Count['state'] >= MAX_EXPEDITIONS_PER_DAY;
      14. }
      Display All

      @USERS, this code is specific to odiabile game, if you add to yours, you have to delete modify some queries.

      Good luck, maybe in the summer,
    • ¿Existe la posibilidad de reducir la cantidad de recursos a encontrar en expedición? Resulta que los jugadores cuando envían mega-recicladores y tienen éxito en la expedición pueden traer millones de recursos dependiendo del almacenamiento de las naves. Alguien me puede ayudar a reducir esto?
    • To do what you ask the best is to change the formula

      PHP Source Code: MissionCaseExpedition.class.php

      1. if ($config->expedition_limit_res_active == 1) {
      2. $founded = round(min($config->expedition_limit_res, $fleetCapacity));
      3. } else {
      4. $founded = round(min($fleetCapacity,min($maxFactor, max(200, $factor)) * $fleetPoints));
      5. }
    • Danter14 wrote:

      Para hacer lo que pides lo mejor es cambiar la formula

      PHP Source Code: MissionCaseExpedition.class.php

      1. if ($config->expedition_limit_res_active == 1) {
      2. $fundado = round(min($config->expedition_limit_res, $fleetCapacity));
      3. } demás {
      4. $fundado = ronda(min($fleetCapacity,min($maxFactor, max(200, $factor)) * $fleetPoints));
      5. }
      Esto en que parte del código iría?