- Created automated deploy-production.sh script
- Added comprehensive PRODUCTION_DEPLOY.md guide
- Includes troubleshooting and Apache configuration
- Ready for production deployment
- Created storage.js wrapper with IndexedDB support
- Automatic fallback to localStorage if IndexedDB unavailable
- Updated all username storage calls to use async API
- Better performance and more storage capacity
- Improved PWA compatibility
Benefits:
- 50MB+ storage vs 5-10MB localStorage
- Async API doesn't block main thread
- Better for future features (game history, stats, etc.)
- Add polling mechanism to wait for window.game initialization
- Disable multiplayer button until game is fully initialized
- Enable button in DOMContentLoaded after game creation
- Prevents 'Game instance not found' error on production
This fixes the critical issue where clicking Multiplayer too quickly
would fail because window.game wasn't ready yet.
- Set up all socket listeners BEFORE connection completes
- Remove nested 'connect' listener that caused race condition
- Add comprehensive logging for registration flow
- Update all listeners to use socket parameter
- Fix window.multiplayerClient reference in retry link
This fixes the 'Registering...' stuck state issue.