零点清理道具
parent
3aad1ca72e
commit
ee6653d58f
|
@ -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){
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue