handle various packets

This commit is contained in:
wish
2022-10-07 21:40:34 +11:00
parent 1b86479672
commit 3c23d12ba6
3 changed files with 47 additions and 16 deletions

View File

@@ -1,15 +1,19 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfAddRewardSongCount represents the MSG_MHF_ADD_REWARD_SONG_COUNT
type MsgMhfAddRewardSongCount struct{}
type MsgMhfAddRewardSongCount struct {
AckHandle uint32
Unk0 uint32
Unk1 []byte
}
// Opcode returns the ID associated with this packet type.
func (m *MsgMhfAddRewardSongCount) Opcode() network.PacketID {
@@ -18,7 +22,10 @@ func (m *MsgMhfAddRewardSongCount) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfAddRewardSongCount) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
return errors.New("NOT IMPLEMENTED")
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint32()
m.Unk1 = bf.ReadBytes(5)
return nil
}
// Build builds a binary packet from the current data.