Skip to content

Add read-only inventory consistency diagnostics#12

Merged
GT-610 merged 1 commit into
mainfrom
inventory-consistency-diagnostics
Jul 7, 2026
Merged

Add read-only inventory consistency diagnostics#12
GT-610 merged 1 commit into
mainfrom
inventory-consistency-diagnostics

Conversation

@GT-610

@GT-610 GT-610 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • add read-only inventory consistency diagnostics after loading inventory.txt
  • report suspicious painted item rarity, paint kit, wear, collection, and StatTrak state issues
  • report storage unit reference and casket count inconsistencies without mutating inventory data

Validation

  • Built csgo_gc in Release with CMake/MSBuild

Summary by CodeRabbit

  • Bug Fixes
    • Added extra inventory validation during file loading to detect and log inconsistent or invalid item data.
    • Improved checks for item attributes, container references, and equipped item state to help surface storage issues earlier.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8b6606f8-2853-4fef-8121-f1b7dacbf16c

📥 Commits

Reviewing files that changed from the base of the PR and between 3bb3ec0 and d014311.

📒 Files selected for processing (2)
  • csgo_gc/inventory.cpp
  • csgo_gc/inventory.h

📝 Walkthrough

Walkthrough

This PR adds a new private method, LogInventoryConsistency() const, to the Inventory class. It is declared in inventory.h and implemented in inventory.cpp, validating casket item counts, painted-item attributes, StatTrak/kill-eater coherence, and storage references. It is invoked from ReadFromFile().

Changes

Inventory Consistency Validation

Layer / File(s) Summary
Method declaration and validation logic
csgo_gc/inventory.h, csgo_gc/inventory.cpp
Adds LogInventoryConsistency() const declaration and implementation that performs a two-pass validation of inventory items: checks casket item-count attributes, item schema validity, painted-item attribute consistency (paint kit, wear, rarity, collections), StatTrak/kill-eater coherence, casket low/high reference completeness, and aggregates referenced item counts per casket against configured counts, logging InventoryCheck: messages for issues. Called at the end of ReadFromFile() after default equips are processed.

Sequence Diagram(s)

sequenceDiagram
  participant ReadFromFile
  participant Inventory
  participant Log

  ReadFromFile->>Inventory: LogInventoryConsistency()
  Inventory->>Inventory: validate casket item counts
  Inventory->>Inventory: validate painted-item attributes
  Inventory->>Inventory: validate StatTrak/kill-eater attributes
  Inventory->>Inventory: check storage references vs casket counts
  Inventory->>Log: print InventoryCheck messages
Loading

Related PRs: None identified.

Suggested labels: enhancement, needs-review

Suggested reviewers: GT-610

🐰 A rabbit peeks in every crate,
Counting items, checking state,
Paint and StatTrak, casket ties,
Logging issues before it's late,
Inventory now verified—first-rate!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding read-only inventory consistency diagnostics.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@GT-610

GT-610 commented Jul 7, 2026

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@GT-610
GT-610 merged commit 3ab803d into main Jul 7, 2026
5 checks passed
@GT-610
GT-610 deleted the inventory-consistency-diagnostics branch July 7, 2026 08:37
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