Implement the "Time Preference" section of the player preferences (issue
#198), which until now was stored in DB but never applied in-game.
procMtime() — the central date/time formatter used across reports, messages,
notices and troop movements — now honours the per-user settings:
- timezone: the stored value is mapped to a DateTimeZone, either a named
DST-aware region (Europe, UK, Turkey, Kolkata, Bangkok, New York,
Chicago, New Zealand) or a fixed UTC offset (general zones); timestamps
are converted before formatting.
- tformat: drives the date layout and 12h/24h clock (0=EU dd.mm.yy 24h,
1=US mm/dd/yy 12h, 2=UK dd/mm/yy 12h, 3=ISO yy/mm/dd 24h). tformat 0
keeps the previous EU output unchanged.
The today/yesterday sentinels are preserved (callers compare them) and are
computed in the player's timezone. The time-only path (mode 9) stays 24h
H:i:s because it feeds the live JS clock counters (unx.js), which parse
"H:i:s" by splitting on ":". A few alliance/report/farm-list rows that
combined procMtime's day part with a raw date('H:i') now take the time from
the same procMtime result, to avoid mixing timezones.
A second "local time" clock is shown next to the server-time one: a small
vanilla-JS snippet emitted once from menu.tpl finds the visible #tp1 clock
and appends a row ticking in the player's timezone (Date.now() + UTC offset),
independent of the browser timezone and of the unx.js counters. It aligns the
value under the server time, is skipped when the player's timezone matches
the server's, and lets the clock box grow so the extra row fits the frame.
Adds the LOCAL_TIME string (EN/FR/RO). When no player session is available
(admin / pre-login) procMtime falls back to the server timezone and EU
layout, i.e. the previous behaviour. Removes the last "not coded yet" tag
from the preferences form.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Incremental Refactor Automation (starvation split in more methods) & Database (cache & checkAllianceEmbassiesStatus refactor), Fix a bug in Alliance.php (now you cannot kick alliance leader)
+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
+A method in Building.php is now static
+Fixed timers in the market
+Fixed a bug that did take in account a wrong tournament square when
calculating the returning time of the troops
-Removed a lot of redundant code and put into a function
+Fixed a bug that permitted to found a new village in already founded
village
+Fixed a bug that permitted to found in an oasis
+Fixed a bug that permitted to hack the time you need to found a new
village
+Fixed a bug that permitted to found a new village to an inexistent one
Previously page loading time was calculated by taking miliseconds
of current wall clock time. In cases where wall clock went into another
second page loading time was calcualted as negative giving incorrect result.
This patch fixes this by using microtime of wall-clock time in float.