mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 16:04:38 +01:00
initial legacy support for DistItem
This commit is contained in:
@@ -3,6 +3,7 @@ package mhfpacket
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"erupe-ce/common/byteframe"
|
"erupe-ce/common/byteframe"
|
||||||
|
_config "erupe-ce/config"
|
||||||
"erupe-ce/network"
|
"erupe-ce/network"
|
||||||
"erupe-ce/network/clientctx"
|
"erupe-ce/network/clientctx"
|
||||||
)
|
)
|
||||||
@@ -26,8 +27,12 @@ func (m *MsgMhfApplyDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
|
|||||||
m.AckHandle = bf.ReadUint32()
|
m.AckHandle = bf.ReadUint32()
|
||||||
m.DistributionType = bf.ReadUint8()
|
m.DistributionType = bf.ReadUint8()
|
||||||
m.DistributionID = bf.ReadUint32()
|
m.DistributionID = bf.ReadUint32()
|
||||||
|
if _config.ErupeConfig.RealClientMode >= _config.G8 {
|
||||||
m.Unk2 = bf.ReadUint32()
|
m.Unk2 = bf.ReadUint32()
|
||||||
|
}
|
||||||
|
if _config.ErupeConfig.RealClientMode >= _config.G10 {
|
||||||
m.Unk3 = bf.ReadUint32()
|
m.Unk3 = bf.ReadUint32()
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package mhfpacket
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"erupe-ce/common/byteframe"
|
"erupe-ce/common/byteframe"
|
||||||
|
_config "erupe-ce/config"
|
||||||
"erupe-ce/network"
|
"erupe-ce/network"
|
||||||
"erupe-ce/network/clientctx"
|
"erupe-ce/network/clientctx"
|
||||||
)
|
)
|
||||||
@@ -27,7 +28,9 @@ func (m *MsgMhfEnumerateDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.
|
|||||||
m.DistType = bf.ReadUint8()
|
m.DistType = bf.ReadUint8()
|
||||||
m.Unk1 = bf.ReadUint8()
|
m.Unk1 = bf.ReadUint8()
|
||||||
m.Unk2 = bf.ReadUint16() // Maximum? Hardcoded to 256
|
m.Unk2 = bf.ReadUint16() // Maximum? Hardcoded to 256
|
||||||
|
if _config.ErupeConfig.RealClientMode >= _config.Z1 {
|
||||||
m.Unk3 = bf.ReadBytes(uint(bf.ReadUint8()))
|
m.Unk3 = bf.ReadBytes(uint(bf.ReadUint8()))
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package channelserver
|
|||||||
import (
|
import (
|
||||||
"erupe-ce/common/byteframe"
|
"erupe-ce/common/byteframe"
|
||||||
ps "erupe-ce/common/pascalstring"
|
ps "erupe-ce/common/pascalstring"
|
||||||
|
_config "erupe-ce/config"
|
||||||
"erupe-ce/network/mhfpacket"
|
"erupe-ce/network/mhfpacket"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -128,8 +129,10 @@ func handleMsgMhfApplyDistItem(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
bf.WriteUint8(item.ItemType)
|
bf.WriteUint8(item.ItemType)
|
||||||
bf.WriteUint32(item.ItemID)
|
bf.WriteUint32(item.ItemID)
|
||||||
bf.WriteUint32(item.Quantity)
|
bf.WriteUint32(item.Quantity)
|
||||||
|
if _config.ErupeConfig.RealClientMode >= _config.G8 {
|
||||||
bf.WriteUint32(item.ID)
|
bf.WriteUint32(item.ID)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user