mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 23:14:36 +01:00
port partial fix/mutex-rework
This commit is contained in:
@@ -3,7 +3,6 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/bfutil"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
@@ -13,7 +12,7 @@ type MsgSysCreateStage struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8 // Likely only has 1 and 2 as values.
|
||||
PlayerCount uint8
|
||||
StageID string // NULL terminated string.
|
||||
StageID string
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -26,8 +25,8 @@ func (m *MsgSysCreateStage) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Client
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.PlayerCount = bf.ReadUint8()
|
||||
stageIDLength := bf.ReadUint8()
|
||||
m.StageID = string(bfutil.UpToNull(bf.ReadBytes(uint(stageIDLength))))
|
||||
bf.ReadUint8() // Length StageID
|
||||
m.StageID = string(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
// MsgSysEnterStage represents the MSG_SYS_ENTER_STAGE
|
||||
type MsgSysEnterStage struct {
|
||||
AckHandle uint32
|
||||
UnkBool uint8
|
||||
Unk bool
|
||||
StageID string
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ func (m *MsgSysEnterStage) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgSysEnterStage) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.UnkBool = bf.ReadUint8()
|
||||
bf.ReadUint8()
|
||||
m.Unk = bf.ReadBool() // IsQuest?
|
||||
bf.ReadUint8() // Length StageID
|
||||
m.StageID = string(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/stringsupport"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
@@ -12,8 +10,7 @@ import (
|
||||
// MsgSysEnumerateStage represents the MSG_SYS_ENUMERATE_STAGE
|
||||
type MsgSysEnumerateStage struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8 // Hardcoded 1 in the binary
|
||||
StagePrefix string // NULL terminated string.
|
||||
StagePrefix string
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,9 +21,9 @@ func (m *MsgSysEnumerateStage) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgSysEnumerateStage) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
bf.ReadUint8()
|
||||
m.StagePrefix = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
|
||||
bf.ReadUint8() // Always 1
|
||||
bf.ReadUint8() // Length StagePrefix
|
||||
m.StagePrefix = string(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgSysLockStage represents the MSG_SYS_LOCK_STAGE
|
||||
type MsgSysLockStage struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8 // Hardcoded 1 in the binary
|
||||
Unk1 uint8 // Hardcoded 1 in the binary
|
||||
StageIDLength uint8
|
||||
StageID string
|
||||
AckHandle uint32
|
||||
StageID string
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -25,10 +22,10 @@ func (m *MsgSysLockStage) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgSysLockStage) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.StageIDLength = bf.ReadUint8()
|
||||
m.StageID = string(bf.ReadBytes(uint(m.StageIDLength)))
|
||||
bf.ReadUint8() // Always 1
|
||||
bf.ReadUint8() // Always 1
|
||||
bf.ReadUint8() // Length StageID
|
||||
m.StageID = string(bf.ReadNullTerminatedBytes())
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,14 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgSysUnlockStage represents the MSG_SYS_UNLOCK_STAGE
|
||||
type MsgSysUnlockStage struct {
|
||||
Unk0 uint16 // Hardcoded 0 in the binary.
|
||||
}
|
||||
type MsgSysUnlockStage struct{}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgSysUnlockStage) Opcode() network.PacketID {
|
||||
@@ -18,12 +17,11 @@ func (m *MsgSysUnlockStage) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgSysUnlockStage) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
bf.ReadUint16() // Zeroed
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgSysUnlockStage) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint16(m.Unk0)
|
||||
return nil
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user