mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 23:14:36 +01:00
Merge pull request #86 from ZeruLight/chore/rename-goocoo
rename instances of gook to goocoo
This commit is contained in:
@@ -2,7 +2,6 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
@@ -11,9 +10,8 @@ import (
|
||||
// MsgMhfEnumerateGuacot represents the MSG_MHF_ENUMERATE_GUACOT
|
||||
type MsgMhfEnumerateGuacot struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16 // Hardcoded 0 in binary
|
||||
Unk0 uint32 // Hardcoded 0 in binary
|
||||
Unk1 uint16 // Hardcoded 0 in binary
|
||||
Unk2 uint16 // Hardcoded 0 in binary
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,9 +22,8 @@ func (m *MsgMhfEnumerateGuacot) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateGuacot) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -2,27 +2,23 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
type Gook struct {
|
||||
Exists bool
|
||||
Index uint32
|
||||
Type uint16
|
||||
Data []byte
|
||||
NameLen uint8
|
||||
Name []byte
|
||||
type Goocoo struct {
|
||||
Index uint32
|
||||
Data1 []uint16
|
||||
Data2 []uint32
|
||||
Name []byte
|
||||
}
|
||||
|
||||
// MsgMhfUpdateGuacot represents the MSG_MHF_UPDATE_GUACOT
|
||||
type MsgMhfUpdateGuacot struct {
|
||||
AckHandle uint32
|
||||
EntryCount uint16
|
||||
Unk0 uint16 // Hardcoded 0 in binary
|
||||
Gooks []Gook
|
||||
Goocoos []Goocoo
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -34,20 +30,18 @@ func (m *MsgMhfUpdateGuacot) Opcode() network.PacketID {
|
||||
func (m *MsgMhfUpdateGuacot) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.EntryCount = bf.ReadUint16()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
_ = bf.ReadUint16() // Zero
|
||||
var temp Goocoo
|
||||
for i := 0; i < int(m.EntryCount); i++ {
|
||||
e := Gook{}
|
||||
e.Index = bf.ReadUint32()
|
||||
e.Type = bf.ReadUint16()
|
||||
e.Data = bf.ReadBytes(50)
|
||||
e.NameLen = bf.ReadUint8()
|
||||
e.Name = bf.ReadBytes(uint(e.NameLen))
|
||||
if e.Type > 0 {
|
||||
e.Exists = true
|
||||
} else {
|
||||
e.Exists = false
|
||||
temp.Index = bf.ReadUint32()
|
||||
for j := 0; j < 22; j++ {
|
||||
temp.Data1 = append(temp.Data1, bf.ReadUint16())
|
||||
}
|
||||
m.Gooks = append(m.Gooks, e)
|
||||
for j := 0; j < 2; j++ {
|
||||
temp.Data2 = append(temp.Data2, bf.ReadUint32())
|
||||
}
|
||||
temp.Name = bf.ReadBytes(uint(bf.ReadUint8()))
|
||||
m.Goocoos = append(m.Goocoos, temp)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user