Skip to content

Fix spawn packet parsing across client localizations - #24

Merged
kis1yi merged 1 commit into
Silkroad-Developer-Community:mainfrom
kis1yi:spawn
Sep 20, 2026
Merged

kis1yi merged 1 commit into
Silkroad-Developer-Community:mainfrom
kis1yi:spawn

Conversation

@kis1yi

@kis1yi kis1yi commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Bug Fixes

    • Improved compatibility with regional client variants when processing NPC dialogue and interaction data.
    • Corrected handling of spawn group quantities, supporting larger groups and preventing incorrect entity processing.
    • Improved parsing of single-entity and grouped spawn messages for more reliable world updates.
  • Improvements

    • NPC interactions now expose additional custom names, options, types, and identifiers where supported.

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 8913b11a-db13-45ef-a766-b8355b1ed136

📥 Commits

Reviewing files that changed from the base of the PR and between 1766a58 and f927da1.

📒 Files selected for processing (6)
  • Library/RSBot.Core/Client/ReferenceManager.cs
  • Library/RSBot.Core/Network/Handler/Agent/Entity/EntityGroupSpawnBeginResponse.cs
  • Library/RSBot.Core/Network/Handler/Agent/Entity/EntityGroupSpawnEndResponse.cs
  • Library/RSBot.Core/Network/Handler/Agent/Entity/EntitySingleSpawnResponse.cs
  • Library/RSBot.Core/Objects/NpcTalk.cs
  • Library/RSBot.Core/Objects/Spawn/SpawnPacketInfo.cs

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change updates client-specific spawn and NPC talk packet parsing. It widens spawn amount storage and iteration to ulong, marks single-spawn packets explicitly, adds NPC talk fields, and increases two dictionary capacity hints.

Changes

Spawn Packet Handling

Layer / File(s) Summary
Spawn amount contract and parsing
Library/RSBot.Core/Objects/Spawn/SpawnPacketInfo.cs, Library/RSBot.Core/Network/Handler/Agent/Entity/EntityGroupSpawnBeginResponse.cs
SpawnPacketInfo.Amount now uses ulong. Chinese clients read the group amount as ULong; other clients retain UShort parsing.
Spawn iteration and single-packet handling
Library/RSBot.Core/Network/Handler/Agent/Entity/EntityGroupSpawnEndResponse.cs, Library/RSBot.Core/Network/Handler/Agent/Entity/EntitySingleSpawnResponse.cs
Group spawning uses a ulong loop counter. Single-spawn parsing passes isGroup: false to SpawnManager.Parse.

NPC Talk Parsing

Layer / File(s) Summary
Client-specific NPC talk format parsing
Library/RSBot.Core/Objects/NpcTalk.cs
NpcTalk adds CustomName, OptionFlags, CustomType, and CustomId. Deserialize now selects field layouts by client type and removes the former shared parsing path.

Reference Capacity Updates

Layer / File(s) Summary
Reference dictionary capacity hints
Library/RSBot.Core/Client/ReferenceManager.cs
The initial capacities of LevelData and AbilityItemByOptLevel increase from 128 to 150 and from 512 to 1024.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

🚥 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 changes to spawn packet parsing for different client localizations. It is concise and specific.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 6 files.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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.

@kis1yi
kis1yi merged commit e8c504d into Silkroad-Developer-Community:main Sep 20, 2026
2 checks passed
@kis1yi
kis1yi deleted the spawn branch September 20, 2026 16:51
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