26 Commits

Author SHA1 Message Date
Ferywir 63c94fa961 feat(preferences): apply time preference (timezone + date format) [#198]
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>
2026-06-12 16:46:33 +03:00
novgorodschi catalin a4e2c506a8 Redesign Admin Panel
Full frontend & backend redesign and refactor
2026-05-25 10:23:39 +03:00
Catalin Novgorodschi 850a46ae2d Some fixes & improovements
1. Fix ban access, 2. Fix profile ('"") , 3. Add on vacation Admin/MH and exclude rat from reinforcement.
2026-05-15 12:13:01 +03:00
Catalin Novgorodschi 01474fb31f Update Readme
Update Readme
2026-05-15 08:17:14 +03:00
Catalin Novgorodschi 3804498ad9 Incremental Refactor Automation & Database (cache)
Incremental Refactor Automation (starvation split in more methods) & Database (cache & checkAllianceEmbassiesStatus refactor), Fix a bug in Alliance.php (now you cannot kick alliance leader)
2026-05-14 15:05:32 +03:00
Catalin Novgorodschi c8d9fae4b4 Incremental refactor Generator/Logging/Multisort
Incremental refactor Generator/Logging/Multisort
2026-05-12 13:22:51 +03:00
Catalin Novgorodschi 260896570e Revert "vulnerability fixed and cleanup and refactor"
This reverts commit 2a44e76414.
2026-02-11 15:22:16 +02:00
Catalin Novgorodschi 2a44e76414 vulnerability fixed and cleanup and refactor 2026-02-11 15:11:43 +02:00
Catalin Novgorodschi 59c1114b1c Change some text on license TravianZ 2025-02-11 11:22:22 +02:00
Catalin Novgorodschi 4980206af5 Update Generator.php 2024-10-31 11:36:15 +02:00
Catalin Novgorodschi 9e13071fe1 Update Generator.php 2024-10-08 15:22:32 +03:00
CarloFalco d5495257f4 Update Generator.php
Update Generator.php, fix 'Coordinates DoNotExist'
2024-06-18 20:53:33 +02:00
Bram 78b2bddde4 Fix CVE-2023-36993 2023-07-06 22:34:03 +02:00
Catalin Novgorodschi 131f0207aa Update Generator.php 2022-02-18 15:14:15 +02:00
Oliver Lehmann dc49a5054a correction of baseID calculation formula to avoid "Coordinates do not exist" error 2021-11-26 08:23:38 +01:00
iopietro edeee02333 Some clean-up 2018-05-22 22:43:01 +02:00
iopietro f0b9f32826 General fixes
+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
2018-05-22 00:33:09 +02:00
iopietro 950fc61f8a General fixes
+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
2018-05-10 20:50:29 +02:00
iopietro a40accc101 Distance calculation optimization and bug fixing
-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
2018-04-29 00:49:24 +02:00
Martin Ambrus 87329832c5 fix: somebody used a diff and left these in :-/ 2017-11-24 23:55:38 +01:00
Shadow 0bfc9d4812 Update Generator.php 2017-01-07 12:20:35 +02:00
uroskn 0ea068cfd3 On PHP5.4+ use REQUEST_TIME_FLOAT instead of microtime for starting measurment of page loading time 2016-07-03 12:08:10 +02:00
uroskn 234bd692e4 Page load time is independent on passing second.
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.
2016-07-03 00:01:15 +02:00
uroskn 1afde368d3 GameEngine and install folders have 777 already set by default 2016-07-02 21:39:28 +02:00
Tomas Kasparek ec18bd788c fix PHP Fatal error: Cannot redeclare class Generator on PHP 5.5
PHP 5.5 STL introdouced class Generator and PHP interpret thinks we want to redeclare it -> rename Generator class to something else
2015-07-08 13:35:20 +02:00
yi12345 98e94af807 finish hero_full.php 2013-06-16 10:38:34 +03:00