fix: wire multiplayer contributions and harden cosmic war system - #41
Merged
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
passive, rub, offline) so player contributions actually reach the
cosmic war server
https://claude.ai/code/session_01WLAo9YUAXfLCe65rcZhFmL