Commit Graph
70 Commits
Author SHA1 Message Date
jwinterm 64e2b45f89 fix: Duplicate address restored message 2026-01-14 08:42:16 -05:00
jwinterm 758d67e72e fix: table lookup and move some messages to debug mode 2026-01-14 08:17:47 -05:00
jwinterm 8fb5c58f9a Fix: History payments 2026-01-13 19:13:11 -05:00
jwinterm 38a7e58e96 fix: payment flow 2026-01-13 18:49:59 -05:00
jwinterm 37323c8683 fix: monster animation p3 2026-01-13 18:37:40 -05:00
jwinterm 12bc3d73d0 fix: monster animation p2 2026-01-13 18:09:04 -05:00
jwinterm 7bd32a929e fix: monster animation in awaiting payment 2026-01-13 18:04:32 -05:00
jwinterm 79cbc4b9e6 fix: Open SHOP modal on START GAME if payout address already set and no credits available 2026-01-13 17:58:14 -05:00
jwinterm e8e0405485 fix: START GAME shows shop modal instead of error when payment required
When both payment modes are enabled (mixed mode) and user has no credits
or confirmed payment, the 'choose_payment' action was falling through to
the error case. Now 'choose_payment' triggers the payment options modal
just like 'make_payment' and 'purchase_credits' do.
2026-01-13 17:46:59 -05:00
jwinterm 0c2d44d429 fix: Animation rendering issues - remove black tile backgrounds
- Replace asterisk (*) sparkles with floor tiles + bright golden color
- Remove skull emoji (☠) and death particles (% *) - use red flash effect
- Fix monster shadows causing black boxes - use red floor glow instead
- Replace 'ESCAPED!' emoji text with character-by-character transparent rendering
- Use GameTiles.getPlayerTile() instead of hardcoded '@'
- Use GameTiles.getMonsterTile() instead of hardcoded '~'

All tiles now render with proper transparency on floor tile base.
2026-01-13 17:32:46 -05:00
jwinterm afe2ac991a feat: Treasure hunt animation for 'Awaiting payment' state
New dedicated animation while waiting for payment:
- Player runs toward BIG pulsating golden treasure
- Player always grabs the treasure (with dramatic pickup moment)
- Monster pack (4-6 monsters) spawns from multiple directions
- 60% chance: player escapes with treasure to the exit
- 40% chance: player gets devoured by monster pack (skull/death effect)

Animation features:
- Massive golden aura around treasure with sparkle ring
- Player glows gold when carrying treasure
- Death particles expand outward on devour
- Monsters converge from edges (left, right, top, bottom)

Existing 'Awaiting next block' animation preserved unchanged.
2026-01-13 17:15:04 -05:00
jwinterm 404f5692d8 feat: Game reconnection/resume support
- Created SuspendedGameManager to preserve game state when users disconnect
- Games are keyed by DB userId (persistent) instead of ephemeral socketId
- handleDisconnect now suspends games for 5 minutes instead of deleting
- handleConnection restores suspended games on reconnect with session token
- Payment monitoring is restored for pending payments on reconnect
- Added hasActiveMonitoring() method to PaymentHandlers
- Queue entries preserved for users with active sessions/payments
- Updated TODO.md with reconnection feature documentation

Users in dungeon or awaiting payment can now close/refresh browser and
seamlessly resume within 5 minutes when reconnecting.
2026-01-13 17:06:35 -05:00
jwinterm ce58a33347 Fix payment bugs, add comprehensive tests, remove dead code
Payment Fixes:
- Prevent credits going negative with WHERE credits >= $1 check
- completeGame now uses recorded payment_mode from game record instead of global gameMode
- Add duplicate payout prevention by checking for existing payouts before processing

Dead Code Cleanup:
- Remove unused MoneroPayService (WalletRPCService is the actual service)
- Remove legacy MoneroPay references from comments

Tests:
- Add 50 comprehensive payment/payout tests (payment_payout_comprehensive.test.js)
- Expand WalletRPCService tests (4 -> 31 tests)
- Total: 106 tests passing across 10 test suites

Documentation:
- Update TODO.md with recent fixes and correct test counts
- Update migration comments to reflect actual wallet service used
2026-01-13 16:45:11 -05:00
jwinterm 9330b3b943 Fix direct payment game start, reduce prod logging, QR improvements
- Fix game start failure in direct payment mode when payment confirms
  before mempool detection (add player to queue if not already there)
- Fix debug logging in production: correct indentation in debugRegisteredUsers,
  swap console_logging config (false in prod, true in debug)
- Add close button to QR code container
- Auto-hide QR on payment detected, confirmed, and game start
2026-01-13 16:04:50 -05:00
jwinterm a91aed84a5 fix single game payment flow and tests 2026-01-08 15:57:47 -05:00
jwinterm 251ace4635 Fix: make reconnect more robust and make spectate window re-openable 2026-01-07 17:44:47 -05:00
jwinterm f18fdf3802 fix awaiting next block before payment addy or payment 2026-01-07 17:07:10 -05:00
jwinterm 00f8057cb5 Fix credits mode payment processing and payout tracking
- Add payout database records: processPayout now inserts into payouts
  table with tx_hash, fee, status, and updates user statistics
