- Add localFen/localFenRef in ChessBoard for optimistic piece placement,
preventing snap-back while awaiting server confirmation
- Sync localFen from server state on each chess.fen update
- Guard GAME_STATE handler in useGameRoom from overwriting a finished
roomStatus, fixing the race where GAME_ENDED (pub/sub) arrives before
GAME_STATE (direct ws.send)
- Reset confirmForfeit immediately on forfeit dispatch for instant UI feedback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Backend:
- Fix session never being attached to ws.data at upgrade time
- Add GameServer class: connection registry, per-connection room tracking,
automatic room cleanup on disconnect via ws.data.rooms
- Replace ws-handler.ts with typed event-driven architecture using mitt
- Remove redundant subscription tracking from RoomManager
- Add JOIN_RESULT with player/spectator lists replacing error-as-control-flow
- Add SESSION_REPLACED for multi-tab same-account detection
- Add FILL_ROOM command for admin solo testing (fills empty slots with host)
- Fix dual-schema routing; remove game types from WsMessageSchema
- Per-player personalized views sent directly after each action
Chess plugin:
- Allow same-player (solo) mode: skip color/turn ownership checks
- Fix forfeit and disconnect handling in solo mode (winner: null)
Frontend:
- Click-to-move with legal move dots and last-move highlight
- Auto-scroll move history, forfeit confirmation, turn-reactive board border
- JOIN_RESULT initialises player/spectator lists immediately on join
- Contextual connecting state, player slot cards in waiting room
- Copy-invite button with Copied! flash, Back to Lobby CTA on finish
- Session-replaced warning banner with Rejoin here action
- Lobby passes preferAs intent through route state
- Admin waiting room shows Start Solo Test button
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Prevent same player from joining as both white and black
- Add validation to reject duplicate players in RoomManager
- Fix spectator status not resetting when joining as player
- Use ref to track latest chess state in ChessBoard for accurate move validation
- Add role field to JOIN_ROOM message schema
- Allow admin users to join rooms and be added as players
- Update panel to pass user role when joining game rooms
- Fix chess move coordinates in tests (algebraic notation)
- Ensure admin users can make moves for both sides
Bun's ws.publish() excludes the sender, so the player making a move never
received the GAME_UPDATE with the new FEN — causing pieces to snap back.
Added ctx.send() alongside ctx.publish() for GAME_UPDATE and GAME_ENDED.
Also redesigned the panel for mobile: hamburger drawer sidebar, responsive
chess board sizing via ResizeObserver, stacked layouts on small screens,
and touch-friendly modals/controls across lobby and game pages.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Wrap chess.js move validation in try-catch for invalid moves. Fix admin
self-play by detecting when both players share the same ID and allowing
either color's pieces to be dragged on the current turn.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Swap the custom move validation and Unicode piece grid for chess.js
(full rules engine with check/checkmate/castling/en passant/promotion)
and react-chessboard (drag-and-drop SVG board). Board styled to match
the purple dark theme and auto-orients to the player's color.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Disconnecting and reconnecting the WebSocket on every route change caused
a race condition: the old socket's async onclose handler would null out
globalWs after the new socket was created, causing JOIN_ROOM messages to
be silently dropped. The WebSocket is a global singleton — keep it alive
and let the built-in reconnection logic handle actual disconnects.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace useState-based page switching with react-router-dom Routes.
Layout now renders admin or player nav items based on user.role.
Add stub pages for PlayerDashboard, GameLobby, and GameRoom.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Split ItemStudio (1863->388), Settings (1445->355), and Users
(1062->164) into focused sub-components under pages/components/.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolve ITEM-type pool entry names from the API when loading an
existing lootbox for editing, so the ItemSearchPicker displays
the selected item instead of showing an empty default.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements comprehensive user management interface for admin panel:
- Search and filter users by username, class, and active status
- Sort by username, level, balance, or XP with pagination
- View and edit user details (balance, XP, level, class, daily streak, active status)
- Manage user inventories (add/remove items with quantities)
- Debounced search input (300ms delay)
- Responsive design (mobile full-screen, desktop slide-in panel)
- Draft state management with unsaved changes tracking
- Keyboard shortcuts (Escape to close detail panel)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements the full admin settings page covering all game settings
(leveling, economy, inventory, lootdrops, trivia, moderation, commands)
and guild settings (roles, channels, welcome message, moderation,
feature overrides). Includes role/channel pickers, trivia category
multi-select, and a feature override flag editor.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace placeholder panel with a full dashboard landing page showing
bot stats, leaderboards, and recent events from /api/stats. Add
sidebar navigation with placeholder pages for Users, Items, Classes,
Quests, Lootdrops, Moderation, Transactions, and Settings. Update
theme to match Aurora design guidelines.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds a React admin panel (panel/) with Discord OAuth2 login,
live dashboard via WebSocket, and settings/management pages.
Includes Docker build support, Vite proxy config for dev,
game_settings migration, and open-redirect protection on auth callback.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>