镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Audit server packets m-z against a real capture - #577

Open
erwan-joly wants to merge 1 commit into
masterfrom
claude/audit-server-packets-m-z
Open

erwan-joly wants to merge 1 commit into
masterfrom
claude/audit-server-packets-m-z

Conversation

@erwan-joly

@erwan-joly erwan-joly commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Audit of server packets with headers m-z (and non-letter) against a real client capture (~33 MB). For every in-scope header, up to 300 distinct captured lines were deserialized with the library's Deserializer, re-serialized with Serializer, and compared byte for byte.

Capture caveats: player ids/names in the capture are already anonymized (MyIdPlayer, Me), which breaks numeric id fields on some lines (pairy, say, spk, su, tp, twk, rest). Those failures are capture artifacts, not layout mismatches. The capture is also from an older client, so fields the class has but the capture lacks were left alone.

Fixed (non-breaking)

  • scr: every captured line has 7 fields; the class had 6. Added Unknow7 (default 0). Corpus snapshot updated for the extra field.
  • mslot: KeyBind.SameKey (-1) was read back as CtrlA (0) because the deserializer maps every -1 enum value to the default. It now keeps -1 when the enum defines it (only affects enums with an explicit -1 member).
  • Tests: CaptureAuditMzTests round-trips captured scr and mslot lines.

Breaking candidates for 27.0.0 (not changed here)

  • mlobj, parcel: the sub-packet is space-separated on the wire (mlobj 1 5 6 5 3 1 0 0 0 0), but the deserializer reads a sub-packet as one dotted token, so all fields after the first are lost. Fix needs the sub-packet fields inlined into the packet.
  • pst: BuffIds is List<int> but the wire carries id.level pairs (153.87 152.87); needs a sub-packet list.
  • umi: wire is vnum.time in one token (umi 5060.34); class has two space fields.
  • qslot: serializer drops the . after the optional Type (index 0) of QsetClientSubPacket (1.1.2 -> 11.2); serializer-level bug, also touches the shared sub-packet.

Table

