feat: implement server-side treasure chest loot generation and secure… - #69
Open
Darrin-Lin wants to merge 2 commits into
Open
feat: implement server-side treasure chest loot generation and secure…#69Darrin-Lin wants to merge 2 commits into
Darrin-Lin wants to merge 2 commits into
Conversation
… coin claiming flow
… unnecessary whitespace
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.
This pull request introduces a secure, server-authoritative system for generating and claiming item and gold drops from monsters and treasure chests. It adds new API endpoints and client logic to request drop data from the backend, updates the drop spawning flow to use server data when available, and ensures that gold pickups are properly claimed and reported. If the server is unavailable, local fallback logic is used to generate drops as before.
Secure Drop Generation and Claiming
Adds new API endpoints and client methods:
AuthApiClientnow supportsGenerateDropsandClearDropsrequests, enabling secure drop generation and cleanup via the backend. [1] [2]Integrates server-driven drop generation:
MonsterandTreasureChestnow request drops from the server when possible, and only fall back to local generation if the server is unavailable or returns an error. [1] [2]instance_idand data, supporting both gold and item drops. [1] [2]Gold Drop Claiming and Profile Sync
CoinDropnow supports secure initialization with aninstance_idand value, and notifies the main game instance when picked up. [1] [2]Maintracks pending claimed drop IDs and provides methods for claiming drops and transmitting the player's profile after pickup.Session and Cleanup Handling
ClearDropsAPI call.Other Improvements
Main.Instancefor easier access to global state and API clients. [1] [2]These changes provide a more secure and authoritative item drop system while maintaining robust fallback behavior for offline or local play.