Updated pets spawn for rusro#11
Conversation
📝 WalkthroughWalkthroughThis PR aligns packet parsing behavior in InventoryUpdateItemResponse by extending the initial byte validation and consumption logic to apply to both Global and RuSro game client types, previously limited to Global only. ChangesInventory packet parsing alignment
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
Library/RSBot.Core/Network/Handler/Agent/Inventory/InventoryUpdateItemResponse.cs (1)
32-33: ⚡ Quick winConsider extracting the repeated client type check.
The same condition
Game.ClientType == GameClientType.Global || Game.ClientType == GameClientType.RuSroappears twice. Extracting it to a local variable or helper method improves maintainability if additional client types need the same behavior in the future.♻️ Refactor option: extract to local variable
public void Invoke(Packet packet) { - if (Game.ClientType == GameClientType.Global - || Game.ClientType == GameClientType.RuSro) + var usesExtendedFormat = Game.ClientType == GameClientType.Global + || Game.ClientType == GameClientType.RuSro; + + if (usesExtendedFormat) if (packet.ReadByte() != 0) //sometimes appears 9 with unknown structure return; var sourceSlot = packet.ReadByte(); - if (Game.ClientType == GameClientType.Global - || Game.ClientType == GameClientType.RuSro) + if (usesExtendedFormat) packet.ReadByte(); //0 - normal, 2 - item disappearingAlso applies to: 39-40
🤖 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 `@Library/RSBot.Core/Network/Handler/Agent/Inventory/InventoryUpdateItemResponse.cs` around lines 32 - 33, Extract the repeated client-type condition into a single reusable predicate to avoid duplication: create a local bool (e.g., bool isGlobalOrRuSro = Game.ClientType == GameClientType.Global || Game.ClientType == GameClientType.RuSro) at the start of the method in InventoryUpdateItemResponse and replace both occurrences of the expression with that variable (or alternatively add a small helper property/method on Game like IsGlobalOrRuSro and use that) so the same logic is centralized and easy to extend.
🤖 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
`@Library/RSBot.Core/Network/Handler/Agent/Inventory/InventoryUpdateItemResponse.cs`:
- Around line 32-33: Extract the repeated client-type condition into a single
reusable predicate to avoid duplication: create a local bool (e.g., bool
isGlobalOrRuSro = Game.ClientType == GameClientType.Global || Game.ClientType ==
GameClientType.RuSro) at the start of the method in InventoryUpdateItemResponse
and replace both occurrences of the expression with that variable (or
alternatively add a small helper property/method on Game like IsGlobalOrRuSro
and use that) so the same logic is centralized and easy to extend.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 0339edf7-3597-4d9a-b56e-f4aada7b9b56
📒 Files selected for processing (1)
Library/RSBot.Core/Network/Handler/Agent/Inventory/InventoryUpdateItemResponse.cs
5eb7768
into
Silkroad-Developer-Community:main
Summary by CodeRabbit