limit EnumerateShop responses

This commit is contained in:
wish
2023-11-29 21:37:41 +11:00
parent ea981ca70f
commit e914cf406b
2 changed files with 5 additions and 2 deletions

View File

@@ -241,6 +241,9 @@ func handleMsgMhfEnumerateShop(s *Session, p mhfpacket.MHFPacket) {
case 10: // Item shop, 0-8
bf := byteframe.NewByteFrame()
items := getShopItems(s, pkt.ShopType, pkt.ShopID)
if len(items) > int(pkt.Limit) {
items = items[:pkt.Limit]
}
writeShopItems(bf, items)
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
}