Skip to content

Validate drop value & quantity server-side#44

Merged
joelhalen merged 1 commit into
DropTracker-io:new-apifrom
yonnski:fix/drop-value-validation
Jul 17, 2026
Merged

Validate drop value & quantity server-side#44
joelhalen merged 1 commit into
DropTracker-io:new-apifrom
yonnski:fix/drop-value-validation

Conversation

@yonnski

@yonnski yonnski commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Drop submissions stored the value and quantity from the client without server-side validation. The GE value was only recomputed when the client sent 0, so any non-zero value was trusted as-is, and quantity was unbounded — which allowed inflated loot totals on the leaderboards.

Changes

  • get_true_item_value now resolves the value from the GE price for any priceable item; the client-supplied value is used only as a fallback for items with no resolvable price (untradeables / brand-new items).
  • Added utils/valuation_guard.py: rejects non-positive/invalid quantities and bounds the per-drop total to the OSRS GE integer ceiling (top-tier single drops still pass).
  • Wired both guards into drop_processor.

Tests

  • tests/unit/test_value_authoritative.py — value is taken from the server price, not the client.
  • tests/unit/test_valuation_guard.py — quantity sanitation + total-value ceiling.

Happy to walk through the details separately.

Submitted drop value and quantity were stored without server-side validation. Value is now resolved from the GE price for any priceable item (client value kept only as a fallback for unpriceable items), and the per-drop total is bounded to the GE integer ceiling.
@joelhalen

Copy link
Copy Markdown
Contributor

Hey @yonnski!
Thanks for cleaning up that gap, looks good to me!

Appreciate you contributing :)

@joelhalen
joelhalen merged commit 3d7fddd into DropTracker-io:new-api Jul 17, 2026
2 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