Hello. After 1 2 attacks, the fleets stay in the air, so the time drops to - what is the solution?
[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 . -
I dont agree, the only reason the fleet become locked is due to an error, just increase your verbosity.
-
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.
-
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 -
Can you change this line
github.com/jkroepke/2Moons/blo…r/includes/common.php#L33
to
error_reporting(E_ALL); -
The code you gave and the newstar code have the same variable
-
Zeus wrote:
The code you gave and the newstar code have the same variable
In The end -
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. -
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
In The end -
Zeus wrote:
The code you gave and the newstar code have the same variable
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
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
- $errorType = array(
- E_ERROR => 'ERROR',
- E_WARNING => 'WARNING',
- E_PARSE => 'PARSING ERROR',
- E_NOTICE => 'NOTICE',
- E_CORE_ERROR => 'CORE ERROR',
- E_CORE_WARNING => 'CORE WARNING',
- E_COMPILE_ERROR => 'COMPILE ERROR',
- E_COMPILE_WARNING => 'COMPILE WARNING',
- E_USER_ERROR => 'USER ERROR',
- E_USER_WARNING => 'USER WARNING',
- E_USER_NOTICE => 'USER NOTICE',
- E_STRICT => 'STRICT NOTICE',
- E_RECOVERABLE_ERROR => 'RECOVERABLE ERROR',
- E_DEPRECATED => 'E_DEPRECATED ERROR',
- E_USER_DEPRECATED => 'E_USER_DEPRECATED ERROR',
- E_ALL => 'RECOVERABLE E_ALL');
-
good idea i might try but it requires time to solve all the issues, if it is working, it is OK for me .
-
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 .
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.
-
Oh OK, i am under newstar subforum. I write this for steemnova 1.8 github version.
-
This problem is 2moons 1.8 grandfather, the situation is that we are going to destroy the month, we put the attack fleet behind it and the moon disappears, the attack fleet that follows it hangs
-
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
después de:
Añades:
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 bloquearseIn The end -
-
Share
- Facebook 0
- Twitter 0
- Google Plus 0
- Reddit 0