冲榜活动修改
parent
09c67a2ed1
commit
6fd68e9a00
|
@ -115,24 +115,32 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
|
|||
/**
|
||||
* 备份排行榜
|
||||
* @param rankType
|
||||
* @param rankInfo
|
||||
*/
|
||||
private boolean backRank(int rankType,Set<ZSetOperations.TypedTuple<String>> rankInfo){
|
||||
private Set<ZSetOperations.TypedTuple<String>> backRank(int rankType){
|
||||
LOGGER.info("===========================冲榜开始备份,活动id:{},排行榜类型:{},时间:{}",id,rankType,TimeUtils.nowInt());
|
||||
try {
|
||||
AbstractRank abstractRank = RankContext.getRankEnum(rankType);
|
||||
Set<ZSetOperations.TypedTuple<String>> rankInfo = abstractRank.getRankByKey("", 0, -1);
|
||||
SChongRankInfo chongRankInfo = SChongRankInfo.getMap().get(id).get(rankType);
|
||||
if (chongRankInfo == null){
|
||||
return false;
|
||||
if (rankInfo == null || chongRankInfo == null){
|
||||
LOGGER.error("===========================冲榜备份提前结束,排行榜空,活动id:{},排行榜类型:{}",id,rankType);
|
||||
return null;
|
||||
}
|
||||
AbstractRank backRank = RankContext.getRankEnum(chongRankInfo.getBackRankType());
|
||||
|
||||
Set<ZSetOperations.TypedTuple<String>> backRankInfo = backRank.getRankByKey("", 0, -1);
|
||||
if (backRankInfo != null && !backRankInfo.isEmpty()){
|
||||
LOGGER.error("===========================冲榜备份提前结束,备份数据已存在,活动id:{},排行榜类型:{}",id,rankType);
|
||||
return null;
|
||||
}
|
||||
String key = RedisUtil.getInstence().getKey(backRank.getRedisKey(),"");
|
||||
RedisUtil.getInstence().zsetAddAall(key,rankInfo);
|
||||
int time = getCleanRankTime(rankType);
|
||||
RedisUtil.getInstence().expire(key,time);
|
||||
RedisUtil.getInstence().expire(key,getCleanRankTime(rankType));
|
||||
return rankInfo;
|
||||
}catch (Exception e){
|
||||
LOGGER.error("===========================冲榜发奖备份排行榜报错:{}-{}-{}",id,rankType,e.getMessage());
|
||||
LOGGER.error("===========================冲榜备份排行榜报错:{}-{}-{}",id,rankType,e.getMessage());
|
||||
}
|
||||
return true;
|
||||
LOGGER.info("===========================冲榜备份结束,活动id:{},排行榜类型:{},时间:{}",id,rankType,TimeUtils.nowInt());
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -142,16 +150,12 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
|
|||
private void sendReward(int rankType) {
|
||||
Thread.currentThread().setName("ChongBang_SendReward-Activity:" + id + "=rankType:"+rankType);
|
||||
LOGGER.info("===========================冲榜开始发奖:{}-{}",id,rankType);
|
||||
AbstractRank abstractRank = RankContext.getRankEnum(rankType);
|
||||
Set<ZSetOperations.TypedTuple<String>> rankInfo = abstractRank.getRankByKey("", 0, -1);
|
||||
if (rankInfo == null){
|
||||
LOGGER.error("===========================冲榜发奖提前结束,排行榜数据为null:{}-{}",id,rankType);
|
||||
return;
|
||||
}
|
||||
|
||||
// 备份排行榜
|
||||
boolean backRankBol = backRank(rankType, rankInfo);
|
||||
if (!backRankBol){
|
||||
Set<ZSetOperations.TypedTuple<String>> rankInfo = backRank(rankType);
|
||||
if (rankInfo == null){
|
||||
LOGGER.error("===========================冲榜发奖提前结束,备份排行榜失败:{}-{}",id,rankType);
|
||||
return;
|
||||
}
|
||||
// 遍历发奖
|
||||
int rank = 1;
|
||||
|
@ -170,7 +174,7 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
|
|||
continue;
|
||||
}
|
||||
ActivityProgressInfo progressInfo = mission.getActivityMissionMap().get(rankType);
|
||||
if (progressInfo != null){
|
||||
if (progressInfo != null && progressInfo.getState() == 2){
|
||||
LOGGER.error("开服冲榜id为{}的玩家,{}活动,{}排行奖励发送失败,奖励已发送,{}-{}", uid, id, rankType, progressInfo.getProgrss(),progressInfo.getState());
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ public class SaveHeroForceEventHandler implements IEventHandler {
|
|||
if (config == null){
|
||||
continue;
|
||||
}
|
||||
num += config.getScore();
|
||||
num += config.getExhibitionScore();
|
||||
}
|
||||
}
|
||||
return num;
|
||||
|
@ -178,7 +178,7 @@ public class SaveHeroForceEventHandler implements IEventHandler {
|
|||
if (config == null){
|
||||
continue;
|
||||
}
|
||||
num += config.getScore();
|
||||
num += config.getExhibitionScore();
|
||||
}
|
||||
}
|
||||
return num;
|
||||
|
|
|
@ -40,6 +40,7 @@ public class SEquipConfig implements BaseConfig,Comparable<SEquipConfig> {
|
|||
|
||||
private int score;
|
||||
|
||||
private int exhibitionScore;
|
||||
|
||||
private int[] range;
|
||||
|
||||
|
@ -136,8 +137,11 @@ public class SEquipConfig implements BaseConfig,Comparable<SEquipConfig> {
|
|||
return score;
|
||||
}
|
||||
|
||||
public int getIfShow(){return ifShow; }
|
||||
public int getExhibitionScore() {
|
||||
return exhibitionScore;
|
||||
}
|
||||
|
||||
public int getIfShow(){return ifShow; }
|
||||
|
||||
public Set<Integer> getRangeHeroTids() {
|
||||
return rangeHeroTids;
|
||||
|
|
Loading…
Reference in New Issue