Skip to content

fix: wire multiplayer contributions and harden cosmic war system - #41

Merged
Sparksx merged 3 commits into
mainfrom
claude/review-multiplayer-status-Z5BX0
Feb 21, 2026
Merged

fix: wire multiplayer contributions and harden cosmic war system#41
Sparksx merged 3 commits into
mainfrom
claude/review-multiplayer-status-Z5BX0

Conversation

@Sparksx

@Sparksx Sparksx commented Feb 21, 2026

Copy link
Copy Markdown
Owner
  • CRITICAL: Connect reportLumens() to all lumen-earning paths (click,
    passive, rub, offline) so player contributions actually reach the
    cosmic war server
  • Deduplicate formatShort() by reusing formatNumber from utils.js
  • Persist mpPrestigeBonus to localStorage for offline play
  • Add disconnect visual indicator (red blinking pip) on balance circle
  • Add offline contribution queueing via localStorage backup
  • Add streak loss toast notification when streak resets
  • Add server acknowledgment for contribution rate changes
  • Add CSS for streak toast and disconnect state

https://claude.ai/code/session_01WLAo9YUAXfLCe65rcZhFmL

- CRITICAL: Connect reportLumens() to all lumen-earning paths (click,
  passive, rub, offline) so player contributions actually reach the
  cosmic war server
- Deduplicate formatShort() by reusing formatNumber from utils.js
- Persist mpPrestigeBonus to localStorage for offline play
- Add disconnect visual indicator (red blinking pip) on balance circle
- Add offline contribution queueing via localStorage backup
- Add streak loss toast notification when streak resets
- Add server acknowledgment for contribution rate changes
- Add CSS for streak toast and disconnect state

https://claude.ai/code/session_01WLAo9YUAXfLCe65rcZhFmL
- Season-end overlay now pauses passive income (shared.seasonEndActive)
- Leaderboard fetch retries up to 2 times with 2s delay on failure
- Fix streak date comparison: normalize pg DATE values to strings,
  use explicit UTC timestamps to avoid DST/timezone drift
- Extract grade qualification threshold to named constant
  (REWARD_MIN_GRADE_INDEX) instead of hardcoded grade name list
- Show player grade badge below balance indicator during gameplay
- Display accumulated MP prestige bonus in overlay player section
- Remove unused isOff/gameMode from season-end.js (lint cleanup)

https://claude.ai/code/session_01WLAo9YUAXfLCe65rcZhFmL
…, UI

- Add UNIQUE constraint on cosmic_war.season + ON CONFLICT to prevent
  duplicate season creation from concurrent checks (#3)
- Change recordContribution to upsert (ON CONFLICT DO UPDATE) to aggregate
  contributions per user+season+side instead of inserting individual rows (#4)
- Pass season number from caller to recordContribution, removing redundant
  getCurrentSeason query (#5)
- Add server-side anti-cheat: cap contributions at 5B per report, rate-limit
  to 8s minimum between reports, reject non-finite amounts (#6)
- Add multiplayer unit tests for reportLumens, getContributionAmount, offline
  queue, and mp state initialization (14 tests) (#8)
- Move notifySideChange into startGame callback so it fires after game init
  instead of before the 700ms animation completes (#9)
- Add login UI (Google/Discord buttons) in overlay for unauthenticated
  players with mode-off variant styling (#10)

https://claude.ai/code/session_01WLAo9YUAXfLCe65rcZhFmL
@Sparksx
Sparksx merged commit a115869 into main Feb 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants