Merge remote-tracking branch 'origin/main' into feature/warehouse-v2

# Conflicts:
#	server/channelserver/handlers.go
This commit is contained in:
wish
2023-12-13 11:38:05 +11:00
143 changed files with 3551 additions and 3183 deletions

View File

@@ -1,19 +1,19 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfAcquireFesta represents the MSG_MHF_ACQUIRE_FESTA
type MsgMhfAcquireFesta struct {
AckHandle uint32
FestaID uint32
GuildID uint32
Unk uint16
AckHandle uint32
FestaID uint32
GuildID uint32
Unk uint8
}
// Opcode returns the ID associated with this packet type.
@@ -23,11 +23,12 @@ func (m *MsgMhfAcquireFesta) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfAcquireFesta) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.FestaID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
m.Unk = bf.ReadUint16()
return nil
m.AckHandle = bf.ReadUint32()
m.FestaID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
m.Unk = bf.ReadUint8()
bf.ReadUint8() // Zeroed
return nil
}
// Build builds a binary packet from the current data.

View File

@@ -12,7 +12,7 @@ import (
type MsgMhfAcquireGuildTresure struct {
AckHandle uint32
HuntID uint32
Unk uint8
Unk bool
}
// Opcode returns the ID associated with this packet type.
@@ -24,7 +24,7 @@ func (m *MsgMhfAcquireGuildTresure) Opcode() network.PacketID {
func (m *MsgMhfAcquireGuildTresure) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.HuntID = bf.ReadUint32()
m.Unk = bf.ReadUint8()
m.Unk = bf.ReadBool()
return nil
}

View File

@@ -11,9 +11,9 @@ import (
// MsgMhfAcquireMonthlyItem represents the MSG_MHF_ACQUIRE_MONTHLY_ITEM
type MsgMhfAcquireMonthlyItem struct {
AckHandle uint32
Unk0 uint16
Unk1 uint16
Unk2 uint32
Unk0 uint8
Unk1 uint8
Unk2 uint16
Unk3 uint32
}
@@ -25,10 +25,11 @@ func (m *MsgMhfAcquireMonthlyItem) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfAcquireMonthlyItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
m.Unk2 = bf.ReadUint32()
m.Unk0 = bf.ReadUint8()
m.Unk1 = bf.ReadUint8()
m.Unk2 = bf.ReadUint16()
m.Unk3 = bf.ReadUint32()
bf.ReadUint32() // Zeroed
return nil
}

View File

@@ -11,9 +11,7 @@ import (
// MsgMhfAcquireTitle represents the MSG_MHF_ACQUIRE_TITLE
type MsgMhfAcquireTitle struct {
AckHandle uint32
Unk0 uint16
Unk1 uint16
TitleID uint16
TitleIDs []uint16
}
// Opcode returns the ID associated with this packet type.
@@ -24,9 +22,11 @@ func (m *MsgMhfAcquireTitle) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfAcquireTitle) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
m.TitleID = bf.ReadUint16()
titles := int(bf.ReadUint16())
bf.ReadUint16() // Zeroed
for i := 0; i < titles; i++ {
m.TitleIDs = append(m.TitleIDs, bf.ReadUint16())
}
return nil
}

View File

@@ -14,7 +14,7 @@ type MsgMhfAnnounce struct {
IPAddress uint32
Port uint16
StageID []byte
Type uint8
Data *byteframe.ByteFrame
}
// Opcode returns the ID associated with this packet type.
@@ -31,8 +31,7 @@ func (m *MsgMhfAnnounce) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCon
_ = bf.ReadUint8()
_ = bf.ReadUint8()
m.StageID = bf.ReadBytes(32)
_ = bf.ReadUint32()
m.Type = bf.ReadUint8()
m.Data = byteframe.NewByteFrameFromBytes(bf.ReadBytes(uint(bf.ReadUint32())))
return nil
}

View File

@@ -1,18 +1,20 @@
package mhfpacket
import (
"errors"
"erupe-ce/common/byteframe"
_config "erupe-ce/config"
"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/common/byteframe"
)
// MsgMhfApplyDistItem represents the MSG_MHF_APPLY_DIST_ITEM
type MsgMhfApplyDistItem struct {
AckHandle uint32
AckHandle uint32
DistributionType uint8
DistributionID uint32
Unk2 uint32
Unk3 uint32
DistributionID uint32
Unk2 uint32
Unk3 uint32
}
// Opcode returns the ID associated with this packet type.
@@ -25,17 +27,16 @@ func (m *MsgMhfApplyDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
m.AckHandle = bf.ReadUint32()
m.DistributionType = bf.ReadUint8()
m.DistributionID = bf.ReadUint32()
m.Unk2 = bf.ReadUint32()
m.Unk3 = bf.ReadUint32()
if _config.ErupeConfig.RealClientMode >= _config.G8 {
m.Unk2 = bf.ReadUint32()
}
if _config.ErupeConfig.RealClientMode >= _config.G10 {
m.Unk3 = bf.ReadUint32()
}
return nil
}
// Build builds a binary packet from the current data.
func (m *MsgMhfApplyDistItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
bf.WriteUint32(m.AckHandle)
bf.WriteUint8(m.DistributionType)
bf.WriteUint32(m.DistributionID)
bf.WriteUint32(m.Unk2)
bf.WriteUint32(m.Unk3)
return nil
}
return errors.New("NOT IMPLEMENTED")
}

View File

