initial warehouse-v2 concept commit

This commit is contained in:
wish
2023-10-01 03:17:51 +11:00
parent 4bf8dc32eb
commit a9f280a2ef
6 changed files with 258 additions and 151 deletions

View File

@@ -13,7 +13,7 @@ import (
type MsgMhfOperateWarehouse struct {
AckHandle uint32
Operation uint8
BoxType string
BoxType uint8
BoxIndex uint8
Name string
}
@@ -27,16 +27,10 @@ func (m *MsgMhfOperateWarehouse) Opcode() network.PacketID {
func (m *MsgMhfOperateWarehouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Operation = bf.ReadUint8()
boxType := bf.ReadUint8()
switch boxType {
case 0:
m.BoxType = "item"
case 1:
m.BoxType = "equip"
}
m.BoxType = bf.ReadUint8()
m.BoxIndex = bf.ReadUint8()
_ = bf.ReadUint8() // lenName
_ = bf.ReadUint16() // Unk
_ = bf.ReadUint8() // lenName
bf.ReadUint16() // Zeroed
m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
return nil
}