零点清理道具

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){

View File

@ -139,7 +139,7 @@ public class MessageUtil {
user.getPlayerInfoManager().setReds(reds);
}
public static void sendBagIndication(int sendUid,int type, List<CommonProto.Item> sendToFront,boolean isMax) {
public static void sendBagIndication(int sendUid,int type, List<CommonProto.Item> sendToFront,boolean isMax) {
if(!isMax){
if(null!= SimpleTransaction.current()){
PlayerInfoProto.UpdateBagIndication.Builder build = PlayerInfoProto.UpdateBagIndication.newBuilder().addAllItem(sendToFront).setType(type).setIsMax(isMax?1:0);