mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 23:44:52 +01:00
limit EnumerateShop responses
This commit is contained in:
@@ -14,7 +14,7 @@ type MsgMhfEnumerateShop struct {
|
|||||||
AckHandle uint32
|
AckHandle uint32
|
||||||
ShopType uint8 // 1 running gachas, 10 normal shop extensions, 8 Diva Defense shop
|
ShopType uint8 // 1 running gachas, 10 normal shop extensions, 8 Diva Defense shop
|
||||||
ShopID uint32
|
ShopID uint32
|
||||||
Unk2 uint16 // 00 80 running gachas, 00 20 normal shop
|
Limit uint16
|
||||||
Unk3 uint8
|
Unk3 uint8
|
||||||
Unk4 uint8
|
Unk4 uint8
|
||||||
Unk5 uint32
|
Unk5 uint32
|
||||||
@@ -30,7 +30,7 @@ func (m *MsgMhfEnumerateShop) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clie
|
|||||||
m.AckHandle = bf.ReadUint32()
|
m.AckHandle = bf.ReadUint32()
|
||||||
m.ShopType = bf.ReadUint8()
|
m.ShopType = bf.ReadUint8()
|
||||||
m.ShopID = bf.ReadUint32()
|
m.ShopID = bf.ReadUint32()
|
||||||
m.Unk2 = bf.ReadUint16()
|
m.Limit = bf.ReadUint16()
|
||||||
m.Unk3 = bf.ReadUint8()
|
m.Unk3 = bf.ReadUint8()
|
||||||
if _config.ErupeConfig.RealClientMode >= _config.G2 {
|
if _config.ErupeConfig.RealClientMode >= _config.G2 {
|
||||||
m.Unk4 = bf.ReadUint8()
|
m.Unk4 = bf.ReadUint8()
|
||||||
|
|||||||
@@ -241,6 +241,9 @@ func handleMsgMhfEnumerateShop(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
case 10: // Item shop, 0-8
|
case 10: // Item shop, 0-8
|
||||||
bf := byteframe.NewByteFrame()
|
bf := byteframe.NewByteFrame()
|
||||||
items := getShopItems(s, pkt.ShopType, pkt.ShopID)
|
items := getShopItems(s, pkt.ShopType, pkt.ShopID)
|
||||||
|
if len(items) > int(pkt.Limit) {
|
||||||
|
items = items[:pkt.Limit]
|
||||||
|
}
|
||||||
writeShopItems(bf, items)
|
writeShopItems(bf, items)
|
||||||
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user