mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 15:34:38 +01:00
initial legacy support for DistItem
This commit is contained in:
@@ -3,6 +3,7 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
_config "erupe-ce/config"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
@@ -26,8 +27,12 @@ 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
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package mhfpacket
|
||||
import (
|
||||
"errors"
|
||||
"erupe-ce/common/byteframe"
|
||||
_config "erupe-ce/config"
|
||||
"erupe-ce/network"
|
||||
"erupe-ce/network/clientctx"
|
||||
)
|
||||
@@ -27,7 +28,9 @@ 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
|
||||
m.Unk3 = bf.ReadBytes(uint(bf.ReadUint8()))
|
||||
if _config.ErupeConfig.RealClientMode >= _config.Z1 {
|
||||
m.Unk3 = bf.ReadBytes(uint(bf.ReadUint8()))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package channelserver
|
||||
import (
|
||||
"erupe-ce/common/byteframe"
|
||||
ps "erupe-ce/common/pascalstring"
|
||||
_config "erupe-ce/config"
|
||||
"erupe-ce/network/mhfpacket"
|
||||
"time"
|
||||
|
||||
@@ -128,7 +129,9 @@ func handleMsgMhfApplyDistItem(s *Session, p mhfpacket.MHFPacket) {
|
||||
bf.WriteUint8(item.ItemType)
|
||||
bf.WriteUint32(item.ItemID)
|
||||
bf.WriteUint32(item.Quantity)
|
||||
bf.WriteUint32(item.ID)
|
||||
if _config.ErupeConfig.RealClientMode >= _config.G8 {
|
||||
bf.WriteUint32(item.ID)
|
||||
}
|
||||
}
|
||||
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user