update parsing of CastBinary & EnterStage

This commit is contained in:
wish
2023-11-19 23:12:58 +11:00
parent e5fa0501b7
commit d7d3e7c61f
2 changed files with 8 additions and 11 deletions

View File

@@ -3,15 +3,14 @@ package mhfpacket
import ( import (
"errors" "errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe" "erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
) )
// MsgSysCastBinary represents the MSG_SYS_CAST_BINARY // MsgSysCastBinary represents the MSG_SYS_CAST_BINARY
type MsgSysCastBinary struct { type MsgSysCastBinary struct {
Unk0 uint16 Unk uint32
Unk1 uint16
BroadcastType uint8 BroadcastType uint8
MessageType uint8 MessageType uint8
RawDataPayload []byte RawDataPayload []byte
@@ -24,8 +23,7 @@ func (m *MsgSysCastBinary) Opcode() network.PacketID {
// Parse parses the packet from binary // Parse parses the packet from binary
func (m *MsgSysCastBinary) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { func (m *MsgSysCastBinary) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.Unk0 = bf.ReadUint16() m.Unk = bf.ReadUint32()
m.Unk1 = bf.ReadUint16()
m.BroadcastType = bf.ReadUint8() m.BroadcastType = bf.ReadUint8()
m.MessageType = bf.ReadUint8() m.MessageType = bf.ReadUint8()
dataSize := bf.ReadUint16() dataSize := bf.ReadUint16()

View File

@@ -4,7 +4,6 @@ import (
"errors" "errors"
"erupe-ce/common/byteframe" "erupe-ce/common/byteframe"
"erupe-ce/common/bfutil"
"erupe-ce/network" "erupe-ce/network"
"erupe-ce/network/clientctx" "erupe-ce/network/clientctx"
) )
@@ -25,8 +24,8 @@ func (m *MsgSysEnterStage) Opcode() network.PacketID {
func (m *MsgSysEnterStage) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error { func (m *MsgSysEnterStage) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32() m.AckHandle = bf.ReadUint32()
m.UnkBool = bf.ReadUint8() m.UnkBool = bf.ReadUint8()
stageIDLength := bf.ReadUint8() bf.ReadUint8()
m.StageID = string(bfutil.UpToNull(bf.ReadBytes(uint(stageIDLength)))) m.StageID = string(bf.ReadNullTerminatedBytes())
return nil return nil
} }