Skip to content

feat: implement secure item drop system with server-side validation - #17

Open
Darrin-Lin wants to merge 1 commit into
mainfrom
refactor/drop
Open

feat: implement secure item drop system with server-side validation#17
Darrin-Lin wants to merge 1 commit into
mainfrom
refactor/drop

Conversation

@Darrin-Lin

Copy link
Copy Markdown
Contributor

This pull request introduces a new secure system for handling pending item and gold drops for players, along with related API and validation improvements. The changes add a new model to track pending drops, update serializers and endpoints to support secure claims, and enhance validation and testing to prevent exploits.

Secure pending drops system:

  • Added a new PlayerPendingDrop model to record pending item or gold drops for players, including ownership, item data, gold amount, and timestamps. This model is managed via a new database migration and includes a string representation for easy debugging. [1] [2]

API and serializer updates:

  • Updated the PlayerProfileUpdateSerializer to accept a list of claimed_drops, enabling clients to securely claim pending drops.
  • Added a new PlayerDropView API endpoint and registered it under the /drop/ path to handle drop-related operations.

Validation and testing improvements:

  • Added tests to ensure the profile update endpoint rejects excessive gold, HP, level jumps, and hacked item spawns, improving security against common exploits.…nd anti-cheat checks

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.

1 participant