From b969c53f3a7857cf7463f2b92d87b2bf7d317c3c Mon Sep 17 00:00:00 2001 From: wish Date: Wed, 21 Feb 2024 02:09:42 +1100 Subject: [PATCH] fix Warehouse packet parsing --- network/mhfpacket/msg_mhf_enumerate_warehouse.go | 3 ++- network/mhfpacket/msg_mhf_operate_warehouse.go | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/network/mhfpacket/msg_mhf_enumerate_warehouse.go b/network/mhfpacket/msg_mhf_enumerate_warehouse.go index 30d30b605..dbc740f80 100644 --- a/network/mhfpacket/msg_mhf_enumerate_warehouse.go +++ b/network/mhfpacket/msg_mhf_enumerate_warehouse.go @@ -25,7 +25,8 @@ func (m *MsgMhfEnumerateWarehouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx m.AckHandle = bf.ReadUint32() m.BoxType = bf.ReadUint8() m.BoxIndex = bf.ReadUint8() - bf.ReadBytes(2) // Zeroed + bf.ReadUint8() // Zeroed + bf.ReadUint8() // Zeroed return nil } diff --git a/network/mhfpacket/msg_mhf_operate_warehouse.go b/network/mhfpacket/msg_mhf_operate_warehouse.go index aa5b70501..0ea57e6c6 100644 --- a/network/mhfpacket/msg_mhf_operate_warehouse.go +++ b/network/mhfpacket/msg_mhf_operate_warehouse.go @@ -29,9 +29,11 @@ func (m *MsgMhfOperateWarehouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx.C m.Operation = bf.ReadUint8() m.BoxType = bf.ReadUint8() m.BoxIndex = bf.ReadUint8() - _ = bf.ReadUint8() // lenName - bf.ReadUint16() // Zeroed - m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes()) + lenName := bf.ReadUint8() + bf.ReadUint16() // Zeroed + if lenName > 0 { + m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes()) + } return nil }