RealClientMode replaced for ClientID

This commit is contained in:
stratic-dev
2024-10-09 08:37:04 +01:00
parent e8fc650d49
commit 738a46a01b
32 changed files with 130 additions and 130 deletions

View File

@@ -51,7 +51,7 @@ func (cc *CryptConn) ReadPacket() ([]byte, error) {
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 {
if _config.ErupeConfig.ClientID < _config.F1 {
encryptedPacketBody = make([]byte, cph.DataSize)
} else {
encryptedPacketBody = make([]byte, uint32(cph.DataSize)+(uint32(cph.Pf0-0x03)*0x1000))

View File

@@ -31,7 +31,7 @@ func (m *MsgMhfAcquireCafeItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cl
m.ItemType = bf.ReadUint16()
m.ItemID = bf.ReadUint16()
m.Quant = bf.ReadUint16()
if _config.ErupeConfig.RealClientMode >= _config.G1 {
if _config.ErupeConfig.ClientID >= _config.G1 {
m.PointCost = bf.ReadUint32()
} else {
m.PointCost = uint32(bf.ReadUint16())

View File

@@ -27,10 +27,10 @@ func (m *MsgMhfApplyDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
m.AckHandle = bf.ReadUint32()
m.DistributionType = bf.ReadUint8()
m.DistributionID = bf.ReadUint32()
if _config.ErupeConfig.RealClientMode >= _config.G8 {
if _config.ErupeConfig.ClientID >= _config.G8 {
m.Unk2 = bf.ReadUint32()
}
if _config.ErupeConfig.RealClientMode >= _config.G10 {
if _config.ErupeConfig.ClientID >= _config.G10 {
m.Unk3 = bf.ReadUint32()
}
return nil

View File

@@ -28,7 +28,7 @@ func (m *MsgMhfEnumerateDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.
m.DistType = bf.ReadUint8()
m.Unk1 = bf.ReadUint8()
m.Unk2 = bf.ReadUint16() // Maximum? Hardcoded to 256
if _config.ErupeConfig.RealClientMode >= _config.Z1 {
if _config.ErupeConfig.ClientID >= _config.Z1 {
m.Unk3 = bf.ReadBytes(uint(bf.ReadUint8()))
}
return nil

View File

@@ -30,7 +30,7 @@ func (m *MsgMhfEnumerateQuest) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cli
m.Unk0 = bf.ReadUint8()
m.World = bf.ReadUint8()
m.Counter = bf.ReadUint16()
if _config.ErupeConfig.RealClientMode <= _config.Z1 {
if _config.ErupeConfig.ClientID <= _config.Z1 {
m.Offset = uint16(bf.ReadUint8())
} else {
m.Offset = bf.ReadUint16()

View File

@@ -32,7 +32,7 @@ func (m *MsgMhfEnumerateShop) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
m.ShopID = bf.ReadUint32()
m.Limit = bf.ReadUint16()
m.Unk3 = bf.ReadUint8()
if _config.ErupeConfig.RealClientMode >= _config.G2 {
if _config.ErupeConfig.ClientID >= _config.G2 {
m.Unk4 = bf.ReadUint8()
m.Unk5 = bf.ReadUint32()
}

View File

@@ -30,7 +30,7 @@ func (m *MsgMhfSavedata) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientCon
m.AllocMemSize = bf.ReadUint32()
m.SaveType = bf.ReadUint8()
m.Unk1 = bf.ReadUint32()
if _config.ErupeConfig.RealClientMode >= _config.G1 {
if _config.ErupeConfig.ClientID >= _config.G1 {
m.DataSize = bf.ReadUint32()
}
if m.DataSize == 0 { // seems to be used when DataSize = 0 rather than on savetype?

View File

@@ -32,12 +32,12 @@ func (m *MsgMhfStampcardStamp) Opcode() network.PacketID {
func (m *MsgMhfStampcardStamp) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
m.AckHandle = bf.ReadUint32()
m.HR = bf.ReadUint16()
if _config.ErupeConfig.RealClientMode >= _config.G1 {
if _config.ErupeConfig.ClientID >= _config.G1 {
m.GR = bf.ReadUint16()
}
m.Stamps = bf.ReadUint16()
bf.ReadUint16() // Zeroed
if _config.ErupeConfig.RealClientMode >= _config.Z2 {
if _config.ErupeConfig.ClientID >= _config.Z2 {
m.Reward1 = uint16(bf.ReadUint32())
m.Reward2 = uint16(bf.ReadUint32())
m.Item1 = uint16(bf.ReadUint32())

View File

@@ -23,11 +23,11 @@ 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()
if _config.ErupeConfig.RealClientMode >= _config.G10 {
if _config.ErupeConfig.ClientID >= _config.G10 {
m.Data = bf.ReadBytes(362)
} else if _config.ErupeConfig.RealClientMode >= _config.GG {
} else if _config.ErupeConfig.ClientID >= _config.GG {
m.Data = bf.ReadBytes(338)
} else if _config.ErupeConfig.RealClientMode >= _config.F5 {
} else if _config.ErupeConfig.ClientID >= _config.F5 {
// G1 is a guess
m.Data = bf.ReadBytes(314)
} else {

View File

@@ -25,7 +25,7 @@ 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()
if _config.ErupeConfig.RealClientMode >= _config.S7 { // Assuming this was added with Ravi?
if _config.ErupeConfig.ClientID >= _config.S7 { // Assuming this was added with Ravi?
m.PlayerCount = bf.ReadUint8()
}
bf.ReadUint8() // SemaphoreID length

View File

@@ -26,7 +26,7 @@ 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()
if _config.ErupeConfig.RealClientMode >= _config.S7 { // Assuming this was added with Ravi?
if _config.ErupeConfig.ClientID >= _config.S7 { // Assuming this was added with Ravi?
m.PlayerCount = bf.ReadUint8()
}
bf.ReadUint8() // SemaphoreID length

View File

@@ -49,7 +49,7 @@ func (m *MsgSysTerminalLog) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Client
e.Unk1 = bf.ReadInt32()
e.Unk2 = bf.ReadInt32()
e.Unk3 = bf.ReadInt32()
if _config.ErupeConfig.RealClientMode >= _config.G1 {
if _config.ErupeConfig.ClientID >= _config.G1 {
for j := 0; j < 4; j++ {
e.Unk4 = append(e.Unk4, bf.ReadInt32())
}