Support giftPackage BatchUse

Co-authored-by: pris <lilch1022@hotmail.com>
This commit is contained in:
xtaodada
2022-05-03 11:09:41 +08:00
committed by Melledy
Unverified
parent 8c7681bd6d
commit 86e6eef4e2
14 changed files with 371 additions and 112 deletions
@@ -90,9 +90,6 @@ public class HandlerBuyGoodsReq extends PacketHandler {
session.getPlayer().addShopLimit(sg.getGoodsId(), buyGoodsReq.getBoughtNum(), ShopManager.getShopNextRefreshTime(sg));
GameItem item = new GameItem(GameData.getItemDataMap().get(sg.getGoodsItem().getId()));
item.setCount(buyGoodsReq.getBoughtNum() * sg.getGoodsItem().getCount());
if (sg.getShowId() > 0) {
item.setRewardBoxId(sg.getShowId());
}
session.getPlayer().getInventory().addItem(item, ActionReason.Shop, true); // fix: not notify when got virtual item from shop
session.send(new PacketBuyGoodsRsp(buyGoodsReq.getShopType(), session.getPlayer().getGoodsLimit(sg.getGoodsId()).getHasBoughtInPeriod(), buyGoodsReq.getGoodsListList().stream().filter(x -> x.getGoodsId() == goodsId).findFirst().get()));
}