Files
Erupe/network/mhfpacket/msg_mhf_operate_joint.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

49 lines
1.2 KiB
Go

package mhfpacket
import (
"errors"
"erupe-ce/network"
"erupe-ce/utils/byteframe"
)
type OperateJointAction uint8
const (
OPERATE_JOINT_DISBAND = 0x01
OPERATE_JOINT_LEAVE = 0x03
OPERATE_JOINT_KICK = 0x09
)
// MsgMhfOperateJoint represents the MSG_MHF_OPERATE_JOINT
type MsgMhfOperateJoint struct {
AckHandle uint32
AllianceID uint32
GuildID uint32
Action OperateJointAction
Data1 *byteframe.ByteFrame
Data2 *byteframe.ByteFrame
}
// Opcode returns the ID associated with this packet type.
func (m *MsgMhfOperateJoint) Opcode() network.PacketID {
return network.MSG_MHF_OPERATE_JOINT
}
// Parse parses the packet from binary
func (m *MsgMhfOperateJoint) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
m.AllianceID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
m.Action = OperateJointAction(bf.ReadUint8())
dataLen := uint(bf.ReadUint8())
m.Data1 = byteframe.NewByteFrameFromBytes(bf.ReadBytes(4))
m.Data2 = byteframe.NewByteFrameFromBytes(bf.ReadBytes(dataLen))
return nil
}
// Build builds a binary packet from the current data.
func (m *MsgMhfOperateJoint) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}