Commit Graph

1484 Commits

Author SHA1 Message Date
Ferywir a787929604 Refactor(sendunitsComplete): wire up buildScoutReport(), drop duplicate [#155] (#183)
The #182 merge resolution left buildScoutReport() defined but never called,
while the original inline scout-report block was kept at the call site — so
the method was dead code and the scout-report logic was duplicated.

This wires it up: the inline block in the `if (!empty($scout))` branch is
replaced by a single `$info_spy = $this->buildScoutReport(...)` call. The
method already exists and its body is identical to the removed inline block,
so behaviour is unchanged — this just removes the duplication and makes the
extraction actually take effect. Brace balance even (634/634).

Co-authored-by: TravianZ Patcher <patcher@localhost>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 06:45:51 +03:00
Ferywir 0b563849bf Fix fatal parse error in Automation.php (broken #180/#181 merge) [#155] (#182)
The merge of #180 (applyBounty) and #181 (buildScoutReport) — both of which
inserted a new private method just before sendunitsComplete() — dropped the
closing brace of buildScoutReport(). As a result applyBounty() was declared
INSIDE buildScoutReport(), producing:

  PHP Parse error: syntax error, unexpected token "private"
  in GameEngine/Automation.php

This crashes Automation.php entirely (HTTP 500), so the whole game automation
stops: troop movements never resolve, buildings never finish, etc.

Fix: restore the missing `}` closing buildScoutReport() before the applyBounty()
docblock. Brace balance is now even again (634/634). One-character structural
fix, no logic change.

Co-authored-by: TravianZ Patcher <patcher@localhost>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Catalin Novgorodschi <cata7007@gmail.com>
2026-06-07 19:23:56 +03:00
Catalin Novgorodschi fd19a6a875 Update Automation.php
Revert last commit
2026-06-07 18:13:46 +03:00
Ferywir 4beb386dfc Refactor(sendunitsComplete): extract buildScoutReport() [#155] (#181)
Phase B — pure behaviour-preserving extraction (issue #155).

buildScoutReport(): extracts the scout-report (info_spy) HTML assembly
(~25 lines) into a helper returning the info_spy string. Handles both
spy modes: resources (spy=1) and defence/buildings (spy=2). The block's
body is moved verbatim (multi-line strings with their exact embedded
whitespace preserved). The reassigned $walllevel/$residencelevel/
$palacelevel were local to this block and never read downstream. No
logic change.

Co-authored-by: TravianZ Patcher <patcher@localhost>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-authored-by: Catalin Novgorodschi <cata7007@gmail.com>
2026-06-07 16:48:55 +03:00
Ferywir 004f101c23 Refactor(sendunitsComplete): extract applyBounty() [#155] (#180) 2026-06-07 16:34:49 +03:00
novgorodschi catalin e6b010e73a Fix #179
Fix #179
2026-06-05 14:00:58 +03:00
novgorodschi catalin 524a352946 Fix forgot for editBuildings name
Fix forgot for editBuildings name
2026-06-05 13:10:59 +03:00
Ferywir d55f6cad9e Refactor(sendunitsComplete): extract handleEvasion() and handleConquest() [#155] (#177) 2026-06-05 07:00:32 +03:00
Ferywir f89877210f Refactor/sendunitscomplete extract (#176) 2026-06-04 20:51:29 +03:00
novgorodschi catalin 2b6277af06 Another correction for language
Another correction for language
2026-06-04 14:14:17 +03:00
novgorodschi catalin 33b7261b4b Change some file
Change some file
2026-06-04 13:39:59 +03:00
novgorodschi catalin efbb2bc89a Fix lang server set
Fix lang server set
2026-06-04 13:19:10 +03:00
Catalin Novgorodschi 28ddc72c01 Merge pull request #175 from Ferywir/feat/per-user-language
Add per-user language selection (closes #166)
2026-06-04 13:15:24 +03:00
novgorodschi catalin 1a4014218c Fix something broken
Fix something broken
2026-06-04 12:35:53 +03:00
Catalin Novgorodschi 9f5ff60840 Merge pull request #172 from Ferywir/fix/admin-system-message-404
Add missing handler for admin "Create System Message"
2026-06-04 10:10:36 +03:00
TravianZ Patcher 421915f774 Add per-user language selection (issue #166)
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>
2026-06-04 09:07:57 +02:00
novgorodschi catalin 11ce6e6052 Added Romanian Language
Added Romanian Language
2026-06-04 09:39:44 +03:00
TravianZ Patcher 903c4a3285 Add missing handler for admin "Create System Message"
The admin panel had a "Create System Message" page (admin.php?p=sysmessage
-> Admin/Templates/sysmessage.tpl) whose form posts to
GameEngine/Admin/Mods/sysmessage.php, but that backend file never existed,
so submitting returned a 404 (Not Found).

Add the handler implementing the prepare -> confirm -> execute flow used by
the template. On execute it displays a global system message to all players
using the existing mechanism (writes Templates/text.tpl from
text_format.tpl and sets users.ok = 1), same as the legacy sysmsg.php.
%TEKST% is escaped for the PHP double-quoted string context to avoid
breakage/injection.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 07:34:57 +02:00
Catalin Novgorodschi 950902f8e1 Merge pull request #171 from Ferywir/l10n/french-and-swiss-timezone
L10n/french and swiss timezone
2026-06-04 07:37:14 +03:00
TravianZ Patcher df003184c8 Add French (fr) translation by Ferywir
Replace GameEngine/Lang/fr.php with a complete, reviewed French
translation:
- Full coverage: all 1439 language keys present (matches en.php), none
  missing or extra.
- Valid PHP: all French apostrophes properly escaped, no unterminated
  strings.
- Months localized, quest tutorial numbering kept consistent with en.php.
- Fixed gender agreement on EMAIL_TAKEN ("Cet e-mail ... utilisé").

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 11:28:09 +02:00
TravianZ Patcher 7a013c38e3 Fix install + admin bugs reported in issue #169
Addresses the five bugs found on master (6e139a1b) during a fresh
Docker install and admin testing:

1. Missing `details` column in gold_fin_log (HTTP 500 on finishing
   construction with gold, buying Gold Club, admin giving gold):
   - Add `details varchar(255)` to the gold_fin_log schema, matching
     every INSERT and the a2b2.php reader that already use it.
   - Fix the broken positional INSERT in Logging::goldFinLog() (it sent
     3 values for a 7-column table) which 500'd on the same gold path.

2. Admin "View Player Info" fatal error: `<? php` -> `<?php` in
   Admin/Templates/playerinfo.tpl.

3. "Reset Server" leaving the DB corrupted (Duplicate key name
   'idx_ft_bonus_xy'): move the croppers indexes inline into the
   CREATE TABLE IF NOT EXISTS so structure recreation is idempotent,
   and add `croppers` to the reset truncate list.

4. Install wizard crash on failed DB connection (mysqli_error(false)):
   use mysqli_connect_error() and show a friendly, actionable message
   (incl. the Docker "db" hostname hint).

5. PHP exposing errors/stack traces to end users: ship a production
   php.ini baseline + docker/php/zz-travianz.ini that turns off
   display_errors and logs to stderr instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-03 08:32:00 +02:00
novgorodschi catalin b495dcb559 Some fix
Some fix
2026-06-02 12:58:20 +03:00
novgorodschi catalin 547e164143 Edit some access for MH user and recreate mass messaage
Edit some access for MH user and recreate mass message and new maintenance system view for admins
2026-06-02 10:59:35 +03:00
novgorodschi catalin 2eaa92fc03 Fix gold log script
Fix gold log script
2026-06-02 08:10:46 +03:00
novgorodschi catalin dbe20c49b5 Some last fix for logs! 2026-05-28 13:22:27 +03:00
novgorodschi catalin 1d1f1dc72a Fix + Redesign
Fix some error programing code and redesign special medals, tribe medals, mh medals, taskmaster medals, natars medals, nature medals, protection medals, etc. Add some language code in Profile.php and preference.tpl. Change some description in struct database for Nature and Taskmaster
2026-05-28 12:25:28 +03:00
novgorodschi catalin 31c475e644 Fix + Credits + Start Language Coding
Fix Artefacts + Credits + Start Language Coding
2026-05-27 12:26:24 +03:00
novgorodschi catalin 1b119d2a35 Fix special medals
Fix special medals
2026-05-26 14:42:19 +03:00
novgorodschi catalin 24fb80371d Fix special medal system
Fix special medal system
2026-05-26 12:34:50 +03:00
novgorodschi catalin 8c3ab3e5eb Fix some bugs + added (coded delAli)
Fix some bugs + added (coded delAli)
2026-05-25 12:37:33 +03:00
novgorodschi catalin a4e2c506a8 Redesign Admin Panel
Full frontend & backend redesign and refactor
2026-05-25 10:23:39 +03:00
novgorodschi catalin 3fa16f13b2 Full Refactor Admin Panel & Logs
Full Refactor Admin Panel & Logs (now you can see detailed logs in admin panel) - ONLY BACKED
2026-05-22 11:29:37 +03:00
novgorodschi catalin 05bfde9063 Remove some unused code and some fix
Remove some unused code and some fix
2026-05-21 13:12:21 +03:00
novgorodschi catalin 878ecec687 Added Account transactions with History
Added Account transactions with History
2026-05-21 11:23:45 +03:00
novgorodschi catalin 3f32e21333 Fix bug in General Stats
Fix bug in General Stats - now troops appear !
2026-05-20 07:47:02 +03:00
novgorodschi catalin e03b7c9037 Fix hero system after refactor
Fix hero system after refactor
2026-05-18 11:12:15 +03:00
novgorodschi catalin 1936e1f02c Disable generic cache
Disable generic cache
2026-05-18 10:43:14 +03:00
novgorodschi catalin ca4afdf7eb Revert "Undo"
This reverts commit 23d779dd9f.
2026-05-18 09:26:19 +03:00
novgorodschi catalin 23d779dd9f Undo
undo
2026-05-18 09:22:24 +03:00
novgorodschi catalin 55e6dd60b5 Refactor + BugFix
1. Fix a bug in Admin Panel that you can edit by yourself your rank, now you cannot edit your rank anymore.

2. Now Alliance Leader can edit his own Position

3. Fix negative value on Demolition Building, now in database at lvl is appear new level not -1

4. Refactor Ajax map, now all is alligned (Ajax folder and Map folder)

5. Fix bug from Palace (when change capital now Automation recount population automaticaly on old capital and new capital)
2026-05-18 09:18:35 +03:00
Catalin Novgorodschi 2bce101a27 Fix reinforcement
Fix reinforcement
2026-05-15 12:43:03 +03:00
Catalin Novgorodschi 51e7e95052 Fix for admin/mh vacation 2026-05-15 12:24:30 +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 afbe64a006 Incremental Refactor Celebration
Incremental Refactor Celebration
2026-05-13 15:17:21 +03:00
Catalin Novgorodschi f99ab72d25 Incremental Refactor Form/BBCode/Mailer/Village
Incremental Refactor Form/BBCode/Mailer/Village
2026-05-13 15:09:05 +03:00
Catalin Novgorodschi 35467b93ec Incremental Refactor Session
Incremental Refactor Session
2026-05-13 14:01:33 +03:00
Catalin Novgorodschi a3cf00c0f9 Incremental Refactor Market/Message/Profile
Incremental Refactor Market/Message/Profile
2026-05-13 12:20:10 +03:00
Catalin Novgorodschi a004f5352b For incremental refactor + some credits 2026-05-12 13:39:10 +03:00