From 151af1a2025c4284bf1ffff9907c9089c446bb49 Mon Sep 17 00:00:00 2001 From: Houmgaor Date: Wed, 18 Feb 2026 22:57:18 +0100 Subject: [PATCH] refactor(mhfpacket): rename MsgMhfUpdateHouse.Unk1 to HasPassword Verified via Wii U decompilation of putUpdate_house: the field is set to 0 when no password is provided, and 1 when a password string is present. The previous comment "Always 0x01" was inaccurate. --- network/mhfpacket/msg_mhf_update_house.go | 4 ++-- network/mhfpacket/msg_parse_large_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/network/mhfpacket/msg_mhf_update_house.go b/network/mhfpacket/msg_mhf_update_house.go index 2c6f0401d..0f7e77c21 100644 --- a/network/mhfpacket/msg_mhf_update_house.go +++ b/network/mhfpacket/msg_mhf_update_house.go @@ -13,7 +13,7 @@ import ( type MsgMhfUpdateHouse struct { AckHandle uint32 State uint8 - Unk1 uint8 // Always 0x01 + HasPassword uint8 // 0 = no password, 1 = has password Password string } @@ -26,7 +26,7 @@ func (m *MsgMhfUpdateHouse) Opcode() network.PacketID { func (m *MsgMhfUpdateHouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { m.AckHandle = bf.ReadUint32() m.State = bf.ReadUint8() - m.Unk1 = bf.ReadUint8() + m.HasPassword = bf.ReadUint8() bf.ReadUint8() // Zeroed bf.ReadUint8() // Zeroed bf.ReadUint8() // Password length diff --git a/network/mhfpacket/msg_parse_large_test.go b/network/mhfpacket/msg_parse_large_test.go index 479c554f4..6c31263e8 100644 --- a/network/mhfpacket/msg_parse_large_test.go +++ b/network/mhfpacket/msg_parse_large_test.go @@ -455,8 +455,8 @@ func TestParseLargeMsgMhfUpdateHouse(t *testing.T) { if pkt.State != tt.state { t.Errorf("State = %d, want %d", pkt.State, tt.state) } - if pkt.Unk1 != 1 { - t.Errorf("Unk1 = %d, want 1", pkt.Unk1) + if pkt.HasPassword != 1 { + t.Errorf("HasPassword = %d, want 1", pkt.HasPassword) } if pkt.Password != tt.password { t.Errorf("Password = %q, want %q", pkt.Password, tt.password)