零点清理道具

duhui 2022-11-13 00:04:08 +08:00
parent 3aad1ca72e
commit ee6653d58f
2 changed files with 8 additions and 5 deletions

View File

@ -1086,8 +1086,10 @@ public class ItemLogic {
ItemManager itemManager = user.getItemManager();
Map<Integer, Item> itemMap = new HashMap<>(itemManager.getItemMap());
Map<Integer, SItem> sItemMap = SItem.getsItemMap();
ArrayList<CommonProto.Item> list = new ArrayList<>();
for (Map.Entry<Integer, Item> itemEntry : itemMap.entrySet()) {
SItem sItem = sItemMap.get(itemEntry.getValue().getItemId());
Item item = itemEntry.getValue();
SItem sItem = sItemMap.get(item.getItemId());
if (sItem == null
|| sItem.getItemType() == GlobalItemType.ONE_RMB_RECHARGE_CARD
|| sItem.getItemType() == GlobalItemType.DAY_TRUE_RECHARGE_JUAN
@ -1095,12 +1097,13 @@ public class ItemLogic {
|| sItem.getItemType() == GlobalItemType.DAY_XIAN_RECHARGE_CARD )
{
itemManager.removeItem(itemEntry.getKey());
list.add(CBean2Proto.getItem(item,0));
LOGGER.info("=================每日零点清理玩家道具角色id{}道具id:{},道具数量:{}",user.getId(),item.getItemId(),item.getItemNum());
}
}
List<CommonProto.Item> allItemList = ItemUtil.getAllItem(user,false);
if(!allItemList.isEmpty()) {
if(!list.isEmpty()) {
ISession session = OnlineUserManager.getSessionByUid(user.getId());
PlayerInfoProto.UpdateBagIndication build = PlayerInfoProto.UpdateBagIndication.newBuilder().addAllItem(allItemList).setType(0).build();
PlayerInfoProto.UpdateBagIndication build = PlayerInfoProto.UpdateBagIndication.newBuilder().addAllItem(list).setType(0).build();
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.UPDATE_BAG_INDICATION_VALUE, build, true);
}
}catch (Exception e){