@@ -1,9 +1,10 @@
package mhfpacket
import (
"errors"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/common/byteframe"
)
// MsgMhfArrangeGuildMember represents the MSG_MHF_ARRANGE_GUILD_MEMBER
@@ -22,11 +23,11 @@ func (m *MsgMhfArrangeGuildMember) Opcode() network.PacketID {
func (m *MsgMhfArrangeGuildMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
charCount := bf.ReadUint16()
bf.ReadUint8() // Zeroed
charCount := int(bf.ReadUint8())
m.CharIDs = make([]uint32, charCount)
for i := uint16(0); i < charCount; i++ {
for i := 0; i < charCount; i++ {
m.CharIDs[i] = bf.ReadUint32()
}
@@ -35,13 +36,5 @@ func (m *MsgMhfArrangeGuildMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx
// Build builds a binary packet from the current data.
func (m *MsgMhfArrangeGuildMember) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
bf.WriteUint32(m.AckHandle)
bf.WriteUint32(m.GuildID)
bf.WriteUint16(uint16(len(m.CharIDs)))
for _, charID := range m.CharIDs {
bf.WriteUint32(charID)
}
return nil
return errors.New("NOT IMPLEMENTED")
}

View File

@@ -1,9 +1,10 @@
package mhfpacket
import (
"errors"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/common/byteframe"
)
// MsgMhfCheckDailyCafepoint represents the MSG_MHF_CHECK_DAILY_CAFEPOINT
@@ -25,7 +26,5 @@ func (m *MsgMhfCheckDailyCafepoint) Parse(bf *byteframe.ByteFrame, ctx *clientct
}
func (m *MsgMhfCheckDailyCafepoint) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
bf.WriteUint32(m.AckHandle)
bf.WriteUint32(m.Unk)
return nil
return errors.New("NOT IMPLEMENTED")
}

View File

@@ -12,7 +12,6 @@ import (
type MsgMhfCheckMonthlyItem struct {
AckHandle uint32
Type uint8
Unk []byte
}
// Opcode returns the ID associated with this packet type.
@@ -24,7 +23,9 @@ func (m *MsgMhfCheckMonthlyItem) Opcode() network.PacketID {
func (m *MsgMhfCheckMonthlyItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Type = bf.ReadUint8()
m.Unk = bf.ReadBytes(3)
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
return nil
}

View File

@@ -12,7 +12,6 @@ type MsgMhfCheckWeeklyStamp struct {
AckHandle uint32
StampType string
Unk1 bool
Unk2 uint16 // Hardcoded 0 in the binary
}
// Opcode returns the ID associated with this packet type.
@@ -31,7 +30,7 @@ func (m *MsgMhfCheckWeeklyStamp) Parse(bf *byteframe.ByteFrame, ctx *clientctx.C
m.StampType = "ex"
}
m.Unk1 = bf.ReadBool()
m.Unk2 = bf.ReadUint16()
bf.ReadUint16() // Zeroed
return nil
}

View File

@@ -12,8 +12,6 @@ import (
// MsgMhfCreateGuild represents the MSG_MHF_CREATE_GUILD
type MsgMhfCreateGuild struct {
AckHandle uint32
Unk0 uint8
Unk1 uint8
Name string
}
@@ -25,9 +23,8 @@ func (m *MsgMhfCreateGuild) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfCreateGuild) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint8()
m.Unk1 = bf.ReadUint8()
_ = bf.ReadUint16() // len
bf.ReadUint16() // Zeroed
bf.ReadUint16() // Name length
m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
return nil
}

View File

@@ -1,19 +1,19 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/common/stringsupport"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/common/stringsupport"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfCreateJoint represents the MSG_MHF_CREATE_JOINT
type MsgMhfCreateJoint struct {
AckHandle uint32
GuildID uint32
Name string
AckHandle uint32
GuildID uint32
Name string
}
// Opcode returns the ID associated with this packet type.
@@ -23,11 +23,12 @@ func (m *MsgMhfCreateJoint) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfCreateJoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
_ = bf.ReadUint32() // len
m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
return nil
m.AckHandle = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
bf.ReadUint16() // Zeroed
bf.ReadUint16() // Name length
m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
return nil
}
// Build builds a binary packet from the current data.

View File

@@ -1,15 +1,14 @@
package mhfpacket
import (
"errors"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/common/byteframe"
)
// MsgMhfDisplayedAchievement represents the MSG_MHF_DISPLAYED_ACHIEVEMENT
type MsgMhfDisplayedAchievement struct {
Unk0 uint8
}
type MsgMhfDisplayedAchievement struct{}
// Opcode returns the ID associated with this packet type.
func (m *MsgMhfDisplayedAchievement) Opcode() network.PacketID {
@@ -18,12 +17,11 @@ func (m *MsgMhfDisplayedAchievement) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfDisplayedAchievement) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.Unk0 = bf.ReadUint8()
bf.ReadUint8() // Zeroed
return nil
}
// Build builds a binary packet from the current data.
func (m *MsgMhfDisplayedAchievement) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
bf.WriteUint8(m.Unk0)
return nil
return errors.New("NOT IMPLEMENTED")
}

View File

@@ -1,18 +1,18 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfEntryFesta represents the MSG_MHF_ENTRY_FESTA
type MsgMhfEntryFesta struct {
AckHandle uint32
FestaID uint32
GuildID uint32
AckHandle uint32
FestaID uint32
GuildID uint32
}
// Opcode returns the ID associated with this packet type.
@@ -22,11 +22,11 @@ func (m *MsgMhfEntryFesta) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfEntryFesta) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.FestaID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
_ = bf.ReadUint16() // Always 0
return nil
m.AckHandle = bf.ReadUint32()
m.FestaID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
bf.ReadUint16() // Zeroed
return nil
}
// Build builds a binary packet from the current data.

View File

@@ -1,17 +1,20 @@
package mhfpacket
import (
"errors"
"erupe-ce/common/byteframe"
_config "erupe-ce/config"
"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/common/byteframe"
)
// MsgMhfEnumerateDistItem represents the MSG_MHF_ENUMERATE_DIST_ITEM
type MsgMhfEnumerateDistItem struct {
AckHandle uint32
Unk0 uint8
Unk1 uint16
DistType uint8
Unk1 uint8
Unk2 uint16
Unk3 []byte
}
// Opcode returns the ID associated with this packet type.
@@ -22,17 +25,16 @@ func (m *MsgMhfEnumerateDistItem) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfEnumerateDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint8()
m.Unk1 = bf.ReadUint16()
m.Unk2 = bf.ReadUint16()
m.DistType = bf.ReadUint8()
m.Unk1 = bf.ReadUint8()
m.Unk2 = bf.ReadUint16() // Maximum? Hardcoded to 256
if _config.ErupeConfig.RealClientMode >= _config.Z1 {
m.Unk3 = bf.ReadBytes(uint(bf.ReadUint8()))
}
return nil
}
// Build builds a binary packet from the current data.
func (m *MsgMhfEnumerateDistItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
bf.WriteUint32(m.AckHandle)
bf.WriteUint8(m.Unk0)
bf.WriteUint16(m.Unk1)
bf.WriteUint16(m.Unk2)
return nil
return errors.New("NOT IMPLEMENTED")
}

View File

@@ -1,16 +1,15 @@
package mhfpacket
import (
"errors"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/common/byteframe"
)
// MsgMhfEnumerateEvent represents the MSG_MHF_ENUMERATE_EVENT
type MsgMhfEnumerateEvent struct {
AckHandle uint32
Unk0 uint16 // Hardcoded 0 in the binary
Unk1 uint16 // Hardcoded 0 in the binary
}
// Opcode returns the ID associated with this packet type.
@@ -21,15 +20,12 @@ func (m *MsgMhfEnumerateEvent) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfEnumerateEvent) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
bf.ReadUint16() // Zeroed
bf.ReadUint16() // Zeroed
return nil
}
// Build builds a binary packet from the current data.
func (m *MsgMhfEnumerateEvent) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
bf.WriteUint32(m.AckHandle)
bf.WriteUint16(m.Unk0)
bf.WriteUint16(m.Unk1)
return nil
return errors.New("NOT IMPLEMENTED")
}

View File

@@ -1,18 +1,18 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfEnumerateFestaMember represents the MSG_MHF_ENUMERATE_FESTA_MEMBER
type MsgMhfEnumerateFestaMember struct {
AckHandle uint32
FestaID uint32
GuildID uint32
AckHandle uint32
FestaID uint32
GuildID uint32
}
// Opcode returns the ID associated with this packet type.
@@ -22,11 +22,11 @@ func (m *MsgMhfEnumerateFestaMember) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfEnumerateFestaMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.AckHandle = bf.ReadUint32()
m.FestaID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
_ = bf.ReadUint16() // Hardcoded 0 in the binary.
return nil
bf.ReadUint16() // Zeroed
return nil
}
// Build builds a binary packet from the current data.

View File

