Skip to content

feat!: 22.0.0 - mate packets as the official server sends them - #544

Open
Nevenit wants to merge 1 commit into
NosCoreIO:masterfrom
Nevenit:feat/pet-packets
Open

Nevenit wants to merge 1 commit into
NosCoreIO:masterfrom
Nevenit:feat/pet-packets

Conversation

@Nevenit

@Nevenit Nevenit commented Oct 16, 2026 •

Copy link
Copy Markdown

Brings the pet/partner packets in line with what the official server sends, for the pets work in NosCore (#655).

Changes

  • sc_p: 40 fields instead of 33. New Unknow2..Unknow8 (indexes 33-39). In the recordings, 34 is 1, 2 or 3 depending on the pet and 39 is always 1. With only 33 fields the client's pet window shows no pictures.
  • sc_n: two more trailing fields (Unknown4, Unknown5; the second is 0 or 1 depending on the partner).
  • in: two more trailing fields on the non-player part (Unknow7, Unknow8). The official server sends them for monsters, npcs and mates alike (30 tokens; we sent 28). Unknow7 carries the pet's 1-3 value, 0 for partners, npcs and monsters.
  • ptctl is typed: Mates (one PtctlSubPacket per mate: id, x, y; counted by Amount, like rest), then VisualId and Speed. With two mates out: ptctl 1 2 1135623 50 132 1135626 49 133 1135623 9. The trailing id and speed were the first mate's in every recording.
    Breaking: PacketEnd is removed, hence 22.0.0. NosCore does not use it.
  • Serializer fix: an absent sub-packet that is written with its own separator now keeps its leading space. A partner without equipment came out as sc_n ... 13458-1-1-1-1 instead of 13458 -1 -1 -1 -1.

How it was checked

  • Lines were recorded from the official server for a character with four pets and two partners. OfficialMatePacketTests builds sc_p, sc_n and in (pet and monster) from those values and compares with the recorded lines character for character, and reads a recorded two-mate ptctl.
  • Each new test fails when its change is reverted.
  • In the serializer corpus snapshot only the sc_p, sc_n, in and ptctl lines changed. The two existing in expectations in SerializerTest gain the two trailing zeros.
  • All 138 tests pass.

Not yet checked

That the 40-field sc_p brings the pet window pictures back in the client. I'll confirm that in-game with the NosCore change that uses this release.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Features
    • Updated mate packet handling to include mate positions, visual IDs, and movement speed.
    • Added additional fields to pet, partner, NPC, and monster packet data for more complete packet details.
  • Bug Fixes
    • Corrected spacing when serializing null required sub-packets.
  • Tests
    • Added checks against captured packet examples and verified that follow reports round-trip unchanged.

Checked against lines recorded from the official server (a character with four pets and
two partners), now pinned in OfficialMatePacketTests:

- sc_p has 40 fields, not 33: Unknow2..Unknow8 (34 is 1-3 per pet, 39 is always 1).
  With only 33 fields the client's pet window shows no pictures.
- sc_n ends with two more fields (Unknown4, Unknown5).
- in: the non-player part ends with two more fields for monsters, npcs and mates alike
  (Unknow7 carries the pet's 1-3 value, 0 otherwise).
- ptctl is typed: Mates (id, x, y per mate, counted by Amount), then VisualId and Speed.
  Breaking: PacketEnd is gone.
- An absent sub-packet written with its own separator keeps its leading space, so a
  partner without equipment is "sc_n ... 13458 -1 -1 -1 -1", not "13458-1-1-1-1".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NosCoreIO/NosCore.Packets/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7e5e566e-d0c1-4a04-9d10-233f7a222ce8
📥 Commits

Reviewing files that changed from the base of the PR and between 4fd24e4 and f819172.

📒 Files selected for processing: 10
  • src/NosCore.Packets/ClientPackets/Mates/PtctlPacket.cs
  • src/NosCore.Packets/ClientPackets/Mates/PtctlSubPacket.cs
  • src/NosCore.Packets/NosCore.Packets.csproj
  • src/NosCore.Packets/Serializer.cs
  • src/NosCore.Packets/ServerPackets/Mates/ScnPacket.cs
  • src/NosCore.Packets/ServerPackets/Mates/ScpPacket.cs
  • src/NosCore.Packets/ServerPackets/Visibility/InNonPlayerSubPacket.cs
  • test/NosCore.Packets.Tests/OfficialMatePacketTests.cs
  • test/NosCore.Packets.Tests/SerializerCorpusTests.ExpressionTreeSerializerOutputIsPinnedForEveryPacket.verified.txt
  • test/NosCore.Packets.Tests/SerializerTest.cs

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

Walkthrough

The packet models now include additional mate and spawn fields. The ptctl packet represents a list of mate positions followed by visual ID and speed. Serializer behavior and tests were updated to cover the packet formats, and the package version changed to 22.0.0.

Changes

Mate packet formats

Layer / File(s) Summary
Client follow report format
src/NosCore.Packets/ClientPackets/Mates/PtctlPacket.cs, src/NosCore.Packets/ClientPackets/Mates/PtctlSubPacket.cs, src/NosCore.Packets/Serializer.cs, test/NosCore.Packets.Tests/OfficialMatePacketTests.cs, test/NosCore.Packets.Tests/SerializerCorpusTests.ExpressionTreeSerializerOutputIsPinnedForEveryPacket.verified.txt, src/NosCore.Packets/NosCore.Packets.csproj
PtctlPacket now represents mate positions, visual ID, and speed. Required null sub-packets with a space discriminator serialize with a leading space. Tests check captured ptctl lines and round trips. The package version changes to 22.0.0.
Server mate and spawn packet fields
src/NosCore.Packets/ServerPackets/Mates/ScnPacket.cs, src/NosCore.Packets/ServerPackets/Mates/ScpPacket.cs, src/NosCore.Packets/ServerPackets/Visibility/InNonPlayerSubPacket.cs, test/NosCore.Packets.Tests/OfficialMatePacketTests.cs, test/NosCore.Packets.Tests/SerializerCorpusTests.ExpressionTreeSerializerOutputIsPinnedForEveryPacket.verified.txt, test/NosCore.Packets.Tests/SerializerTest.cs
ScnPacket, ScpPacket, and InNonPlayerSubPacket add serialized fields. Captured-packet tests and pinned serializer outputs include the added values.

Priority: ➖ Normal

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

Change: Feature

Suggested reviewers: erwan-joly

Merge Risk: ⚪ Minimal · up to f8191

The packet models represent the recorded mate and spawn formats, and the investigated ptctl parsing concern was refuted. No concrete user-impacting defect was established, so the change appears ready to merge subject to normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 8 files. (2 skipped: 2 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 clearly identifies the breaking 22.0.0 update and accurately summarizes the main change: matching mate packet formats to the official server.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 8 files. (2 skipped: 2 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

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