Add an admin-controlled debug mode that captures PHP errors of all
players into var/log/debug-players.log, to hunt remaining PHP 8.3 bugs
from real play sessions. Fully transparent to players: no redirect, no
gameplay change, errors are never displayed.
- DB: new debug_log table (one row), mirroring the maintenance pattern.
- Database: getDebugMode()/setDebugMode()/setDebugSettings(), defensive
when the table is absent (no blank page).
- Session: register a custom error + shutdown handler when enabled; the
handler runs even when php.ini error_reporting masks warnings/notices,
so capture is complete without a Docker rebuild. Auto-disables after a
configurable window.
- DebugErrorLogger: size-capped file with a single .log.1 rotation,
honours the @ operator, never throws.
- Admin: new "Debug Error Log" page (levels, size cap, auto-off, on-page
viewer, clear, download) + debugLog action mod.
- Menu: admin-only quick on/off widget (TZ_DEBUG_ON/OFF, EN/FR/RO).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The profile already had a language selector (Templates/Profile/preference.tpl)
that saved the choice into users.lang and $_SESSION['lang'], but the saved
preference was never used to actually load the language: every page loads
include("Lang/".LANG.".php") with the server-wide LANG constant, so changing
the language in the profile had no visible effect.
This wires it up:
- Introduce SERVER_LANG (the server default) and make LANG the EFFECTIVE
display language, resolved from the player's saved preference
($_SESSION['lang']) with a fallback to SERVER_LANG
(install/data/constant_format.tpl).
SECURITY: the value is sanitized to [a-z_] and the target Lang/<x>.php
file must exist, otherwise we fall back to the server default. This
prevents Local File Inclusion via include("Lang/".LANG.".php").
- Seed $_SESSION['lang'] from users.lang on login (GameEngine/Session.php,
PopulateVar), so the chosen language applies right after logging in.
- Keep the SERVER default intact when an admin saves settings: the admin
config regenerators and the "Server Settings"/config displays now use
SERVER_LANG (the server default) instead of the per-user LANG, so an
admin browsing in their own language can't accidentally overwrite the
server default (6 Admin/Mods/edit*.php + editServerSet.tpl + config.tpl).
Note: existing installs must also add SERVER_LANG + the LANG resolution to
their generated GameEngine/config.php (and the Admin/Mods/constant_format.tpl
copy) since config is generated at install time.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
+Moved "isWinner()" method from Automation.php to Session.php, it's now
triggered when activating plus function or entering in
plus1.php/build.php
+General clean-up and better indentation
+The tournament square bonus is now displayed correctly
+Confederation and shared forums are now visible to the confederation
alliances or selected alliances/users
+Sticked topics are now displayed first
+Fixed a bug that permitted to add confederated alliances/users to
shared forums
+Minor bug fixing
+Returning troops time will now flow correctly in the rally point
+Resources won't be set to 0 anymore if overflow (this could have
happened in high speed servers)
+Fixed a distorted view of the right part of the page, while reading a
mass message
+Fixed a bug that permitted to send resourcers to himself
+Fixed a bug that permitted to send resources to invalid villages
+Fixed a bug that permitted to create offerings with 0 resources or
invalid resources type
+Fixed a bug that permitted to accept offerings of other allies
+Fixed a bug that permitted to accept offerings with a too high maxtime
+Fixed a bug that permitted to accept offering from the same village
+Fixed a bug that permitted to accept offering with too few merchants
+Fixed a bug that permitted to accept offerings without the requested
resources
+Fixed a bug that hid offerings with a valid maxtime
+Fixed some bugs relative to errors diplaying
+Added some error
+Some clean-up
When switching databse data (for example restoring a backup etc.) and
a user is already logged-in (has a valid cookie, and thus PHP session)
but that user doesn't exist in the database anymore, we need to log them
out, since no data are available for them.
A lot has happened here. Here's the list:
1. autoloader was added that should prevent various "failed to open
stream" errors when trying to load new classes
2. PHP-based data generation was replaced by MySQL-based one, hopefully
fixing the installation problems when insert payload it too high and the
DB wouldn't populate with some users
3. thanks to step 2, the installation should be really almost
instantenious, instead of waiting a long time for many SQL connections
and queries to populate the world
4. World Data & Oasis generation and population is done in 1 step now