Files
Erupe/network/mhfpacket/msg_mhf_read_beat_level.go
stratic-dev 62fe5cf277 moved bin 8 out and removed clientctx
moved crypto bin8 out of entrance server

removed unused clientctx

missed import

fix accidental commit and rename ack_helpers
2024-10-09 18:36:34 +01:00

41 lines
1.1 KiB
Go

package mhfpacket
import (
"errors"
"erupe-ce/network"
"erupe-ce/utils/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 {
return errors.New("NOT IMPLEMENTED")
}