Skip to content

feat: update v26 for items.dat parser#61

Merged
CLOEI merged 1 commit into
CLOEI:mainfrom
JadlionHD:feat/items-v26-parser
May 10, 2026
Merged

feat: update v26 for items.dat parser#61
CLOEI merged 1 commit into
CLOEI:mainfrom
JadlionHD:feat/items-v26-parser

Conversation

@JadlionHD

@JadlionHD JadlionHD commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Bug Fixes
    • Improved item data parsing for version 26 and later compatibility.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Item parser now supports version 26 by adding a byte-skip instruction after reading hit-sound fields, extending the existing version-conditional parsing logic for item deserialization.

Changes

Item Parser Version 26 Handling

Layer / File(s) Summary
Version 26 Byte Skip Logic
src/items.rs
Added version >= 26 conditional that skips one byte after hit-sound field parsing in parse_item.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A whisker-twitch at version's gate,
One byte skipped, the format waits,
Version twenty-six takes flight,
Mori's parser reads it right! 🐰✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: update v26 for items.dat parser' clearly and concisely describes the main change: adding version 26 support to the items.dat file parser.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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 and usage tips.

@JadlionHD

Copy link
Copy Markdown
Contributor Author

Still not sure what that 1 byte does, so I'll skip it for now

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/items.rs (1)

230-250: ⚡ Quick win

Consider adding explicit test coverage for version 26.

The existing test relies on the items.dat file on disk, which may or may not be version 26. Consider adding a test that:

  • Explicitly constructs or reads a v26 items.dat file
  • Verifies that the version is correctly detected as 26
  • Validates that parsing completes without error
  • Optionally checks that the cursor position is correct after parsing

This would ensure the v26 parsing logic is exercised and remains correct across future changes.

🧪 Example test structure
#[test]
fn parse_items_dat_v26() {
    let data = std::fs::read("items.dat").expect("items.dat not found");
    let db = ItemsDat::parse(&data).expect("parse failed");
    
    // If this is a v26 file, verify it parsed correctly
    if db.version >= 26 {
        println!("Testing v26 format with {} items", db.items.len());
        assert!(!db.items.is_empty());
        // Add v26-specific assertions here
    }
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/items.rs` around lines 230 - 250, Add an explicit unit test that ensures
ItemsDat v26 parsing is exercised: create a new test (e.g., parse_items_dat_v26)
that loads or constructs a known v26 items.dat byte buffer and calls
ItemsDat::parse(&data), then asserts db.version == 26, that parsing returned Ok
and db.items is non-empty, and optionally verifies cursor/offset position or
other v26-specific fields; reference the existing parse_items_dat helper for
structure and use ItemsDat::parse, ItemsDat, and db.version/db.items to locate
the relevant code to reuse.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/items.rs`:
- Around line 230-250: Add an explicit unit test that ensures ItemsDat v26
parsing is exercised: create a new test (e.g., parse_items_dat_v26) that loads
or constructs a known v26 items.dat byte buffer and calls
ItemsDat::parse(&data), then asserts db.version == 26, that parsing returned Ok
and db.items is non-empty, and optionally verifies cursor/offset position or
other v26-specific fields; reference the existing parse_items_dat helper for
structure and use ItemsDat::parse, ItemsDat, and db.version/db.items to locate
the relevant code to reuse.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 088a6a5e-a9a4-4223-b5e6-463c623e1c1e

📥 Commits

Reviewing files that changed from the base of the PR and between cc99312 and 3e84a7d.

📒 Files selected for processing (1)
  • src/items.rs

@CLOEI

CLOEI commented May 10, 2026

Copy link
Copy Markdown
Owner

Hell yea, thanks for your contributions!

@CLOEI CLOEI merged commit 7db2c15 into CLOEI:main May 10, 2026
9 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