@@ -10,8 +10,7 @@ import (
// MsgMhfEnumerateGuacot represents the MSG_MHF_ENUMERATE_GUACOT
type MsgMhfEnumerateGuacot struct {
AckHandle uint32
Unk0 uint32 // Hardcoded 0 in binary
Unk1 uint16 // Hardcoded 0 in binary
Unk0 uint32
}
// Opcode returns the ID associated with this packet type.
@@ -23,7 +22,7 @@ func (m *MsgMhfEnumerateGuacot) Opcode() network.PacketID {
func (m *MsgMhfEnumerateGuacot) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint32()
m.Unk1 = bf.ReadUint16()
bf.ReadUint16() // Zeroed
return nil
}

View File

@@ -2,9 +2,7 @@ package mhfpacket
import (
"errors"
"erupe-ce/common/bfutil"
"erupe-ce/common/byteframe"
"erupe-ce/common/stringsupport"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
@@ -34,8 +32,8 @@ type MsgMhfEnumerateGuild struct {
Type EnumerateGuildType
Page uint8
Sorting bool
Data1 []byte
Data2 string
Data1 *byteframe.ByteFrame
Data2 *byteframe.ByteFrame
}
// Opcode returns the ID associated with this packet type.
@@ -49,12 +47,12 @@ func (m *MsgMhfEnumerateGuild) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli
m.Type = EnumerateGuildType(bf.ReadUint8())
m.Page = bf.ReadUint8()
m.Sorting = bf.ReadBool()
_ = bf.ReadBytes(1)
m.Data1 = bf.ReadBytes(4)
_ = bf.ReadBytes(2)
lenData2 := uint(bf.ReadUint8())
_ = bf.ReadBytes(1)
m.Data2 = stringsupport.SJISToUTF8(bfutil.UpToNull(bf.ReadBytes(lenData2)))
bf.ReadUint8() // Zeroed
m.Data1 = byteframe.NewByteFrameFromBytes(bf.ReadBytes(4))
bf.ReadUint16() // Zeroed
dataLen := uint(bf.ReadUint8())
bf.ReadUint8() // Zeroed
m.Data2 = byteframe.NewByteFrameFromBytes(bf.ReadBytes(dataLen))
return nil
}

View File

@@ -1,18 +1,17 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfEnumerateGuildItem represents the MSG_MHF_ENUMERATE_GUILD_ITEM
type MsgMhfEnumerateGuildItem struct {
AckHandle uint32
GuildId uint32
Unk0 uint16
GuildID uint32
}
// Opcode returns the ID associated with this packet type.
@@ -22,9 +21,10 @@ func (m *MsgMhfEnumerateGuildItem) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfEnumerateGuildItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.GuildId = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.AckHandle = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
return nil
}

View File

@@ -1,17 +1,17 @@
package mhfpacket
import (
"errors"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/common/byteframe"
)
// MsgMhfEnumerateGuildMember represents the MSG_MHF_ENUMERATE_GUILD_MEMBER
type MsgMhfEnumerateGuildMember struct {
AckHandle uint32
Unk0 uint16 // Hardcoded 00 01 in the binary
Unk1 uint32 // Alliance related
GuildID uint32
AckHandle uint32
AllianceID uint32
GuildID uint32
}
// Opcode returns the ID associated with this packet type.
@@ -22,17 +22,14 @@ func (m *MsgMhfEnumerateGuildMember) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfEnumerateGuildMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint32()
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Always 1
m.AllianceID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
return nil
}
// Build builds a binary packet from the current data.
func (m *MsgMhfEnumerateGuildMember) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
bf.WriteUint32(m.AckHandle)
bf.WriteUint16(m.Unk0)
bf.WriteUint32(m.Unk1)
bf.WriteUint32(m.GuildID)
return nil
return errors.New("NOT IMPLEMENTED")
}

View File

@@ -12,7 +12,8 @@ import (
type MsgMhfEnumerateGuildTresure struct {
AckHandle uint32
MaxHunts uint16
Unk uint32
Unk0 uint16
Unk1 uint16
}
// Opcode returns the ID associated with this packet type.
@@ -24,9 +25,8 @@ func (m *MsgMhfEnumerateGuildTresure) Opcode() network.PacketID {
func (m *MsgMhfEnumerateGuildTresure) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.MaxHunts = bf.ReadUint16()
// Changes with MaxHunts
// 0 if MaxHunts = 1, 1 if MaxHunts = 30
m.Unk = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
return nil
}

View File

@@ -14,7 +14,6 @@ type MsgMhfEnumerateHouse struct {
AckHandle uint32
CharID uint32
Method uint8
Unk uint16
Name string
}
@@ -28,7 +27,7 @@ func (m *MsgMhfEnumerateHouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli
m.AckHandle = bf.ReadUint32()
m.CharID = bf.ReadUint32()
m.Method = bf.ReadUint8()
m.Unk = bf.ReadUint16()
bf.ReadUint16() // Zeroed
lenName := bf.ReadUint8()
if lenName > 0 {
m.Name = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())

View File

@@ -10,8 +10,13 @@ import (
// MsgMhfEnumerateInvGuild represents the MSG_MHF_ENUMERATE_INV_GUILD
type MsgMhfEnumerateInvGuild struct {
AckHandle uint32
Unk []byte
AckHandle uint32
Unk uint32
Operation uint8
ActiveHours uint8
DaysActive uint8
PlayStyle uint8
GuildRequest uint8
}
// Opcode returns the ID associated with this packet type.
@@ -22,7 +27,12 @@ func (m *MsgMhfEnumerateInvGuild) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfEnumerateInvGuild) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk = bf.ReadBytes(9)
m.Unk = bf.ReadUint32()
m.Operation = bf.ReadUint8()
m.ActiveHours = bf.ReadUint8()
m.DaysActive = bf.ReadUint8()
m.PlayStyle = bf.ReadUint8()
m.GuildRequest = bf.ReadUint8()
return nil
}

View File

@@ -1,18 +1,16 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfEnumeratePrice represents the MSG_MHF_ENUMERATE_PRICE
type MsgMhfEnumeratePrice struct {
AckHandle uint32
Unk0 uint16 // Hardcoded 0 in the binary
Unk1 uint16 // Hardcoded 0 in the binary
}
// Opcode returns the ID associated with this packet type.
@@ -23,8 +21,8 @@ func (m *MsgMhfEnumeratePrice) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfEnumeratePrice) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
bf.ReadUint16() // Zeroed
bf.ReadUint16() // Zeroed
return nil
}

View File

@@ -1,18 +1,16 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfEnumerateRanking represents the MSG_MHF_ENUMERATE_RANKING
type MsgMhfEnumerateRanking struct {
AckHandle uint32
Unk0 uint16 // Hardcoded 0 in the binary
Unk1 uint16 // Hardcoded 0 in the binary
}
// Opcode returns the ID associated with this packet type.
@@ -23,8 +21,9 @@ func (m *MsgMhfEnumerateRanking) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfEnumerateRanking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
bf.ReadUint16() // Zeroed
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
return nil
}

View File

