[BUG][2.8.1] Fleets stay in the air

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

  • in includes/error.log you can find the exact cause of the issue why your fleets are staying in the air (mostly due to a coding error/missing parameter)
    Without this info, no one will be able to help you out finding a solution
  • Even if there is no issues with php or errors, fleets lock times to time ( in my opinion it is caused by hosting problems ) .

    you need a cronjob, to check fleet_events table. In this table there is a column called `locked`

    you need to convert `locked` to NULL with a Cronjob,

    for example check each minutes with a cronjob ( fleet_events table ) and find locked fleets, conver them to NULL .
    ogniter.net

    for a slightly better version of steemnova

    github.com/koraykarakus/steemnova-1.8-x
  • in my situation it happens without throwing errors, maybe i have a problem with error class but after releasing lock it does not throw error back. Check admin panel, and try unlocking locked fleet events, if it does not throw error you can set a cronjob which is unlocking fleet events, but if they are throwing errors dont use cronjob and solve the real problem.
    ogniter.net

    for a slightly better version of steemnova

    github.com/koraykarakus/steemnova-1.8-x
  • When you attack a planet or more than one planet, it drops to - after 1 2 attacks, sometimes it drops on the first attack. I looked at the error log but I didn't see any errors.

    If it is from the server, I have a VDS package, I can adjust whatever needs to be adjusted in a linear orientation. but if you tell me what needs to be set, at least I can set it
  • bro, I can't get log error, it's very strange :) so I can't share the error code (-) it drops just weird I wonder if it's design or because we added something new like a bonus
  • you should use my solution, it wont throw error, i dont know why it happens

    create a new cronjob and check %%FLEET_EVENTS%% each minute

    select from this table where lock IS NOT NULL

    example : $sql = "SELECT * FROM %%FLEETS_EVENT%% WHERE `lock` is NOT NULL;";


    foreach loop and build an insert sql, INSERT INTO %%FLEET_EVENTS%% ... ON DUPLICATE KEY UPDATE ...
    and update this table with lock = NULL on the contion where lock is not NULL


    full cronjob code :

    <?php



    require_once 'includes/classes/cronjob/CronjobTask.interface.php';

    class FleetLockCronjob implements CronjobTask
    {
    function run()
    {

    $db = Database::get();
    $sql = "SELECT * FROM %%FLEETS_EVENT%% WHERE `lock` is NOT NULL;";
    $fleet = $db->select($sql);
    $n="NULL";

    $sql_fleet = "INSERT INTO %%FLEETS_EVENT%% (fleetID,`lock`,time) VALUES ";


    foreach ($fleet as $fleetkey => $fleetval) {
    $sql_fleet .= "(" . $fleetval['fleetID'] . ', ' . $n . ', ' . $fleetval['time'] . "), ";
    }

    if (!empty($fleet)) {
    $sql_fleet = substr($sql_fleet,0,-2);
    $sql_fleet .= " ON DUPLICATE KEY UPDATE
    `lock` = VALUES (`lock`),
    time = VALUES (time);";
    $db->insert($sql_fleet);
    }

    }
    }


    Test it, it might cause another issues, better way is to solve the problem why some fleet is locked, it is a work around.
    ogniter.net

    for a slightly better version of steemnova

    github.com/koraykarakus/steemnova-1.8-x
  • Zeus wrote:

    bro, I can't get log error, it's very strange :) so I can't share the error code (-) it drops just weird I wonder if it's design or because we added something new like a bonus
    bro no creo que un bono cause el bloqueo de flota, eso pasa mallormente cuando hay algo mal escrito en el código de la misión, envíame el archivo de la misión que se te bloquea para revisarlo y ver si puedo ayudarte en una posible solución
  • Zeus wrote:

    The code you gave and the newstar code have the same variable
    i dont see the same code, they have the following: github.com/Yaro2709/New-Star/b…r/includes/common.php#L36

    amamoslavida wrote:

    you should use my solution, it wont throw error, i dont know why it happens

    create a new cronjob and check %%FLEET_EVENTS%% each minute

    select from this table where lock IS NOT NULL

    example : $sql = "SELECT * FROM %%FLEETS_EVENT%% WHERE `lock` is NOT NULL;";


    foreach loop and build an insert sql, INSERT INTO %%FLEET_EVENTS%% ... ON DUPLICATE KEY UPDATE ...
    and update this table with lock = NULL on the contion where lock is not NULL


    full cronjob code :

    <?php



    require_once 'includes/classes/cronjob/CronjobTask.interface.php';

    class FleetLockCronjob implements CronjobTask
    {
    function run()
    {

    $db = Database::get();
    $sql = "SELECT * FROM %%FLEETS_EVENT%% WHERE `lock` is NOT NULL;";
    $fleet = $db->select($sql);
    $n="NULL";

    $sql_fleet = "INSERT INTO %%FLEETS_EVENT%% (fleetID,`lock`,time) VALUES ";


    foreach ($fleet as $fleetkey => $fleetval) {
    $sql_fleet .= "(" . $fleetval['fleetID'] . ', ' . $n . ', ' . $fleetval['time'] . "), ";
    }

    if (!empty($fleet)) {
    $sql_fleet = substr($sql_fleet,0,-2);
    $sql_fleet .= " ON DUPLICATE KEY UPDATE
    `lock` = VALUES (`lock`),
    time = VALUES (time);";
    $db->insert($sql_fleet);
    }

    }
    }


    Test it, it might cause another issues, better way is to solve the problem why some fleet is locked, it is a work around.

    This is definitly a bad solution and would be downvoted like hell on websites like Stackoverflow.

    You can set your mission code inside a try & catch block and log every exception in an log file to start. EG: github.com/Yaro2709/New-Star/b…lyingFleetHandler.php#L78

    PHP Source Code

    1. try {
    2. switch($fleetRow['fleet_mess'])
    3. {
    4. case 0:
    5. $missionObj->TargetEvent();
    6. break;
    7. case 1:
    8. $missionObj->ReturnEvent();
    9. break;
    10. case 2:
    11. $missionObj->EndStayEvent();
    12. break;
    13. }
    14. } catch(Exception $e) {
    15. error_log(var_dump($e->getMessage()))
    16. }
    Display All


    Do you already have an error.log file present in the includes folder and is it writable ? 2moons wont write to the file if its not existent or writtable.

    and as last solution. Add more logging: github.com/Yaro2709/New-Star/b…GeneralFunctions.php#L567

    PHP Source Code

    1. $errorType = array(
    2. E_ERROR => 'ERROR',
    3. E_WARNING => 'WARNING',
    4. E_PARSE => 'PARSING ERROR',
    5. E_NOTICE => 'NOTICE',
    6. E_CORE_ERROR => 'CORE ERROR',
    7. E_CORE_WARNING => 'CORE WARNING',
    8. E_COMPILE_ERROR => 'COMPILE ERROR',
    9. E_COMPILE_WARNING => 'COMPILE WARNING',
    10. E_USER_ERROR => 'USER ERROR',
    11. E_USER_WARNING => 'USER WARNING',
    12. E_USER_NOTICE => 'USER NOTICE',
    13. E_STRICT => 'STRICT NOTICE',
    14. E_RECOVERABLE_ERROR => 'RECOVERABLE ERROR',
    15. E_DEPRECATED => 'E_DEPRECATED ERROR',
    16. E_USER_DEPRECATED => 'E_USER_DEPRECATED ERROR',
    17. E_ALL => 'RECOVERABLE E_ALL');
    Display All
  • amamoslavida wrote:

    Even if there is no issues with php or errors, fleets lock times to time ( in my opinion it is caused by hosting problems ) .

    you need a cronjob, to check fleet_events table. In this table there is a column called `locked`

    you need to convert `locked` to NULL with a Cronjob,

    for example check each minutes with a cronjob ( fleet_events table ) and find locked fleets, conver them to NULL .
    Fleets never lock from time to time, its your faulty code then.
    You also do not need to check any cronjobs for flights.

    If no error is thrown, it definitely does happen in any of classes folder files - most probably in BuildFunctions or PlanetRessUpdate OR if you are using opbe - check its own error folder inside of the opbe folder.
  • does this thing happen in steemnova version 1.8 ? Of course they are not loosing by their will, but the problem is no error logs, and it happens before fleet reaches the target coordinate. Probably caused of other classes than missions or OPBE.
    ogniter.net

    for a slightly better version of steemnova

    github.com/koraykarakus/steemnova-1.8-x
  • Abyss wrote:

    Este problema es 2moons 1.8 abuelo, la situacion es que vamos a destrozar el mes, le ponemos la flota de ataque detras y la luna desaparece, la flota de ataque que la sigue se cuelga
    Para corregir este error puedes hacer los siguientes cambios:


    después de:

    PHP Source Code: MissionCaseAttack.class.php

    1. $targetPlanet = $db->selectSingle($sql, array(
    2. ':planetId' => $this->_fleet['fleet_end_id']
    3. ));

    Añades:


    PHP Source Code: MissionCaseAttack.class.php

    1. if($targetPlanet == false)
    2. {
    3. $this->setState(FLEET_RETURN);
    4. $this->SaveFleet();
    5. return;
    6. }

    Con esto la flota que va a realizar el ataque después que se halla destruido la luna al ver que dicha luna ya no existe retornará a su planeta de inicio sin bloquearse