1、redis工具类null异常处理

2、用户缓存优化
3、邮件添加领取和读取日志
back_recharge
duhui 2023-04-11 16:00:02 +08:00
parent 1647adf854
commit b19096d9e6
4 changed files with 4 additions and 2 deletions

View File

@ -411,7 +411,6 @@ public class AreaManager {
if (serverIds.contains(targetServerId)) {
return true;
}
LOGGER.error("the serverid={} can not allow permit,the current areaId={}", targetServerId, areaId);
return false;
}

View File

@ -1589,7 +1589,7 @@ public class RedisUtil {
if (!RedisKey.newAreaCacChe.contains(type) && !RedisKey.rankCacChe.contains(type) && key.length() == 8) {
Integer serverId = RedisUtil.getInstence().getObject(RedisKey.CUser_ServerId_Key, key, Integer.class, GlobalsDef.REDIS_OVER_TIME_DAY * 10);
if (serverId != null || !AreaManager.getInstance().checkServerIdAllowPermit(serverId)) {
if (serverId != null){
return serverId + RedisKey.Delimiter_colon + type + RedisKey.Delimiter_colon + key;
}
}

View File

@ -101,6 +101,7 @@ public class UserManager {
}
Integer count = userCount.getOrDefault(uid, 0);
if (count-- <= 0){
MongoUtil.getLjsdMongoTemplate().lastUpdate();
LOGGER.info("离线玩家{}被请求次数为{},剔除缓存",uid,count);
iterator.remove();
removeUser(uid);

View File

@ -192,6 +192,7 @@ public class MailLogic {
mail.setState(Global.MAIL_DRAW_ST_UNGET);
}
}
LOGGER.error("玩家读取了邮件,邮件信息:{},当前时间:{}", mail, TimeUtils.now());
mailManager.addMail(mail);
ReportUtil.onReportEvent(user, ReportEventEnum.OPEN_MAIL.getType());
PlayerInfoProto.MailReadResponse.Builder builder = PlayerInfoProto.MailReadResponse.newBuilder().setMailInfo(CBean2Proto.getMail(mail, false));
@ -247,6 +248,7 @@ public class MailLogic {
mail.setState(Global.MAIL_DRAW_ST_GOT);
mail.setNoUseDeleteTime(TimeUtils.now()+TimeUtils.DAY*Global.MAIL_NOUSE_DELETE_TIME);
mailManager.addMail(mail);
LOGGER.error("玩家领取了邮件uid{},邮件信息:{},当前时间:{}",userId, mail, TimeUtils.now());
}
}
if (state != 1) {