header lines checked (total / distinct) status
m_list 770 / 101 mismatch left: duplicate header dispatch picks MlistMaterialsPacket; MlistPacket layout matches
mall 1 / 1 ok
mapout 1293 / 2 ok (one line has a stray trailing space)
minfo 1 / 1 mismatch left: -1.0/0 tokens, single sample
mlinfo 40 / 13 mismatch left: older client sends music name text, not id
mlobj 1 / 1 mismatch left (breaking, see above)
mlobjlst 43 / 10 mismatch left: 4 lines carry anonymized/odd values in list entries
mlpt 1 / 1 ok
ms_c 242 / 2 ok
msg 471 / 212 ok
mslot 12 / 2 fixed
mv 879496 / 300 ok
mz 13 / 7 ok
n_inv 214 / 117 mismatch left: list items have two shapes (6 fields for type 0, 5 otherwise)
npc_req 998 / 300 mismatch left: older client omits trailing field
npinfo 67 / 1 ok
OK 40 / 2 ok (one line has a capture comment)
out 877 / 300 ok
p_clear 115 / 1 ok
pairy 1301 / 35 ok (3 lines anonymized ids)
parcel 50 / 37 mismatch left (breaking, see above)
pidx 4 / 4 ok
pinit 1623 / 20 mismatch left: older client omits trailing fields
post 8 / 5 mismatch left: anonymized/non-UTF8 text, needs more samples
pski 1 / 1 ok
pst 12157 / 300 mismatch left (breaking, see above)
qna 30 / 11 mismatch left: embedded client packets (#arena, #guri) not resolvable from server types
qset 50 / 20 mismatch left: 5 lines use space-separated tail, meaning unclear
qslot 894 / 45 mismatch left (serializer bug, see above)
qsti 4 / 4 ok
qstlist 44 / 16 ok
rage 27 / 10 ok
raid 1023 / 300 mismatch left: multi-shape packet (type 0 member list, type 3 16-17 fields); not modelled
raidbf 7 / 3 ok (trailing space in capture)
rank_cool 36 / 1 ok
rboss 311 / 188 ok
rbr 1 / 1 mismatch left: single sample
rc 1683 / 300 ok
rc_blist 18 / 18 mismatch left: `
rc_reg 1 / 1 ok
rc_scalc 1 / 1 mismatch left: one sample has a trailing item name; not enough samples to add a field
rc_slist 16 / 12 mismatch left: nested ^ item data, anonymized names
rdi 1 / 1 ok
req_info 644 / 287 mismatch left: older client omits trailing field
rest 362 / 241 ok (11 lines anonymized ids)
revive 163 / 86 ok
rp 3 / 1 mismatch left: embedded client packet
rsfi / rsfn / rsfp 37 / 22 / 1279 ok
s_memo 4 / 2 ok
say 1376 / 300 ok (34 lines anonymized ids)
sc 1352 / 43 ok
sc_n 248 / 100 mismatch left: empty equipment written -1 on wire vs -1.0.0; older client omits trailing fields
sc_p 747 / 300 mismatch left: older client omits trailing fields
sc_p_stc 58 / 3 mismatch left: older client omits trailing field
scp 220 / 2 ok
scr 41 / 3 fixed
script 10 / 2 mismatch left: older client omits trailing field
sd 3 / 3 ok
shop 1595 / 292 ok
shopclose 37 / 1 mismatch left: older client sends no field
ski 67 / 11 ok
sopen 1 / 1 ok
sp 661 / 300 ok
spk 161 / 159 ok (4 lines anonymized ids)
sqst 257 / 21 ok
sr 381 / 13 ok
st 21824 / 300 mismatch left: older client omits trailing fields
stat 26978 / 300 ok
su 14972 / 300 ok (failures are anonymized ids)
talk 22 / 22 mismatch left: first field empty on the wire
target / targetoff 12 / 1 ok
tc_info 5 / 5 mismatch left: older layout, needs review
tit 40 / 10 mismatch left: older client sends class name text
titinfo 2 / 2 ok
title 3 / 3 mismatch left: one line has an empty sub-field (0.)
tp 331 / 278 ok (31 lines anonymized ids)
twk 36 / 12 mismatch left: older client omits trailing fields; rest anonymized
umi 30 / 7 mismatch left (breaking, see above)
vb 498 / 15 ok (one line has a capture comment)
wopen 225 / 12 mismatch left: first field empty on the wire
wp 887 / 92 ok
zzim 36 / 1 ok

Headers with no captured line (not checked): minipet, mlinfobr, mlintro, mlo_, modal, modali, msgi, msgi2, n_inv_item, n_inv_skills, NsTeST, p_sex, pet_cool2, petski, pflag, pjoin, psd, pstash, pstash_all, qnai, qnai2, qnamli, qnamli2, qr, raidopen, rc_buy, s_memoi, s_memoi2, say_p, sayi, sayi2, sayitem, sayitemt, sayt, scene, shop_end, skyinit, slinfo, stash, stash_all, stbm, stp, stp2, stpm, success, ta_, tbf, today_stc, useobj.

Summary

85 in-scope headers had captured lines; 49 round-trip cleanly (or fail only on anonymized ids, capture comments or a stray trailing space), 2 are fixed non-breakingly (scr, mslot), and the rest are left with reasons. Five clear layout mismatches (mlobj, parcel, pst, umi, qslot) need breaking changes and are grouped above for 27.0.0 / #574. All 196 tests pass.

https://claude.ai/code/session_01CUfJ45wGkdbqEmzdtJSGhD


Generated by Claude Code

…udit (m-z)

scr carries seven fields on the wire; add Unknow7. The deserializer mapped
every -1 enum value to the default, losing KeyBind.SameKey in mslot; keep -1
when the enum defines it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUfJ45wGkdbqEmzdtJSGhD
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between f52ea98 and ebf3f5c.

Files selected for processing: 4

  • src/NosCore.Packets/Deserializer.cs
  • src/NosCore.Packets/ServerPackets/Player/ScrPacket.cs
  • test/NosCore.Packets.Tests/CaptureAuditMzTests.cs
  • test/NosCore.Packets.Tests/SerializerCorpusTests.ExpressionTreeSerializerOutputIsPinnedForEveryPacket.verified.txt
  • 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

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