80 Commits

Author SHA1 Message Date
9f3a914d0f UI: Add git commit hash and age to status bar 2025-12-24 00:03:24 +11:00
e4848a6e56 Fix: Enable session score tracking in multiplayer mode 2025-12-23 22:46:03 +11:00
233db999b6 UI: Update surrender prompt with premium visual design 2025-12-23 22:35:27 +11:00
8ef896088b Docs: Update screenshots with production captures featuring new UI elements 2025-12-23 22:30:40 +11:00
5dbd75f093 Docs: Complete overhaul of README with production URL and screenshots 2025-12-23 22:26:20 +11:00
d48885c1db UI: Significantly enhance last move highlight with pulse and glow 2025-12-23 22:18:17 +11:00
74de333006 Feat: Add temporary 2x brightness highlight for last move 2025-12-23 22:02:04 +11:00
d1bcf36887 Feat: Add 5-second delay and winning move highlight for game over 2025-12-23 20:34:50 +11:00
f35b25b903 Feat: Add brightness sliders for grid lines and intersection dots 2025-12-23 19:47:01 +11:00
c2f8e8687b UI: Refine grid line visibility (0.3) and dots (0.4) 2025-12-23 19:31:10 +11:00
78f16c68b2 UI: Increase grid line visibility for better accessibility on dark screens 2025-12-23 19:11:23 +11:00
68c9a67dbd Docs: Update README with Proxmox deployment guide and add deployment scripts 2025-12-23 19:08:52 +11:00
eceb3aafc5 Fix: Dynamically detect Node.js path for systemd service 2025-12-23 18:55:16 +11:00
b03e287590 Add TurnKey Linux provisioning script 2025-12-23 11:35:42 +11:00
5646e42e47 docs: update README with new screenshots for Ghost Piece, Board Glow, and Surrender Modal 2025-12-22 20:13:17 +11:00
6e575ea1f7 Docs: Update README with image placeholders for Surrender/Rematch features 2025-12-22 19:51:46 +11:00
c03cd62dad Docs: Major README update with Surrender, Rematch, and Auto-Start details 2025-12-22 19:48:16 +11:00
632dedcf57 Docs: Cleanup unused files and update README/DEPLOYMENT guides with auto-start instructions 2025-12-22 19:44:24 +11:00
bdd36a92c7 Add DB schema update script for production 2025-12-22 19:38:54 +11:00
e398aa6885 Add systemd service and auto-start setup script 2025-12-22 19:35:05 +11:00
d0f72f01c8 Fix: syntax error in registerPlayer 2025-12-22 19:26:02 +11:00
69dc70ee06 Reliability: Fix disconnect logic, add game restoration, and prevent race conditions
- gameManager.js:
  - Added disconnectTimeouts Map to track/clear pending timeouts correctly
  - Updated handleDisconnect to not abandon game if player reconnects
  - Updated registerPlayer to clear timeouts and restore active game state
  - Added race condition checks to handleSurrender and acceptRematch

- multiplayer.js:
  - Updated handleRegistration to resume active game if data provided
  - Updated startMultiplayerGame to restore board state from server data
2025-12-22 19:25:15 +11:00
f879050b0c Fix: Add missing socket listeners and fix database calls for surrender/rematch
- server.js: Added missing listeners for surrender, send_rematch, accept_rematch, decline_rematch events (previously missing, causing features to simple do nothing)
- gameManager.js: Removed invalid calls to non-existent incrementWins/incrementLosses methods (abandonGame already handles this internally)
2025-12-22 19:19:30 +11:00
04860c3e39 Fix: Re-add surrender and rematch methods that were accidentally removed
- Re-added handleSurrender, sendRematch, acceptRematch, declineRematch methods
- Fixed to use activeGames instead of games Map
- Fixed to use correct property names (player1Id not player1_id)
- This fixes the issue where surrender would hang indefinitely
2025-12-22 19:15:22 +11:00
62b28beed3 Fix: Add opponentId to game_started events for surrender/rematch functionality
- Added opponentId field to both game_started socket emissions in acceptChallenge
- This allows client to properly track opponent for rematch requests
- Fixes surrender button not showing issue (client needs opponentId to enable features)
2025-12-22 18:09:55 +11:00
0933644710 Fix gameManager.js syntax errors and add rematches Map to constructor 2025-12-22 17:46:46 +11:00
a9d1327d77 Add surrender and rematch functionality - Part 2 (Complete)
Client-side (multiplayer.js):
- Add socket listeners for rematch events
- Update startMultiplayerGame to show surrender button and track opponent ID
- Update handleGameEnded to show game-over modal with stats
- Add handleRematchRequest method
- Add global helper functions for rematch acceptance/decline

Server-side (gameManager.js):
- Add rematches Map to track rematch requests
- Add handleSurrender method
- Add sendRematch, acceptRematch, declineRematch methods
- Handle surrender stats updates and game cleanup

Server (server.js):
- Add socket listeners for: surrender, send_rematch, accept_rematch, decline_rematch

