mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-16 17:05:03 +01:00
Fix client crash and implement quest loading
Fixed client crashes caused by handleMsgMhfEnumeratePrice and handleMsgMhfEnumerateRanking wherein the server's response didn't contain enough data, causing the client to read uninitalized memory. Implemented quest loading handlers GetFile, WaitStageBinary, and UnlockStage, as well as correcting the IssueLogkey handler.
This commit is contained in:
@@ -5,8 +5,21 @@ import (
|
||||
"github.com/Andoryuuta/byteframe"
|
||||
)
|
||||
|
||||
type scenarioFileIdentifer struct {
|
||||
Unk0 uint8
|
||||
Unk1 uint32
|
||||
Unk2 uint8
|
||||
Unk3 uint8
|
||||
}
|
||||
|
||||
// MsgSysGetFile represents the MSG_SYS_GET_FILE
|
||||
type MsgSysGetFile struct{}
|
||||
type MsgSysGetFile struct {
|
||||
AckHandle uint32
|
||||
IsScenario bool
|
||||
FilenameLength uint8
|
||||
Filename string
|
||||
ScenarioIdentifer scenarioFileIdentifer
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgSysGetFile) Opcode() network.PacketID {
|
||||
@@ -15,10 +28,23 @@ func (m *MsgSysGetFile) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgSysGetFile) Parse(bf *byteframe.ByteFrame) error {
|
||||
panic("Not implemented")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.IsScenario = bf.ReadBool()
|
||||
if m.IsScenario {
|
||||
m.ScenarioIdentifer = scenarioFileIdentifer{
|
||||
bf.ReadUint8(),
|
||||
bf.ReadUint32(),
|
||||
bf.ReadUint8(),
|
||||
bf.ReadUint8(),
|
||||
}
|
||||
} else {
|
||||
m.FilenameLength = bf.ReadUint8()
|
||||
m.Filename = string(bf.ReadBytes(uint(m.FilenameLength)))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgSysGetFile) Build(bf *byteframe.ByteFrame) error {
|
||||
panic("Not implemented")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user