Files
Erupe/network/mhfpacket/msg_mhf_enumerate_guild.go
2022-08-04 06:43:41 +10:00

57 lines
1.7 KiB
Go

package mhfpacket
import (
"errors"
"io"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
type EnumerateGuildType uint8
const (
ENUMERATE_GUILD_TYPE_GUILD_NAME = 0x01
ENUMERATE_GUILD_TYPE_LEADER_NAME = 0x02
ENUMERATE_GUILD_TYPE_LEADER_ID = 0x03
ENUMERATE_GUILD_TYPE_ORDER_MEMBERS = 0x04
ENUMERATE_GUILD_TYPE_ORDER_REGISTRATION = 0x05
ENUMERATE_GUILD_TYPE_ORDER_RANK = 0x06
ENUMERATE_GUILD_TYPE_MOTTO = 0x07
ENUMERATE_GUILD_TYPE_RECRUITING = 0x08
ENUMERATE_ALLIANCE_TYPE_ALLIANCE_NAME = 0x09
ENUMERATE_ALLIANCE_TYPE_LEADER_NAME = 0x0A
ENUMERATE_ALLIANCE_TYPE_LEADER_ID = 0x0B
ENUMERATE_ALLIANCE_TYPE_ORDER_MEMBERS = 0x0C
ENUMERATE_ALLIANCE_TYPE_ORDER_REGISTRATION = 0x0D
)
// MsgMhfEnumerateGuild represents the MSG_MHF_ENUMERATE_GUILD
type MsgMhfEnumerateGuild struct {
AckHandle uint32
Type EnumerateGuildType
Page uint8
RawDataPayload []byte
}
// Opcode returns the ID associated with this packet type.
func (m *MsgMhfEnumerateGuild) Opcode() network.PacketID {
return network.MSG_MHF_ENUMERATE_GUILD
}
// Parse parses the packet from binary
func (m *MsgMhfEnumerateGuild) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Type = EnumerateGuildType(bf.ReadUint8())
m.Page = bf.ReadUint8()
m.RawDataPayload = bf.DataFromCurrent()
bf.Seek(-2, io.SeekEnd)
return nil
}
// Build builds a binary packet from the current data.
func (m *MsgMhfEnumerateGuild) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
return errors.New("NOT IMPLEMENTED")
}