mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-20 19:04:37 +01:00
major rewrite
This commit is contained in:
@@ -2,18 +2,17 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/bfutil"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/stringsupport"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfApplyCampaign represents the MSG_MHF_APPLY_CAMPAIGN
|
||||
type MsgMhfApplyCampaign struct {
|
||||
AckHandle uint32
|
||||
CampaignID uint32
|
||||
NullPadding uint16 // set as 0 in z2
|
||||
CodeString string
|
||||
AckHandle uint32
|
||||
CampaignID uint32
|
||||
Code string
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -25,9 +24,8 @@ func (m *MsgMhfApplyCampaign) Opcode() network.PacketID {
|
||||
func (m *MsgMhfApplyCampaign) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.CampaignID = bf.ReadUint32()
|
||||
m.NullPadding = bf.ReadUint16()
|
||||
m.CodeString = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
|
||||
bf.ReadInt8()
|
||||
bf.ReadUint16() // Zeroed
|
||||
m.Code = string(bfutil.UpToNull(bf.ReadBytes(16)))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user