refactor(mhfpacket): rename 15 Unk fields with identified meanings

Replace unknown field names with descriptive names based on handler
logic analysis, switch dispatch patterns, DB query context, and
inline comments:

- ObjectHandleID, IsQuest, ItemIDCount, MaxCount, TokenLength,
  FormatVersion, LogoutType (high confidence from comments/constants)
- QueryType, DataType, MissionIndex, CheckOnly, RequestType,
  ExchangeType, TournamentID (confirmed by handler switch/if usage)

Also fix MsgSysLogout.Build calling ReadUint8 instead of WriteUint8.
This commit is contained in:
Houmgaor
2026-02-18 21:48:08 +01:00
parent 2bd5f98f32
commit 0d07a1f698
35 changed files with 104 additions and 104 deletions

View File

@@ -359,7 +359,7 @@ func TestBuildParseUpdateObjectBinary(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
original := &MsgSysUpdateObjectBinary{
Unk0: tt.unk0,
ObjectHandleID: tt.unk0,
Unk1: tt.unk1,
}
@@ -374,8 +374,8 @@ func TestBuildParseUpdateObjectBinary(t *testing.T) {
t.Fatalf("Parse() error = %v", err)
}
if parsed.Unk0 != original.Unk0 {
t.Errorf("Unk0 = %d, want %d", parsed.Unk0, original.Unk0)
if parsed.ObjectHandleID != original.ObjectHandleID {
t.Errorf("Unk0 = %d, want %d", parsed.ObjectHandleID, original.ObjectHandleID)
}
if parsed.Unk1 != original.Unk1 {
t.Errorf("Unk1 = %d, want %d", parsed.Unk1, original.Unk1)
@@ -767,7 +767,7 @@ func TestBuildParseEnumerateDistItem(t *testing.T) {
AckHandle: tt.ackHandle,
DistType: tt.distType,
Unk1: tt.unk1,
Unk2: tt.unk2,
MaxCount: tt.unk2,
}
bf := byteframe.NewByteFrame()
@@ -775,7 +775,7 @@ func TestBuildParseEnumerateDistItem(t *testing.T) {
bf.WriteUint32(original.AckHandle)
bf.WriteUint8(original.DistType)
bf.WriteUint8(original.Unk1)
bf.WriteUint16(original.Unk2)
bf.WriteUint16(original.MaxCount)
bf.WriteUint8(0) // Unk3 length (for Z1+ client mode)
_, _ = bf.Seek(0, io.SeekStart)
@@ -793,8 +793,8 @@ func TestBuildParseEnumerateDistItem(t *testing.T) {
if parsed.Unk1 != original.Unk1 {
t.Errorf("Unk1 = %d, want %d", parsed.Unk1, original.Unk1)
}
if parsed.Unk2 != original.Unk2 {
t.Errorf("Unk2 = %d, want %d", parsed.Unk2, original.Unk2)
if parsed.MaxCount != original.MaxCount {
t.Errorf("Unk2 = %d, want %d", parsed.MaxCount, original.MaxCount)
}
})
}