update parsing of many packets

This commit is contained in:
wish
2023-11-19 02:34:02 +11:00
parent fc57d63689
commit 85fc76edd5
44 changed files with 272 additions and 278 deletions

View File

@@ -1,24 +1,22 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgSysLogin represents the MSG_SYS_LOGIN
type MsgSysLogin struct {
AckHandle uint32
CharID0 uint32
LoginTokenNumber uint32
HardcodedZero0 uint16
RequestVersion uint16
CharID1 uint32
HardcodedZero1 uint16
LoginTokenStringLength uint16 // Hardcoded to 0x11
LoginTokenString string
AckHandle uint32
CharID0 uint32
LoginTokenNumber uint32
HardcodedZero0 uint16
RequestVersion uint16
CharID1 uint32
LoginTokenString string
}
// Opcode returns the ID associated with this packet type.
@@ -34,8 +32,8 @@ func (m *MsgSysLogin) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContex
m.HardcodedZero0 = bf.ReadUint16()
m.RequestVersion = bf.ReadUint16()
m.CharID1 = bf.ReadUint32()
m.HardcodedZero1 = bf.ReadUint16()
m.LoginTokenStringLength = bf.ReadUint16()
bf.ReadUint16() // Zeroed
bf.ReadUint16() // Always 11
m.LoginTokenString = string(bf.ReadNullTerminatedBytes())
return nil
}