@@ -14,7 +14,7 @@ type MsgMhfEnumerateShop struct {
AckHandle uint32
ShopType uint8 // 1 running gachas, 10 normal shop extensions, 8 Diva Defense shop
ShopID uint32
Unk2 uint16 // 00 80 running gachas, 00 20 normal shop
Limit uint16
Unk3 uint8
Unk4 uint8
Unk5 uint32
@@ -30,7 +30,7 @@ func (m *MsgMhfEnumerateShop) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
m.AckHandle = bf.ReadUint32()
m.ShopType = bf.ReadUint8()
m.ShopID = bf.ReadUint32()
m.Unk2 = bf.ReadUint16()
m.Limit = bf.ReadUint16()
m.Unk3 = bf.ReadUint8()
if _config.ErupeConfig.RealClientMode >= _config.G2 {
m.Unk4 = bf.ReadUint8()

View File

@@ -11,7 +11,6 @@ import (
// MsgMhfEnumerateUnionItem represents the MSG_MHF_ENUMERATE_UNION_ITEM
type MsgMhfEnumerateUnionItem struct {
AckHandle uint32
Unk0 uint16
}
// Opcode returns the ID associated with this packet type.
@@ -22,8 +21,8 @@ func (m *MsgMhfEnumerateUnionItem) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfEnumerateUnionItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
return nil
}

View File

@@ -13,7 +13,6 @@ type MsgMhfExchangeWeeklyStamp struct {
AckHandle uint32
StampType string
Unk1 uint8
Unk2 uint16
}
// Opcode returns the ID associated with this packet type.
@@ -32,7 +31,7 @@ func (m *MsgMhfExchangeWeeklyStamp) Parse(bf *byteframe.ByteFrame, ctx *clientct
m.StampType = "ex"
}
m.Unk1 = bf.ReadUint8()
m.Unk2 = bf.ReadUint16()
bf.ReadUint16() // Zeroed
return nil
}

View File

@@ -12,7 +12,6 @@ import (
type MsgMhfGetAchievement struct {
AckHandle uint32
CharID uint32
Unk1 uint32 // char?
}
// Opcode returns the ID associated with this packet type.
@@ -24,7 +23,7 @@ func (m *MsgMhfGetAchievement) Opcode() network.PacketID {
func (m *MsgMhfGetAchievement) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.CharID = bf.ReadUint32()
m.Unk1 = bf.ReadUint32()
bf.ReadUint32() // Zeroed
return nil
}

View File

@@ -1,17 +1,16 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfGetRengokuBinary represents the MSG_MHF_GET_RENGOKU_BINARY
type MsgMhfGetRengokuBinary struct {
AckHandle uint32
Unk0 uint8 // Hardcoded 0 in binary
}
// Opcode returns the ID associated with this packet type.
@@ -22,7 +21,7 @@ func (m *MsgMhfGetRengokuBinary) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfGetRengokuBinary) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint8()
bf.ReadUint8() // Zeroed
return nil
}

View File

@@ -1,18 +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"
)
// MsgMhfInfoFesta represents the MSG_MHF_INFO_FESTA
type MsgMhfInfoFesta struct {
AckHandle uint32
Unk0 uint16 // Hardcoded 0 in the binary
Unk1 uint16 // Hardcoded 0 in the binary
Unk0 uint8
}
// Opcode returns the ID associated with this packet type.
@@ -23,8 +22,10 @@ func (m *MsgMhfInfoFesta) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfInfoFesta) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
m.Unk0 = bf.ReadUint8()
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
return nil
}

View File

@@ -12,7 +12,6 @@ import (
type MsgMhfInfoJoint struct {
AckHandle uint32
AllianceID uint32
Unk uint32
}
// Opcode returns the ID associated with this packet type.
@@ -24,7 +23,7 @@ func (m *MsgMhfInfoJoint) Opcode() network.PacketID {
func (m *MsgMhfInfoJoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.AllianceID = bf.ReadUint32()
m.Unk = bf.ReadUint32()
bf.ReadUint32() // Zeroed
return nil
}

View File

@@ -1,17 +1,16 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfListMail represents the MSG_MHF_LIST_MAIL
type MsgMhfListMail struct {
AckHandle uint32
Unk0 uint32
}
// Opcode returns the ID associated with this packet type.
@@ -22,7 +21,8 @@ func (m *MsgMhfListMail) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfListMail) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint32()
bf.ReadUint16() // Zeroed
bf.ReadUint16() // Zeroed
return nil
}

View File

@@ -1,17 +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"
)
// MsgMhfListMember represents the MSG_MHF_LIST_MEMBER
type MsgMhfListMember struct {
AckHandle uint32
Unk0 uint16 // Hardcoded 01 00 in the JP client.
Unk0 uint8 // Hardcoded 01 in the JP client.
}
// Opcode returns the ID associated with this packet type.
@@ -22,7 +22,8 @@ func (m *MsgMhfListMember) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfListMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk0 = bf.ReadUint8()
bf.ReadUint8() // Zeroed
return nil
}

View File

@@ -1,17 +1,17 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfLoadGuildCooking represents the MSG_MHF_LOAD_GUILD_COOKING
type MsgMhfLoadGuildCooking struct{
AckHandle uint32
MaxMeals uint8
type MsgMhfLoadGuildCooking struct {
AckHandle uint32
MaxMeals uint8
}
// Opcode returns the ID associated with this packet type.
@@ -22,7 +22,7 @@ func (m *MsgMhfLoadGuildCooking) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfLoadGuildCooking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
_ = bf.ReadUint8()
m.MaxMeals = bf.ReadUint8()
return nil
}

View File

@@ -16,7 +16,6 @@ type MsgMhfLoadHouse struct {
Destination uint8
// False if already in hosts My Series, in case host updates PW
CheckPass bool
Unk3 uint16 // Hardcoded 0 in binary
Password string
}
@@ -31,8 +30,8 @@ func (m *MsgMhfLoadHouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCo
m.CharID = bf.ReadUint32()
m.Destination = bf.ReadUint8()
m.CheckPass = bf.ReadBool()
_ = bf.ReadUint16()
_ = bf.ReadUint8() // Password length
bf.ReadUint16() // Zeroed
bf.ReadUint8() // Password length
m.Password = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
return nil
}

View File

@@ -23,7 +23,6 @@ type MsgMhfOperateGuildMember struct {
GuildID uint32
CharID uint32
Action uint8
Unk []byte
}
// Opcode returns the ID associated with this packet type.
@@ -37,7 +36,8 @@ func (m *MsgMhfOperateGuildMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx
m.GuildID = bf.ReadUint32()
m.CharID = bf.ReadUint32()
m.Action = bf.ReadUint8()
m.Unk = bf.ReadBytes(3)
bf.ReadUint8() // Zeroed
bf.ReadUint16() // Zeroed
return nil
}

View File

@@ -22,7 +22,8 @@ type MsgMhfOperateJoint struct {
AllianceID uint32
GuildID uint32
Action OperateJointAction
UnkData *byteframe.ByteFrame
Data1 *byteframe.ByteFrame
Data2 *byteframe.ByteFrame
}
// Opcode returns the ID associated with this packet type.
@@ -36,8 +37,9 @@ func (m *MsgMhfOperateJoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clien
m.AllianceID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
m.Action = OperateJointAction(bf.ReadUint8())
m.UnkData = byteframe.NewByteFrameFromBytes(bf.DataFromCurrent())
bf.Seek(int64(len(bf.Data())-2), 0)
dataLen := uint(bf.ReadUint8())
m.Data1 = byteframe.NewByteFrameFromBytes(bf.ReadBytes(4))
m.Data2 = byteframe.NewByteFrameFromBytes(bf.ReadBytes(dataLen))
return nil
}

View File

@@ -1,20 +1,19 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfOprMember represents the MSG_MHF_OPR_MEMBER
type MsgMhfOprMember struct {
AckHandle uint32
Blacklist bool
Operation bool
Unk uint16
CharID uint32
AckHandle uint32
Blacklist bool
Operation bool
CharIDs []uint32
}
// Opcode returns the ID associated with this packet type.
@@ -24,12 +23,15 @@ func (m *MsgMhfOprMember) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfOprMember) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Blacklist = bf.ReadBool()
m.Operation = bf.ReadBool()
m.Unk = bf.ReadUint16()
m.CharID = bf.ReadUint32()
return nil
m.AckHandle = bf.ReadUint32()
m.Blacklist = bf.ReadBool()
m.Operation = bf.ReadBool()
bf.ReadUint8()
chars := int(bf.ReadUint8())
for i := 0; i < chars; i++ {
m.CharIDs = append(m.CharIDs, bf.ReadUint32())
}
return nil
}
// Build builds a binary packet from the current data.

View File

