From 40fe5fc2331e1c071285a582686bd47a69b2e436 Mon Sep 17 00:00:00 2001 From: wish Date: Tue, 28 Feb 2023 18:12:24 +1100 Subject: [PATCH] simplify shop enumeration --- server/channelserver/handlers_shop_gacha.go | 32 +++++---------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/server/channelserver/handlers_shop_gacha.go b/server/channelserver/handlers_shop_gacha.go index 91f92205e..e3981bfbf 100644 --- a/server/channelserver/handlers_shop_gacha.go +++ b/server/channelserver/handlers_shop_gacha.go @@ -204,37 +204,19 @@ func handleMsgMhfEnumerateShop(s *Session, p mhfpacket.MHFPacket) { bf.WriteUint16(entryCount) doAckBufSucceed(s, pkt.AckHandle, bf.Data()) case 3: // Hunting Festival Exchange - bf := byteframe.NewByteFrame() - items := getShopItems(s, pkt.ShopType, pkt.ShopID) - writeShopItems(bf, items) - doAckBufSucceed(s, pkt.AckHandle, bf.Data()) + fallthrough case 4: // N Points, 0-6 - bf := byteframe.NewByteFrame() - items := getShopItems(s, pkt.ShopType, pkt.ShopID) - writeShopItems(bf, items) - doAckBufSucceed(s, pkt.AckHandle, bf.Data()) + fallthrough case 5: // GCP->Item, 0-6 - bf := byteframe.NewByteFrame() - items := getShopItems(s, pkt.ShopType, pkt.ShopID) - writeShopItems(bf, items) - doAckBufSucceed(s, pkt.AckHandle, bf.Data()) + fallthrough case 6: // Gacha coin->Item - doAckBufSucceed(s, pkt.AckHandle, make([]byte, 4)) + fallthrough case 7: // Item->GCP - bf := byteframe.NewByteFrame() - items := getShopItems(s, pkt.ShopType, pkt.ShopID) - writeShopItems(bf, items) - doAckBufSucceed(s, pkt.AckHandle, bf.Data()) + fallthrough case 8: // Diva - bf := byteframe.NewByteFrame() - items := getShopItems(s, pkt.ShopType, pkt.ShopID) - writeShopItems(bf, items) - doAckBufSucceed(s, pkt.AckHandle, bf.Data()) + fallthrough case 9: // Diva song shop - bf := byteframe.NewByteFrame() - items := getShopItems(s, pkt.ShopType, pkt.ShopID) - writeShopItems(bf, items) - doAckBufSucceed(s, pkt.AckHandle, bf.Data()) + fallthrough case 10: // Item shop, 0-8 bf := byteframe.NewByteFrame() items := getShopItems(s, pkt.ShopType, pkt.ShopID)