rewrite EnumerateStage & parse ReserveStage

This commit is contained in:
wish
2023-11-07 16:50:39 +11:00
parent cf8a5da0b2
commit 6ff20858ed
2 changed files with 12 additions and 15 deletions

View File

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