@@ -11,10 +11,11 @@ import (
type OperateMailOperation uint8
const (
OPERATE_MAIL_DELETE = 0x01
OPERATE_MAIL_LOCK = 0x02
OPERATE_MAIL_UNLOCK = 0x03
OPERATE_MAIL_ACQUIRE_ITEM = 0x05
OperateMailDelete = iota + 1
OperateMailLock
OperateMailUnlock
OpreateMailNull
OperateMailAcquireItem
)
// MsgMhfOprtMail represents the MSG_MHF_OPRT_MAIL
@@ -23,7 +24,6 @@ type MsgMhfOprtMail struct {
AccIndex uint8
Index uint8
Operation OperateMailOperation
Unk0 uint8
Data []byte
Amount uint16
ItemID uint16
@@ -40,8 +40,8 @@ func (m *MsgMhfOprtMail) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCon
m.AccIndex = bf.ReadUint8()
m.Index = bf.ReadUint8()
m.Operation = OperateMailOperation(bf.ReadUint8())
m.Unk0 = bf.ReadUint8()
if m.Operation == OPERATE_MAIL_ACQUIRE_ITEM {
bf.ReadUint8() // Zeroed
if m.Operation == OperateMailAcquireItem {
m.Amount = bf.ReadUint16()
m.ItemID = bf.ReadUint16()
}

View File

@@ -1,15 +1,19 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfPlayFreeGacha represents the MSG_MHF_PLAY_FREE_GACHA
type MsgMhfPlayFreeGacha struct{}
type MsgMhfPlayFreeGacha struct {
AckHandle uint32
GachaID uint32
GachaType uint8
}
// Opcode returns the ID associated with this packet type.
func (m *MsgMhfPlayFreeGacha) Opcode() network.PacketID {
@@ -18,7 +22,10 @@ func (m *MsgMhfPlayFreeGacha) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfPlayFreeGacha) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
return errors.New("NOT IMPLEMENTED")
m.AckHandle = bf.ReadUint32()
m.GachaID = bf.ReadUint32()
m.GachaType = bf.ReadUint8()
return nil
}
// Build builds a binary packet from the current data.

View File

@@ -1,15 +1,24 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfPostSeibattle represents the MSG_MHF_POST_SEIBATTLE
type MsgMhfPostSeibattle struct{}
type MsgMhfPostSeibattle struct {
AckHandle uint32
Unk0 uint8
Unk1 uint8
Unk2 uint32
Unk3 uint8
Unk4 uint16
Unk5 uint16
Unk6 uint8
}
// Opcode returns the ID associated with this packet type.
func (m *MsgMhfPostSeibattle) Opcode() network.PacketID {
@@ -18,7 +27,15 @@ func (m *MsgMhfPostSeibattle) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfPostSeibattle) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
return errors.New("NOT IMPLEMENTED")
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint8()
m.Unk1 = bf.ReadUint8()
m.Unk2 = bf.ReadUint32()
m.Unk3 = bf.ReadUint8()
m.Unk4 = bf.ReadUint16()
m.Unk5 = bf.ReadUint16()
m.Unk6 = bf.ReadUint8()
return nil
}
// Build builds a binary packet from the current data.

View File

@@ -19,7 +19,6 @@ type MsgMhfReadMail struct {
// This is the index within the current mail list
Index uint8
Unk0 uint16
}
// Opcode returns the ID associated with this packet type.
@@ -32,7 +31,7 @@ func (m *MsgMhfReadMail) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCon
m.AckHandle = bf.ReadUint32()
m.AccIndex = bf.ReadUint8()
m.Index = bf.ReadUint8()
m.Unk0 = bf.ReadUint16()
bf.ReadUint16() // Zeroed
return nil
}

View File

@@ -13,7 +13,6 @@ type MsgMhfReadMercenaryW struct {
AckHandle uint32
Op uint8
Unk1 uint8
Unk2 uint16 // Hardcoded 0 in the binary
}
// Opcode returns the ID associated with this packet type.
@@ -25,8 +24,9 @@ func (m *MsgMhfReadMercenaryW) Opcode() network.PacketID {
func (m *MsgMhfReadMercenaryW) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Op = bf.ReadUint8()
m.Unk1 = bf.ReadUint8()
m.Unk2 = bf.ReadUint16()
m.Unk1 = bf.ReadUint8() // Supposed to be 0 or 1, but always 1
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
return nil
}

View File

@@ -12,8 +12,7 @@ type MsgMhfRegisterEvent struct {
Unk0 uint16
WorldID uint16
LandID uint16
Unk3 uint8
Unk4 uint8
Unk1 bool
}
// Opcode returns the ID associated with this packet type.
@@ -27,8 +26,8 @@ func (m *MsgMhfRegisterEvent) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
m.Unk0 = bf.ReadUint16()
m.WorldID = bf.ReadUint16()
m.LandID = bf.ReadUint16()
m.Unk3 = bf.ReadUint8()
m.Unk4 = bf.ReadUint8()
m.Unk1 = bf.ReadBool()
bf.ReadUint8() // Zeroed
return nil
}

View File

@@ -12,7 +12,6 @@ import (
type MsgMhfReleaseEvent struct {
AckHandle uint32
RaviID uint32
Unk1 uint32
}
// Opcode returns the ID associated with this packet type.
@@ -24,7 +23,7 @@ func (m *MsgMhfReleaseEvent) Opcode() network.PacketID {
func (m *MsgMhfReleaseEvent) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.RaviID = bf.ReadUint32()
m.Unk1 = bf.ReadUint32()
bf.ReadUint32() // Zeroed
return nil
}

View File

@@ -15,7 +15,7 @@ type MsgMhfSendMail struct {
RecipientID uint32
SubjectLength uint16
BodyLength uint16
Quantity uint32
Quantity uint16
ItemID uint16
Subject string
Body string
@@ -32,7 +32,8 @@ func (m *MsgMhfSendMail) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCon
m.RecipientID = bf.ReadUint32()
m.SubjectLength = bf.ReadUint16()
m.BodyLength = bf.ReadUint16()
m.Quantity = bf.ReadUint32()
bf.ReadUint16() // Zeroed
m.Quantity = bf.ReadUint16()
m.ItemID = bf.ReadUint16()
m.Subject = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
m.Body = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())

View File

@@ -13,7 +13,6 @@ type MsgMhfSetGuildManageRight struct {
AckHandle uint32
CharID uint32
Allowed bool
Unk []byte
}
// Opcode returns the ID associated with this packet type.
@@ -26,7 +25,7 @@ func (m *MsgMhfSetGuildManageRight) Parse(bf *byteframe.ByteFrame, ctx *clientct
m.AckHandle = bf.ReadUint32()
m.CharID = bf.ReadUint32()
m.Allowed = bf.ReadBool()
m.Unk = bf.ReadBytes(3)
bf.ReadBytes(3) // Zeroed
return nil
}

View File

@@ -34,7 +34,7 @@ func (m *MsgMhfStampcardStamp) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli
m.HR = bf.ReadUint16()
m.GR = bf.ReadUint16()
m.Stamps = bf.ReadUint16()
_ = bf.ReadUint16()
bf.ReadUint16() // Zeroed
if _config.ErupeConfig.RealClientMode > _config.Z1 {
m.Reward1 = uint16(bf.ReadUint32())
m.Reward2 = uint16(bf.ReadUint32())

View File

@@ -1,18 +1,18 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfStateFestaG represents the MSG_MHF_STATE_FESTA_G
type MsgMhfStateFestaG struct {
AckHandle uint32
FestaID uint32
GuildID uint32
FestaID uint32
GuildID uint32
}
// Opcode returns the ID associated with this packet type.
@@ -25,7 +25,7 @@ func (m *MsgMhfStateFestaG) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Client
m.AckHandle = bf.ReadUint32()
m.FestaID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
_ = bf.ReadUint16() // Hardcoded 0 in the binary.
bf.ReadUint16() // Zeroed
return nil
}

View File

@@ -1,18 +1,18 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfStateFestaU represents the MSG_MHF_STATE_FESTA_U
type MsgMhfStateFestaU struct {
AckHandle uint32
FestaID uint32
GuildID uint32
AckHandle uint32
FestaID uint32
GuildID uint32
}
// Opcode returns the ID associated with this packet type.
@@ -22,11 +22,11 @@ func (m *MsgMhfStateFestaU) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfStateFestaU) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.FestaID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
_ = bf.ReadUint16() // Hardcoded 0 in the binary.
return nil
m.AckHandle = bf.ReadUint32()
m.FestaID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
bf.ReadUint16() // Zeroed
return nil
}
// Build builds a binary packet from the current data.

