七界发奖优化
parent
bc798e4cb4
commit
89be667495
|
@ -234,6 +234,10 @@ public class TimeUtils {
|
|||
return (int) (now() / 1000);
|
||||
}
|
||||
|
||||
public static String nowStr() {
|
||||
return getTimeStamp2(now());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取特定日期当天的零点时间
|
||||
*
|
||||
|
@ -269,8 +273,13 @@ public class TimeUtils {
|
|||
* 获取时间戳字符串yyyy-MM-dd HH:mm:ss
|
||||
*/
|
||||
public static String getTimeStamp2(Long time) {
|
||||
try {
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern(ymdhms_Format_new);
|
||||
return formatter.format(LocalDateTime.ofInstant(Instant.ofEpochMilli(time),ZoneId.systemDefault()));
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -80,7 +80,6 @@ public class CarDelayFunction implements FunctionManager {
|
|||
// 个人
|
||||
String personTitle = SErrorCodeEerverConfig.getI18NMessage("family_fight_rank_personreward_title");
|
||||
int nowTime = TimeUtils.nowInt();
|
||||
int times=0;
|
||||
for(ZSetOperations.TypedTuple<String> rankInfo : personRangeWithScores){
|
||||
int uid = Integer.parseInt(rankInfo.getValue());
|
||||
long score = rankInfo.getScore().longValue();
|
||||
|
|
|
@ -579,10 +579,10 @@ public class ArenaLogic {
|
|||
}
|
||||
// 超7天未登录玩家,不再发奖励
|
||||
long offLineTime = csPlayer.getOffLineTime();
|
||||
if (offLineTime == 0 || TimeUtils.now() > (offLineTime + GlobalsDef.REDIS_OVER_TIME_DAY * 7 * 1000L)){
|
||||
if (TimeUtils.now() > (offLineTime + TimeUtils.WEEK)){
|
||||
String recordKey = RedisUtil.getInstence().getKey(RedisKey.ARENA_RRECORD, Integer.toString(uid));
|
||||
RedisUtil.getInstence().del(recordKey);
|
||||
LOGGER.error("竞技场发奖,玩家:{} 离线时间超过七天,剔除排行榜并且不再发奖,上次离线时间:{}",uid, offLineTime);
|
||||
LOGGER.error("竞技场发奖,玩家:{} ,排名:{},离线时间超过七天,剔除排行榜并且不再发奖,上次离线时间:{}",uid,rank,offLineTime);
|
||||
continue;
|
||||
}
|
||||
User user = UserManager.getUserNotCache(uid);
|
||||
|
|
|
@ -11,10 +11,12 @@ import com.ljsd.jieling.globals.Global;
|
|||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.FightDispatcher;
|
||||
import com.ljsd.jieling.logic.fight.GameFightType;
|
||||
|
@ -446,7 +448,17 @@ public class SevenWorldLogic {
|
|||
int rank = 0;
|
||||
for (ZSetOperations.TypedTuple<String> tuple : range) {
|
||||
rank++;
|
||||
User user = UserManager.getUserNotCache(Integer.parseInt(tuple.getValue()));
|
||||
int uid = Integer.parseInt(tuple.getValue());
|
||||
CSPlayer player = CrossServiceLogic.getPlayerByRedis(uid);
|
||||
if (player == null){
|
||||
LOGGER.error("七界发奖,玩家缓存找不到,uid:{},排名:{}",uid,rank);
|
||||
continue;
|
||||
}
|
||||
if (TimeUtils.now() > (player.getOffLineTime()+TimeUtils.WEEK)){
|
||||
LOGGER.error("七界发奖,玩家登陆时间超过七天,uid:{},排名:{},最后登陆时间:{},当前时间:{}",uid,rank,TimeUtils.getTimeStamp2(player.getOffLineTime()),TimeUtils.nowStr());
|
||||
continue;
|
||||
}
|
||||
User user = UserManager.getUserNotCache(uid);
|
||||
if (user == null){
|
||||
continue;
|
||||
}
|
||||
|
@ -473,7 +485,6 @@ public class SevenWorldLogic {
|
|||
|
||||
/**
|
||||
* 每周末的23:30分发奖
|
||||
* @return
|
||||
*/
|
||||
private boolean isTime(){
|
||||
int week = TimeUtils.getDayOfWeek();
|
||||
|
|
Loading…
Reference in New Issue