mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-02-06 10:06:53 +01:00
Merge remote-tracking branch 'origin/main' into feature/diva
# Conflicts: # server/channelserver/handlers_diva.go
This commit is contained in:
@@ -3,6 +3,7 @@ package network
|
||||
import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
_config "erupe-ce/config"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
@@ -48,7 +49,14 @@ func (cc *CryptConn) ReadPacket() ([]byte, error) {
|
||||
}
|
||||
|
||||
// Now read the encrypted packet body after getting its size from the header.
|
||||
encryptedPacketBody := make([]byte, cph.DataSize)
|
||||
var encryptedPacketBody []byte
|
||||
|
||||
// Don't know when support for this was added, works in Forward.4, doesn't work in Season 6.0
|
||||
if _config.ErupeConfig.RealClientMode < _config.F1 {
|
||||
encryptedPacketBody = make([]byte, cph.DataSize)
|
||||
} else {
|
||||
encryptedPacketBody = make([]byte, uint32(cph.DataSize)+(uint32(cph.Pf0-0x03)*0x1000))
|
||||
}
|
||||
_, err = io.ReadFull(cc.conn, encryptedPacketBody)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -56,7 +64,7 @@ func (cc *CryptConn) ReadPacket() ([]byte, error) {
|
||||
|
||||
// Update the key rotation before decrypting.
|
||||
if cph.KeyRotDelta != 0 {
|
||||
cc.readKeyRot = (uint32(cph.KeyRotDelta) * (cc.readKeyRot + 1))
|
||||
cc.readKeyRot = uint32(cph.KeyRotDelta) * (cc.readKeyRot + 1)
|
||||
}
|
||||
|
||||
out, combinedCheck, check0, check1, check2 := crypto.Decrypt(encryptedPacketBody, cc.readKeyRot, nil)
|
||||
@@ -94,7 +102,7 @@ func (cc *CryptConn) SendPacket(data []byte) error {
|
||||
keyRotDelta := byte(3)
|
||||
|
||||
if keyRotDelta != 0 {
|
||||
cc.sendKeyRot = (uint32(keyRotDelta) * (cc.sendKeyRot + 1))
|
||||
cc.sendKeyRot = uint32(keyRotDelta) * (cc.sendKeyRot + 1)
|
||||
}
|
||||
|
||||
// Encrypt the data
|
||||
|
||||
@@ -2,10 +2,11 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
_config "erupe-ce/config"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireCafeItem represents the MSG_MHF_ACQUIRE_CAFE_ITEM
|
||||
@@ -30,7 +31,11 @@ func (m *MsgMhfAcquireCafeItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cl
|
||||
m.ItemType = bf.ReadUint16()
|
||||
m.ItemID = bf.ReadUint16()
|
||||
m.Quant = bf.ReadUint16()
|
||||
m.PointCost = bf.ReadUint32()
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G1 {
|
||||
m.PointCost = bf.ReadUint32()
|
||||
} else {
|
||||
m.PointCost = uint32(bf.ReadUint16())
|
||||
}
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,15 +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"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireItem represents the MSG_MHF_ACQUIRE_ITEM
|
||||
type MsgMhfAcquireItem struct{}
|
||||
type MsgMhfAcquireItem struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
Length uint16
|
||||
Unk1 []uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfAcquireItem) Opcode() network.PacketID {
|
||||
@@ -18,7 +23,13 @@ func (m *MsgMhfAcquireItem) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Length = bf.ReadUint16()
|
||||
for i := 0; i < int(m.Length); i++ {
|
||||
m.Unk1 = append(m.Unk1, bf.ReadUint32())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfAcquireTournament represents the MSG_MHF_ACQUIRE_TOURNAMENT
|
||||
type MsgMhfAcquireTournament struct{}
|
||||
type MsgMhfAcquireTournament struct {
|
||||
AckHandle uint32
|
||||
TournamentID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfAcquireTournament) Opcode() network.PacketID {
|
||||
@@ -18,7 +21,9 @@ func (m *MsgMhfAcquireTournament) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfAcquireTournament) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.TournamentID = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -28,7 +28,8 @@ func (m *MsgMhfAnnounce) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCon
|
||||
m.IPAddress = bf.ReadUint32()
|
||||
m.Port = bf.ReadUint16()
|
||||
_ = bf.ReadUint8()
|
||||
_ = bf.ReadUint16()
|
||||
_ = bf.ReadUint8()
|
||||
_ = bf.ReadUint8()
|
||||
m.StageID = bf.ReadBytes(32)
|
||||
_ = bf.ReadUint32()
|
||||
m.Type = bf.ReadUint8()
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfApplyCampaign represents the MSG_MHF_APPLY_CAMPAIGN
|
||||
type MsgMhfApplyCampaign struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
Unk0 uint32
|
||||
Unk1 uint16
|
||||
Unk2 []byte
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,17 +23,13 @@ func (m *MsgMhfApplyCampaign) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfApplyCampaign) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Unk2 = bf.ReadBytes(16)
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfApplyCampaign) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint8(m.Unk0)
|
||||
bf.WriteUint8(m.Unk1)
|
||||
bf.WriteUint16(m.Unk2)
|
||||
return nil
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,18 +1,19 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"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.
|
||||
@@ -32,10 +33,5 @@ func (m *MsgMhfApplyDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
|
||||
|
||||
// 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")
|
||||
}
|
||||
|
||||
@@ -1,15 +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"
|
||||
)
|
||||
|
||||
// MsgMhfCaravanMyRank represents the MSG_MHF_CARAVAN_MY_RANK
|
||||
type MsgMhfCaravanMyRank struct{}
|
||||
type MsgMhfCaravanMyRank struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk2 uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfCaravanMyRank) Opcode() network.PacketID {
|
||||
@@ -18,7 +23,11 @@ func (m *MsgMhfCaravanMyRank) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCaravanMyRank) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
// MsgMhfCaravanMyScore represents the MSG_MHF_CARAVAN_MY_SCORE
|
||||
type MsgMhfCaravanMyScore struct{}
|
||||
type MsgMhfCaravanMyScore struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk2 int32
|
||||
Unk3 int32
|
||||
Unk4 uint32
|
||||
Unk5 int32
|
||||
Unk6 int32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfCaravanMyScore) Opcode() network.PacketID {
|
||||
@@ -18,7 +27,15 @@ func (m *MsgMhfCaravanMyScore) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCaravanMyScore) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadInt32()
|
||||
m.Unk3 = bf.ReadInt32()
|
||||
m.Unk4 = bf.ReadUint32()
|
||||
m.Unk5 = bf.ReadInt32()
|
||||
m.Unk6 = bf.ReadInt32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,15 +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"
|
||||
)
|
||||
|
||||
// MsgMhfCaravanRanking represents the MSG_MHF_CARAVAN_RANKING
|
||||
type MsgMhfCaravanRanking struct{}
|
||||
type MsgMhfCaravanRanking struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk2 int32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfCaravanRanking) Opcode() network.PacketID {
|
||||
@@ -18,7 +23,11 @@ func (m *MsgMhfCaravanRanking) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfCaravanRanking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadInt32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
// MsgMhfEntryTournament represents the MSG_MHF_ENTRY_TOURNAMENT
|
||||
type MsgMhfEntryTournament struct{}
|
||||
type MsgMhfEntryTournament struct {
|
||||
AckHandle uint32
|
||||
TournamentID uint32
|
||||
Unk0 uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfEntryTournament) Opcode() network.PacketID {
|
||||
@@ -18,7 +22,10 @@ func (m *MsgMhfEntryTournament) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEntryTournament) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.TournamentID = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfEnumerateCampaign represents the MSG_MHF_ENUMERATE_CAMPAIGN
|
||||
type MsgMhfEnumerateCampaign struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
Unk0 uint16
|
||||
Unk1 uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -22,17 +21,15 @@ func (m *MsgMhfEnumerateCampaign) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateCampaign) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfEnumerateCampaign) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint8(m.Unk0)
|
||||
bf.WriteUint8(m.Unk1)
|
||||
bf.WriteUint16(m.Unk2)
|
||||
bf.WriteUint16(m.Unk0)
|
||||
bf.WriteUint16(m.Unk1)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"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
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
Unk3 []byte
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,16 +25,13 @@ func (m *MsgMhfEnumerateDistItem) Opcode() network.PacketID {
|
||||
func (m *MsgMhfEnumerateDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
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")
|
||||
}
|
||||
|
||||
@@ -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,9 +2,9 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
|
||||
"erupe-ce/common/bfutil"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/stringsupport"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
@@ -12,28 +12,30 @@ import (
|
||||
type EnumerateGuildType uint8
|
||||
|
||||
const (
|
||||
ENUMERATE_GUILD_TYPE_GUILD_NAME = 0x01
|
||||
ENUMERATE_GUILD_TYPE_LEADER_NAME = 0x02
|
||||
ENUMERATE_GUILD_TYPE_LEADER_ID = 0x03
|
||||
ENUMERATE_GUILD_TYPE_ORDER_MEMBERS = 0x04
|
||||
ENUMERATE_GUILD_TYPE_ORDER_REGISTRATION = 0x05
|
||||
ENUMERATE_GUILD_TYPE_ORDER_RANK = 0x06
|
||||
ENUMERATE_GUILD_TYPE_MOTTO = 0x07
|
||||
ENUMERATE_GUILD_TYPE_RECRUITING = 0x08
|
||||
ENUMERATE_ALLIANCE_TYPE_ALLIANCE_NAME = 0x09
|
||||
ENUMERATE_ALLIANCE_TYPE_LEADER_NAME = 0x0A
|
||||
ENUMERATE_ALLIANCE_TYPE_LEADER_ID = 0x0B
|
||||
ENUMERATE_ALLIANCE_TYPE_ORDER_MEMBERS = 0x0C
|
||||
ENUMERATE_ALLIANCE_TYPE_ORDER_REGISTRATION = 0x0D
|
||||
ENUMERATE_GUILD_UNKNOWN = iota
|
||||
ENUMERATE_GUILD_TYPE_GUILD_NAME
|
||||
ENUMERATE_GUILD_TYPE_LEADER_NAME
|
||||
ENUMERATE_GUILD_TYPE_LEADER_ID
|
||||
ENUMERATE_GUILD_TYPE_ORDER_MEMBERS
|
||||
ENUMERATE_GUILD_TYPE_ORDER_REGISTRATION
|
||||
ENUMERATE_GUILD_TYPE_ORDER_RANK
|
||||
ENUMERATE_GUILD_TYPE_MOTTO
|
||||
ENUMERATE_GUILD_TYPE_RECRUITING
|
||||
ENUMERATE_ALLIANCE_TYPE_ALLIANCE_NAME
|
||||
ENUMERATE_ALLIANCE_TYPE_LEADER_NAME
|
||||
ENUMERATE_ALLIANCE_TYPE_LEADER_ID
|
||||
ENUMERATE_ALLIANCE_TYPE_ORDER_MEMBERS
|
||||
ENUMERATE_ALLIANCE_TYPE_ORDER_REGISTRATION
|
||||
)
|
||||
|
||||
// MsgMhfEnumerateGuild represents the MSG_MHF_ENUMERATE_GUILD
|
||||
type MsgMhfEnumerateGuild struct {
|
||||
AckHandle uint32
|
||||
Type EnumerateGuildType
|
||||
Page uint8
|
||||
Sorting bool
|
||||
RawDataPayload []byte
|
||||
AckHandle uint32
|
||||
Type EnumerateGuildType
|
||||
Page uint8
|
||||
Sorting bool
|
||||
Data1 []byte
|
||||
Data2 string
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -47,9 +49,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.ReadUint8()
|
||||
m.RawDataPayload = bf.DataFromCurrent()
|
||||
bf.Seek(-2, io.SeekEnd)
|
||||
_ = 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)))
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +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"
|
||||
)
|
||||
|
||||
// MsgMhfEnumerateItem represents the MSG_MHF_ENUMERATE_ITEM
|
||||
type MsgMhfEnumerateItem struct{}
|
||||
type MsgMhfEnumerateItem struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
Unk1 uint16
|
||||
CampaignID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfEnumerateItem) Opcode() network.PacketID {
|
||||
@@ -18,7 +23,11 @@ func (m *MsgMhfEnumerateItem) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.CampaignID = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -2,6 +2,7 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
_config "erupe-ce/config"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
@@ -29,7 +30,11 @@ func (m *MsgMhfEnumerateQuest) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.World = bf.ReadUint8()
|
||||
m.Counter = bf.ReadUint16()
|
||||
m.Offset = bf.ReadUint16()
|
||||
if _config.ErupeConfig.RealClientMode <= _config.Z1 {
|
||||
m.Offset = uint16(bf.ReadUint8())
|
||||
} else {
|
||||
m.Offset = bf.ReadUint16()
|
||||
}
|
||||
m.Unk4 = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
_config "erupe-ce/config"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfEnumerateShop represents the MSG_MHF_ENUMERATE_SHOP
|
||||
@@ -31,8 +32,10 @@ func (m *MsgMhfEnumerateShop) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
|
||||
m.ShopID = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
m.Unk3 = bf.ReadUint8()
|
||||
m.Unk4 = bf.ReadUint8()
|
||||
m.Unk5 = bf.ReadUint32()
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G2 {
|
||||
m.Unk4 = bf.ReadUint8()
|
||||
m.Unk5 = bf.ReadUint32()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
// MsgMhfGetBreakSeibatuLevelReward represents the MSG_MHF_GET_BREAK_SEIBATU_LEVEL_REWARD
|
||||
type MsgMhfGetBreakSeibatuLevelReward struct{}
|
||||
type MsgMhfGetBreakSeibatuLevelReward struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 int32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfGetBreakSeibatuLevelReward) Opcode() network.PacketID {
|
||||
@@ -18,7 +22,10 @@ func (m *MsgMhfGetBreakSeibatuLevelReward) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfGetBreakSeibatuLevelReward) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadInt32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,15 +1,22 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfGetFixedSeibatuRankingTable represents the MSG_MHF_GET_FIXED_SEIBATU_RANKING_TABLE
|
||||
type MsgMhfGetFixedSeibatuRankingTable struct{}
|
||||
type MsgMhfGetFixedSeibatuRankingTable struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 int32
|
||||
Unk2 int32
|
||||
Unk3 int32
|
||||
Unk4 int32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfGetFixedSeibatuRankingTable) Opcode() network.PacketID {
|
||||
@@ -18,7 +25,13 @@ func (m *MsgMhfGetFixedSeibatuRankingTable) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfGetFixedSeibatuRankingTable) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadInt32()
|
||||
m.Unk2 = bf.ReadInt32()
|
||||
m.Unk3 = bf.ReadInt32()
|
||||
m.Unk4 = bf.ReadInt32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -11,8 +11,13 @@ import (
|
||||
// MsgMhfGetGemInfo represents the MSG_MHF_GET_GEM_INFO
|
||||
type MsgMhfGetGemInfo struct {
|
||||
AckHandle uint32
|
||||
Unk uint32
|
||||
Unk1 []byte
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk2 int32
|
||||
Unk3 int32
|
||||
Unk4 int32
|
||||
Unk5 int32
|
||||
Unk6 int32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,8 +28,13 @@ func (m *MsgMhfGetGemInfo) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfGetGemInfo) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadBytes(24)
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadInt32()
|
||||
m.Unk3 = bf.ReadInt32()
|
||||
m.Unk4 = bf.ReadInt32()
|
||||
m.Unk5 = bf.ReadInt32()
|
||||
m.Unk6 = bf.ReadInt32()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +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"
|
||||
)
|
||||
|
||||
// MsgMhfGetNotice represents the MSG_MHF_GET_NOTICE
|
||||
type MsgMhfGetNotice struct{}
|
||||
type MsgMhfGetNotice struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk2 int32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfGetNotice) Opcode() network.PacketID {
|
||||
@@ -18,7 +23,11 @@ func (m *MsgMhfGetNotice) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfGetNotice) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadInt32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfGetRandFromTable represents the MSG_MHF_GET_RAND_FROM_TABLE
|
||||
type MsgMhfGetRandFromTable struct{}
|
||||
type MsgMhfGetRandFromTable struct {
|
||||
AckHandle uint32
|
||||
Results uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfGetRandFromTable) Opcode() network.PacketID {
|
||||
@@ -18,7 +21,9 @@ func (m *MsgMhfGetRandFromTable) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfGetRandFromTable) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Results = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -11,8 +11,8 @@ import (
|
||||
// MsgMhfGetRyoudama represents the MSG_MHF_GET_RYOUDAMA
|
||||
type MsgMhfGetRyoudama struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Request1 uint8
|
||||
Request2 uint8
|
||||
GuildID uint32
|
||||
Unk3 uint8
|
||||
}
|
||||
@@ -25,8 +25,8 @@ func (m *MsgMhfGetRyoudama) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfGetRyoudama) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Request1 = bf.ReadUint8()
|
||||
m.Request2 = bf.ReadUint8()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
m.Unk3 = bf.ReadUint8()
|
||||
return nil
|
||||
|
||||
@@ -1,20 +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"
|
||||
)
|
||||
|
||||
// MsgMhfGetSeibattle represents the MSG_MHF_GET_SEIBATTLE
|
||||
type MsgMhfGetSeibattle struct {
|
||||
// Communicator type, multi-format. This might be valid for only one type.
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint32 // Some shared ID with MSG_SYS_RECORD_LOG, world ID?
|
||||
Type uint8
|
||||
GuildID uint32
|
||||
Unk3 uint8
|
||||
Unk4 uint16
|
||||
}
|
||||
@@ -28,8 +27,8 @@ func (m *MsgMhfGetSeibattle) Opcode() network.PacketID {
|
||||
func (m *MsgMhfGetSeibattle) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
m.Type = bf.ReadUint8()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
m.Unk3 = bf.ReadUint8()
|
||||
m.Unk4 = bf.ReadUint16()
|
||||
return nil
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
// MsgMhfGetSenyuDailyCount represents the MSG_MHF_GET_SENYU_DAILY_COUNT
|
||||
type MsgMhfGetSenyuDailyCount struct{}
|
||||
type MsgMhfGetSenyuDailyCount struct {
|
||||
AckHandle uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfGetSenyuDailyCount) Opcode() network.PacketID {
|
||||
@@ -18,7 +20,8 @@ func (m *MsgMhfGetSenyuDailyCount) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfGetSenyuDailyCount) 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.
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfGetTenrouirai represents the MSG_MHF_GET_TENROUIRAI
|
||||
type MsgMhfGetTenrouirai struct {
|
||||
// Communicator type, multi-format. This might be valid for only one type.
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
Unk1 uint32
|
||||
Unk2 uint16
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
GuildID uint32
|
||||
Unk3 uint8
|
||||
Unk4 uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -25,9 +26,11 @@ func (m *MsgMhfGetTenrouirai) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfGetTenrouirai) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
m.Unk3 = bf.ReadUint8()
|
||||
m.Unk4 = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
// MsgMhfGetTinyBin represents the MSG_MHF_GET_TINY_BIN
|
||||
type MsgMhfGetTinyBin struct {
|
||||
// Communicator type, multi-format. This might be valid for only one type.
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,8 +25,9 @@ func (m *MsgMhfGetTinyBin) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfGetTinyBin) 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.Unk2 = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -8,19 +8,8 @@ import (
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// The server sends different responses based on these values.
|
||||
const (
|
||||
TowerInfoTypeUnk0 = iota
|
||||
TowerInfoTypeTowerRankPoint
|
||||
TowerInfoTypeGetOwnTowerSkill
|
||||
TowerInfoTypeGetOwnTowerLevelV3
|
||||
TowerInfoTypeTowerTouhaHistory
|
||||
TowerInfoTypeUnk5
|
||||
)
|
||||
|
||||
// MsgMhfGetTowerInfo represents the MSG_MHF_GET_TOWER_INFO
|
||||
type MsgMhfGetTowerInfo struct {
|
||||
// Communicator type, multi-format. This might be valid for only one type.
|
||||
AckHandle uint32
|
||||
InfoType uint32 // Requested response type
|
||||
Unk0 uint32
|
||||
|
||||
@@ -11,33 +11,33 @@ import (
|
||||
type OperateGuildAction uint8
|
||||
|
||||
const (
|
||||
OPERATE_GUILD_DISBAND = 0x01
|
||||
OPERATE_GUILD_APPLY = 0x02
|
||||
OPERATE_GUILD_LEAVE = 0x03
|
||||
OPERATE_GUILD_RESIGN = 0x04
|
||||
OPERATE_GUILD_SET_APPLICATION_DENY = 0x05
|
||||
OPERATE_GUILD_SET_APPLICATION_ALLOW = 0x06
|
||||
OPERATE_GUILD_SET_AVOID_LEADERSHIP_TRUE = 0x07
|
||||
OPERATE_GUILD_SET_AVOID_LEADERSHIP_FALSE = 0x08
|
||||
OPERATE_GUILD_UPDATE_COMMENT = 0x09
|
||||
OPERATE_GUILD_DONATE_RANK = 0x0a
|
||||
OPERATE_GUILD_UPDATE_MOTTO = 0x0b
|
||||
OPERATE_GUILD_RENAME_PUGI_1 = 0x0c
|
||||
OPERATE_GUILD_RENAME_PUGI_2 = 0x0d
|
||||
OPERATE_GUILD_RENAME_PUGI_3 = 0x0e
|
||||
OPERATE_GUILD_CHANGE_PUGI_1 = 0x0f
|
||||
OPERATE_GUILD_CHANGE_PUGI_2 = 0x10
|
||||
OPERATE_GUILD_CHANGE_PUGI_3 = 0x11
|
||||
OPERATE_GUILD_UNLOCK_OUTFIT = 0x12
|
||||
// 0x13 Unk
|
||||
// 0x14 Unk
|
||||
OPERATE_GUILD_DONATE_EVENT = 0x15
|
||||
OPERATE_GUILD_EVENT_EXCHANGE = 0x16
|
||||
// 0x17 Unk
|
||||
// 0x18 Unk
|
||||
OPERATE_GUILD_CHANGE_DIVA_PUGI_1 = 0x19
|
||||
OPERATE_GUILD_CHANGE_DIVA_PUGI_2 = 0x1a
|
||||
OPERATE_GUILD_CHANGE_DIVA_PUGI_3 = 0x1b
|
||||
OperateGuildDisband = iota + 1
|
||||
OperateGuildApply
|
||||
OperateGuildLeave
|
||||
OperateGuildResign
|
||||
OperateGuildSetApplicationDeny
|
||||
OperateGuildSetApplicationAllow
|
||||
OperateGuildSetAvoidLeadershipTrue
|
||||
OperateGuildSetAvoidLeadershipFalse
|
||||
OperateGuildUpdateComment
|
||||
OperateGuildDonateRank
|
||||
OperateGuildUpdateMotto
|
||||
OperateGuildRenamePugi1
|
||||
OperateGuildRenamePugi2
|
||||
OperateGuildRenamePugi3
|
||||
OperateGuildChangePugi1
|
||||
OperateGuildChangePugi2
|
||||
OperateGuildChangePugi3
|
||||
OperateGuildUnlockOutfit
|
||||
OperateGuildDonateRoom
|
||||
OperateGuildGraduateRookie
|
||||
OperateGuildDonateEvent
|
||||
OperateGuildEventExchange
|
||||
OperateGuildUnknown // I don't think this op exists
|
||||
OperateGuildGraduateReturn
|
||||
OperateGuildChangeDivaPugi1
|
||||
OperateGuildChangeDivaPugi2
|
||||
OperateGuildChangeDivaPugi3
|
||||
)
|
||||
|
||||
// MsgMhfOperateGuild represents the MSG_MHF_OPERATE_GUILD
|
||||
|
||||
@@ -1,15 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfPostBoostTimeLimit represents the MSG_MHF_POST_BOOST_TIME_LIMIT
|
||||
type MsgMhfPostBoostTimeLimit struct{}
|
||||
type MsgMhfPostBoostTimeLimit struct {
|
||||
AckHandle uint32
|
||||
Expiration uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfPostBoostTimeLimit) Opcode() network.PacketID {
|
||||
@@ -18,7 +21,9 @@ func (m *MsgMhfPostBoostTimeLimit) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfPostBoostTimeLimit) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Expiration = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
// MsgMhfPostGemInfo represents the MSG_MHF_POST_GEM_INFO
|
||||
type MsgMhfPostGemInfo struct{}
|
||||
type MsgMhfPostGemInfo struct {
|
||||
AckHandle uint32
|
||||
Op uint32
|
||||
Unk1 uint32
|
||||
Gem int32
|
||||
Quantity int32
|
||||
CID int32
|
||||
Message int32
|
||||
Unk6 int32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfPostGemInfo) Opcode() network.PacketID {
|
||||
@@ -18,7 +27,15 @@ func (m *MsgMhfPostGemInfo) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfPostGemInfo) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Op = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Gem = bf.ReadInt32()
|
||||
m.Quantity = bf.ReadInt32()
|
||||
m.CID = bf.ReadInt32()
|
||||
m.Message = bf.ReadInt32()
|
||||
m.Unk6 = bf.ReadInt32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfPostNotice represents the MSG_MHF_POST_NOTICE
|
||||
type MsgMhfPostNotice struct{}
|
||||
type MsgMhfPostNotice struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk2 int32
|
||||
Unk3 int32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfPostNotice) Opcode() network.PacketID {
|
||||
@@ -18,7 +24,12 @@ func (m *MsgMhfPostNotice) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfPostNotice) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadInt32()
|
||||
m.Unk3 = bf.ReadInt32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,22 +1,34 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfPostTenrouirai represents the MSG_MHF_POST_TENROUIRAI
|
||||
type MsgMhfPostTenrouirai struct{
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
Unk1 uint32
|
||||
Unk2 uint32
|
||||
Unk3 uint32
|
||||
Unk4 uint32
|
||||
Unk5 uint8
|
||||
type MsgMhfPostTenrouirai struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Op uint8
|
||||
GuildID uint32
|
||||
Unk1 uint8
|
||||
|
||||
Floors uint16
|
||||
Antiques uint16
|
||||
Chests uint16
|
||||
Cats uint16
|
||||
TRP uint16
|
||||
Slays uint16
|
||||
|
||||
DonatedRP uint16
|
||||
PreviousRP uint16
|
||||
Unk2_0 uint16
|
||||
Unk2_1 uint16
|
||||
Unk2_2 uint16
|
||||
Unk2_3 uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -27,12 +39,28 @@ func (m *MsgMhfPostTenrouirai) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfPostTenrouirai) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
m.Unk3 = bf.ReadUint32()
|
||||
m.Unk4 = bf.ReadUint32()
|
||||
m.Unk5 = bf.ReadUint8()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Op = bf.ReadUint8()
|
||||
m.GuildID = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
|
||||
switch m.Op {
|
||||
case 1:
|
||||
m.Floors = bf.ReadUint16()
|
||||
m.Antiques = bf.ReadUint16()
|
||||
m.Chests = bf.ReadUint16()
|
||||
m.Cats = bf.ReadUint16()
|
||||
m.TRP = bf.ReadUint16()
|
||||
m.Slays = bf.ReadUint16()
|
||||
case 2:
|
||||
m.DonatedRP = bf.ReadUint16()
|
||||
m.PreviousRP = bf.ReadUint16()
|
||||
m.Unk2_0 = bf.ReadUint16()
|
||||
m.Unk2_1 = bf.ReadUint16()
|
||||
m.Unk2_2 = bf.ReadUint16()
|
||||
m.Unk2_3 = bf.ReadUint16()
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -11,9 +11,10 @@ import (
|
||||
// MsgMhfPostTinyBin represents the MSG_MHF_POST_TINY_BIN
|
||||
type MsgMhfPostTinyBin struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint8
|
||||
Unk3 uint8
|
||||
Data []byte
|
||||
}
|
||||
|
||||
@@ -25,9 +26,10 @@ func (m *MsgMhfPostTinyBin) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfPostTinyBin) 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.Unk2 = bf.ReadUint8()
|
||||
m.Unk3 = bf.ReadUint8()
|
||||
m.Data = bf.ReadBytes(uint(bf.ReadUint16()))
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,28 +1,26 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfPostTowerInfo represents the MSG_MHF_POST_TOWER_INFO
|
||||
type MsgMhfPostTowerInfo struct {
|
||||
// Communicator type, multi-format. This might be valid for only one type.
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
InfoType uint32
|
||||
Unk1 uint32
|
||||
Unk2 uint32
|
||||
Unk3 uint32
|
||||
Unk4 uint32
|
||||
Unk5 uint32
|
||||
Unk6 uint32
|
||||
Unk7 uint32
|
||||
Unk8 uint32
|
||||
Unk9 uint32
|
||||
Unk10 uint32
|
||||
Skill int32
|
||||
TR int32
|
||||
TRP int32
|
||||
Cost int32
|
||||
Unk6 int32
|
||||
Unk7 int32
|
||||
Block1 int32
|
||||
Unk9 int64
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -33,17 +31,16 @@ func (m *MsgMhfPostTowerInfo) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfPostTowerInfo) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.InfoType = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
m.Unk3 = bf.ReadUint32()
|
||||
m.Unk4 = bf.ReadUint32()
|
||||
m.Unk5 = bf.ReadUint32()
|
||||
m.Unk6 = bf.ReadUint32()
|
||||
m.Unk7 = bf.ReadUint32()
|
||||
m.Unk8 = bf.ReadUint32()
|
||||
m.Unk9 = bf.ReadUint32()
|
||||
m.Unk10 = bf.ReadUint32()
|
||||
m.Skill = bf.ReadInt32()
|
||||
m.TR = bf.ReadInt32()
|
||||
m.TRP = bf.ReadInt32()
|
||||
m.Cost = bf.ReadInt32()
|
||||
m.Unk6 = bf.ReadInt32()
|
||||
m.Unk7 = bf.ReadInt32()
|
||||
m.Block1 = bf.ReadInt32()
|
||||
m.Unk9 = bf.ReadInt64()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,7 @@ type MsgMhfPresentBox struct {
|
||||
Unk4 uint32
|
||||
Unk5 uint32
|
||||
Unk6 uint32
|
||||
Unk7 uint32
|
||||
Unk8 uint32
|
||||
Unk7 []uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -37,8 +36,9 @@ func (m *MsgMhfPresentBox) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientC
|
||||
m.Unk4 = bf.ReadUint32()
|
||||
m.Unk5 = bf.ReadUint32()
|
||||
m.Unk6 = bf.ReadUint32()
|
||||
m.Unk7 = bf.ReadUint32()
|
||||
m.Unk8 = bf.ReadUint32()
|
||||
for i := uint32(0); i < m.Unk2; i++ {
|
||||
m.Unk7 = append(m.Unk7, bf.ReadUint32())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +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"
|
||||
)
|
||||
|
||||
// MsgMhfReadBeatLevelAllRanking represents the MSG_MHF_READ_BEAT_LEVEL_ALL_RANKING
|
||||
type MsgMhfReadBeatLevelAllRanking struct{}
|
||||
type MsgMhfReadBeatLevelAllRanking struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
GuildID int32
|
||||
Unk2 int32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfReadBeatLevelAllRanking) Opcode() network.PacketID {
|
||||
@@ -18,7 +23,11 @@ func (m *MsgMhfReadBeatLevelAllRanking) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfReadBeatLevelAllRanking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.GuildID = bf.ReadInt32()
|
||||
m.Unk2 = bf.ReadInt32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -1,15 +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"
|
||||
)
|
||||
|
||||
// MsgMhfReadBeatLevelMyRanking represents the MSG_MHF_READ_BEAT_LEVEL_MY_RANKING
|
||||
type MsgMhfReadBeatLevelMyRanking struct{}
|
||||
type MsgMhfReadBeatLevelMyRanking struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk2 []int32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfReadBeatLevelMyRanking) Opcode() network.PacketID {
|
||||
@@ -18,7 +23,13 @@ func (m *MsgMhfReadBeatLevelMyRanking) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfReadBeatLevelMyRanking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
for i := 0; i < 16; i++ {
|
||||
m.Unk2 = append(m.Unk2, bf.ReadInt32())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -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"
|
||||
)
|
||||
|
||||
// MsgMhfReadLastWeekBeatRanking represents the MSG_MHF_READ_LAST_WEEK_BEAT_RANKING
|
||||
type MsgMhfReadLastWeekBeatRanking struct{}
|
||||
type MsgMhfReadLastWeekBeatRanking struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
Unk1 int32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfReadLastWeekBeatRanking) Opcode() network.PacketID {
|
||||
@@ -18,7 +22,10 @@ func (m *MsgMhfReadLastWeekBeatRanking) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfReadLastWeekBeatRanking) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadInt32()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
)
|
||||
|
||||
// MsgMhfRegisterEvent represents the MSG_MHF_REGISTER_EVENT
|
||||
type MsgMhfRegisterEvent struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
Unk1 uint8
|
||||
Unk2 uint8
|
||||
WorldID uint16
|
||||
LandID uint16
|
||||
Unk3 uint8
|
||||
Unk4 uint8
|
||||
Unk5 uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -26,11 +25,10 @@ func (m *MsgMhfRegisterEvent) Opcode() network.PacketID {
|
||||
func (m *MsgMhfRegisterEvent) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint8()
|
||||
m.WorldID = bf.ReadUint16()
|
||||
m.LandID = bf.ReadUint16()
|
||||
m.Unk3 = bf.ReadUint8()
|
||||
m.Unk4 = bf.ReadUint8()
|
||||
m.Unk5 = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
// MsgMhfReleaseEvent represents the MSG_MHF_RELEASE_EVENT
|
||||
type MsgMhfReleaseEvent struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint32
|
||||
RaviID uint32
|
||||
Unk1 uint32
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ func (m *MsgMhfReleaseEvent) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfReleaseEvent) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.RaviID = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
_config "erupe-ce/config"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfSavedata represents the MSG_MHF_SAVEDATA
|
||||
@@ -29,7 +30,9 @@ func (m *MsgMhfSavedata) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCon
|
||||
m.AllocMemSize = bf.ReadUint32()
|
||||
m.SaveType = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.DataSize = bf.ReadUint32()
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G1 {
|
||||
m.DataSize = bf.ReadUint32()
|
||||
}
|
||||
if m.DataSize == 0 { // seems to be used when DataSize = 0 rather than on savetype?
|
||||
m.RawDataPayload = bf.ReadBytes(uint(m.AllocMemSize))
|
||||
} else {
|
||||
|
||||
@@ -1,18 +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"
|
||||
)
|
||||
|
||||
// MsgMhfSetCaAchievementHist represents the MSG_MHF_SET_CA_ACHIEVEMENT_HIST
|
||||
type MsgMhfSetCaAchievementHist struct{
|
||||
AckHandle uint32
|
||||
type CaAchievementHist struct {
|
||||
Unk0 uint32
|
||||
Unk1 uint32
|
||||
Unk1 uint8
|
||||
}
|
||||
|
||||
// MsgMhfSetCaAchievementHist represents the MSG_MHF_SET_CA_ACHIEVEMENT_HIST
|
||||
type MsgMhfSetCaAchievementHist struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint16
|
||||
Unk1 uint8
|
||||
Unk2 []CaAchievementHist
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,8 +29,14 @@ func (m *MsgMhfSetCaAchievementHist) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfSetCaAchievementHist) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
for i := 0; i < int(m.Unk1); i++ {
|
||||
var temp CaAchievementHist
|
||||
temp.Unk0 = bf.ReadUint32()
|
||||
temp.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = append(m.Unk2, temp)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,17 +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"
|
||||
)
|
||||
|
||||
// MsgMhfSexChanger represents the MSG_MHF_SEX_CHANGER
|
||||
type MsgMhfSexChanger struct {
|
||||
AckHandle uint32
|
||||
Gender uint8
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,6 +26,9 @@ func (m *MsgMhfSexChanger) Opcode() network.PacketID {
|
||||
func (m *MsgMhfSexChanger) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Gender = bf.ReadUint8()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint8()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
_config "erupe-ce/config"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
@@ -34,12 +35,14 @@ func (m *MsgMhfStampcardStamp) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli
|
||||
m.GR = bf.ReadUint16()
|
||||
m.Stamps = bf.ReadUint16()
|
||||
_ = bf.ReadUint16()
|
||||
m.Reward1 = uint16(bf.ReadUint32())
|
||||
m.Reward2 = uint16(bf.ReadUint32())
|
||||
m.Item1 = uint16(bf.ReadUint32())
|
||||
m.Item2 = uint16(bf.ReadUint32())
|
||||
m.Quantity1 = uint16(bf.ReadUint32())
|
||||
m.Quantity2 = uint16(bf.ReadUint32())
|
||||
if _config.ErupeConfig.RealClientMode > _config.Z1 {
|
||||
m.Reward1 = uint16(bf.ReadUint32())
|
||||
m.Reward2 = uint16(bf.ReadUint32())
|
||||
m.Item1 = uint16(bf.ReadUint32())
|
||||
m.Item2 = uint16(bf.ReadUint32())
|
||||
m.Quantity1 = uint16(bf.ReadUint32())
|
||||
m.Quantity2 = uint16(bf.ReadUint32())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/network/clientctx"
|
||||
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
)
|
||||
|
||||
// MsgMhfStateCampaign represents the MSG_MHF_STATE_CAMPAIGN
|
||||
type MsgMhfStateCampaign struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint8
|
||||
Unk2 uint16
|
||||
AckHandle uint32
|
||||
CampaignID uint32
|
||||
Unk1 uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,17 +23,12 @@ func (m *MsgMhfStateCampaign) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfStateCampaign) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
m.Unk2 = bf.ReadUint16()
|
||||
m.CampaignID = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfStateCampaign) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint8(m.Unk0)
|
||||
bf.WriteUint8(m.Unk1)
|
||||
bf.WriteUint16(m.Unk2)
|
||||
return nil
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,45 +1,42 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"errors"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfUpdateBeatLevel represents the MSG_MHF_UPDATE_BEAT_LEVEL
|
||||
type MsgMhfUpdateBeatLevel struct {
|
||||
AckHandle uint32
|
||||
Unk1 uint32
|
||||
Unk2 uint32
|
||||
MonsterData []byte
|
||||
Unk3 uint8
|
||||
Unk4 uint32
|
||||
Unk5 uint16
|
||||
Unk6 uint8
|
||||
|
||||
AckHandle uint32
|
||||
Unk1 uint32
|
||||
Unk2 uint32
|
||||
Data1 []int32
|
||||
Data2 []int32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
func (m *MsgMhfUpdateBeatLevel) Opcode() network.PacketID {
|
||||
return network.MSG_MHF_UPDATE_BEAT_LEVEL
|
||||
return network.MSG_MHF_UPDATE_BEAT_LEVEL
|
||||
}
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfUpdateBeatLevel) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
m.MonsterData = bf.ReadBytes(uint(120))
|
||||
m.Unk3 = bf.ReadUint8()
|
||||
m.Unk4 = bf.ReadUint32()
|
||||
m.Unk5 = bf.ReadUint16()
|
||||
m.Unk6 = bf.ReadUint8()
|
||||
return nil
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint32()
|
||||
m.Unk2 = bf.ReadUint32()
|
||||
for i := 0; i < 16; i++ {
|
||||
m.Data1 = append(m.Data1, bf.ReadInt32())
|
||||
}
|
||||
for i := 0; i < 16; i++ {
|
||||
m.Data2 = append(m.Data2, bf.ReadInt32())
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgMhfUpdateBeatLevel) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"erupe-ce/network/clientctx"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
|
||||
// MsgMhfUpdateUseTrendWeaponLog represents the MSG_MHF_UPDATE_USE_TREND_WEAPON_LOG
|
||||
type MsgMhfUpdateUseTrendWeaponLog struct {
|
||||
AckHandle uint32
|
||||
Unk0 uint8
|
||||
Unk1 uint16 // Weapon/item ID probably?
|
||||
AckHandle uint32
|
||||
WeaponType uint8
|
||||
WeaponID uint16
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -23,8 +23,8 @@ func (m *MsgMhfUpdateUseTrendWeaponLog) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfUpdateUseTrendWeaponLog) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint8()
|
||||
m.Unk1 = bf.ReadUint16()
|
||||
m.WeaponType = bf.ReadUint8()
|
||||
m.WeaponID = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,9 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/common/bfutil"
|
||||
"erupe-ce/common/byteframe"
|
||||
_config "erupe-ce/config"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
@@ -27,8 +26,9 @@ func (m *MsgSysCreateAcquireSemaphore) Opcode() network.PacketID {
|
||||
func (m *MsgSysCreateAcquireSemaphore) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.Unk0 = bf.ReadUint16()
|
||||
m.PlayerCount = bf.ReadUint8()
|
||||
fmt.Printf("PLAYER COUNT :: %d", m.PlayerCount)
|
||||
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))))
|
||||
return nil
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
// MsgSysDeleteSemaphore represents the MSG_SYS_DELETE_SEMAPHORE
|
||||
type MsgSysDeleteSemaphore struct {
|
||||
AckHandle uint32
|
||||
SemaphoreID uint32
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -20,7 +20,7 @@ func (m *MsgSysDeleteSemaphore) Opcode() network.PacketID {
|
||||
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgSysDeleteSemaphore) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.SemaphoreID = bf.ReadUint32()
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
@@ -12,7 +11,7 @@ import (
|
||||
type MsgSysLoadRegister struct {
|
||||
AckHandle uint32
|
||||
RegisterID uint32
|
||||
Unk1 uint8
|
||||
Values uint8
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
@@ -24,23 +23,13 @@ func (m *MsgSysLoadRegister) Opcode() network.PacketID {
|
||||
func (m *MsgSysLoadRegister) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.RegisterID = bf.ReadUint32()
|
||||
m.Unk1 = bf.ReadUint8()
|
||||
fixedZero0 := bf.ReadUint16()
|
||||
fixedZero1 := bf.ReadUint8()
|
||||
|
||||
if fixedZero0 != 0 || fixedZero1 != 0 {
|
||||
return fmt.Errorf("expected fixed-0 values, got %d %d", fixedZero0, fixedZero1)
|
||||
}
|
||||
m.Values = bf.ReadUint8()
|
||||
_ = bf.ReadUint8()
|
||||
_ = bf.ReadUint16()
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgSysLoadRegister) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint32(m.RegisterID)
|
||||
bf.WriteUint8(m.Unk1)
|
||||
bf.WriteUint16(0)
|
||||
bf.WriteUint8(0)
|
||||
|
||||
return nil
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package mhfpacket
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
@@ -12,7 +11,6 @@ import (
|
||||
type MsgSysOperateRegister struct {
|
||||
AckHandle uint32
|
||||
SemaphoreID uint32
|
||||
fixedZero uint16
|
||||
RawDataPayload []byte
|
||||
}
|
||||
|
||||
@@ -25,12 +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()
|
||||
m.fixedZero = bf.ReadUint16()
|
||||
|
||||
if m.fixedZero != 0 {
|
||||
return fmt.Errorf("expected fixed-0 values, got %d", m.fixedZero)
|
||||
}
|
||||
|
||||
_ = bf.ReadUint16()
|
||||
dataSize := bf.ReadUint16()
|
||||
m.RawDataPayload = bf.ReadBytes(uint(dataSize))
|
||||
return nil
|
||||
@@ -38,11 +31,5 @@ func (m *MsgSysOperateRegister) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cl
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
func (m *MsgSysOperateRegister) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
|
||||
bf.WriteUint32(m.AckHandle)
|
||||
bf.WriteUint32(m.SemaphoreID)
|
||||
bf.WriteUint16(0)
|
||||
bf.WriteUint16(uint16(len(m.RawDataPayload)))
|
||||
bf.WriteBytes(m.RawDataPayload)
|
||||
|
||||
return nil
|
||||
return errors.New("NOT IMPLEMENTED")
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package mhfpacket
|
||||
|
||||
import (
|
||||
"errors"
|
||||
_config "erupe-ce/config"
|
||||
|
||||
"erupe-ce/common/byteframe"
|
||||
"erupe-ce/network"
|
||||
@@ -13,7 +14,11 @@ type TerminalLogEntry struct {
|
||||
Index uint32
|
||||
Type1 uint8
|
||||
Type2 uint8
|
||||
Data []int16
|
||||
Unk0 int16
|
||||
Unk1 int32
|
||||
Unk2 int32
|
||||
Unk3 int32
|
||||
Unk4 []int32
|
||||
}
|
||||
|
||||
// MsgSysTerminalLog represents the MSG_SYS_TERMINAL_LOG
|
||||
@@ -42,8 +47,14 @@ func (m *MsgSysTerminalLog) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Client
|
||||
e.Index = bf.ReadUint32()
|
||||
e.Type1 = bf.ReadUint8()
|
||||
e.Type2 = bf.ReadUint8()
|
||||
for j := 0; j < 15; j++ {
|
||||
e.Data = append(e.Data, bf.ReadInt16())
|
||||
e.Unk0 = bf.ReadInt16()
|
||||
e.Unk1 = bf.ReadInt32()
|
||||
e.Unk2 = bf.ReadInt32()
|
||||
e.Unk3 = bf.ReadInt32()
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G1 {
|
||||
for j := 0; j < 4; j++ {
|
||||
e.Unk4 = append(e.Unk4, bf.ReadInt32())
|
||||
}
|
||||
}
|
||||
m.Entries = append(m.Entries, e)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user