- Fix credits deduction: QueueManager game start methods now properly
  call processGameStart() to deduct credits (was being skipped)
- Fix credits_update emission: moved from GameModeManager (no io access)
  to socketHandlers/queueManager where io is available
- Add payment recovery: users who disconnect during payment confirmation
  now get credits recovered automatically on reconnect
- Remove dead handlePaymentDetected method that referenced undefined this.db
2026-01-02 14:19:11 -05:00
jwinterm aec1c71a8c add early entry and help screens for new users 2025-12-26 10:21:25 -05:00
jwinterm f1c86a084b Fix payout calculation - update defaults and add debug logging 2025-12-24 21:00:22 -05:00
jwinterm b062a1a5fa debug payouts 2025-12-24 20:54:07 -05:00
jwinterm 371945fc21 fix user count broadcast timing 2025-12-24 20:43:57 -05:00
jwinterm 4a423576ac fix payment monitoring 2025-12-24 20:26:13 -05:00
jwinterm 25877c6ef3 fix qr generation 2025-12-24 20:10:42 -05:00
jwinterm 2c781ec043 fix payout calcs 2025-12-24 20:03:26 -05:00
jwinterm 0ff95d3142 fix payment modal p2 2025-12-24 19:51:32 -05:00
jwinterm 675caf220f fix payment modal 2025-12-24 19:31:46 -05:00
jwinterm e218fbf67b fix payment UI 2025-12-24 17:24:04 -05:00
jwinterm 3589406bac fix payment addy bug 2025-12-24 16:45:35 -05:00
jwinterm 4bf7ac2a15 docs: fix systemd paths to match /app clone location
- Update WorkingDirectory and EnvironmentFile paths
- Add instructions for creating .env before starting service
- Add systemctl enable/start commands
2025-12-24 12:38:16 -05:00
jwinterm 244a584204 feat: add payout retry tracking and HOSTED_BY footer
Payout retry system:
- Add migration 007 with retry_count, last_error, last_retry_at columns
- Payouts now retry up to PAYOUT_MAX_RETRIES times before permanent failure
- Each failure logs the attempt number and error message
- Console shows ⚠️ for retryable failures, 💀 for permanent failures
- Added SQL examples in .env.example for querying/resetting failed payouts

HOSTED_BY feature:
- Add HOSTED_BY and HOSTED_BY_NAME env vars
- /api/game-modes endpoint returns hostedBy info
- Footer displays 'Hosted by: <link>' when configured

Also improved .env.example:
- Better documentation for credit packages with reasonable defaults
- Clearer explanation of retry behavior
2025-12-24 12:30:14 -05:00
jwinterm 48cdb0c6da security: remove deprecated request package, fix npm audit vulnerabilities
- Replace deprecated 'request' with axios in rpccalls.js
- Remove 'request' from package.json (was only used in one file)
- Update node-pg-migrate to ^8.0.4 to fix glob vulnerability
- Run npm audit fix to resolve axios, form-data, js-yaml vulnerabilities
- Fix test/index.js to use correct path for rpccalls import
- Add Node.js installation and npm audit instructions to README
- Add deploy key setup instructions to README

Before: 8 vulnerabilities (1 low, 2 moderate, 3 high, 2 critical)
After: 0 vulnerabilities
2025-12-24 11:38:54 -05:00
jwinterm 7d701fe01b add backup scripts and improve docs and .env.example 2025-12-22 16:29:32 -05:00
jwinterm 7f91d83308 fix monster bug and let spectators join pending games 2025-12-22 11:25:22 -05:00
jwinterm 24f46fa35e fix chat and payments and add spectator mode 2025-12-22 10:36:46 -05:00
jwinterm fbf5bd5b17 add stagenet warning and increase diff of game and also add modes 2025-12-21 15:10:40 -05:00
jwinterm aa419689c8 fix multimode payments and get credits working again 2025-12-21 14:08:20 -05:00
jwinterm be2ba473ff Add health check endpoint and missing REST API endpoints. 2025-12-20 10:34:05 -05:00
jwinterm deca4a4685 add db commands and test payout (worked!) 2025-11-23 13:33:04 -05:00
jwinterm fa61d60bc0 Limit payment requests 2025-09-30 07:03:41 -04:00
jwinterm 4e7a773496 add address modal and try to fix payout 2025-09-29 17:40:59 -04:00
jwinterm 95711b9d26 add error handling and more tests 2025-09-29 11:20:11 -04:00
jwinterm c7cbdff021 UnifyPayments (megachange) 2025-09-29 08:49:27 -04:00
jwinterm 9a4911f410 fix audio and add new audio and fix qr and db index 2025-09-28 10:43:48 -04:00
jwinterm 2d993379bf single_game payment and audio alerts working 2025-09-28 09:23:00 -04:00
jwinterm f8241dd309 Continue working on payment logic 2025-09-27 11:21:11 -04:00
jwinterm e3915dcde2 Begin payment logic and tests 2025-09-27 08:45:22 -04:00
jwinterm 4ad063f735 Get back into it 2025-09-24 14:06:42 -04:00
jwinterm bd97d9d848 First (untested) payment and db setup 2025-06-01 14:17:29 -04:00
jwinterm f02e16272e refactor frontend and fix debug mode 2025-05-29 13:40:44 -04:00