Added code

This commit is contained in:
stratic-dev
2024-02-26 04:19:28 +00:00
parent f5ee81b8d1
commit d195e667ae
4 changed files with 24 additions and 11 deletions

View File

@@ -3,6 +3,7 @@ package mhfpacket
import (
"errors"
"erupe-ce/common/byteframe"
"erupe-ce/common/stringsupport"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
@@ -12,7 +13,7 @@ type MsgMhfApplyCampaign struct {
AckHandle uint32
CampaignID uint32
NullPadding uint16 // set as 0 in z2
CodeString []byte
CodeString string
}
// Opcode returns the ID associated with this packet type.
@@ -25,7 +26,8 @@ func (m *MsgMhfApplyCampaign) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
m.AckHandle = bf.ReadUint32()
m.CampaignID = bf.ReadUint32()
m.NullPadding = bf.ReadUint16()
m.CodeString = bf.ReadBytes(16)
m.CodeString = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
bf.ReadInt8()
return nil
}