mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 16:04:38 +01:00
41 lines
1.0 KiB
Go
41 lines
1.0 KiB
Go
package mhfpacket
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"erupe-ce/common/byteframe"
|
|
"erupe-ce/network"
|
|
"erupe-ce/network/clientctx"
|
|
)
|
|
|
|
// MsgMhfAcquireUdItem represents the MSG_MHF_ACQUIRE_UD_ITEM
|
|
type MsgMhfAcquireUdItem struct {
|
|
AckHandle uint32
|
|
Freeze bool
|
|
RewardType uint8
|
|
Count int
|
|
RewardIDs []uint32
|
|
}
|
|
|
|
// Opcode returns the ID associated with this packet type.
|
|
func (m *MsgMhfAcquireUdItem) Opcode() network.PacketID {
|
|
return network.MSG_MHF_ACQUIRE_UD_ITEM
|
|
}
|
|
|
|
// Parse parses the packet from binary
|
|
func (m *MsgMhfAcquireUdItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
|
m.AckHandle = bf.ReadUint32()
|
|
m.Freeze = bf.ReadBool()
|
|
m.RewardType = bf.ReadUint8()
|
|
m.Count = int(bf.ReadUint8())
|
|
for i := 0; i < m.Count; i++ {
|
|
m.RewardIDs = append(m.RewardIDs, bf.ReadUint32())
|
|
}
|
|
return nil
|
|
}
|
|
|
|
// Build builds a binary packet from the current data.
|
|
func (m *MsgMhfAcquireUdItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
|
return errors.New("NOT IMPLEMENTED")
|
|
}
|