0 ? (time() - $cronLastRun) : -1; $cronActive = ($cronAge >= 0 && $cronAge < 90); $cronLoop = defined('CRON_LOOP_SECONDS') ? (int) CRON_LOOP_SECONDS : 300; $cronTick = defined('CRON_TICK_SECONDS') ? (int) CRON_TICK_SECONDS : 60; $cronKey = defined('CRON_KEY') ? (string) CRON_KEY : ''; $cleanReports = defined('CLEANUP_REPORTS_DAYS') ? (int) CLEANUP_REPORTS_DAYS : 14; $cleanChat = defined('CLEANUP_CHAT_DAYS') ? (int) CLEANUP_CHAT_DAYS : 7; $cleanMessages = defined('CLEANUP_MESSAGES_DAYS') ? (int) CLEANUP_MESSAGES_DAYS : 0; $cleanupMarker = __DIR__ . '/../../GameEngine/Prevention/cleanup_last.txt'; $cleanupInfo = @is_file($cleanupMarker) ? @json_decode((string) @file_get_contents($cleanupMarker), true) : null; $cronPath = realpath(__DIR__ . '/../../cron.php'); $cronCmd = $cronPath ? '*/5 * * * * /usr/local/bin/php ' . $cronPath . ' >> ' . dirname(dirname($cronPath)) . '/cron.log 2>&1' : ''; ?>
Cron & Automation
Current status
Automation source Cron job" : "Page loads (fallback)"; ?> When the cron job is not running, the game still works: players' page loads process the tick, exactly as before the cron was introduced.
Last cron tick 0) { echo date('d.m.Y H:i:s', $cronLastRun) . ' (' . $cronAge . 's ago)'; } else { echo "Never"; } ?>
Cron job command Add this in cPanel → Cron Jobs. Writing to cron.log instead of /dev/null lets you see errors if it fails to start.
Settings
Invocation length (seconds) ?How long one cron.php invocation keeps working. Most shared hosts only allow a cron every 5 minutes, while Automation expects to run about every minute — so one invocation runs several ticks in a row. Use 300 for a "*/5" cron. Set 0 only if your host allows a cron every minute. 0 = a single tick per invocation. Maximum 3300 (55 minutes).
Tick interval (seconds) ?How often Automation runs inside one invocation. Automation's own guard expects roughly 60 seconds; going lower mostly adds load without processing anything new. Recommended: 60. Allowed range 15–900.
HTTP trigger key ?Only needed when calling cron.php over HTTP (for example from an external cron service). The server's own cron job does not use it. Regenerating invalidates any URL you configured elsewhere. Not set – one will be generated on save. •••••••• show
Database cleanup
Last cleanup run (removed: ' . (int) ($r['reports'] ?? 0) . ' reports, ' . (int) ($r['chat'] ?? 0) . ' chat, ' . (int) ($r['messages'] ?? 0) . ' messages)'; } else { echo "Not run yet"; } ?> Runs from Automation once per hour. Rows are removed in batches, so the first run on an old server catches up over several passes.
Battle reports (days) ?Unarchived reports older than this are deleted. Reports a player archived are never touched. 0 disables the rule. 0 = keep forever.
Chat messages (days) ?The chat window only ever shows the last 13 messages per alliance, so older history is not used anywhere in the game. 0 = keep forever.
Deleted messages (days) ?Only messages deleted by BOTH the sender and the recipient are removed — they are no longer visible to anyone in the game. Disabled by default. 0 = disabled (default).