Changelog
All notable changes to Dragon Lord will be documented in this file.
The format is based on Keep a Changelog,
and this project adheres to Semantic Versioning.
[Unreleased]
0.8.9December 6, 2025
Added
- PostgreSQL Database Support:
- Full PostgreSQL support alongside existing SQLite support
- Installer now allows choosing between SQLite and PostgreSQL during setup
- PostgreSQL connection configuration (host, port, database, username, password)
- Separate PostgreSQL schema file (
database/schema_postgresql.sql) with proper PostgreSQL syntax
- Database-agnostic
Database class that automatically handles both database types
- PostgreSQL extension checks (
pdo_pgsql and pgsql) in setup pre-flight checks
- UTC timezone configuration for PostgreSQL connections
- Admin portal database management tab with:
- Current database information display (type, host, port, database name, username)
- Database statistics (total tables, total records, database size)
- Connection testing functionality
- Database migration tool (SQLite to PostgreSQL)
- Database Migration System:
- Admin portal interface for migrating from SQLite to PostgreSQL
- Automatic data transfer table-by-table with transaction safety
- Handles SERIAL primary keys for PostgreSQL compatibility
- Updates configuration after successful migration
- Error handling and rollback support
Changed
- Database Abstraction:
Database class now supports both SQLite and PostgreSQL dynamically
- Database type determined from configuration file (
db_config_saved.php)
- Schema initialization automatically loads correct schema file based on database type
- All database queries now use database-agnostic methods
- Setup Detection:
- Setup completion detection now works for both SQLite and PostgreSQL
- Checks database type from configuration before performing type-specific checks
- Uses
Database::getInstance()->tableExists() for database-agnostic table existence checks
- Prevents redirection loops after PostgreSQL installation
- Timestamp Handling:
- All datetime functions now use database-agnostic implementations
- PostgreSQL connections automatically set timezone to UTC
- All timestamp generation uses UTC timezone consistently
- Replaced SQLite-specific
datetime() calls with PHP-calculated timestamps for security-critical queries
Fixed
- Registration with PostgreSQL:
- Fixed
SQLSTATE[42883]: Undefined function: datetime() error when registering with PostgreSQL
- Replaced SQLite-specific
datetime() calls in security_auth.inc.php with PHP-calculated UTC timestamps
- All login attempt tracking now works correctly with PostgreSQL
- Setup Redirection Loop:
- Fixed issue where setup would redirect back to
setup.php after successful PostgreSQL installation
- Setup detection now correctly identifies initialized PostgreSQL databases
- Database file existence check only runs for SQLite, not PostgreSQL
- Database File Creation:
- Fixed
game.db being created even when PostgreSQL was selected during setup
- SQLite database file only created when SQLite is selected
- Permission setting step only runs for SQLite installations
- PDO Parameter Handling:
- Fixed
TypeError: PDO::query(): Argument #2 ($fetchMode) must be of type ?int, array given in tableExists() method
- Changed from
PDO::query() with parameters to PDO::prepare() and execute() for parameterized queries
- Ensures proper and secure query execution for both SQLite and PostgreSQL
- PostgreSQL Schema Syntax:
- Fixed
ON CONFLICT clause positioning in PostgreSQL INSERT statements (must appear after VALUES)
- Added
UNIQUE constraint to item_definitions.name to support ON CONFLICT (name) DO NOTHING
- All schema statements now use correct PostgreSQL syntax
0.8.8December 6, 2025
Added
- Admin Portal Security Enhancements:
- Converted
swagger.html to swagger.php with server-side authentication
- Added server-side admin authentication check to Swagger UI documentation page
- Prevents unauthorized access to API documentation even if client-side checks are bypassed
- Both
admin-docs.php and swagger.php now require admin authentication at the server level
Changed
- Quest List UI Improvements:
- Added "Quest Type" column to quest management list (replaces requirements/rewards columns)
- Quest type displayed with styled badge (Simple, Combat, Item Collection, Story)
- Removed "Requirements" and "Rewards" columns from list view (still available in edit form)
- Improved quest list readability and faster scanning of quest types
Fixed
- Admin Portal Redirect Loop:
- Fixed redirect loop when accessing
/admin/ while not logged in
- Improved base path calculation in
admin/index.php to use REQUEST_URI instead of SCRIPT_NAME
- Prevents
ERR_TOO_MANY_REDIRECTS error for unauthenticated users
- Reset Game Round Button:
- Fixed reset game round button not working in rounds tab
- Added proper event listener attachment when rounds tab is opened
- Fixed duplicate toast notifications when resetting game round
- Button now properly triggers confirmation dialog and resets the round
0.8.7December 5, 2025
Changed
- Database Schema Consolidation:
- Consolidated all database table definitions into
database/schema.sql as single source of truth
- Added missing tables to schema.sql:
map_zones, world_treasure_chests, world_monsters, world_monster_attacks, world_events, world_event_interactions
- Added missing game settings:
treasure_chest_event_settings, cave_settings
- Added missing column to
item_definitions: available_at_merchant
- All fresh installs now use schema.sql exclusively via
setup.php
- Setup Script Improvements:
- Enhanced
setup.php with automatic permission fixing for required directories
- Improved schema execution with better error handling and statement ordering
- Added "Fix Permissions" button that appears when permission issues are detected
- Better error logging and reporting for schema execution failures
- Fixed schema execution to properly handle CREATE TABLE statements before CREATE INDEX statements
Removed
- Unused Migration Files:
- Removed all SQL migration files from
database/migrations/ folder (8 files total)
- Migration files removed:
add_map_zones.sql, add_world_monsters.sql, add_world_events.sql, add_treasure_chests.sql, add_treasure_chest_event_settings.sql, add_items_system.sql, add_potion_effects.sql, add_missing_magic_spells_descriptions.sql, fix_magic_type_for_weapons_armor.sql, add_quest_system_enhancements.sql, update_existing_quests.sql, update_first_steps_to_combat.sql, update_map_zone_coordinates.sql
- Removed
database/init_quests.sql (quests now inserted from schema.sql)
- These files were not being executed automatically and their functionality is now handled by
config/database.php's runMigrations() function for existing databases
- Backup and Unused Files:
- Removed
setup (Copy).php (backup file)
- Removed
api/quest_fixed.php (unused backup, quest.php is the active file)
Fixed
- Schema Execution:
- Fixed schema.sql execution to properly order statements (CREATE TABLE before CREATE INDEX)
- Fixed missing
available_at_merchant column causing INSERT statement failures
- Improved statement parsing to handle multi-line CREATE TABLE statements correctly
- Better error handling for column mismatches and missing tables
0.8.6December 3, 2025
Added
- World Monster Event System Enhancements:
- Monster event timer expiration now automatically removes remaining spawned monsters from the map
- All active monsters from expired events are marked as defeated and despawned
- Monster event announcements sent immediately when events start (both scheduled and immediate)
- System messages sent to players who defeat world monsters with full reward details
- Chat announcements posted when players defeat world monsters (first-person format: "I defeated the [MonsterType]!")
- Monster Icon Management:
- Admin can configure up to 6 unique icons per monster type (goblin, orc, troll, dragon)
- Icon Manager modal integration for selecting monster icons
- Icons randomly selected when monsters spawn
- Database schema updated to support monster icon paths
- Monster Visual Enhancements:
- Increased monster icon size from 48px to 80px for better visibility
- Increased health bar size from 4px to 10px height, 80px width
- Monster icons display with health-based color coding (green/yellow/orange/red)
- Health progress bar displayed below monster icons on map
- Monster Attack Cooldown System:
- Configurable attack cooldown (default: 5 seconds, was 30 seconds)
- Per-player cooldown tracking with visual feedback
- Monster icons show spinner/throbber during cooldown period
- Attack button disabled during cooldown with "On Cooldown" message
- Cooldown automatically clears when timer expires
- Event Announcement Marquee:
- Scrolling marquee overlay at top of page for event announcements
- Automatically displays when treasure chest or monster events start
- Single-scroll animation (20 seconds) instead of infinite loop
- Auto-hides after animation completes
- Checks system messages and event settings for active events
Changed
- Monster Event Timing:
- Immediate start events (blank scheduled_start) now work correctly
- Events use current time as start time when no monsters exist yet
- Announcements sent before monster spawning for immediate visibility
- Event expiration properly removes all remaining monsters
- Monster Attack Cooldown:
- Reduced default cooldown from 30 seconds to 5 seconds (configurable)
- Cooldown duration returned in API response for frontend tracking
- Monster Defeat Messages:
- System message sent to defeating player with full reward breakdown
- Chat message posted in first-person format from player perspective
- Monster List Display:
- Fixed admin panel monster list to use correct API endpoint (
world-monsters-list)
- Monster list now properly displays all spawned world monsters
Fixed
- Monster Icon Selection:
- Fixed icon picker not updating preview when icon selected
- Fixed duplicate "Remove" buttons appearing after icon removal
- Removed confusing "Add Icon" button (all 6 slots always visible)
- Icon preview updates immediately when icon is selected
- Monster Event Start:
- Fixed immediate start events not working (blank scheduled_start)
- Fixed event announcements not being sent immediately
- Fixed event timer expiration not removing remaining monsters
- Quest Item Purchase:
- Fixed "Item name is required" error when buying quest items from General Store
- Item name now correctly passed in
params object instead of directly in body
- Event Announcement API:
- Fixed messages API endpoint error (changed from
/api/player.php?action=messages to /api/game.php?action=messages-list)
- Event announcement checking now works correctly without console errors
0.8.5December 2, 2025
Added
- Map Live Update System:
- Integrated Leaflet Liveupdate plugin for smooth map data updates without closing popups
- Map now updates every 5 seconds automatically without interrupting player interactions
- Live update control button in top-right corner of map (can be toggled on/off)
- Popups remain open during map updates, preventing frustration when clicking on events
- Cave and Shrine Modal System:
- Beautiful modal popups for caves and shrines with immersive stories
- Cave Modals: Display unique randomly-generated stories about mysterious caves, mines, and caverns
- Shrine Modals: Display unique randomly-generated stories about sacred shrines and temples
- Large icons (⛰️ for caves, ⛩️ for shrines) and styled story text
- "Collect" buttons that trigger the actual interaction after viewing the story
- Preview system allows players to read stories before committing to interaction
- Enhanced Event Icons:
- Increased event icon sizes for better visibility on map
- Shrines, caves, and portals: Increased from 24px to 40px
- Merchants: Increased from 32px to 48px
- Enhanced borders and shadows for improved visibility
- Player pins remain at original size (24px) for consistency
Changed
- Map Popup Behavior: All map popups now use autoPan to automatically pan the map when opened near edges
- Event Spawn Padding: Increased from 5% to 15% to keep events further from map edges
- Cave Icon: Changed from 🕳️ (hole) to ⛰️ (mountain) for better visual representation
- Map Update System: Replaced setInterval-based updates with Leaflet Liveupdate plugin for smoother experience
- Event Interaction Flow: Caves and shrines now show modals first, then collect on button click (instead of immediate interaction)
Fixed
- Map Popup Cut-off: Fixed popups being cut off at map edges by implementing autoPan with 50px padding
- Popup Closing on Refresh: Fixed popups closing when map data refreshes (now uses liveupdate plugin)
- Event Spawn Locations: Events now spawn further from edges (15% padding) preventing popup visibility issues
- Admin Spawn Functions: Admin spawn-chest function now uses padded bounds like other spawn functions
0.8.4December 2, 2025
Added
- Arena Protection System:
- Players who lose in arena combat now receive temporary protection from arena attacks
- Configurable Protection Duration: Admin can set protection duration in hours (default: 12 hours, max: 168 hours/1 week)
- Protection Settings: New "Protection Duration (Hours)" setting in Admin → Arena tab
- Protection Overlay: When a protected player visits the Arena tab, a transparent red overlay appears with:
- Countdown timer showing remaining protection time (HH:MM:SS format)
- Reason message explaining why protection is active
- All attack buttons disabled while protection is active
- Player List Indicators: Protected players show a "🛡️ Protected" badge in the arena player list
- Attack Prevention: Protected players cannot attack others, and cannot be attacked by others
- Automatic Expiration: Protection automatically expires when the timer reaches zero, and the arena refreshes automatically
- Database Schema: Added
arena_protection_until column to players table for tracking protection timestamps
Changed
- Arena Combat: Losing players (both attacker and defender) now receive protection after defeat
- Arena UI: Enhanced arena interface to show protection status for all players
- Arena API: Arena list endpoint now includes protection status for current player and all listed players
Fixed
- Arena Protection: Fixed issue where players could be repeatedly attacked immediately after defeat
- Protection Display: Protection status now properly displayed in arena player list with visual indicators
0.8.3December 1, 2025
Added
- Merchant Item System:
- Items can now be marked as "Available at Merchant" in the admin portal
- Merchants now use items from the item database instead of randomly generated items
- 4 Default Merchant Items: Pre-configured items ready for merchant events
- Elixir of Immortality (epic potion with magic defense)
- Cursed Blade (legacy weapon with dark magic)
- Soul Reaper (epic weapon with Whirlwind spell)
- Divine Robe (epic armor with defense magic)
- Merchant Settings in Admin Portal: Complete configuration interface in World Map tab
- Price multiplier (default: 3.0x base sell price)
- Minimum price (default: 50 gold)
- Max items per merchant (default: 4)
- Merchant Item Toggle: Admin can mark/unmark items for merchant use in Items tab
- Merchant Icon: Merchants now use barracks-tent.svg icon instead of blue dot
- World Map Event Improvements:
- Guaranteed Event Spawning: One shrine and one cave guaranteed per location
- Edge Padding System: Events spawn with 5% padding from map boundaries to prevent edge placement
- All event types (caves, shrines, merchants, portals, treasure chests, monsters) use padded bounds
Changed
- Merchant Pricing: Merchants now charge actual gold prices (3x base sell price by default) instead of free items
- Merchant Item Generation: Changed from random loot generation to using items marked for merchant use
- World Map Event Spawning: Shrines and caves are now guaranteed (one per location) before random events spawn
- Database Schema: Added
available_at_merchant column to item_definitions table
- Merchant Modal: Updated to show actual gold prices and disable buy button if player lacks funds
Fixed
- Merchant Button Clicks: Fixed onclick handlers to use
window.gameUI for proper function access
- Merchant Item Display: Fixed merchant modal to show prices instead of "Buy (Free)"
- World Map Edge Spawning: Fixed events spawning too close to map edges (now uses 5% padding)
- Shrine Spawning: Fixed to ensure one shrine spawns per location (was random)
- Cave Spawning: Fixed to ensure one cave spawns per location (was random)
0.8.2December 1, 2025
Added
- Treasure Chest Event System:
- Configurable treasure chest events with admin-controlled scheduling
- Event Configuration: Admin can configure total chests, duration (default: 30 minutes), spawn interval, and player collection limits
- Staggered Spawning: Chests spawn gradually over the event duration instead of all at once (prevents single-player collection)
- Scheduled Events: Admin can schedule events to start at specific times (UTC)
- Mass Announcements: Automatic system message sent to all players when scheduled events begin
- Player Collection Limits: Configurable limit on how many chests each player can collect during an event
- Event Toggle: Admin can enable/disable treasure chest events entirely
- Admin UI: Complete configuration interface in World Map admin tab
- Cave Daily Limit System:
- Configurable daily limit for cave event interactions per player (default: 1 per day)
- Players can only use caves up to the configured limit per day
- Admin-configurable limit in World Map admin tab
- Prevents players from exploiting cave events for unlimited rewards
Changed
- Treasure Chest Spawning: Changed from random hourly spawning to event-based system with configurable schedules
- Treasure Chest Duration: Default duration changed from 24 hours to 30 minutes (configurable by admin)
- Shrine Usage: Shrines now limited to one use per day per player (across all shrines)
- Cave Usage: Caves now have configurable daily limit per player (default: 1)
- Database Schema: Added
treasure_chest_event_settings and cave_settings to game_settings table for fresh installs
Fixed
- Duplicate Toast Messages: Fixed duplicate toast popups when collecting from shrines (now shows single message)
- Player Pin Display: Player pins now use avatar icons instead of colored dots, with distinct styling for admin players (purple) vs regular players (gold/brown)
- Zone Label Styling: Zone labels now have medieval brown/gold styling with shimmer effects matching Phase text on login page
- Zone Label Background: Fixed zone label background width to properly contain text (especially for "Ancient Dungeon")
0.8.1November 30, 2025
Added
- Interactive World Map System:
- New Map tab in terminal using Leaflet.js for interactive world map display
- Custom map image support (PNG/WEBP) with custom coordinate system
- Player Tracking: Real-time player location pins on map with random placement within zones to prevent stacking
- Zone System: Clickable zones for each game location (Town, Dark Forest, Ancient Dungeon) allowing players to move between locations
- Treasure Chest System: Random treasure chests spawn on the map (5-10 per location per day)
- Chests have rarity levels (common, rare, epic, legendary) with color-coded markers
- Click to collect chests for random gold and items
- Despawn timers displayed on map
- Chests automatically spawn and clean up expired/collected chests
- World Monsters (Shared Health Pool): Boss monsters that multiple players can attack
- Monsters have shared health that doesn't regenerate between attacks
- Last-hit player wins rewards (gold, XP, special loot)
- Attack cooldown system (30 seconds between attacks)
- Health bars displayed on map with color-coded status
- Monster types: goblins, dragons, orcs, trolls
- Respawn system (24 hours after defeat)
- Special loot drops that can't be bought at blacksmith
- Random Events System: Four types of random events spawn on the map
- Caves: Explore for random rewards (gold, XP, items with 30% chance)
- Shrines: Pray for permanent stat boosts (strength, dexterity, intelligence, or charisma)
- Merchants: Purchase special items (2-4 items per merchant, higher chance of epic/legacy items)
- Portals: Teleport to random locations (one-time use)
- Events spawn 1-3 per location per day with weighted probabilities
- Event-specific despawn timers (merchants/portals: 2 hours, caves/shrines: 24 hours)
- Real-time Updates: Map data refreshes every 5 seconds showing current player locations, chests, monsters, and events
- Admin Controls: Admin panel endpoints for manually spawning chests, monsters, and events
- Database Schema: New tables for map zones, treasure chests, world monsters, world events, and interactions
- Round Reset Support: All world map data properly clears on round reset (chests, monsters, events)
- Fresh Install Support: All new tables included in schema.sql for fresh database installs
Changed
- Database Schema: Updated schema.sql to include all world map tables for fresh installs
- Round Reset: Enhanced round reset logic to clear all world map data (treasure chests, monsters, events, and related interactions)
- Map Zones: Zones persist across rounds (not cleared on reset) as they are configuration data
0.7.10November 30, 2025
Fixed
- Magic Items: Fixed missing magic spells and descriptions for default items
- Added spell "Power Surge" and description for Elixir of Power
- Added description for Elixir of Protection
- Added description for Elixir of Immortality
- Added spell "Fairy Bolt" and description for Magic Fairy
- Added spell "Dark Strike" and description for Cursed Blade
- Created migration script to update existing databases
- Admin Item Editor: Fixed Magic Type dropdown not auto-selecting the correct value when editing items
- Magic Type dropdown now properly selects "Attack" or "Defense" based on item's magic_type
- Added robust selection method using both value and selectedIndex
- Ensured magic fields are visible before setting dropdown value
- Arena PvP Combat: Fixed multiple issues with arena combat display and functionality
- Fixed player health showing NaN - now properly displays health from combat data
- Fixed player not attacking - combat log now correctly shows both attacker and defender attacks
- Fixed combat border color - now turns green on victory (removes yellow/red states)
- Fixed defender health display - now shows 0/100 when defender is defeated
- Added victory/defeat turns to combat log for proper outcome detection
- Added pill-style victory messages showing who was defeated, gold stolen, and items stolen
- Fixed player stats display - now uses full attacker stats from combat result
- Fixed combat log format handling - properly handles both PvP (attacker_attack/defender_attack) and regular combat formats
Changed
- Arena Combat Response: Arena combat now returns full attacker and defender stats (attack, defense, strength, etc.) instead of just basic info
- Combat Display: Improved victory detection to handle both turn-based victory flags and PvP-specific victory indicators
0.8.0December 1, 2025
Added
- Warriors Training Center:
- New training facility in Town where players can battle progressively stronger masters
- Players must meet XP requirements to challenge each master level
- Daily attack limit (configurable by admin, default: 5 attacks per day)
- On victory: Players gain XP, gold, and permanent stat increases (+1 STR, DEX, INT, CHR)
- Training level advances after defeating a master
- Master dialog system with typewriter effect
- XP requirement display with progress bar
- Admin-configurable settings for all 10 training levels:
- Master name, avatar icon (with icon picker), dialog text
- XP requirement, XP reward, gold reward
- Stats formulas for master stats (configurable per level)
- Training level and daily attacks reset on round reset
- Master icons use custom game-icons.net.svg icons for visual variety
0.7.9November 30, 2025
Fixed
- Combat System: Fixed issue where combat would sometimes freeze without showing the close button - now always displays close button after all turns
- Message System: Fixed reply functionality to properly auto-populate recipient when replying to messages
- Message UI: Redesigned recipient field for better UX - search field is now separate with selected player pills displayed below instead of inline
- Message Security: Added XSS protection by sanitizing all message subjects and bodies before database storage
- Message Validation: Added length limits (subject: 200 chars, body: 10,000 chars) to prevent abuse
Changed
- Message Recipient Field: Improved user experience with separate search input and recipient pills displayed below the field
- Message Sanitization: All messages (regular, replies, and admin announcements) are now sanitized using
htmlspecialchars() to prevent XSS attacks
0.7.8November 30, 2025
Added
- Arena PvP Combat System:
- New Arena tab in the terminal for player vs player combat
- Players can attack other players within configurable level range
- Daily attack limit (configurable by admin)
- Turn-based combat system similar to monster combat
- Victory rewards: 80% of defender's on-hand gold (configurable) and chance-based equipped item looting (50% per item, configurable)
- Loot system respects attacker's bag space - items won't be looted if no space available
- Health persists after combat (like monster combat)
- Defeated players receive automatic notification messages
- Admin-configurable settings: max attacks per day, level range, offline attack allowance, gold loot percentage, item loot chance
- PvP can be enabled/disabled per player in admin panel
- PvP attack counter resets during game round resets
- In-Game Message System:
- New Messages button in game header with unread badge indicator
- Full message system with inbox, sent, and deleted folders
- Compose messages to single or multiple recipients (comma-separated usernames)
- Read/unread status tracking
- Reply functionality with automatic "Re: " prefix
- Delete messages (moves to deleted folder)
- System messages for PvP defeat notifications
- Message list shows sender/recipient, subject, date, and preview
- Unread badge displays count (up to "99+")
- Admin Announcement System:
- New Announcements section in Game Settings tab
- Send system messages to all players at once
- Subject and message body fields
- Confirmation dialog before sending
- Status display showing success/error and recipient count
- All announcements logged in admin action logs
- Terminal Map Background:
- Terminal now displays map1.png as background image
- Map stretches to fit terminal container
- Semi-transparent overlay ensures text readability
Changed
- Terminal Background: Map image now serves as terminal background with transparency for better visual experience
0.7.7December 1, 2025
Added
- Chat Unread Indicator:
- Chat button now highlights with purple glow and pulsing animation when there are unread messages
- Red notification badge displays unread message count (up to "99+")
- Indicator automatically clears when the chat tab is opened
- Chat polling runs continuously to track unread messages even when tab is not active
- Potion Shop Effects Display:
- Potion shop now displays permanent stat bonuses for each potion
- Color-coded effects: Health (red), Max Health (red), Strength (orange), Dexterity (blue), Intelligence (purple), Charisma (magenta)
- Effects shown in a highlighted "Permanent Effects" section on each potion card
- Item descriptions also displayed when available
Fixed
- Game Round Reset:
- Bank gold (
bank_gold) now properly resets to 0 during game round resets
- All player gold (both pocket and bank) is now reset correctly
- Action Refill Purchase:
- Players can no longer purchase action refills when they already have maximum actions
- Button shows "Actions Maxed" when at maximum actions
- Backend validation prevents purchasing when actions are already at max
0.7.6December 1, 2025
Added
- Bank Modal Interface:
- Replaced terminal-based bank menu with modern modal interface
- Visual display of pocket gold and bank gold with safety indicators
- Bank limit display showing current usage and percentage
- Deposit and withdraw sections with input fields and quick action buttons (All, Half, 25%)
- Toast notifications for successful deposits and withdrawals
- Input fields automatically clear after transactions
Changed
- Admin Player Edit:
- Health field now uses a slider control for easier adjustment
- Health display shows color-coded status (red/orange/green based on percentage)
- Health slider automatically updates when max health is changed
- Both health slider and number input are synchronized
- Bank gold and pocket gold are clearly labeled as separate fields
Fixed
- Bank System:
- Input fields now properly clear after deposit/withdraw actions
- Toast notifications appear for all bank transactions
- Bank limits are properly enforced from General Store settings
0.7.5December 1, 2025
Added
- General Store System:
- New General Store accessible from Town with multiple purchase options
- Bag Expansion: Purchase additional inventory slots (configurable base cost, cost increment, slots per expansion, max bag size)
- Action Refills: Purchase additional daily actions (configurable cost per action, actions per purchase, max purchases per day)
- Gold Booster: Temporary boost that increases gold rewards by a configurable percentage for a set duration
- Bank Limit Increase: Purchase increases to bank gold storage limit (configurable base cost, cost increment, limit increment, max limit)
- Quest Items: Purchase quest items needed for active quests (configurable markup multiplier, enable/disable option)
- All pricing and limits are fully configurable through the admin panel
- Admin panel "General Store" tab for configuring all store settings
- Gold booster automatically applies to all combat and loot gold rewards
- Bank limit and quest items sections are conditionally shown (hidden if unlimited bank or quest purchases disabled)
- Purchase tracking columns added to players table:
bag_expansions_purchased, bank_limit_increases_purchased, gold_booster_expires_at, bank_limit
- All General Store purchases are reset during game round resets
Fixed
- Game Reset: General Store purchase tracking (bag expansions, bank limit increases, gold booster, bank limit) now properly resets when a new game round starts
0.7.4November 30, 2025
Fixed
- Equipped Items Display:
- Fixed equipped items tab in player settings to show all equipped items, not just standard slots
- Items that don't match standard equipment slots (weapon, helmet, chestplate, gauntlets, boots, shield) are now displayed as additional slots
- Improved equipped item filtering to handle integer, boolean, and string values
- Equipment Slot Mapping:
- Gloves and gauntlets now use the same equipment slot (both map to "Gauntlets" slot)
- Items with
item_subtype of "gloves" or names containing "gloves"/"glove" are correctly mapped to the gauntlets slot
- Potion Usage Validation:
- Added check to prevent using health potions when player health is already at maximum
- Players will see an error message: "Your health is already full! You cannot use this health potion."
- Only applies to health restoration potions (
potion_health_bonus), not max health increase potions
0.7.3November 29, 2025
Added
- Admin Items Tab Enhancements:
- Pagination controls for items list (20 items per page by default)
- Search functionality with text input to filter items by name
- Filter dropdowns for
item_type (weapon/armor/potion/fairy/misc) and category (common/legacy/epic)
- Clear Filters button to reset all search and filter criteria
- Page information display (e.g., "Page 1 of 6 (116 items)")
Fixed
- Duplicate Quest Prevention:
- Added UNIQUE constraint on
quests.name column to prevent duplicate quest creation
- Removed redundant quest loading from
init_quests.sql (quests are already in schema.sql)
- Added migration to automatically remove existing duplicate quests (keeps lowest ID)
- Marked
init_quests.sql as deprecated with documentation
- Fixed root cause: both
schema.sql and init_quests.sql were inserting the same quests
0.7.2November 29, 2025
Added
- Potion Shop System:
- New potion shop modal in town (similar to blacksmith)
- Items can be marked as available at potion shop (separate from blacksmith and loot)
- Admin panel toggle to add/remove items from potion shop
- 12 default potion items added to schema (Health, Mana, Greater variants, Elixirs)
- Potion shop items priced at 2x base sell price
- Buy-only shop (no selling)
- Blacksmith Default Items:
- 47 default items added to schema and marked for blacksmith shop
- Items range from cheap (8g) to expensive (3000g) across all categories
- Includes weapons, armor (chestplates, helmets, gauntlets, boots, shields)
- Covers Common, Legacy, and Epic tiers
- Game Reset Improvements:
- Player inventory is now cleared during round reset
- Ensures clean slate for new rounds
Changed
- Town Location:
- Removed Stables service from town
- Potion Shop now available as a service in town
- Player Help Page:
- Added "Game Rounds & Resets" section explaining what happens during resets
- Clarified that accounts and custom content are preserved
- Added tips about Blacksmith and Potion Shop
Fixed
- Database Schema:
- All INSERT statements now correctly include
available_at_potion_shop field
- Proper column/value alignment for all item definitions
0.7.1November 28, 2025
Added
- Combat Modal Polish:
- Health bars moved above player/monster portraits for better readability
- Dynamic combat state styling: green (default), yellow (active combat), red (defeated)
- Terminal Tabs Expansion:
- Rankings Tab with player list sorted by experience, online indicators, and 1st/2nd/3rd place badges
- View Player Modal from rankings showing avatar, stats, bio, location, and equipped items
- Chat Tab with in‑game round chat, avatars, clickable links, and browser‑local timestamps
- Chat Roles & Badges:
- Admins highlighted with purple chat edge and "Admin" badge
- Top 3 ranked players highlighted with gold chat edge and rank badges (🥇/🥈/🥉)
- Game Action Controls:
- Configurable Action Refill Settings in Admin → Game Settings (default 24 hours, adjustable in hours)
- Lightweight client-side chat send cooldown to reduce message spam (short delay between sends)
Changed
- Text‑to‑Speech Provider:
- Simplified server‑side TTS to use Google Cloud Text‑to‑Speech exclusively
- Removed configuration and documentation for OpenAI, Azure, and Amazon Polly providers
- Online Status Logic:
- Rankings and "View Player" modal now share a unified, session‑based online check
- Chat Timestamps:
- All chat timestamps are stored/served as UTC and rendered in the viewer's local timezone in the UI
Fixed
- View Player Modal:
- Close behavior and pointer events corrected so the modal can always be dismissed
- Avatar and equipped item icons now use the shared game icon helpers with proper fallbacks
- Chat Initialization:
- "Loading chat..." placeholder now clears correctly even when there are no messages
- Ensured send button and Enter key reliably dispatch chat messages after switching tabs
0.7.0December 2025
Added
- Server-Side Text-to-Speech (TTS) System: Complete replacement of browser-based TTS
- Multiple Provider Support: Configure OpenAI, Google Cloud TTS, Azure Cognitive Services, or Amazon Polly
- High-Quality Voices: Non-robotic, natural-sounding voices from professional TTS services
- Audio Caching: Generated audio files are cached for 24 hours to reduce API calls and improve performance
- Admin Configuration: Full TTS configuration in Admin Panel → Game Settings
- Enable/disable TTS
- Select provider (OpenAI, Google, Azure, Amazon)
- Configure API keys and credentials
- Set voice preferences and language settings
- Provider-Specific Settings:
- OpenAI: API key, voice selection (Alloy, Echo, Fable, Onyx, Nova, Shimmer), model selection (tts-1, tts-1-hd)
- Google Cloud: API key, voice name (e.g., en-US-Standard-D, en-US-Wavenet-D)
- Azure: API key, region, voice name (e.g., en-US-JennyNeural)
- Amazon Polly: Access key, secret key, region, voice ID (e.g., Joanna)
- Automatic Audio Playback: Story quest text is automatically converted to audio and played
- Error Handling: User-friendly error messages for configuration issues or API failures
Changed
- TTS Implementation: Replaced browser Web Speech API with server-side TTS API
- More reliable across different browsers and platforms
- Better voice quality and consistency
- No browser-specific limitations or voice availability issues
- Quest Level Filtering: Quests now only show if player meets level requirements
- Locked quests (below player level) are hidden from quest list
- In-progress and completed quests always visible regardless of level
- Welcome Message: Enhanced default welcome message handling
- Full default message restored if database has only short version
- Better fallback handling for missing or empty messages
Fixed
- Transaction Errors: Fixed "There is already an active transaction" error in story quest choices
- Reward functions (addExperience, addGold) now called outside main transaction
- Proper transaction management to prevent nested transaction conflicts
- Welcome Message Display: Fixed welcome message not showing on game start
- Improved API response handling
- Better default message fallback logic
0.6.9December 2025
Added
- Immersive Story Quest Modal: Complete redesign of story quest experience
- Dedicated full-screen modal overlay for story quests (replaces inline quest modal display)
- Typewriter Text Effect: Story text appears character-by-character with blinking cursor
- Click to Skip: Players can click anywhere on text to skip typewriter animation
- Character Portraits: Display character portraits using game icon system (configurable per step)
- Text-to-Speech Support: Optional browser-based text-to-speech with toggle button
- Fade and Slide Animations: Smooth transitions between story steps
- Game Action Pausing: All game actions (terminal, navigation, combat) pause during story
- Auto-Start: Story quests automatically open immersive modal when accepted
- Progress Tracking: Visual step indicator (Step X of Y) in modal header
- Completion Screen: Special completion screen with rewards display
- Modal Lock: Story modal cannot be closed until story is completed
Changed
- Story Quest Display: Story quests no longer show inline in quest modal
- Quest modal now shows "Start Story" or "Continue Story" buttons for story quests
- Story content moved to dedicated immersive modal
- Quest API: Added
get action to fetch individual quest data
- Icon Path Updates: Fixed icon paths for Enchanted Boots and Gauntlets of Power to match live database
Fixed
- Welcome Dialog: Fixed welcome dialog z-index to ensure it appears above story quest modal
- Icon Paths: Corrected icon paths for Enchanted Boots and Gauntlets of Power in schema.sql
0.6.8November 27, 2025
Added
- Story Quest: "The Lost Artifact": New interactive story quest with 4 steps and multiple branching choices
- Players navigate through an ancient dungeon, solve riddles, and make moral decisions
- Each choice offers different rewards (XP and gold) based on the player's decisions
- Story quests provide an engaging narrative experience with meaningful choices
- Available to players level 3 and above
Changed
- Schema Updates: Updated
schema.sql to match live database
- Fixed icon paths for Magic Robe and Monster Shield to match live database
- Added
is_quest_item column to all item INSERT statements
- Treasure Key now marked as quest item (
is_quest_item = 1) in default schema
- Added all 4 default quests from live database (First Steps, Dragon Slayer, Combat Sleepface, Collect the Keys)
- Added new story quest "The Lost Artifact" to default quests
0.6.7November 27, 2025
Added
- Quest System Enhancements: Comprehensive quest system with multiple quest types
- Item Collection Quests: Collect specific quantities of quest items and turn them in
- Combat Quests: Defeat monsters of certain levels a specified number of times
- Story Mode Quests: Interactive story quests with player choices that grant gold and XP
- Quest Item Flagging: Items can be marked as "quest items" in the admin panel
- Quest Progress Tracking: Real-time progress tracking for all quest types
- Quest Completion Rewards: Gold and XP rewards displayed in pill-style terminal messages
- Quest Tabs: Separate tabs for "Active Quests" and "Completed Quests" in quest modal
- Quest Sorting: Active quests sorted by status (in progress → available → locked)
- Quest Button Flashing: Quest button flashes when player has a quest ready to turn in
- Stackable Items Selling: Enhanced selling system for stackable items
- Sell Quantity Modal: Modal with slider and number input for selecting quantity to sell
- Max Sell Button: Quick button to sell entire stack at once
- Quantity-Based Pricing: Total sell price calculated as
price × quantity
- Quest Item Protection: Prevents selling quest items needed for active quests
Changed
- Quest Admin Interface: Replaced JSON-based quest editing with user-friendly form interface
- Form-based quest creation/editing instead of raw JSON input
- Type-specific sections that show/hide based on quest type
- Dynamic form validation for quest requirements
- Quest Display: Improved quest list organization and visual feedback
- Completed quests moved to separate tab
- Active quests sorted by completion status
- Visual indicators for quest status (available, in progress, locked, completed)
Fixed
- Quest Progression: Fixed quests not updating progress after combat
- Quest Locking: Fixed quests showing as locked when requirements were met
- Setup Redirect: Fixed setup.php not showing on fresh installs
- Sell Item Errors: Fixed "Item not found" errors appearing after successful item sales
- Stackable Item Selling: Fixed sell button not working for stackable items (modal now displays correctly)
0.6.6November 27, 2025
Added
- Item Stacking System: Items can now be marked as stackable in the admin panel
- Stackable items automatically stack in inventory when looted (quantity increases instead of creating new items)
- Quantity badge displayed on stacked items in inventory (bottom-right corner, blue badge)
- Quantity shown in item tooltip for stacked items
- Bag size counts unique items, not total quantity (stackable items don't fill bag slots)
- Using, selling, or dropping a stackable item decrements quantity instead of deleting the item
- Stackable checkbox added to item form in admin panel
stackable field added to item_definitions table
Changed
- Loot System: Stackable items now automatically stack when looted
- System checks for existing stack before creating new item
- If stack exists, quantity is incremented; otherwise, new item is created
- Item Usage: Stackable items decrement quantity instead of being deleted
- Applies to fairy items, selling, and dropping
- Item is only deleted when quantity reaches 0
0.6.5November 27, 2025
Added
- Combat Equipment Display: Equipment icons now displayed in combat header
- Player equipment (weapon, helmet, chestplate, gauntlets, boots, shield) shown on left side of combat header
- Monster equipment (weapon, armor) shown on right side of combat header
- Equipment icons use proper database icons with glow effects
- Health bars no longer pushed out of view
- Monster-Only Item Indicators: Added colored pill indicators in admin items list
- Red/orange pills for monster-only items (similar to blacksmith yellow pills)
- Toggle button to mark items as monster-only
- Monster-only items excluded from player loot drops
- API endpoint
item-toggle-monster-only for managing monster-only status
- Monster Equipment Scaling: Monster equipment stats now scale with monster level
- Weapon attack scales: 10% increase per level above 1
- Armor defense scales: 10% increase per level above 1
- Higher level monsters have stronger equipment
- Default Monster-Only Items: Added 4 default monster-only items for fresh installs
- Monster Sword (weapon, 20 attack)
- Monster Club (weapon, 20 attack)
- Monster Chestplate (armor, 10 defense)
- Monster Shield (armor, 10 defense)
Changed
- Monster Level Spawning: Monsters now spawn at player level or one level above
- Minimum level:
max(base_level, player_level) - ensures monsters are always challenging
- Maximum level:
player_level + 1 - can be one level above player
- Prevents low-level monsters from appearing for high-level players
- Monster Equipment Level Requirement: Lowered from level 3+ to level 2+
- Level 2: 20% weapon chance, 15% armor chance
- Level 3: 30% weapon chance, 25% armor chance
- Scales up to 100% at higher levels
- Combat Challenge: Combat is now more balanced and challenging
- Monsters always match or exceed player level
- Equipment stats scale with monster level
- Higher level monsters have better equipment more often
Fixed
- Inventory Icons: Fixed inventory items not displaying correct icons from database
- Updated
getPlayerInventory() to JOIN with item_definitions table to retrieve icon_path
- Inventory items now use correct database icons instead of defaulting to fallback icons
- Monster Icons and Stats: Fixed monsters not using correct icons and stats from database
- Updated
generateEncounter() to load monsters from monster_definitions table instead of hardcoded encounters
- Monsters now use
icon_path, base_level, base_health, and base stats from database
- Updated
handleCombat() to preserve icon_path and equipment in returned monster data
- Monster Stats Scaling: Fixed monster stats not scaling correctly from database base stats
- Stats now properly scale from base stats with 10% increase per level above base
- Added ±15% random variation to scaled stats for variety
- Health scales: 20% increase per level above base
- Loot Drops: Fixed loot drops to exclude monster-only and blacksmith-only items
- Updated
generateLootItem() to properly exclude items where monster_only = 1 or available_at_blacksmith = 1
- Loot now only drops from items available to players
- Item Form Icon Manager: Fixed icon manager button not working when adding new items
- Icon picker setup now happens after form is cloned to preserve event listeners
- Item Form Subtype Dropdown: Fixed subtype dropdown being blank when selecting item type
- Item type change listener now set up after form is cloned
- Subtype options now properly populate when item type is selected
0.6.4November 27, 2025
Fixed
- Inventory Icons: Fixed inventory items not displaying correct icons from database
- Updated
getPlayerInventory() to JOIN with item_definitions table to retrieve icon_path
- Inventory items now use correct database icons instead of defaulting to fallback icons
- Monster Icons and Stats: Fixed monsters not using correct icons and stats from database
- Updated
generateEncounter() to load monsters from monster_definitions table instead of hardcoded encounters
- Monsters now use
icon_path, base_level, base_health, and base stats from database
- Updated
handleCombat() to preserve icon_path in returned monster data
- Monster Level Spawning: Fixed monster level spawning logic
- Minimum spawn level now uses
base_level from database (monsters with base_level > 1 won't spawn below that level)
- Maximum spawn level scales with player level:
max(base_level, min(player_level, base_level + 3))
- Stats scale from base stats: 10% increase per level above base
- Health scales: 20% increase per level above base
- Rewards scale based on level multiplier
- Loot Drops: Fixed loot drops to exclude monster-only and blacksmith-only items
- Updated
generateLootItem() to properly exclude items where monster_only = 1 or available_at_blacksmith = 1
- Loot now only drops from items available to players
Changed
- Monster Generation: Monsters are now loaded from
monster_definitions table with full database integration
- Monsters use database-defined base stats, health, gold, and experience values
- Monster icons are loaded from
icon_path field in database
- Location-based monster filtering (monsters can be assigned to specific locations)
- Inventory System: Inventory now includes icon paths from item definitions
- Items display correct icons based on
icon_path from item_definitions table
- Fallback to hardcoded icon mapping if
icon_path is not available
0.6.3November 25, 2025
Added
- Logo Support: Added logo images for login page and game header
logo.png for login page (positioned on left side)
logo_header.png for game header (replaces "Dragon Lord" text)
- Logos blend with dark theme using CSS mix-blend-mode
- Documentation Tab: New dedicated Documentation tab in admin portal
- Moved Swagger API documentation button from Security tab
- Moved Admin Portal Guide button from Security tab
- Comprehensive admin portal documentation page (
admin-docs.php)
- All Admin Tabs Visible: All admin portal tabs now properly displayed
- Quests, Rounds, Dashboard, Logs tabs now visible in navigation
- Documentation tab added to navigation
Changed
- Login Page Layout: Improved login page design
- Logo positioned on left side, login form on right (side-by-side layout)
- Description text moved below "Create Account" button
- "Create Account" link converted to blue button for better UX
- Description updated to include "L.O.R.D." reference
- Responsive design: stacks vertically on mobile devices
- Admin Portal Organization: Improved admin portal structure
- Documentation buttons moved from Security tab to dedicated Documentation tab
- Removed "Round Reset" placeholder from Game Settings tab (functionality in Rounds tab)
Fixed
- Monster Editing: Fixed monster edit functionality
- Removed duplicate placeholder function that was overriding proper implementation
- Monster edit form now works correctly with full CRUD functionality
- Documentation Buttons: Fixed documentation button event listeners
- Event listeners now properly attached when Documentation tab is accessed
- Prevents duplicate listener attachment
0.6.2November 24, 2025
Added
- Magic Item Descriptions: Added description field for magic items
- Description/quote field in item creation/editing form (shown when "Has Magic" is checked)
- Descriptions displayed in item panel when viewing items in inventory
- Styled with italic gold text for visual appeal
- Blacksmith Shop System: Complete blacksmith shop management
- Items can be marked as available at blacksmith (separate from loot drops)
- Admin panel shows blacksmith availability status for each item
- Toggle button to add/remove items from blacksmith shop
- Blacksmith shop loads items from database (replaces hardcoded items)
- Items sold at 2x base sell price
- Blacksmith items are excluded from loot drops (only shop-purchasable)
- Purchased items properly added to player inventory with all stats
Changed
- Loot Generation: Updated to use item_definitions table when available
- Loot items now come from item_definitions (excluding blacksmith items)
- Falls back to generated items if no definitions available
- Respects item categories (common, legacy, epic) for rarity
- Export/Import: Updated to include new item fields
- Export now includes
description and available_at_blacksmith fields
- Import properly handles new fields when restoring settings
0.6.1November 23, 2025
Fixed
- CSRF Token Validation: Fixed "Invalid CSRF token" errors on logout and all POST endpoints
- Added
session_start() to all API endpoints (api/auth.php, api/player.php, api/game.php, api/quest.php) before CSRF validation
- Improved CSRF token handling to support empty request bodies (logout, equip-item, etc.)
- CSRF tokens can now be sent via
X-CSRF-Token header or csrf_token in JSON body
- Fixed
php://input consumption issue - all endpoints now read input once and reuse it
- Logout Functionality: Logout now works correctly with CSRF protection
- Item Equipping: Fixed equip-item endpoint CSRF validation
- All POST Endpoints: All POST endpoints now properly validate CSRF tokens with session support
Technical Details
- Session must be started before CSRF token validation can work
- All API endpoints now start session early in the request lifecycle
- Improved error handling for empty request bodies in CSRF validation
0.6.0November 23, 2025
Added
- API Security System: Comprehensive API security with configurable settings
- Origin Validation: Only requests from same origin or whitelisted origins are allowed
- CORS Protection: Configurable Cross-Origin Resource Sharing settings
- CSRF Protection: All state-changing operations require CSRF tokens
- API Security Settings: Admin-configurable API security settings (CORS, CSRF, rate limiting, logging)
- API Token System: Generate, manage, and revoke API tokens for external system access
- Token Authentication: Support for Bearer tokens, X-API-Token headers, and query parameters
- Token Management UI: Admin panel interface for generating and managing API tokens
- Swagger/OpenAPI Documentation: Interactive API documentation
- Swagger UI Integration: Full Swagger UI for exploring and testing API endpoints
- OpenAPI 3.0 Specification: Complete API documentation with all endpoints, parameters, and schemas
- Admin-Only Access: Swagger documentation is only accessible to administrators
- Interactive Testing: Test API endpoints directly from the Swagger interface
- Welcome Message Dialog: Configurable welcome message displayed on login
- Never Show Again Option: Players can dismiss the welcome message permanently
- localStorage Persistence: Dismissal preference saved in browser storage
- Admin Configuration: Welcome message can be configured in admin panel
Changed
- API Security: All POST endpoints now properly handle CSRF tokens and input parsing
- Input Handling: Fixed
php://input consumption issue - all POST endpoints now read input once and reuse it
- CSRF Token Management: Improved CSRF token fetching to avoid circular dependencies
- Admin Panel: Added API Security Settings and API Tokens sections to Security tab
- API Endpoints: All POST endpoints now correctly validate CSRF tokens before processing requests
- Password Strength Check: Exempted from CSRF requirement (read-only operation)
- Registration/Login: Exempted from CSRF requirement (public endpoints)
Fixed
- CSRF Token Errors: Fixed "Invalid CSRF token" errors on password strength checks during registration
- Input Consumption: Fixed issue where
php://input was read twice, causing empty request bodies
- Player Settings: Fixed save player settings functionality
- API Token Generation: Fixed CSRF token issues preventing token generation
- All POST Endpoints: Fixed CSRF validation in player.php, game.php, quest.php, and admin.php
Technical Details
- New database table:
api_tokens for storing API token hashes
- New API security settings stored in
game_settings table
api_security.inc.php for API security functions
swagger.php endpoint for serving OpenAPI specification
swagger.html for Swagger UI interface
- Database migrations ensure API security settings work on fresh installs
- All POST endpoints now use single
php://input read pattern
0.5.02025-11-23
Added
- Comprehensive Security System: Full-featured security implementation for login and registration
- Brute Force Protection: Account and IP-based lockouts after failed login attempts
- Rate Limiting: Configurable rate limits for login and registration attempts per IP
- Password Policy System: Configurable password requirements (length, uppercase, lowercase, numbers, special characters)
- Password Strength Indicator: Real-time password strength checker with visual progress bar (weak/fair/good/strong)
- Password Requirements Display: Visual checklist showing which password requirements are met
- Account Lockout System: Automatic account lockouts with configurable duration
- Login Attempt Tracking: Database tracking of all login attempts (successful and failed)
- Security Settings Admin Panel: New Security tab in admin panel for configuring all security policies
- Password Match Validation: Real-time password confirmation matching for registration and password changes
- Anti-DDoS Protection: Rate limiting and IP-based lockouts to prevent distributed attacks
Changed
- Password Validation: Registration and password changes now enforce configurable password policies
- Login Security: All login attempts are now tracked and rate-limited
- Admin Panel: Added new "Security" tab for managing security settings
- Registration Form: Enhanced with password strength indicator and requirements checklist
- Password Change Form: Enhanced with password strength indicator in player settings
Technical Details
- New database tables:
login_attempts, account_lockouts
- New security settings stored in
game_settings table
SecurityAuth class for all security operations
- Password strength calculation algorithm (0-100 score)
- Automatic cleanup of old login attempts and expired lockouts
- IP address detection with proxy support
- Database migrations ensure compatibility with fresh installations
0.4.12025-11-23
Added
- Bank Gold Management: Admin panel now displays and allows editing of player bank gold balances
- Admin Status Display: Player list now shows admin status with crown icon (👑) for admin players
- Level-Based Experience: Admin panel now only allows level changes; experience is automatically calculated from level to prevent sync issues
- Experience Progress Display: Edit player form shows calculated experience progress (current/total needed) for reference
Changed
- Player Edit Form: Experience field is now read-only and calculated from level; shows progress display for reference
- Player List: Added "Bank" column to show bank gold balances alongside pocket gold
- Gold Field Labels: Clarified "Gold" as "Gold (Pocket)" and added separate "Bank Gold" field in edit form
- Level/Experience Sync: When level is updated, experience is automatically set to minimum required for that level
- Player Details Endpoint: Now uses
getPlayerStats() to return calculated stats (exp_progress, exp_needed) matching sidebar display
Fixed
- Experience Display Mismatch: Fixed issue where admin panel showed different experience values than sidebar
- Negative Experience Progress: Fixed negative experience values by ensuring level always matches experience
- Player Stats Refresh: Sidebar now properly refreshes after admin edits player data
- SQL Parameter Error: Fixed duplicate parameter issue in player-edit endpoint
- Edit Modal Z-Index: Fixed edit player modal appearing behind admin modal
Technical Details
- Added
bank_gold column to players table in schema.sql for fresh installs
- Added
bank_gold migration in config/database.php for existing databases
- Updated admin API to include
bank_gold in allowed fields and player list queries
- Experience calculation now uses
totalExpForLevel() when level is updated
0.4.02025-11-23
Added
- Comprehensive Admin Panel: Full-featured admin management system accessible via admin button in header
- Player Management: View all players with complete stats, inventory count, and block status
- Player Actions: Edit player information, delete players, block/unblock players
- Player Details: View detailed player information including inventory, equipped items, and quests
- Game Settings Management: Configure welcome message, OAuth settings, and round reset
- Welcome Message System: Customizable welcome message shown to players on login (can be enabled/disabled)
- Items Management: View, create, edit, and delete item definitions
- Monsters Management: View, create, edit, and delete monster definitions
- Monster Definitions Database: Monsters now stored in database for admin management
- Item Definitions Database: Items now stored in database with full properties (attack, defense, magic, etc.)
- Game Settings Database: Centralized settings storage for welcome messages and OAuth configuration
- Player Blocking System: Track and manage blocked players with reason logging
- Admin API Endpoints: Complete REST API for all admin operations
- Tabbed Admin Interface: Organized admin panel with Players, Settings, Items, and Monsters tabs
- Toast Notifications: Visual feedback for all admin actions
- Database Migrations: Automatic migration system for new admin tables
Changed
- Admin button now visible in header for admin users
- Monster generation can now use database-defined monsters (fallback to hardcoded if none exist)
- Item generation can now use database-defined items (fallback to procedural generation if none exist)
- Admin UI uses modern table layouts with action buttons
- Settings management centralized in admin panel
Technical Details
- New database tables:
monster_definitions, game_settings, player_blocks
- Expanded
item_definitions table with full item properties
- Admin API endpoints:
/api/admin.php?action=* for all admin operations
- Admin authentication enforced on all admin endpoints
- Database migrations ensure compatibility with fresh installations
0.3.22025-11-23
Added
- Magic Stat System: Magic stat display in sidebar showing total magic power from equipped items
- Magic Types: Items can have attack magic or defense magic types
- Attack Magic Spells: Seven different attack spells (Fireball, Ice Bolts, Whirlwind, Stone Stomp, Lightning Bolt, Water Spray, Acid Spray) randomly assigned to magic weapons
- Attack Magic Combat: Attack magic items can trigger once per battle for a guaranteed critical hit with spell-specific messages
- Defense Magic: Defense magic items boost player defense stats when equipped
- Bag Full Indicator: Bag icon in header highlights in red with pulsing animation when inventory is full
- Bag Full Tooltip: Hover tooltip on bag icon displays "Your bag is full!" when inventory is at capacity
- Equipped Item Badges: Visual checkmark badges on equipped items in inventory grid
- Fairy Item Effects: Rainbow glitter animation effect for fairy items in inventory
- Equipment Tab Enhancements: Category badges (C/L/E) and category-based border colors in equipment tab
- Monster Stats Display: Full monster stats (STR, DEX, INT, CHR, Attack, Defense) now properly displayed in combat
Changed
- Magic power is now calculated and displayed separately from attack/defense
- Attack magic weapons randomly receive one of seven spell types when generated
- Equipment tab now uses category colors (grey/yellow/purple) instead of always green
- Monster stats now properly scale with level and are displayed in combat
- Bag status is automatically checked and updated after inventory operations
Fixed
- Magic stat not appearing in sidebar (now displays total magic power)
- Attack and Defense showing "-" instead of "0" when no items equipped
- Monster stats showing default values (10/10/10/10, 0/0) regardless of level
- Equipment tab not showing category badges
- Equipment tab always showing green borders instead of category colors
- Equipped items not showing checkmark badges in inventory
Technical Details
- Database schema updated with
magic_type column for attack/defense magic classification
magic_spell data stored in item stats JSON for spell type tracking
- Bag full detection uses
updateBagStatus() function that checks inventory capacity
- Monster stats properly passed through combat return values
0.3.12025-11-23
Added
- Combat Stats Display: Side-by-side comparison of player and monster stats during combat showing STR, DEX, INT, CHR, Attack, Defense, and Health
- Monster Equipment System: Higher level monsters (level 3+) can now have weapons and armor that affect their combat stats
- Monster Random Stats: Monsters now have randomized STR, DEX, INT, and CHR stats with level-based scaling and variation
- Enhanced Monster Combat: Monsters now use their stats (STR, DEX, INT) and equipment in combat calculations, with INT affecting critical hit chance
- Duplicate Request Prevention: Frontend now prevents duplicate sell requests when rapidly clicking sell button
- Improved Error Handling: Better error handling for JSON decoding of item stats and equipped items retrieval
Changed
- Monster combat damage now incorporates monster STR, DEX, and equipped weapon attack values
- Monster critical hit chance now scales with monster INT (base 5%, +0.3% per INT above 10, capped at 30%)
- Player attacks now account for monster's equipped armor defense
- Higher level monsters are more likely to have equipment (30% weapon chance at level 3, scaling up)
- Armor and chestplate items now use proper Game Icons (breastplate and chest-armor icons)
- Equipped items are automatically unequipped before selling
Fixed
- Armor and chestplate items showing default/incorrect icons (now use proper Game Icons)
- Selling armor items showing both success and error messages
getPlayerStats() failing when decoding malformed item stats JSON
- Race conditions when selling items due to duplicate requests
- Error handling for equipped items with invalid stats data
0.3.02025-11-23
Added
- Inventory System: Complete inventory management with expandable bag slots (default 10, expandable via store)
- Item Categories: Three-tier rarity system (Common, Legacy, Epic) affecting item stats and sell prices
- Magic Items: Items with magical properties, living descriptions, and visual effects (blue-to-purple gradient glow)
- Equipment System: Equip weapons and armor with automatic slot management (one item per slot: weapon, helmet, chestplate, gauntlets, boots, shield)
- Fairy Items: Consumable items that fully heal the player and grant variable XP based on category (Common: 5-50, Legacy: 50-200, Epic: 200-500)
- Item Actions: Sell items for gold, drop items, use fairy items, equip/unequip items
- Loot System: Random loot drops after combat victories (60% chance) with category-based rarity
- Gold Loss on Defeat: Players lose 10-30% of on-hand gold when defeated in combat
- Player Settings: Comprehensive settings modal with tabs for Profile, Equipment, and Security
- Avatar Selection: Choose from 21 Game Icons head/face avatars with gradient color effects
- Player Bio: Add a personal bio (max 500 characters) visible in player settings
- Password Management: Change password for local accounts (hidden for OAuth users)
- Equipment Display: View all equipped items in settings with unequip functionality
- Attack/Defense Stats: Sidebar displays total attack and defense from equipped items
- Combat Integration: Equipped items' attack and defense values are used in combat calculations
- Health/XP Bars: Visual progress bars for health and experience in sidebar
- Location Display: Current location shown in header next to logout button
- Bag Icon: Quick access to inventory via bag icon in header
- Game Icons Integration: Local Game Icons SVG files for items, monsters, and avatars
- Tabbed Settings Interface: Organized settings modal with Profile, Equipment, and Security tabs
- OAuth Conditional Display: OAuth login options only show if OAuth is configured
- Security Tab: Password change tab only visible for local (non-OAuth) accounts
- Item Detail Panel: Slide-out panel showing detailed item information when clicking inventory items
- Visual Item Effects: Magic items display animated gradient borders and glowing effects
- Combat Speed Optimization: Reduced animation delays for faster combat experience
- Error Handling: Comprehensive error handling and logging for item operations
- Transaction Safety: Database transactions ensure atomicity for item operations (sell, use, equip)
Changed
- Combat now incorporates equipped item stats (attack/defense) along with player attributes (STR, DEX, INT, CHR)
- Player avatar displayed in sidebar next to username (removed "Name:" label and default profile icon)
- Inventory display changed from list to grid layout with hover tooltips
- Item panel now hidden by default, only shows when clicking an item
- Settings modal reorganized into tabbed interface to reduce scrolling
- OAuth login options dynamically shown/hidden based on server configuration
- Fairy item XP gain now varies by item category instead of fixed amount
- Item sell price calculation includes fallback for items missing sell_price
- Improved error messages and logging throughout item system
Fixed
- Transaction conflicts when using fairy items (nested transaction errors)
- Item sell operations failing due to missing error handling
- Avatar not updating in sidebar after selection
- Combat display showing incorrect player icon (now uses selected avatar)
- Inventory modal width issues and item details visible without clicking
- Settings tabs not working (missing function implementation)
- Security tab showing for OAuth users (now conditionally hidden)
- OAuth login options showing when not configured (now conditionally hidden)
- Item panel buttons appearing disabled (brightened styling)
- Fairy item use button not appearing for fairy-type items
- Missing
equipped column migration for existing databases
- Database migration system now includes all required columns for fresh installs
Technical Details
- Database schema updated with
bag_size, avatar, bio columns in players table
- Database schema updated with
category, sell_price, item_subtype, has_magic, magic_power, equipped columns in player_items table
- Migration system ensures all new columns are added to existing databases
- All database changes are included in
schema.sql for fresh installations
- Local Game Icons stored in
public/game-icons.net.svg/ directory
- Item operations use database transactions for data integrity
- Base path detection improved for various deployment scenarios
0.2.02025-11-23
Added
- Automatic setup detection and redirect to setup page on fresh installs
- Database detection in setup: Shows existing database file with size and player count
- Manual database deletion option in setup UI with confirmation dialog
- Comprehensive system checks in setup: PHP version, extensions, mod_rewrite, session directory, .htaccess
- Web server user detection (www-data, apache, nginx, etc.)
- Automatic permission fixing: Sets 0755 for directories, 0644 for files
- Automatic ownership fixing: Attempts to set correct ownership to web server user
- Setup status API endpoint (
/api/game.php?action=setup-status) for frontend setup detection
- Skill point allocation system: Players earn skill points on level-up to allocate to STR, DEX, INT, CHA
- Skill editor modal for allocating skill points
- Bank system: Safe storage for gold (gold in bank is safe, gold on player can be lost)
- Bank menu with deposit and withdraw functionality
- Location-specific menus with ASCII art and numbered services
- Pill-style banners with slanted ends for location and bank names
- Victory confetti animation for combat wins
- Icons for pill buttons (trophy for victory, etc.)
Changed
- Rest action now heals 20 HP at a time instead of full health
- Rest action fails if player is already at full health (doesn't consume action)
- Setup script automatically deletes existing database file before initialization
- Setup detection now checks for
players table existence instead of requiring actual players
- Improved base path detection for root domain, subdomain, and subfolder installations
- Monster levels now randomized based on player level when exploring
- Rewards scaled based on randomized monster level
- Player stats (STR, DEX, INT, CHA) now incorporated into combat calculations
- Daily action limit no longer applies to store services (bank, blacksmith, etc.)
- Removed redundant action buttons from sidebar (moved to header)
- Removed duplicate "Quests" button from header
- Removed "Stats" button from header (accessible via sidebar)
Fixed
- Setup redirect not working on fresh installs
- Setup redirect using wrong base path in subfolder installations
- Database file being copied during deployment causing setup detection issues
- Setup completion detection requiring players to exist (now only checks for
players table)
- Rest action allowing use at full health
- Bank failing to load due to missing database column
- Service 6 (Explore Town) error when exploring
- HTML banner tags being displayed as raw text instead of rendered
- Player data loading error (missing status endpoint)
- Login failing after user account creation
- Rest action error (missing action endpoint handler)
- Permission issues: Setup now uses secure permissions (0755/0644) instead of 777
- Setup script now properly handles OAuth skip scenario
0.1.12025-11-22
Added
- HTML-based terminal overlay for modern text rendering with CSS styling
- Special formatting tags:
[PILL:], [GRADIENT:], [GLOW:], [HIGHLIGHT:] for enhanced text styling
- Gradient effect on DRAGON LORD logo (yellow, orange, red)
- Smooth fade-in animations for terminal lines
- Enhanced combat display with HTML/CSS animations and in-place updates
Changed
- Terminal output now primarily uses HTML/CSS instead of canvas for better formatting
- Improved terminal text spacing and line height to prevent overlapping
- Welcome animation now uses HTML terminal overlay for better visual effects
- Combat display uses HTML overlay with animated figures and health bars
- Terminal font size increased to 16px for better readability
Fixed
- Terminal text overlapping and running into each other
- HTML tags being escaped instead of rendered in terminal output
- Dragon animation displaying multiple times instead of animating in place
- Terminal line spacing and formatting issues
0.1.02025-11-22
Added
- Interactive web-based setup system (
setup.php) that can be run from CLI or browser
- Pre-setup system checks (PHP version, extensions, directory permissions, SQLite functionality)
- Local username/password authentication as an alternative to OAuth
- First registered user automatically becomes admin
- ANSI terminal renderer with Canvas-based rendering
- Terminal scrollback buffer (up to 1000 lines) with mouse wheel scrolling
- Visible scrollbar for terminal with click-to-jump and drag-to-scroll functionality
- Animated welcome screen with ASCII art logo
- Terminal command input system with command history (arrow keys)
- Quests modal panel with quest listing, acceptance, and progress tracking
- Player stats display in sidebar
- Action buttons (Rest, Explore) in sidebar
- Location navigation buttons
- Game commands:
help, rest, explore, move, quests, stats, clear
- Base path detection for subdirectory installations
- Setup completion marker file to prevent redirect loops
Changed
- Setup process now fully interactive and browser-runnable
- OAuth configuration made optional during setup
- Terminal rendering improved with proper character sizing and canvas scaling
- Screen buffer initialization improved with validation and error handling
- Welcome animation timing and display fixed
Fixed
- Terminal display issues (blank screen, sizing problems)
- Screen buffer initialization when dimensions weren't set
- Welcome animation renderer reference issues
- Redirect logic for subdirectory installations
- Asset path resolution for CSS and JavaScript files
- Scrollbar direction (now scrolls correctly)
- Excessive console logging from renderer
Technical Details
- ANSI renderer supports 16 colors, text scrolling, and terminal emulation
- Scrollback buffer maintains history of scrolled-off content
- Quest system integrated with modal UI for better user experience
- Database schema includes support for quests, player items, and game rounds
- Error handling improved throughout the application