mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
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>
This commit is contained in:
+5
-5
@@ -905,6 +905,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%gold_fin_log` (
|
||||
gold int(11) NOT NULL DEFAULT 0,
|
||||
time int(11) NOT NULL DEFAULT 0,
|
||||
log varchar(255) DEFAULT NULL,
|
||||
details varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (id),
|
||||
KEY uid (uid),
|
||||
KEY time (time)
|
||||
@@ -1776,13 +1777,12 @@ CREATE TABLE IF NOT EXISTS %PREFIX%croppers (
|
||||
fieldtype TINYINT UNSIGNED NOT NULL, -- 1 = 9c, 6 = 15c
|
||||
best_oasis_bonus TINYINT UNSIGNED NOT NULL, -- 0,25,50,75,100,125,150
|
||||
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
CHECK (best_oasis_bonus IN (0,25,50,75,100,125,150))
|
||||
CHECK (best_oasis_bonus IN (0,25,50,75,100,125,150)),
|
||||
KEY idx_ft_bonus_xy (fieldtype, best_oasis_bonus, x, y),
|
||||
KEY idx_xy (x, y),
|
||||
KEY idx_bonus (best_oasis_bonus)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
CREATE INDEX idx_ft_bonus_xy ON %PREFIX%croppers (fieldtype, best_oasis_bonus, x, y);
|
||||
CREATE INDEX idx_xy ON %PREFIX%croppers (x, y);
|
||||
CREATE INDEX idx_bonus ON %PREFIX%croppers (best_oasis_bonus);
|
||||
|
||||
--
|
||||
-- Dumping data for table `%prefix%croppers`
|
||||
--
|
||||
|
||||
Reference in New Issue
Block a user