删除邮件
parent
44eae0f96f
commit
95a7801138
|
|
@ -4,6 +4,8 @@ import com.alibaba.fastjson.JSON;
|
|||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.HeroStaticConfig;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.db.mongo.LjsdMongoTemplate;
|
||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||
import com.ljsd.jieling.db.mongo.gmActivity.ARBActivity;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
|
|
@ -31,6 +33,7 @@ import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.explorerMap.ExplorerMapLogic;
|
||||
import com.ljsd.jieling.logic.home.event.HomeEvent;
|
||||
import com.ljsd.jieling.logic.item.ItemLog;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
|
|
@ -50,6 +53,8 @@ import config.*;
|
|||
import manager.STableManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.mongodb.core.query.Criteria;
|
||||
import org.springframework.data.mongodb.core.query.Query;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
|
@ -58,6 +63,7 @@ import util.StringUtil;
|
|||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Component
|
||||
|
|
@ -165,8 +171,9 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
GmActivityLogic.zeroUpdateGmActivity(user);
|
||||
// 临时代码,处理活动bug, 只有在1月24号当天开服得玩家需要优化
|
||||
xunbaoActivityHandler(user);
|
||||
gmDeleteMail(user);
|
||||
//临时处理返利活动
|
||||
gmRechargeBackHandler(user);
|
||||
// gmRechargeBackHandler(user);
|
||||
|
||||
List<CommonProto.GoodsTypeDuration> goodsTypeDurations = BuyGoodsNewLogic.getGoodsTypeDurations(user);
|
||||
//问卷状态
|
||||
|
|
@ -764,6 +771,62 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
LOGGER.info("返利活动补偿,uid:{},金额:{}",user.getId(), collect);
|
||||
}
|
||||
|
||||
private void gmDeleteMail(User user){
|
||||
String key = "deleteMail0208";
|
||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
Integer integer = playerInfoManager.getCompensateMark().get(key);
|
||||
if (integer != null){
|
||||
return;
|
||||
}
|
||||
|
||||
playerInfoManager.putCompensateMark(key,1);
|
||||
|
||||
String reg = "限时返利活动|限时单笔豪礼|妖晶返利|单笔充值";
|
||||
|
||||
MailManager mailManager = user.getMailManager();
|
||||
Map<String, Mail> mailMap = mailManager.getMailMap();
|
||||
long start = 1675850400L;
|
||||
long end = 1675852680L;
|
||||
for (Map.Entry<String, Mail> entry : mailMap.entrySet()) {
|
||||
Mail mail = entry.getValue();
|
||||
int sendTime = mail.getSendTime();
|
||||
if (sendTime > end || sendTime < start){
|
||||
continue;
|
||||
}
|
||||
boolean isMatch = Pattern.matches(reg, mail.getHead());
|
||||
if (!isMatch){
|
||||
continue;
|
||||
}
|
||||
mailManager.removeMail(entry.getKey());
|
||||
LOGGER.info("gm删除邮件,uid:{},mail:{}",user.getId(),mail.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void gmDeleteItem(User user){
|
||||
String key = "deleteItem0208";
|
||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
Integer integer = playerInfoManager.getCompensateMark().get(key);
|
||||
if (integer != null){
|
||||
return;
|
||||
}
|
||||
playerInfoManager.putCompensateMark(key,1);
|
||||
long start = 1675850400L;
|
||||
long end = 1675852680L;
|
||||
try {
|
||||
LjsdMongoTemplate ljsdMongoTemplate = MongoUtil.getLjsdMongoTemplate();
|
||||
Query query = new Query();
|
||||
query.addCriteria(Criteria.where("uid").is(user.getId()));
|
||||
query.addCriteria(Criteria.where("type").is(0));
|
||||
query.addCriteria(Criteria.where("reason").is(user.getId()));
|
||||
query.addCriteria(Criteria.where("time").lte(String.valueOf(end)).gte(String.valueOf(start)));
|
||||
List<ItemLog> itemLogs = ljsdMongoTemplate.findAllByCondition(query, ItemLog.class);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 摘星阁装备强化调整后返还玩家强化道具
|
||||
* @param user
|
||||
|
|
|
|||
|
|
@ -135,4 +135,23 @@ public class Mail extends MongoBase {
|
|||
public void setMarkType(int markType) {
|
||||
this.markType = markType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Mail{" +
|
||||
"id='" + id + '\'' +
|
||||
", roleUid=" + roleUid +
|
||||
", state=" + state +
|
||||
", head='" + head + '\'' +
|
||||
", content='" + content + '\'' +
|
||||
", mailItem='" + mailItem + '\'' +
|
||||
", sendTime=" + sendTime +
|
||||
", effectiveTime=" + effectiveTime +
|
||||
", sendName='" + sendName + '\'' +
|
||||
", noUseDeleteTime=" + noUseDeleteTime +
|
||||
", mailType=" + mailType +
|
||||
", isTop=" + isTop +
|
||||
", markType=" + markType +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -279,6 +279,22 @@ public class PlayerManager extends MongoBase {
|
|||
updateString("gmRechargeBackMark", gmRechargeBackMark);
|
||||
}
|
||||
|
||||
private Map<String, Integer> compensateMark = new HashMap<>();
|
||||
|
||||
public Map<String, Integer> getCompensateMark() {
|
||||
return compensateMark;
|
||||
}
|
||||
|
||||
public void setCompensateMark(Map<String, Integer> compensateMark) {
|
||||
this.compensateMark = compensateMark;
|
||||
updateString("compensateMark", compensateMark);
|
||||
}
|
||||
|
||||
public void putCompensateMark(String key, int value) {
|
||||
this.compensateMark.put(key,value);
|
||||
updateString("compensateMark", compensateMark);
|
||||
}
|
||||
|
||||
/**
|
||||
* bt 特权等级,key:UnlockType, value:等级
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in New Issue