54 Commits

Author SHA1 Message Date
novgorodschi catalin 31b13873e8 Fix Server Settings in Admin Panel
Fix Server Settings in Admin Panel + fix New function in admin.php
2026-06-23 14:40:23 +03:00
Ferywir f581add125 feature(rally-point): mark incoming attacks + show per-troop travel time [#245] (#248) 2026-06-22 06:54:41 +03:00
Ferywir 827354a622 feat(admin): add transparent debug error-log mode
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>
2026-06-12 17:18:39 +03:00
Ferywir 20804d9182 feat: IP ban support (#185) (#188) 2026-06-09 15:15:27 +03:00
Ferywir 95df9b9018 Fix HTTP 500 when queuing a 2nd Smithy/Armoury upgrade of the same unit (#173) 2026-06-04 19:51:37 +03: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 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
Catalin Novgorodschi 8e3f4e16a9 Update struct.sql 2026-05-24 10:34:13 +03:00
novgorodschi catalin e6a3bb7db7 Update log system gold
Update log system gold
2026-05-20 11:55:18 +03:00
Catalin Novgorodschi 01474fb31f Update Readme
Update Readme
2026-05-15 08:17:14 +03:00
Catalin Novgorodschi 1b66ce2139 Fix oasis regeneration
Fix a bug that appear when you attack an unoccupied oasis and not conquer and remain 0 units. After that troops not regenerate.
2026-05-14 08:42:12 +03:00
Catalin Novgorodschi 8901c36c06 Incremental Refactor Templates 2
Incremental Refactor Templates 2
2026-05-07 08:24:40 +03:00
Catalin Novgorodschi e3420faaf5 Multihunter acces is 8
Multihunter acces is 8
2026-04-29 09:02:54 +03:00
Catalin Novgorodschi ebbf5165aa Code for preference (just logic not operational)
Code for preference (just logic not operational)
2026-04-27 15:04:44 +03:00
haki99 0f083fe4ed Refactor SQL 2025-12-19 23:54:38 +01:00
haki99 6a555c7f39 Fix SQL syntax by removing parentheses 2025-12-19 23:53:06 +01:00
haki99 510421e4ed Refactor oasis regeneration SQL script
Refactor oasis regeneration SQL script to improve clarity and maintainability.
2025-12-19 22:57:21 +01:00
haki99 4e30e49475 Update SQL queries for player count and progression 2025-12-19 22:17:21 +01:00
haki99 3b359d6f85 Adjust unit growth calculations with player metrics
Updated unit growth calculations based on player progression and growth factor.
2025-12-17 17:10:11 +01:00
Catalin Novgorodschi db3d9bfff1 Crop finder @lietuvis10
Fix crop_finder.php by @lietuvis10
2025-10-23 10:27:45 +03:00
221V 1be3106f76 AUTO_INCREMENT columns start from 1 by default 2025-02-06 20:48:41 +02:00
Martin Kalabek e61177614e fix missing prefixes for oasis troops regen sql 2024-10-10 20:05:14 +02:00
Shadow 4c116aefea update 2019-05-06 09:18:20 +03:00
iopietro c574a71b3a General fixes
+Fixed a bug that didn't delete artifacts when a player deleted his
account
+Added "(artifact)" if a village has an artifact in the village overview
+Added the artifact section in the multihunter panel (return to natars
doesn't work yet)

NOTE: To play this version of the game, you have to run this query first
(where "s1_" is the prefix of your server):

ALTER TABLE `s1_artefacts` ADD `del` TINYINT(1) NULL DEFAULT '0' AFTER
`lastupdate`;
ALTER TABLE `testtravian`.`s1_artefacts` ADD INDEX
`active-owner-conquered-del` (`active`, `owner`, `conquered`, `del`);
2018-06-21 14:43:47 +02:00
Shadow 5bc1633182 Block folder accces
+404 error
2018-06-13 11:17:18 +03:00
iopietro c9332ea67d General fixes
+Changed the Multihunter's tribe from 0 to Romans (1)
+Added an option to the Multihunter's panel map which shows all
artefacts on the map
2018-06-06 01:29:42 +02:00
iopietro 3d5239c163 Added some indexes
You can add them without reinstalling the whole server, by executing
this query (where "s1_" is the prefix of your server):

ALTER TABLE `s1_forum_cat` ADD INDEX `display_to_alliances`
(`display_to_alliances`(11));
ALTER TABLE `s1_forum_cat` ADD INDEX `display_to_users`
(`display_to_users`(11));
ALTER TABLE `s1_forum_cat` ADD INDEX `sorting` (`sorting`);
2018-05-21 17:43:17 +02:00
iopietro 877762ea6e General fixes
+Updated installation SQL struct

NOTE: To play this version without reinstalling the server, you need to
run this query (where "s1_" is the prefix of the server):

ALTER TABLE `s1_forum_topic`
  DROP `alliance0`,
  DROP `player0`,
  DROP `coor0`,
  DROP `report0`;

ALTER TABLE `s1_forum_post`
  DROP `alliance0`,
  DROP `player0`,
  DROP `coor0`,
  DROP `report0`;
2018-05-20 16:56:37 +02:00
iopietro 4f98e14c29 Alliance forum fixes part 2
+Added the "Forum" link to the game menu (above Game Rules), player
without an alliance, will be able to access to public forums only
+All players can now open public forums (even without an alliance), post
to them, edit and delete them
+Added the possility to add alliances and players to the "Who can view
this forum" list, the graphic was present but there wasn't the database
and code support (conditions aren't coded yet)
+General fixes

NOTE: To play this version without reinstalling the server, you have to
run this simple query:

ALTER TABLE s1_forum_cat ADD (`display_to_alliances` text,
`display_to_users` text)
2018-05-19 22:04:51 +02:00
iopietro e5d823cda0 Alliance forum fixes part 1
Fixed the majority of security issues:

+Fixed a bug that permitted to edit, delete and create a forum in any
alliance, without any permissions
+Fixed a bug that permitted to edit, create and delete any kind of
thread, with any kind of permission
+Fixed a bug that permitted to edit, modify and delete every kind of
post, without any kind of permission
+Fixed a bug that din't permit to create posts and threads
+Fixed a bug that permitted to create forum and threads with empty
name/topic
+Fixed a bug that permitted to move a thread to an invalid forum
+Fixed a bug that permitted to create an invalid type of forum
+Fixed a bug that didn't permit to move forums, to the top and the
bottom of their forum type (in reality, it wasn't even coded)
+Added a sorting column for supporting the "move to top/bottom"
functionality
+Minor improvements and bug fixing/code indentation/removal of redundant
code

NOTE: For playing this version, you HAVE to add a new column to the table "s1_forum_cat", you can simply do that by running this query (where "s1_" is the prefix of your server): ALTER TABLE s1_forum_cat ADD `sorting` int(11) NOT NULL AFTER `id`
2018-05-18 00:28:48 +02:00
iopietro bdd3bfd41c Farmlist improvements and fixes
+Troops while adding/editing a raid lists are now inside of a table,
this is a graphic enhancement
+Reduced the X and Y textboxes size while adding/editing a raid list
+Fixed a bug that didn't permit to add a raid list
+Fixed a bug that did permit to insert spies in raid lists
+The farmlists graphic is now more clear, "Add raid" and "Start raid"
are now two general buttons, instead of having two buttons for raid list
+"Select all" checkbox, will select all raid without refreshing the page
(through JS)
+Moved the function "getDistance" to Database.php
+Removed a lot of redundant code from crop_finder.php
+Removed rams, catapults, chiefs and settlers from the raid list,
because the first three can't even loot resources
+Removed trooplist2.tpl because of a more general unique template file
(trooplist.tpl)
+Some minor improvements and bug fixing

IMPORTANT NOTE: if you don't want to reinstal the whole server, you can
simply run this little query (where "s1_" is the prefix of your server):

ALTER TABLE `s1_raidlist` DROP `t7`, DROP `t8`, DROP `t9`, DROP `t10`;
2018-05-16 16:49:25 +02:00
iopietro 26cb03cdb6 Artifacts fixing part 1
+Added a new table in the database, called "artefacts_chrono" which
stores the chronology of all artifacts
+Added the support for the artifacts chronology in 27_show.tpl
+Added the support for interacting with the artifacts chronology table in Database.php
+Cleaned the code in 27_show.tpl
+Some minor improovements and bug fixing
2018-04-23 20:34:28 +02:00
Shadow d4e19c7127 update medals accounts 2018-01-23 10:07:52 +02:00
Alex Stoica 1a71fdbc60 Add WW win correct date 2018-01-07 16:48:22 +00:00
Martin Ambrus b261212d12 fix: expansion slots not being cleared up upon village destruction
#400
2017-12-02 16:17:47 +01:00
Martin Ambrus 55a5238a6d chore: create default users with bcrypt enabled by default 2017-12-01 19:32:03 +01:00
Martin Ambrus 6d0e95670b refactor: messages and reports only loaded on pages where needed
#313
2017-11-17 21:00:00 +01:00
Martin Ambrus d17d1f9b32 refactor: last round of database values caching
#313
2017-11-17 19:40:34 +01:00
Martin Ambrus e2612efbf8 refactor: date column really can't be varchar 2017-11-17 17:20:05 +01:00
Martin Ambrus 282d7f9db8 refactor: real hero check to use a lot less queries 2017-11-17 13:28:21 +01:00
Martin Ambrus 9b0d7995e3 refactor: index for ww_attacks 2017-11-08 15:46:24 +01:00
Martin Ambrus 90f8982245 fix: hero dying and revival doesn't work correctly with multiple heroes 2017-11-02 23:59:03 +01:00
Martin Ambrus cdfb3ece4a fix: typo in unique index
Fixes #263
2017-11-02 13:24:43 +01:00
Martin Ambrus 7c67e1e7b9 fix: only 1 hero can exist and is deleted upon new hero training start
Closes #261
2017-11-02 11:05:26 +01:00
Martin Ambrus c9038e20b8 refactor: alliance and Embassy mechanics refactoring, stage 2 of 3
Everything is now prepared for the last stage, where the code to handle
Embassy destruction during a battle will be added and tested :)

A few Embassy-demolition-related issues have been ironed-out in this
commit as well.
2017-11-01 00:16:52 +01:00
Martin Ambrus 1525771ee9 fix: correction in generation of units in oasis 2017-10-28 15:15:30 +02:00
Martin Ambrus 6226412825 fix: coordinates were still generated in wrong descension 2017-10-28 11:08:35 +02:00
Martin Ambrus 2cfb84ebe2 fix: world data generation now returns the correct number of records 2017-10-28 10:30:53 +02:00
Martin Ambrus 7689e73280 refactor: new market DB index 2017-10-27 23:05:29 +02:00