零点清理道具添加前端推送协议

back_recharge
duhui 2022-11-11 10:56:32 +08:00
parent 998ab5ce14
commit ff090866d4
2 changed files with 27 additions and 12 deletions

View File

@ -160,6 +160,10 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
Double score = item.getScore();
try {
User user = UserManager.getUser(uid, true);
if (user == null){
LOGGER.error("开服冲榜id为{}的玩家,{}活动,{}排行奖励发送失败,原因玩家不存在", uid, id, rankType);
continue;
}
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
if (mission == null){
LOGGER.error("开服冲榜id为{}的玩家,{}活动,{}排行奖励发送失败,原因活动不存在", uid, id, rankType);

View File

@ -14,6 +14,7 @@ import com.ljsd.jieling.jbean.ActivityMission;
import com.ljsd.jieling.jbean.ActivityProgressInfo;
import com.ljsd.jieling.ktbeans.ReportEventEnum;
import com.ljsd.jieling.ktbeans.ReportUtil;
import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.activity.AbstractActivity;
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
import com.ljsd.jieling.logic.activity.event.EspecialEquipUpEvent;
@ -1081,19 +1082,29 @@ public class ItemLogic {
* @param user
*/
public void zeroCleanItem(User user){
ItemManager itemManager = user.getItemManager();
Map<Integer, Item> itemMap = new HashMap<>(itemManager.getItemMap());
Map<Integer, SItem> sItemMap = SItem.getsItemMap();
for (Map.Entry<Integer, Item> itemEntry : itemMap.entrySet()) {
SItem sItem = sItemMap.get(itemEntry.getValue().getItemId());
if (sItem == null
|| sItem.getItemType() == GlobalItemType.ONE_RMB_RECHARGE_CARD
|| sItem.getItemType() == GlobalItemType.DAY_TRUE_RECHARGE_JUAN
|| sItem.getItemType() == GlobalItemType.DAY_RMB_CARD
|| sItem.getItemType() == GlobalItemType.DAY_XIAN_RECHARGE_CARD )
{
itemManager.removeItem(itemEntry.getKey());
try {
ItemManager itemManager = user.getItemManager();
Map<Integer, Item> itemMap = new HashMap<>(itemManager.getItemMap());
Map<Integer, SItem> sItemMap = SItem.getsItemMap();
for (Map.Entry<Integer, Item> itemEntry : itemMap.entrySet()) {
SItem sItem = sItemMap.get(itemEntry.getValue().getItemId());
if (sItem == null
|| sItem.getItemType() == GlobalItemType.ONE_RMB_RECHARGE_CARD
|| sItem.getItemType() == GlobalItemType.DAY_TRUE_RECHARGE_JUAN
|| sItem.getItemType() == GlobalItemType.DAY_RMB_CARD
|| sItem.getItemType() == GlobalItemType.DAY_XIAN_RECHARGE_CARD )
{
itemManager.removeItem(itemEntry.getKey());
}
}
List<CommonProto.Item> allItemList = ItemUtil.getAllItem(user,false);
if(!allItemList.isEmpty()) {
ISession session = OnlineUserManager.getSessionByUid(user.getId());
PlayerInfoProto.UpdateBagIndication build = PlayerInfoProto.UpdateBagIndication.newBuilder().addAllItem(allItemList).setType(0).build();
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.UPDATE_BAG_INDICATION_VALUE, build, true);
}
}catch (Exception e){
LOGGER.error("零点清理玩家当日过期道具报错:{}",e.getMessage());
}
}