View File

@@ -1,11 +1,11 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfTransferItem represents the MSG_MHF_TRANSFER_ITEM
@@ -15,8 +15,8 @@ type MsgMhfTransferItem struct {
// correlate with any item IDs that would make sense to get after quests so
// I have no idea what this actually does
Unk0 uint32
Unk1 uint16 // Hardcoded
Unk2 uint16 // Hardcoded
Unk1 uint8
Unk2 uint16
}
// Opcode returns the ID associated with this packet type.
@@ -28,7 +28,8 @@ func (m *MsgMhfTransferItem) Opcode() network.PacketID {
func (m *MsgMhfTransferItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint32()
m.Unk1 = bf.ReadUint16()
m.Unk1 = bf.ReadUint8()
bf.ReadUint8() // Zeroed
m.Unk2 = bf.ReadUint16()
return nil
}

View File

@@ -12,7 +12,6 @@ import (
type MsgMhfTransitMessage struct {
AckHandle uint32
Unk0 uint8
Unk1 uint8
SearchType uint16
MessageData []byte
}
@@ -26,7 +25,7 @@ func (m *MsgMhfTransitMessage) Opcode() network.PacketID {
func (m *MsgMhfTransitMessage) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint8()
m.Unk1 = bf.ReadUint8()
bf.ReadUint8() // Zeroed
m.SearchType = bf.ReadUint16()
m.MessageData = bf.ReadBytes(uint(bf.ReadUint16()))
return nil

View File

@@ -1,15 +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"
)
// MsgMhfUnreserveSrg represents the MSG_MHF_UNRESERVE_SRG
type MsgMhfUnreserveSrg struct{}
type MsgMhfUnreserveSrg struct {
AckHandle uint32
}
// Opcode returns the ID associated with this packet type.
func (m *MsgMhfUnreserveSrg) Opcode() network.PacketID {
@@ -18,7 +20,8 @@ func (m *MsgMhfUnreserveSrg) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfUnreserveSrg) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
return errors.New("NOT IMPLEMENTED")
m.AckHandle = bf.ReadUint32()
return nil
}
// Build builds a binary packet from the current data.

View File

@@ -1,18 +1,16 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfUpdateCafepoint represents the MSG_MHF_UPDATE_CAFEPOINT
type MsgMhfUpdateCafepoint struct {
AckHandle uint32
Unk0 uint16 // Hardcoded 0 in binary
Unk1 uint16 // Hardcoded 0 in binary
}
// Opcode returns the ID associated with this packet type.
@@ -23,8 +21,8 @@ func (m *MsgMhfUpdateCafepoint) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfUpdateCafepoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
bf.ReadUint16() // Zeroed
bf.ReadUint16() // Zeroed
return nil
}

View File

