七界和车迟斗法刷新问题
parent
8c634d7df2
commit
88821c6094
|
@ -1475,8 +1475,7 @@ public class TimeUtils {
|
||||||
public static int getDayOfWeekBytime(long time) {
|
public static int getDayOfWeekBytime(long time) {
|
||||||
Calendar calendar = Calendar.getInstance();
|
Calendar calendar = Calendar.getInstance();
|
||||||
calendar.setTimeInMillis(time);
|
calendar.setTimeInMillis(time);
|
||||||
int week = calendar.get(Calendar.DAY_OF_WEEK) - 1;
|
return calendar.get(Calendar.DAY_OF_WEEK) - 1;
|
||||||
return week;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -31,24 +31,6 @@ public class CarDelayFunction implements FunctionManager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startAction(TimeControllerOfFunction timeControllerOfFunction) throws Exception {
|
public void startAction(TimeControllerOfFunction timeControllerOfFunction) throws Exception {
|
||||||
|
|
||||||
String backName = "backup";
|
|
||||||
|
|
||||||
AbstractRank personRank = RankContext.getRankEnum(RankEnum.CAR_DEALY_RANK.getType());
|
|
||||||
AbstractRank guildRank = RankContext.getRankEnum(RankEnum.CAR_DEALY_GUILD_RANK.getType());
|
|
||||||
|
|
||||||
String key = RedisUtil.getInstence().getKey(personRank.getRedisKey(), "");
|
|
||||||
String guildKey = RedisUtil.getInstence().getKey(guildRank.getRedisKey(), "");
|
|
||||||
String crossKey = RedisUtil.getInstence().getKey(personRank.getCrossRedisKey(), "",false);
|
|
||||||
String crossGuildKey = RedisUtil.getInstence().getKey(guildRank.getCrossRedisKey(), "",false);
|
|
||||||
String carPeopleNum = RedisUtil.getInstence().getKey(RedisKey.CAR_DEALY_GUILD_FIGHT_PEOPLE_NUM,"");
|
|
||||||
|
|
||||||
String[] delKeys = {key,guildKey,crossKey,crossGuildKey,carPeopleNum};
|
|
||||||
RedisUtil.getInstence().rename(60*60*16, backName, delKeys);
|
|
||||||
// String userLevelGuild = RedisUtil.getInstence().getKey(RedisKey.USER_LEVEL_GUILD_INFO, "");
|
|
||||||
// delKeys.add(userLevelGuild);
|
|
||||||
LOGGER.error("车迟斗法备份排行榜:{}",Arrays.asList(delKeys));
|
|
||||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -116,7 +98,15 @@ public class CarDelayFunction implements FunctionManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 删除排行榜
|
||||||
|
String personKey = RedisUtil.getInstence().getKey(personRank.getRedisKey(), "");
|
||||||
|
String guildKey = RedisUtil.getInstence().getKey(guildRank.getRedisKey(), "");
|
||||||
|
String crossPersonKey = RedisUtil.getInstence().getKey(personRank.getCrossRedisKey(), "",false);
|
||||||
|
String crossGuildKey = RedisUtil.getInstence().getKey(guildRank.getCrossRedisKey(), "",false);
|
||||||
|
String carPeopleNum = RedisUtil.getInstence().getKey(RedisKey.CAR_DEALY_GUILD_FIGHT_PEOPLE_NUM,"");
|
||||||
|
LOGGER.info("车迟斗法清空排行榜==================={},{},{},{},{}",personKey,guildKey,crossPersonKey,crossGuildKey,carPeopleNum);
|
||||||
|
RedisUtil.getInstence().del(personKey,guildKey,crossPersonKey,crossGuildKey,carPeopleNum);
|
||||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||||
// RedisUtil.getInstence().del(lockKey);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,33 @@
|
||||||
package com.ljsd.jieling.core.function;
|
package com.ljsd.jieling.core.function;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||||
import com.ljsd.jieling.core.FunctionManager;
|
import com.ljsd.jieling.core.FunctionManager;
|
||||||
import com.ljsd.jieling.db.redis.RedisKey;
|
import com.ljsd.jieling.db.redis.RedisKey;
|
||||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
|
import com.ljsd.jieling.globals.Global;
|
||||||
|
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||||
|
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||||
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
||||||
|
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.item.ItemLogic;
|
||||||
|
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||||
import com.ljsd.jieling.logic.rank.RankContext;
|
import com.ljsd.jieling.logic.rank.RankContext;
|
||||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||||
import com.ljsd.jieling.logic.sevenworld.SevenWorldLogic;
|
import com.ljsd.jieling.logic.sevenworld.SevenWorldLogic;
|
||||||
|
import config.SErrorCodeEerverConfig;
|
||||||
|
import config.SQijieRanking;
|
||||||
|
import manager.STableManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.data.redis.core.ZSetOperations;
|
||||||
|
import util.StringUtil;
|
||||||
|
import util.TimeUtils;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lvxinran
|
* @author lvxinran
|
||||||
|
@ -22,15 +40,61 @@ public class SevenWorldFunction implements FunctionManager {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void closeAction(){
|
public void closeAction(){
|
||||||
|
int crossGroup = GlobleSystemLogic.crossGroup;
|
||||||
|
String lockKey = "SEVEN_WORLD_RESET_LOCK" + RedisKey.Delimiter_colon + crossGroup;
|
||||||
|
boolean lock = RedisUtil.getInstence().lock(lockKey, TimeUtils.ONE_SECOND * 60);
|
||||||
|
if (!lock) {
|
||||||
|
//没有拿到锁直接返回
|
||||||
|
LOGGER.error("七界试炼,重置排行榜退出, key:{} 跨服分组 ={},锁状态:{},未获取到锁",lockKey, crossGroup, lock);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOGGER.info("七界试炼活动结束,开始发奖...");
|
||||||
|
// 排行榜
|
||||||
|
String crossRedisKey = RankContext.getRankEnum(RankEnum.CROSS_SEVEN_WORLD_RANK.getType()).getCrossRedisKey();
|
||||||
|
Set<ZSetOperations.TypedTuple<String>> range = RedisUtil.getInstence().getZsetreverseRangeWithScores(crossRedisKey,"",0,-1,false);
|
||||||
|
// 排名
|
||||||
|
int rank = 0;
|
||||||
|
for (ZSetOperations.TypedTuple<String> tuple : range) {
|
||||||
|
rank++;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
String title = SErrorCodeEerverConfig.getI18NMessage("Qijie_mail_title");
|
||||||
|
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("Qijie_mail_txt", new Object[]{rank},new int[0],"#");
|
||||||
|
// 排行奖励
|
||||||
|
Map<Integer, SQijieRanking> config = STableManager.getConfig(SQijieRanking.class);
|
||||||
|
for (SQijieRanking value : config.values()) {
|
||||||
|
// 排名区间
|
||||||
|
if (rank >= value.getMinRank() && rank <= value.getMaxRank()){
|
||||||
|
// 发邮件奖励
|
||||||
|
String reward = StringUtil.parseArrayToString(value.getRankingReward());
|
||||||
|
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
|
||||||
|
// 清除道具
|
||||||
|
ItemLogic.getInstance().functionEndClearItem(user.getId(), FunctionIdEnum.CrossSevenWorld.getFunctionType(), BIReason.SEVEN_WORLD_FUNCTION_END);
|
||||||
|
LOGGER.info("七界结束,发送邮件并删除道具,uid:{},奖励:{},",user.getId(),reward);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LOGGER.info("七界试炼发奖结束,开始清除排行榜...");
|
||||||
|
String key = RedisUtil.getInstence().getKey2(crossRedisKey, "");
|
||||||
|
RedisUtil.getInstence().del(key);
|
||||||
|
LOGGER.info("七界试炼重置结束,清理排行榜...{}",key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void startAction(TimeControllerOfFunction timeControllerOfFunction) {
|
public void startAction(TimeControllerOfFunction timeControllerOfFunction) {
|
||||||
// 清除排行榜信息
|
|
||||||
String crossRedisKey = RankContext.getRankEnum(RankEnum.CROSS_SEVEN_WORLD_RANK.getType()).getCrossRedisKey();
|
|
||||||
String key = RedisUtil.getInstence().getKey(crossRedisKey, "",false);
|
|
||||||
RedisUtil.getInstence().del(key);
|
|
||||||
SevenWorldLogic.setEnd(false);
|
|
||||||
LOGGER.info("七界试炼活动开始,清理排行榜...{}:{}",key,SevenWorldLogic.isEnd());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -458,6 +458,10 @@ public class RedisKey {
|
||||||
* 七届积分排行
|
* 七届积分排行
|
||||||
*/
|
*/
|
||||||
public static final String SEVEN_WORLD_INTEGRAL_RANK = "SEVEN_WORLD_INTEGRAL_RANK";
|
public static final String SEVEN_WORLD_INTEGRAL_RANK = "SEVEN_WORLD_INTEGRAL_RANK";
|
||||||
|
/**
|
||||||
|
* 七届标记
|
||||||
|
*/
|
||||||
|
public static final String SEVEN_WORLD_MARK = "SEVEN_WORLD_MARK";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 网页支付特殊处理用
|
* 网页支付特殊处理用
|
||||||
|
|
|
@ -1274,7 +1274,7 @@ public class RedisUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> void putMapEntry(String key,String mapKey, T value){
|
public <T> void putMapEntry2(String key,String mapKey, T value){
|
||||||
for (int i = 0; i < MAX_TRY_TIMES; i++) {
|
for (int i = 0; i < MAX_TRY_TIMES; i++) {
|
||||||
try {
|
try {
|
||||||
redisTemplate.opsForHash().put(key,mapKey,gson.toJson(value));
|
redisTemplate.opsForHash().put(key,mapKey,gson.toJson(value));
|
||||||
|
@ -1331,7 +1331,7 @@ public class RedisUtil {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> T getMapValue(String key, String mapKey, Class<T> clazz) {
|
public <T> T getMapValue2(String key, String mapKey, Class<T> clazz) {
|
||||||
for (int i = 0; i < MAX_TRY_TIMES; i++) {
|
for (int i = 0; i < MAX_TRY_TIMES; i++) {
|
||||||
try {
|
try {
|
||||||
String valueStr = (String) redisTemplate.opsForHash().get(key, mapKey);
|
String valueStr = (String) redisTemplate.opsForHash().get(key, mapKey);
|
||||||
|
@ -1466,6 +1466,10 @@ public class RedisUtil {
|
||||||
return getKey(type,key,true);
|
return getKey(type,key,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getKey2(String type,String key){
|
||||||
|
return getKey(type,key,false);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取key
|
* 获取key
|
||||||
* @param type
|
* @param type
|
||||||
|
|
|
@ -34,10 +34,10 @@ public class AddItemHandler implements IEventHandler{
|
||||||
int lv = PlayerLogic.getInstance().getGodPrivilegeLv(user);
|
int lv = PlayerLogic.getInstance().getGodPrivilegeLv(user);
|
||||||
String key = RedisKey.GOD_LEVEL_UP_TIME + ":" + GameApplication.serverId + ":" + lv;
|
String key = RedisKey.GOD_LEVEL_UP_TIME + ":" + GameApplication.serverId + ":" + lv;
|
||||||
String uid = String.valueOf(user.getId());
|
String uid = String.valueOf(user.getId());
|
||||||
UserGodLvVo userGodLvVo = RedisUtil.getInstence().getMapValue(key, uid, UserGodLvVo.class);
|
UserGodLvVo userGodLvVo = RedisUtil.getInstence().getMapValue2(key, uid, UserGodLvVo.class);
|
||||||
if (userGodLvVo == null){
|
if (userGodLvVo == null){
|
||||||
userGodLvVo = new UserGodLvVo(user);
|
userGodLvVo = new UserGodLvVo(user);
|
||||||
RedisUtil.getInstence().putMapEntry(key, uid, userGodLvVo);
|
RedisUtil.getInstence().putMapEntry2(key, uid, userGodLvVo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -360,13 +360,16 @@ public class MailLogic {
|
||||||
Mail mail = new Mail(uid,title,content,reward,sendTime, mailEffectiveTime,"system",Global.MAIL_TYPE_SYS);
|
Mail mail = new Mail(uid,title,content,reward,sendTime, mailEffectiveTime,"system",Global.MAIL_TYPE_SYS);
|
||||||
String key = RedisKey.MAIL_REWARD_MARK + RedisKey.Delimiter_colon + uid;
|
String key = RedisKey.MAIL_REWARD_MARK + RedisKey.Delimiter_colon + uid;
|
||||||
String timeKey = String.valueOf(TimeUtils.now());
|
String timeKey = String.valueOf(TimeUtils.now());
|
||||||
RedisUtil.getInstence().putMapEntry(key,timeKey,mail);
|
RedisUtil.getInstence().putMapEntry2(key,timeKey,mail);
|
||||||
// 有新邮件就增加30天的有效时间
|
// 有新邮件就增加30天的有效时间
|
||||||
RedisUtil.getInstence().expire(key,60*60*24*30);
|
RedisUtil.getInstence().expire(key,60*60*24*30);
|
||||||
LOGGER.info("redis邮件标记:key:{}, time:{}, mail:{}",key,timeKey,mail);
|
LOGGER.info("redis邮件标记:key:{}, time:{}, mail:{}",key,timeKey,mail);
|
||||||
}
|
}
|
||||||
//发送邮件
|
|
||||||
public void sendSpecialMail(int uid, String title, String content, String reward, int sendTime, int mailEffectiveTime,int isTop ,int markType) throws Exception {
|
/**
|
||||||
|
* 发送邮件
|
||||||
|
*/
|
||||||
|
public void sendSpecialMail(int uid, String title, String content, String reward, int sendTime, int mailEffectiveTime,int isTop ,int markType) {
|
||||||
try {
|
try {
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
Mail mail = new Mail(uid,title,content,reward,sendTime, mailEffectiveTime,"system",Global.MAIL_TYPE_SYS,isTop,markType);
|
Mail mail = new Mail(uid,title,content,reward,sendTime, mailEffectiveTime,"system",Global.MAIL_TYPE_SYS,isTop,markType);
|
||||||
|
@ -377,6 +380,7 @@ public class MailLogic {
|
||||||
LOGGER.error(e +";sendMail==>uid={},title={},reward:{}",uid,title,reward);
|
LOGGER.error(e +";sendMail==>uid={},title={},reward:{}",uid,title,reward);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*每分钟检测是否有需要发的邮件
|
*每分钟检测是否有需要发的邮件
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.sevenworld;
|
||||||
import com.ljsd.GameApplication;
|
import com.ljsd.GameApplication;
|
||||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||||
import com.ljsd.jieling.core.HandlerLogicThread;
|
import com.ljsd.jieling.core.HandlerLogicThread;
|
||||||
|
import com.ljsd.jieling.db.redis.RedisKey;
|
||||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
import com.ljsd.jieling.exception.ErrorCode;
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
|
@ -70,14 +71,6 @@ public class SevenWorldLogic {
|
||||||
|
|
||||||
private static boolean end = false;
|
private static boolean end = false;
|
||||||
|
|
||||||
public static boolean isEnd() {
|
|
||||||
return end;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setEnd(boolean end) {
|
|
||||||
SevenWorldLogic.end = end;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 活动开启状态
|
* 活动开启状态
|
||||||
* @param user
|
* @param user
|
||||||
|
@ -350,10 +343,10 @@ public class SevenWorldLogic {
|
||||||
int ceil = (int) Math.ceil(reward[1] * (buff / 10000));
|
int ceil = (int) Math.ceil(reward[1] * (buff / 10000));
|
||||||
// 排行榜积分
|
// 排行榜积分
|
||||||
if (reward[0] == 1241) {
|
if (reward[0] == 1241) {
|
||||||
if (isEnd()) {
|
// if (getEnd() == 1) {
|
||||||
// 规定时间不获得积分
|
// // 规定时间不获得积分
|
||||||
continue;
|
// continue;
|
||||||
}
|
// }
|
||||||
// 排行榜添加积分
|
// 排行榜添加积分
|
||||||
addRank(user.getId(),reward[1] + ceil);
|
addRank(user.getId(),reward[1] + ceil);
|
||||||
LOGGER.info("七界得分,uid:{},score:{}, qieji:{}",user.getId(),reward[1] + ceil, stage);
|
LOGGER.info("七界得分,uid:{},score:{}, qieji:{}",user.getId(),reward[1] + ceil, stage);
|
||||||
|
@ -434,65 +427,93 @@ public class SevenWorldLogic {
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// public static void setEnd(int value){
|
||||||
* 结束发送奖励
|
// RedisUtil redisUtil = RedisUtil.getInstence();
|
||||||
*/
|
// String key = redisUtil.getKey2(RedisKey.SEVEN_WORLD_MARK, String.valueOf(GlobleSystemLogic.crossGroup));
|
||||||
public void sendRankReward(){
|
// redisUtil.set(key,String.valueOf(value));
|
||||||
if (isTime()){
|
// }
|
||||||
LOGGER.info("七界试炼活动结束,开始发奖...{{}}",isEnd());
|
//
|
||||||
SevenWorldLogic.setEnd(true);
|
// public static int getEnd(){
|
||||||
// 排行榜
|
// RedisUtil redisUtil = RedisUtil.getInstence();
|
||||||
String crossRedisKey = RankContext.getRankEnum(RankEnum.CROSS_SEVEN_WORLD_RANK.getType()).getCrossRedisKey();
|
// String key = redisUtil.getKey2(RedisKey.SEVEN_WORLD_MARK, String.valueOf(GlobleSystemLogic.crossGroup));
|
||||||
Set<ZSetOperations.TypedTuple<String>> range = RedisUtil.getInstence().getZsetreverseRangeWithScores(crossRedisKey,"",0,-1,false);
|
// Object obj = redisUtil.get(key);
|
||||||
// 排名
|
// if (obj == null){
|
||||||
int rank = 0;
|
// obj = 0;
|
||||||
for (ZSetOperations.TypedTuple<String> tuple : range) {
|
// }
|
||||||
rank++;
|
// return (int)obj;
|
||||||
int uid = Integer.parseInt(tuple.getValue());
|
// }
|
||||||
CSPlayer player = CrossServiceLogic.getPlayerByRedis(uid);
|
//
|
||||||
if (player == null){
|
// /**
|
||||||
LOGGER.error("七界发奖,玩家缓存找不到,uid:{},排名:{}",uid,rank);
|
// * 每周末的24:00分重置排行榜积分
|
||||||
continue;
|
// */
|
||||||
}
|
// public void overSevenWorld(){
|
||||||
if (TimeUtils.now() > (player.getOffLineTime()+TimeUtils.WEEK)){
|
// int week = TimeUtils.getDayOfWeek();
|
||||||
LOGGER.error("七界发奖,玩家登陆时间超过七天,uid:{},排名:{},最后登陆时间:{},当前时间:{}",uid,rank,TimeUtils.getTimeStamp2(player.getOffLineTime()),TimeUtils.nowStr());
|
// int hour = TimeUtils.getHourOfDay();
|
||||||
continue;
|
// int minute = TimeUtils.getMiunte();
|
||||||
}
|
// // 发奖时间
|
||||||
User user = UserManager.getUserNotCache(uid);
|
// boolean sendRewardTime = week == 7 && hour == 23 && minute == 30;
|
||||||
if (user == null){
|
// if (sendRewardTime){
|
||||||
continue;
|
// LOGGER.info("七界试炼活动结束,开始发奖...{{}}", getEnd());
|
||||||
}
|
// SevenWorldLogic.setEnd(1);
|
||||||
String title = SErrorCodeEerverConfig.getI18NMessage("Qijie_mail_title");
|
// // 排行榜
|
||||||
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("Qijie_mail_txt", new Object[]{rank},new int[0],"#");
|
// String crossRedisKey = RankContext.getRankEnum(RankEnum.CROSS_SEVEN_WORLD_RANK.getType()).getCrossRedisKey();
|
||||||
// 排行奖励
|
// Set<ZSetOperations.TypedTuple<String>> range = RedisUtil.getInstence().getZsetreverseRangeWithScores(crossRedisKey,"",0,-1,false);
|
||||||
Map<Integer, SQijieRanking> config = STableManager.getConfig(SQijieRanking.class);
|
// // 排名
|
||||||
for (SQijieRanking value : config.values()) {
|
// int rank = 0;
|
||||||
// 排名区间
|
// for (ZSetOperations.TypedTuple<String> tuple : range) {
|
||||||
if (rank >= value.getMinRank() && rank <= value.getMaxRank()){
|
// rank++;
|
||||||
// 发邮件奖励
|
// int uid = Integer.parseInt(tuple.getValue());
|
||||||
String reward = StringUtil.parseArrayToString(value.getRankingReward());
|
// CSPlayer player = CrossServiceLogic.getPlayerByRedis(uid);
|
||||||
MailLogic.getInstance().sendMail(user.getId(),title,content,reward,TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
|
// if (player == null){
|
||||||
// 清除道具
|
// LOGGER.error("七界发奖,玩家缓存找不到,uid:{},排名:{}",uid,rank);
|
||||||
ItemLogic.getInstance().functionEndClearItem(user.getId(),FunctionIdEnum.CrossSevenWorld.getFunctionType(),BIReason.SEVEN_WORLD_FUNCTION_END);
|
// continue;
|
||||||
LOGGER.info("七界结束,发送邮件并删除道具,uid:{},奖励:{},",user.getId(),reward);
|
// }
|
||||||
break;
|
// if (TimeUtils.now() > (player.getOffLineTime()+TimeUtils.WEEK)){
|
||||||
}
|
// LOGGER.error("七界发奖,玩家登陆时间超过七天,uid:{},排名:{},最后登陆时间:{},当前时间:{}",uid,rank,TimeUtils.getTimeStamp2(player.getOffLineTime()),TimeUtils.nowStr());
|
||||||
}
|
// continue;
|
||||||
}
|
// }
|
||||||
LOGGER.info("七界试炼活动结束,发奖完成...{{}}",isEnd());
|
// User user = UserManager.getUserNotCache(uid);
|
||||||
}
|
// if (user == null){
|
||||||
}
|
// continue;
|
||||||
|
// }
|
||||||
/**
|
// String title = SErrorCodeEerverConfig.getI18NMessage("Qijie_mail_title");
|
||||||
* 每周末的23:30分发奖
|
// String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("Qijie_mail_txt", new Object[]{rank},new int[0],"#");
|
||||||
*/
|
// // 排行奖励
|
||||||
private boolean isTime(){
|
// Map<Integer, SQijieRanking> config = STableManager.getConfig(SQijieRanking.class);
|
||||||
int week = TimeUtils.getDayOfWeek();
|
// for (SQijieRanking value : config.values()) {
|
||||||
int hour = TimeUtils.getHourOfDay();
|
// // 排名区间
|
||||||
int minute = TimeUtils.getMiunte();
|
// if (rank >= value.getMinRank() && rank <= value.getMaxRank()){
|
||||||
boolean b = week == 7 && hour == 23 && minute == 30;
|
// // 发邮件奖励
|
||||||
LOGGER.info("当前时间:week:{},hour:{},minute:{},result:{}",week,hour,minute,b);
|
// String reward = StringUtil.parseArrayToString(value.getRankingReward());
|
||||||
return b;
|
// MailLogic.getInstance().sendMail(user.getId(),title,content,reward,TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
|
||||||
}
|
// // 清除道具
|
||||||
|
// ItemLogic.getInstance().functionEndClearItem(user.getId(),FunctionIdEnum.CrossSevenWorld.getFunctionType(),BIReason.SEVEN_WORLD_FUNCTION_END);
|
||||||
|
// LOGGER.info("七界结束,发送邮件并删除道具,uid:{},奖励:{},",user.getId(),reward);
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// LOGGER.info("七界试炼活动结束,发奖完成...{{}}", getEnd());
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // 重置排行榜时间
|
||||||
|
// boolean resetTime = week == 1 && hour == 0 && minute == 0;
|
||||||
|
// if (resetTime){
|
||||||
|
// int crossGroup = GlobleSystemLogic.crossGroup;
|
||||||
|
// String lockKey = "SEVEN_WORLD_RESET_LOCK" + RedisKey.Delimiter_colon + crossGroup;
|
||||||
|
// boolean lock = RedisUtil.getInstence().lock(lockKey, TimeUtils.ONE_SECOND * 60);
|
||||||
|
// if (!lock) {
|
||||||
|
// //没有拿到锁直接返回
|
||||||
|
// LOGGER.error("七界试炼,重置排行榜退出, key:{} 跨服分组 ={},锁状态:{},未获取到锁",lockKey, crossGroup, lock);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// // 清除排行榜信息
|
||||||
|
// String crossRedisKey = RankContext.getRankEnum(RankEnum.CROSS_SEVEN_WORLD_RANK.getType()).getCrossRedisKey();
|
||||||
|
// String key = RedisUtil.getInstence().getKey(crossRedisKey, "",false);
|
||||||
|
// RedisUtil.getInstence().del(key);
|
||||||
|
// SevenWorldLogic.setEnd(0);
|
||||||
|
// LOGGER.info("七界试炼重置结束,清理排行榜...{}:{}",key,SevenWorldLogic.getEnd());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,42 +14,37 @@ import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
import com.ljsd.jieling.logic.SituationLogic;
|
import com.ljsd.jieling.logic.SituationLogic;
|
||||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
|
||||||
import com.ljsd.jieling.logic.activity.event.MinuteTaskEvent;
|
import com.ljsd.jieling.logic.activity.event.MinuteTaskEvent;
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
||||||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||||
import com.ljsd.jieling.logic.arena.CrossLingmaiLogic;
|
import com.ljsd.jieling.logic.arena.CrossLingmaiLogic;
|
||||||
import com.ljsd.jieling.logic.arena.CrossYuxulundaoLogic;
|
import com.ljsd.jieling.logic.arena.CrossYuxulundaoLogic;
|
||||||
import com.ljsd.jieling.logic.dao.GuildMyInfo;
|
|
||||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
|
|
||||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
|
||||||
import com.ljsd.jieling.logic.explorerMap.ExplorerMapLogic;
|
import com.ljsd.jieling.logic.explorerMap.ExplorerMapLogic;
|
||||||
import com.ljsd.jieling.logic.family.CrossDeathPathLogic;
|
import com.ljsd.jieling.logic.family.CrossDeathPathLogic;
|
||||||
import com.ljsd.jieling.logic.family.DeathPathLogic;
|
import com.ljsd.jieling.logic.family.DeathPathLogic;
|
||||||
import com.ljsd.jieling.logic.family.GuildFightLogic;
|
import com.ljsd.jieling.logic.family.GuildFightLogic;
|
||||||
import com.ljsd.jieling.logic.family.GuildLogic;
|
|
||||||
import com.ljsd.jieling.logic.help.HelpHeroLogic;
|
import com.ljsd.jieling.logic.help.HelpHeroLogic;
|
||||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||||
import com.ljsd.jieling.logic.question.QuestionLogic;
|
import com.ljsd.jieling.logic.question.QuestionLogic;
|
||||||
import com.ljsd.jieling.logic.rank.CrossRankManager;
|
import com.ljsd.jieling.logic.rank.CrossRankManager;
|
||||||
import com.ljsd.jieling.logic.rank.RankLogic;
|
import com.ljsd.jieling.logic.rank.RankLogic;
|
||||||
import com.ljsd.jieling.logic.sevenworld.SevenWorldLogic;
|
|
||||||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
||||||
import com.ljsd.jieling.logic.store.StoreLogic;
|
import com.ljsd.jieling.logic.store.StoreLogic;
|
||||||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||||
import com.ljsd.jieling.thread.ThreadManager;
|
import com.ljsd.jieling.thread.ThreadManager;
|
||||||
import com.ljsd.jieling.util.AyyncWorker;
|
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
import manager.STableManager;
|
import manager.STableManager;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import util.TimeUtils;
|
import util.TimeUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.Calendar;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
public class MinuteTask extends Thread {
|
public class MinuteTask extends Thread {
|
||||||
private static final Logger LOGGER = LoggerFactory.getLogger(MinuteTask.class);
|
private static final Logger LOGGER = LoggerFactory.getLogger(MinuteTask.class);
|
||||||
|
@ -109,12 +104,6 @@ public class MinuteTask extends Thread {
|
||||||
LOGGER.error("Exception::=>{}",e.toString());
|
LOGGER.error("Exception::=>{}",e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
SevenWorldLogic.getInstance().sendRankReward();
|
|
||||||
}catch (Exception e){
|
|
||||||
e.printStackTrace();
|
|
||||||
LOGGER.error("七界Exception::=>{}",e.toString());
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
// 跨服分组
|
// 跨服分组
|
||||||
everyMondayZeroClockTask();
|
everyMondayZeroClockTask();
|
||||||
|
|
Loading…
Reference in New Issue