fix merc saving/loading

This commit is contained in:
wish
2022-08-08 21:02:07 +10:00
parent 4968252491
commit 265dc25800
3 changed files with 31 additions and 30 deletions

View File

@@ -1,18 +1,20 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfSaveMercenary represents the MSG_MHF_SAVE_MERCENARY
type MsgMhfSaveMercenary struct{
AckHandle uint32
DataSize uint32
RawDataPayload []byte
type MsgMhfSaveMercenary struct {
AckHandle uint32
GCP uint32
Unk0 uint32
MercData []byte
Unk1 uint32
}
// Opcode returns the ID associated with this packet type.
@@ -23,8 +25,11 @@ func (m *MsgMhfSaveMercenary) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfSaveMercenary) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.DataSize = bf.ReadUint32()
m.RawDataPayload = bf.ReadBytes(uint(m.DataSize))
bf.ReadUint32() // lenData
m.GCP = bf.ReadUint32()
m.Unk0 = bf.ReadUint32()
m.MercData = bf.ReadBytes(uint(bf.ReadUint32()))
m.Unk1 = bf.ReadUint32()
return nil
}