Commit Graph

3 Commits

Author SHA1 Message Date
Thomas Hallock c29501f666 fix: create arcade sessions on room join to enable config changes
Fixes "No active session found" error when adjusting game settings
before starting a game in arcade rooms.

**Problem:**
- Sessions were only created on START_GAME move
- SET_CONFIG moves require an active session in setup phase
- Users couldn't adjust settings until after starting game

**Solution:**
- Create session in setup phase when user joins room (if none exists)
- Initialize with room's game config from database
- Allows SET_CONFIG moves before game starts

**Changes:**
- socket-server.ts:72-100 - Auto-create session on join-arcade-session
- RoomMemoryPairsProvider.tsx:4 - Remove unused import
- nas-deployment/docker-compose.yaml:15 - Fix DB volume mount path

**Related:**
- Also fixes database persistence by correcting volume mount from
  ./data:/app/data to ./data:/app/apps/web/data

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 13:52:35 -05:00
Thomas Hallock bda5bc6c0e fix: prevent database imports from being bundled into client code
**Problem:**
- player-ownership.ts imported drizzle-orm and @/db at top level
- When RoomMemoryPairsProvider imported client-safe utilities, Webpack bundled ALL imports including database code
- This caused hydration error: "The 'original' argument must be of type Function"
- Node.js util.promisify was being called in browser context

**Solution:**
1. Created player-ownership.client.ts with ONLY client-safe utilities
   - No database imports
   - Safe to import from 'use client' components
   - Contains: buildPlayerOwnershipFromRoomData(), buildPlayerMetadata(), helper functions

2. Updated player-ownership.ts to re-export client utilities and add server-only functions
   - Re-exports everything from .client.ts
   - Adds buildPlayerOwnershipMap() (async, database-backed)
   - Safe to import from server components/API routes

3. Updated RoomMemoryPairsProvider to import from .client.ts

**Result:**
- No more hydration errors on /arcade/room
- Client bundle doesn't include database code
- Server code can still use both client and server utilities

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-10 11:40:46 -05:00
Thomas Hallock eb8ed8b22c feat: add complete NAS deployment system for apps/web
- Add Dockerfile with multi-stage build for monorepo
- Add GitHub Actions workflow for automated CI/CD
- Add NAS deployment configuration for abaci.one
- Configure Porkbun DDNS integration
- Add Watchtower for auto-updates
- Fix Next.js standalone output configuration
- Add missing dependencies for package builds

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-27 08:42:41 -05:00