@@ -9,7 +9,7 @@ import (
type Goocoo struct {
Index uint32
Data1 []uint16
Data1 []int16
Data2 []uint32
Name []byte
}
@@ -30,12 +30,12 @@ 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()
_ = bf.ReadUint16() // Zero
bf.ReadUint16() // Zeroed
var temp Goocoo
for i := 0; i < int(m.EntryCount); i++ {
temp.Index = bf.ReadUint32()
for j := 0; j < 22; j++ {
temp.Data1 = append(temp.Data1, bf.ReadUint16())
temp.Data1 = append(temp.Data1, bf.ReadInt16())
}
for j := 0; j < 2; j++ {
temp.Data2 = append(temp.Data2, bf.ReadUint32())

View File

@@ -25,8 +25,6 @@ type GuildIconMsgPart struct {
type MsgMhfUpdateGuildIcon struct {
AckHandle uint32
GuildID uint32
PartCount uint16
Unk1 uint16
IconParts []GuildIconMsgPart
}
@@ -39,12 +37,12 @@ func (m *MsgMhfUpdateGuildIcon) Opcode() network.PacketID {
func (m *MsgMhfUpdateGuildIcon) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
m.PartCount = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
partCount := int(bf.ReadUint16())
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
m.IconParts = make([]GuildIconMsgPart, partCount)
m.IconParts = make([]GuildIconMsgPart, m.PartCount)
for i := 0; i < int(m.PartCount); i++ {
for i := 0; i < partCount; i++ {
m.IconParts[i] = GuildIconMsgPart{
Index: bf.ReadUint16(),
ID: bf.ReadUint16(),

View File

@@ -10,7 +10,7 @@ import (
type Item struct {
Unk0 uint32
ItemId uint16
ItemID uint16
Amount uint16
Unk1 uint32
}
@@ -18,10 +18,8 @@ type Item struct {
// MsgMhfUpdateGuildItem represents the MSG_MHF_UPDATE_GUILD_ITEM
type MsgMhfUpdateGuildItem struct {
AckHandle uint32
GuildId uint32
Amount uint16
Unk1 uint16 // 0x00 0x00
Items []Item // Array of updated item IDs
GuildID uint32
Items []Item
}
// Opcode returns the ID associated with this packet type.
@@ -32,14 +30,15 @@ func (m *MsgMhfUpdateGuildItem) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfUpdateGuildItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.GuildId = bf.ReadUint32()
m.Amount = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
m.Items = make([]Item, int(m.Amount))
m.GuildID = bf.ReadUint32()
itemCount := int(bf.ReadUint16())
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
m.Items = make([]Item, itemCount)
for i := 0; i < int(m.Amount); i++ {
for i := 0; i < itemCount; i++ {
m.Items[i].Unk0 = bf.ReadUint32()
m.Items[i].ItemId = bf.ReadUint16()
m.Items[i].ItemID = bf.ReadUint16()
m.Items[i].Amount = bf.ReadUint16()
m.Items[i].Unk1 = bf.ReadUint32()
}

View File

@@ -13,8 +13,7 @@ import (
type MsgMhfUpdateHouse struct {
AckHandle uint32
State uint8
Unk1 uint8 // Always 0x01
Unk2 uint16 // Always 0x0000
Unk1 uint8 // Always 0x01
Password string
}
@@ -28,8 +27,9 @@ func (m *MsgMhfUpdateHouse) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Client
m.AckHandle = bf.ReadUint32()
m.State = bf.ReadUint8()
m.Unk1 = bf.ReadUint8()
m.Unk2 = bf.ReadUint16()
_ = bf.ReadUint8() // Password length
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Password length
m.Password = stringsupport.SJISToUTF8(bf.ReadNullTerminatedBytes())
return nil
}

View File

@@ -1,17 +1,18 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
_config "erupe-ce/config"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfUpdateMyhouseInfo represents the MSG_MHF_UPDATE_MYHOUSE_INFO
type MsgMhfUpdateMyhouseInfo struct {
AckHandle uint32
Unk0 []byte
Data []byte
}
// Opcode returns the ID associated with this packet type.
@@ -22,7 +23,16 @@ func (m *MsgMhfUpdateMyhouseInfo) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfUpdateMyhouseInfo) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadBytes(0x16A)
if _config.ErupeConfig.RealClientMode >= _config.G10 {
m.Data = bf.ReadBytes(362)
} else if _config.ErupeConfig.RealClientMode >= _config.GG {
m.Data = bf.ReadBytes(338)
} else if _config.ErupeConfig.RealClientMode >= _config.F5 {
// G1 is a guess
m.Data = bf.ReadBytes(314)
} else {
m.Data = bf.ReadBytes(290)
}
return nil
}

View File

@@ -11,9 +11,7 @@ import (
// MsgMhfUpdateUnionItem represents the MSG_MHF_UPDATE_UNION_ITEM
type MsgMhfUpdateUnionItem struct {
AckHandle uint32
Amount uint16
Unk1 uint16 // 0x00 0x00
Items []Item // Array of updated item IDs
Items []Item
}
// Opcode returns the ID associated with this packet type.
@@ -24,13 +22,14 @@ func (m *MsgMhfUpdateUnionItem) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfUpdateUnionItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Amount = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
m.Items = make([]Item, int(m.Amount))
itemCount := int(bf.ReadUint16())
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
m.Items = make([]Item, itemCount)
for i := 0; i < int(m.Amount); i++ {
for i := 0; i < itemCount; i++ {
m.Items[i].Unk0 = bf.ReadUint32()
m.Items[i].ItemId = bf.ReadUint16()
m.Items[i].ItemID = bf.ReadUint16()
m.Items[i].Amount = bf.ReadUint16()
m.Items[i].Unk1 = bf.ReadUint32()
}

View File

@@ -1,19 +1,20 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgMhfUseGachaPoint represents the MSG_MHF_USE_GACHA_POINT
type MsgMhfUseGachaPoint struct{
AckHandle uint32
Unk0 uint16 // padding?
TrialCoins uint32
PremiumCoins uint32
type MsgMhfUseGachaPoint struct {
AckHandle uint32
Unk0 uint8
Unk1 uint8
TrialCoins uint32
PremiumCoins uint32
}
// Opcode returns the ID associated with this packet type.
@@ -24,7 +25,8 @@ func (m *MsgMhfUseGachaPoint) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfUseGachaPoint) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk0 = bf.ReadUint8()
m.Unk1 = bf.ReadUint8()
m.TrialCoins = bf.ReadUint32()
m.PremiumCoins = bf.ReadUint32()
return nil

View File

@@ -11,7 +11,7 @@ import (
// MsgMhfVoteFesta represents the MSG_MHF_VOTE_FESTA
type MsgMhfVoteFesta struct {
AckHandle uint32
Unk uint32
FestaID uint32
GuildID uint32
TrialID uint32
}
@@ -24,7 +24,7 @@ func (m *MsgMhfVoteFesta) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgMhfVoteFesta) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk = bf.ReadUint32()
m.FestaID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
m.TrialID = bf.ReadUint32()
return nil

View File

@@ -1,17 +1,16 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgSysCastBinary represents the MSG_SYS_CAST_BINARY
type MsgSysCastBinary struct {
Unk0 uint16
Unk1 uint16
Unk uint32
BroadcastType uint8
MessageType uint8
RawDataPayload []byte
@@ -24,8 +23,7 @@ func (m *MsgSysCastBinary) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgSysCastBinary) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
m.Unk = bf.ReadUint32()
m.BroadcastType = bf.ReadUint8()
m.MessageType = bf.ReadUint8()
dataSize := bf.ReadUint16()

View File

@@ -2,7 +2,6 @@ package mhfpacket
import (
"errors"
"erupe-ce/common/bfutil"
"erupe-ce/common/byteframe"
_config "erupe-ce/config"
"erupe-ce/network"
@@ -29,8 +28,8 @@ func (m *MsgSysCreateAcquireSemaphore) Parse(bf *byteframe.ByteFrame, ctx *clien
if _config.ErupeConfig.RealClientMode >= _config.S7 { // Assuming this was added with Ravi?
m.PlayerCount = bf.ReadUint8()
}
SemaphoreIDLength := bf.ReadUint8()
m.SemaphoreID = string(bfutil.UpToNull(bf.ReadBytes(uint(SemaphoreIDLength))))
bf.ReadUint8() // SemaphoreID length
m.SemaphoreID = string(bf.ReadNullTerminatedBytes())
return nil
}

View File

@@ -2,6 +2,7 @@ package mhfpacket
import (
"errors"
_config "erupe-ce/config"
"erupe-ce/common/byteframe"
"erupe-ce/network"
@@ -10,10 +11,10 @@ import (
// MsgSysCreateSemaphore represents the MSG_SYS_CREATE_SEMAPHORE
type MsgSysCreateSemaphore struct {
AckHandle uint32
Unk0 uint16
DataSize uint16
RawDataPayload []byte
AckHandle uint32
Unk0 uint16
PlayerCount uint8
SemaphoreID string
}
// Opcode returns the ID associated with this packet type.
@@ -25,8 +26,11 @@ func (m *MsgSysCreateSemaphore) Opcode() network.PacketID {
func (m *MsgSysCreateSemaphore) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.DataSize = bf.ReadUint16()
m.RawDataPayload = bf.ReadBytes(uint(m.DataSize))
if _config.ErupeConfig.RealClientMode >= _config.S7 { // Assuming this was added with Ravi?
m.PlayerCount = bf.ReadUint8()
}
bf.ReadUint8() // SemaphoreID length
m.SemaphoreID = string(bf.ReadNullTerminatedBytes())
return nil
}

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"
)
@@ -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
}

View File

@@ -4,7 +4,6 @@ import (
"errors"
"erupe-ce/common/byteframe"
"erupe-ce/common/bfutil"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
@@ -12,7 +11,7 @@ import (
// MsgSysEnterStage represents the MSG_SYS_ENTER_STAGE
type MsgSysEnterStage struct {
AckHandle uint32
UnkBool uint8
Unk bool
StageID string
}
@@ -24,9 +23,9 @@ 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()
stageIDLength := bf.ReadUint8()
m.StageID = string(bfutil.UpToNull(bf.ReadBytes(uint(stageIDLength))))
m.Unk = bf.ReadBool() // IsQuest?
bf.ReadUint8() // Length StageID
m.StageID = string(bf.ReadNullTerminatedBytes())
return nil
}

View File

@@ -3,7 +3,6 @@ package mhfpacket
import (
"errors"
"erupe-ce/common/bfutil"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
@@ -27,8 +26,8 @@ func (m *MsgSysEnumerateClient) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cl
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint8()
m.Get = 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
}

View File

@@ -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
}

View File

@@ -4,9 +4,9 @@ import (
"errors"
"erupe-ce/common/bfutil"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/common/byteframe"
)
type scenarioFileIdentifer struct {

View File

@@ -2,7 +2,6 @@ package mhfpacket
import (
"erupe-ce/common/byteframe"
"erupe-ce/common/bfutil"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
@@ -27,8 +26,8 @@ func (m *MsgSysGetStageBinary) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli
m.BinaryType0 = bf.ReadUint8()
m.BinaryType1 = bf.ReadUint8()
m.Unk0 = bf.ReadUint32()
stageIDLength := bf.ReadUint8()
m.StageID = string(bfutil.UpToNull(bf.ReadBytes(uint(stageIDLength))))
bf.ReadUint8() // StageID length
m.StageID = string(bf.ReadNullTerminatedBytes())
return nil
}

View File

@@ -1,18 +1,16 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgSysHideClient represents the MSG_SYS_HIDE_CLIENT
type MsgSysHideClient struct {
Hide bool
Unk0 uint16 // Hardcoded 0 in binary
Unk1 uint8 // Hardcoded 0 in binary
}
// Opcode returns the ID associated with this packet type.
@@ -23,8 +21,9 @@ func (m *MsgSysHideClient) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgSysHideClient) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.Hide = bf.ReadBool()
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint8()
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Zeroed
return nil
}

View File

@@ -1,18 +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"
)
// MsgSysIssueLogkey represents the MSG_SYS_ISSUE_LOGKEY
type MsgSysIssueLogkey struct {
AckHandle uint32
Unk0 uint16 // Hardcoded 00 01 in binary
Unk1 uint16 // Hardcoded 0 in binary.
Unk0 uint16
}
// Opcode returns the ID associated with this packet type.
@@ -24,7 +23,7 @@ func (m *MsgSysIssueLogkey) Opcode() network.PacketID {
func (m *MsgSysIssueLogkey) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Unk1 = bf.ReadUint16()
bf.ReadUint16() // Zeroed
return nil
}

View File

@@ -24,8 +24,8 @@ func (m *MsgSysLoadRegister) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clien
m.AckHandle = bf.ReadUint32()
m.RegisterID = bf.ReadUint32()
m.Values = bf.ReadUint8()
_ = bf.ReadUint8()
_ = bf.ReadUint16()
bf.ReadUint8() // Zeroed
bf.ReadUint16() // Zeroed
return nil
}

View File

@@ -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
}

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
}

View File

@@ -23,7 +23,7 @@ func (m *MsgSysOperateRegister) Opcode() network.PacketID {
func (m *MsgSysOperateRegister) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.SemaphoreID = bf.ReadUint32()
_ = bf.ReadUint16()
bf.ReadUint16() // Zeroed
dataSize := bf.ReadUint16()
m.RawDataPayload = bf.ReadBytes(uint(dataSize))
return nil

View File

@@ -1,21 +1,19 @@
package mhfpacket
import (
"errors"
import (
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgSysRecordLog represents the MSG_SYS_RECORD_LOG
type MsgSysRecordLog struct {
AckHandle uint32
Unk0 uint32
Unk1 uint16 // Hardcoded 0
HardcodedDataSize uint16 // Hardcoded 0x4AC
Unk3 uint32 // Some shared ID with MSG_MHF_GET_SEIBATTLE. World ID??
DataBuf []byte
AckHandle uint32
Unk0 uint32
Unk1 uint32
Data []byte
}
// Opcode returns the ID associated with this packet type.
@@ -27,10 +25,10 @@ func (m *MsgSysRecordLog) Opcode() network.PacketID {
func (m *MsgSysRecordLog) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint32()
m.Unk1 = bf.ReadUint16()
m.HardcodedDataSize = bf.ReadUint16()
m.Unk3 = bf.ReadUint32()
m.DataBuf = bf.ReadBytes(uint(m.HardcodedDataSize))
bf.ReadUint16() // Zeroed
size := bf.ReadUint16()
m.Unk1 = bf.ReadUint32()
m.Data = bf.ReadBytes(uint(size))
return nil
}

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
}

View File

@@ -1,17 +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"
)
// MsgSysRightsReload represents the MSG_SYS_RIGHTS_RELOAD
type MsgSysRightsReload struct{
type MsgSysRightsReload struct {
AckHandle uint32
Unk0 byte
Unk0 []byte
}
// Opcode returns the ID associated with this packet type.
@@ -22,7 +22,7 @@ func (m *MsgSysRightsReload) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgSysRightsReload) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint8()
m.Unk0 = bf.ReadBytes(uint(bf.ReadUint8()))
return nil
}

View File

@@ -2,7 +2,6 @@ package mhfpacket
import (
"erupe-ce/common/byteframe"
"erupe-ce/common/bfutil"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
@@ -24,9 +23,9 @@ func (m *MsgSysSetStageBinary) Opcode() network.PacketID {
func (m *MsgSysSetStageBinary) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.BinaryType0 = bf.ReadUint8()
m.BinaryType1 = bf.ReadUint8()
stageIDLength := bf.ReadUint8() // <= 0x20
dataSize := bf.ReadUint16() // <= 0x400
m.StageID = string(bfutil.UpToNull(bf.ReadBytes(uint(stageIDLength))))
bf.ReadUint8() // StageID length <= 0x20
dataSize := bf.ReadUint16() // <= 0x400
m.StageID = string(bf.ReadNullTerminatedBytes())
m.RawDataPayload = bf.ReadBytes(uint(dataSize))
return nil
}

View File

@@ -1,17 +1,16 @@
package mhfpacket
import (
"errors"
"errors"
"erupe-ce/network/clientctx"
"erupe-ce/network"
"erupe-ce/common/byteframe"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
// MsgSysSetStagePass represents the MSG_SYS_SET_STAGE_PASS
type MsgSysSetStagePass struct {
Unk0 uint8 // Hardcoded 0 in the binary
Password string // NULL-terminated string
Password string // NULL-terminated string
}
// Opcode returns the ID associated with this packet type.
@@ -21,8 +20,8 @@ func (m *MsgSysSetStagePass) Opcode() network.PacketID {
// Parse parses the packet from binary
func (m *MsgSysSetStagePass) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.Unk0 = bf.ReadUint8()
_ = bf.ReadUint8() // Password length
bf.ReadUint8() // Zeroed
bf.ReadUint8() // Password length
m.Password = string(bf.ReadNullTerminatedBytes())
return nil
}

View File

@@ -23,11 +23,9 @@ type TerminalLogEntry struct {
// MsgSysTerminalLog represents the MSG_SYS_TERMINAL_LOG
type MsgSysTerminalLog struct {
AckHandle uint32
LogID uint32 // 0 on the first packet, and the server sends back a value to use for subsequent requests.
EntryCount uint16
Unk0 uint16 // Hardcoded 0 in the binary
Entries []*TerminalLogEntry
AckHandle uint32
LogID uint32 // 0 on the first packet, and the server sends back a value to use for subsequent requests.
Entries []TerminalLogEntry
}
// Opcode returns the ID associated with this packet type.
@@ -39,11 +37,11 @@ func (m *MsgSysTerminalLog) Opcode() network.PacketID {
func (m *MsgSysTerminalLog) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.LogID = bf.ReadUint32()
m.EntryCount = bf.ReadUint16()
m.Unk0 = bf.ReadUint16()
entryCount := int(bf.ReadUint16())
bf.ReadUint16() // Zeroed
for i := 0; i < int(m.EntryCount); i++ {
e := &TerminalLogEntry{}
var e TerminalLogEntry
for i := 0; i < entryCount; i++ {
e.Index = bf.ReadUint32()
e.Type1 = bf.ReadUint8()
e.Type2 = bf.ReadUint8()

View File

@@ -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")
}

View File

@@ -2,7 +2,6 @@ package mhfpacket
import (
"erupe-ce/common/byteframe"
"erupe-ce/common/bfutil"
"erupe-ce/network"
"erupe-ce/network/clientctx"
)
@@ -27,8 +26,8 @@ func (m *MsgSysWaitStageBinary) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cl
m.BinaryType0 = bf.ReadUint8()
m.BinaryType1 = bf.ReadUint8()
m.Unk0 = bf.ReadUint32()
stageIDLength := bf.ReadUint8()
m.StageID = string(bfutil.UpToNull(bf.ReadBytes(uint(stageIDLength))))
bf.ReadUint8() // StageID length
m.StageID = string(bf.ReadNullTerminatedBytes())
return nil
}