Files
Erupe/network/mhfpacket/msg_mhf_read_beat_level.go
2020-01-19 12:52:57 -05:00

39 lines
1.1 KiB
Go

package mhfpacket
import (
"github.com/Andoryuuta/Erupe/network"
"github.com/Andoryuuta/byteframe"
)
// MsgMhfReadBeatLevel represents the MSG_MHF_READ_BEAT_LEVEL
type MsgMhfReadBeatLevel struct {
AckHandle uint32
Unk0 uint32
ValidIDCount uint32 // Valid entries in the array
IDs [16]uint32
}
// Opcode returns the ID associated with this packet type.
func (m *MsgMhfReadBeatLevel) Opcode() network.PacketID {
return network.MSG_MHF_READ_BEAT_LEVEL
}
// Parse parses the packet from binary
func (m *MsgMhfReadBeatLevel) Parse(bf *byteframe.ByteFrame) error {
// I assume this used to be dynamic, but as of the last JP client version, all of this data is hard-coded literals.
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint32() // Always 1
m.ValidIDCount = bf.ReadUint32() // Always 4
// Always 0x74, 0x6B, 0x02, 0x24 followed by 12 zero values.
for i := 0; i < len(m.IDs); i++ {
m.IDs[i] = bf.ReadUint32()
}
return nil
}
// Build builds a binary packet from the current data.
func (m *MsgMhfReadBeatLevel) Build(bf *byteframe.ByteFrame) error {
panic("Not implemented")
}