mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 15:34:38 +01:00
fix parsing and handling of DistItem packets
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfApplyDistItem represents the MSG_MHF_APPLY_DIST_ITEM
|
||||
type MsgMhfApplyDistItem struct {
|
||||
AckHandle uint32
|
||||
AckHandle uint32
|
||||
DistributionType uint8
|
||||
DistributionID uint32
|
||||
Unk2 uint32
|
||||
Unk3 uint32
|
||||
DistributionID uint32
|
||||
Unk2 uint32
|
||||
Unk3 uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -32,10 +33,5 @@ func (m *MsgMhfApplyDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfApplyDistItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint8(m.DistributionType)
|
||||
bf.WriteUint32(m.DistributionID)
|
||||
bf.WriteUint32(m.Unk2)
|
||||
bf.WriteUint32(m.Unk3)
|
||||
return nil
|
||||
}
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfEnumerateDistItem represents the MSG_MHF_ENUMERATE_DIST_ITEM
|
||||
type MsgMhfEnumerateDistItem struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint16
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
Unk3 []byte
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,16 +25,13 @@ func (m *MsgMhfEnumerateDistItem) Opcode() network.PacketID {
|
||||
func (m *MsgMhfEnumerateDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
m.Unk3 = bf.ReadBytes(uint(bf.ReadUint8()))
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfEnumerateDistItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint8(m.Unk0)
|
||||
bf.WriteUint16(m.Unk1)
|
||||
bf.WriteUint16(m.Unk2)
|
||||
return nil
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user