【跨服优化】跨服排行榜和跨服聊天改为在开服7天内不开放

back_recharge
xuexinpeng 2021-09-26 11:42:33 +08:00
parent 447ac9d61b
commit 30fe0d8ca6
2 changed files with 26 additions and 5 deletions

View File

@ -128,8 +128,23 @@ public class GlobleSystemLogic implements IEventHandler {
}
}
}
public static long oneWeekTimelong = 604800000L;
/**
*
* @return
*/
public static boolean isOpenServer7(){
// 开服时间戳
long openTime = TimeUtils.stringToTimeLong2(GameApplication.serverConfig.getOpenTime());
long openServer7DayTime = openTime + oneWeekTimelong;
// 当前时间戳
long now = TimeUtils.now();
if(now >= openServer7DayTime){
return false;
}else{
return true;
}
}
/**
*
*
@ -138,12 +153,14 @@ public class GlobleSystemLogic implements IEventHandler {
* 2 50
*/
public void calCulRank() {
//开服前7天不开放跨服功能
/*if(isOpenServer7()){
return;
}*/
//不参与跨服,不用计算世界等级
if(!GameApplication.serverProperties.isArenaCross()){
return;
}
SMServerArenaSetting setting = STableManager.getConfig(SMServerArenaSetting.class).get(1);
int rankEndLine = setting.getWorldLevLimit();
double sum=0;

View File

@ -394,9 +394,13 @@ public class MailLogic {
//检测跨服分组邮件
Integer split = redisUtil.getMapValue(RedisKey.SERVER_SPLIT_MAIL_INFO, "", String.valueOf(GameApplication.serverId), Integer.class);
if(split!=null){
sendServerSplitMail();
//开服前七天不发跨服分组邮件
if(!GlobleSystemLogic.isOpenServer7()){
sendServerSplitMail();
}
redisUtil.removeMapEntrys(RedisKey.SERVER_SPLIT_MAIL_INFO, "", String.valueOf(GameApplication.serverId));
}
//检测个人邮件
Map<String, MailCache> mails =redisUtil.getMapValues(RedisKey.READY_TO_USER_MAIL, "", String.class, MailCache.class);
if (mails.size()<1){