Features now fully functional:
- Players can surrender during active games
- Players can request rematches after games end
- Opponents receive rematch notifications
- Game-over modal shows stats and rematch option
2025-12-22 17:42:14 +11:00
622a7e4094 Add surrender and rematch UI - Part 1
- Add surrender button to game controls
- Add game-over modal with stats and rematch option
- Add surrender confirmation modal
- Add all CSS styling for new modals and buttons
- Add surrender-rematch.js with global helper functions
- Update multiplayer.js constructor to track opponent for rematch
2025-12-22 17:39:43 +11:00
6c4aedec1d Add automatic deployment system to fix database disconnection after git pull
- Create post-merge git hook for auto service restart
- Add setup-auto-deploy.sh for easy installation
- Hook detects PM2, systemd, or manual process management
- Automatically runs npm install if package.json changes
- Eliminates need to manually run deploy.sh after updates
2025-12-22 16:09:19 +11:00
a1d51d6f26 Add production deployment instructions for PostgreSQL migration 2025-12-22 13:48:55 +11:00
0a8ea2b603 Migrate from Supabase to direct PostgreSQL connection
- Replace @supabase/supabase-js with native pg library
- Rewrite database.js to use PostgreSQL connection pool
- Update server.js with PostgreSQL connection testing
- Create postgres-schema.sql with complete database schema
- Add apply-schema.js script for easy schema deployment
- Update all documentation (README.md, DEPLOYMENT.md, deploy.sh)
- Remove Supabase-specific files and references
- Update db.config.example.js with PostgreSQL format
2025-12-22 12:54:36 +11:00
90cf68327a Fix UI overlap by truncating long status messages 2025-12-21 20:51:19 +11:00
79ffb771a8 Enhance UI with ghost piece and board glow effects 2025-12-21 20:41:19 +11:00
acf32d0418 Redesign status bar to split Turn Info (left) and Player Identity (right) 2025-12-21 20:15:46 +11:00
91535dc8fc Merge status and turn indicator into single UI bar 2025-12-21 20:08:33 +11:00
3f9ca7e2f4 Merge status message into top controls panel for better UI 2025-12-21 18:19:46 +11:00
481de45276 Merge turn indicator with player indicator at top
- Added ID to turn label for easier updates
- Updated multiplayer.js to use turnLabel ID
- Reset turn label when switching modes or resetting game
- Improved UX by keeping player/turn info together
2025-12-21 17:52:12 +11:00
5a3315ed9d Clean up deployment scripts and documentation
- Removed all unused/deprecated deployment scripts
- Created single unified deploy.sh script
- Added comprehensive DEPLOYMENT.md guide
- Updated README.md for Supabase migration
- Script prompts for project directory or uses current
- Auto-detects web server (Nginx/Apache/CloudSticks)
- Fully automated deployment process
2025-12-21 17:44:32 +11:00
a869cff76d Add script to fix existing CloudSticks vhost
- Modifies app-connect5.conf instead of creating new file
- Adds proxy rules to existing SSL-enabled vhost
- Removes duplicate connect5-proxy.conf
- Uses correct nginx-cs service name
2025-12-21 17:28:47 +11:00
7f36f039d9 Add script to move proxy config to vhosts.d
- CloudSticks uses /etc/nginx-cs/vhosts.d/ not conf.d
- Moves existing config to correct location
- Restarts Nginx
- Tests endpoints
2025-12-21 17:17:39 +11:00
66fa37b68c Add nginx config diagnostic script 2025-12-21 17:15:00 +11:00
c3d4c9cb4b Fix CloudSticks setup to handle missing nginx command
- Auto-detects nginx binary location
- Falls back to systemctl/service commands
- Better error handling
- More detailed status reporting
2025-12-21 17:07:01 +11:00
14598ac343 Add simple CloudSticks Nginx setup using conf.d
- Creates separate config file in /etc/nginx-cs/conf.d/
- Avoids modifying main nginx.conf
- Simpler and safer approach
- Complete server block with SSL and proxy rules
2025-12-21 17:05:31 +11:00
0cfa72f92a Add fully automated CloudSticks Nginx setup script
- Hardcoded /etc/nginx-cs/ path for CloudSticks
- No user input required
- Auto-detects SSL server block
- Backs up config before changes
- Tests and reloads Nginx
- Starts Node.js if needed
- Tests both local and production endpoints
2025-12-21 17:03:33 +11:00
e343f02ffe Add Nginx configuration for CloudSticks Ubuntu 24.04
- Created setup-nginx.sh automated setup script
- Added NGINX_SETUP.md with manual instructions
- Replaces Apache config (CloudSticks uses Nginx)
- Configures proxy for /api and /socket.io
- Includes WebSocket support for multiplayer
2025-12-21 16:56:58 +11:00
9194961fff Add Apache config finder script 2025-12-21 16:41:20 +11:00
bd5f35f15d Add automated Apache setup script
- Created setup-apache.sh for one-command configuration
- Auto-detects Apache config file
- Enables required modules
- Adds proxy rules
- Backs up original config
- Tests and restarts Apache
- Verifies Node.js server is running
- Tests API endpoint
2025-12-21 16:39:24 +11:00
94e9510ddd Add Apache proxy configuration for production
- Created apache-config.conf with proxy rules
- Added APACHE_FIX.md with step-by-step instructions
- Fixes 404 errors on /api and /socket.io endpoints
- Enables WebSocket support for multiplayer
2025-12-21 16:13:02 +11:00
d7e9ab3529 Add CloudSticks deployment script without PM2 dependency
- Created deploy-cloudsticks.sh for CloudSticks environment
- Works with systemd, PM2, or direct node execution
- Added CLOUDSTICKS_DEPLOY.md with specific instructions
- Handles case where PM2 is not installed
2025-12-21 16:04:24 +11:00
3f82ae04ef Remove git pull from deployment script for CloudSticks
- CloudSticks handles auto-deployment from GitHub
- Removed redundant git pull step
- Updated step numbers accordingly
2025-12-21 16:00:18 +11:00