策划需求:车迟斗法功能修改
parent
ab293afbb2
commit
3ed9406b49
|
@ -51,10 +51,11 @@ public class CarDelayFunction implements FunctionManager {
|
||||||
// 获取车迟斗法当前boss的索引id
|
// 获取车迟斗法当前boss的索引id
|
||||||
int indexId = GuildFightLogic.carDelayProgressIndication.getBossIndexId();
|
int indexId = GuildFightLogic.carDelayProgressIndication.getBossIndexId();
|
||||||
// 根据索引id取出当前的奖励配置
|
// 根据索引id取出当前的奖励配置
|
||||||
Map<Integer, TreeMap<Integer, String>> rewardByTypeAndRankMap = SWorldBossRewardConfig.rewardByBossIdMap.get(indexId);
|
Map<Integer, TreeMap<Long, String>> rewardByTypeAndRankMap = SWorldBossRewardConfig.rewardByBossIdMap.get(indexId);
|
||||||
|
// 个人
|
||||||
TreeMap<Integer, String> personRewardConfigTreeMap = rewardByTypeAndRankMap.get(2);
|
TreeMap<Long, String> personRewardConfigTreeMap = rewardByTypeAndRankMap.get(2);
|
||||||
TreeMap<Integer, String> guildRewardConfigTreeMap = rewardByTypeAndRankMap.get(1);
|
// 工会
|
||||||
|
TreeMap<Long, String> guildRewardConfigTreeMap = rewardByTypeAndRankMap.get(1);
|
||||||
|
|
||||||
AbstractRank personRank = RankContext.getRankEnum(RankEnum.CAR_DEALY_RANK.getType());
|
AbstractRank personRank = RankContext.getRankEnum(RankEnum.CAR_DEALY_RANK.getType());
|
||||||
AbstractRank guildRank = RankContext.getRankEnum(RankEnum.CAR_DEALY_GUILD_RANK.getType());
|
AbstractRank guildRank = RankContext.getRankEnum(RankEnum.CAR_DEALY_GUILD_RANK.getType());
|
||||||
|
@ -70,18 +71,15 @@ public class CarDelayFunction implements FunctionManager {
|
||||||
guildRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(guildRank.getRedisKey(), "", 0, -1);
|
guildRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(guildRank.getRedisKey(), "", 0, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 个人
|
||||||
int rank=0;
|
|
||||||
String personTitle = SErrorCodeEerverConfig.getI18NMessage("family_fight_rank_personreward_title");
|
String personTitle = SErrorCodeEerverConfig.getI18NMessage("family_fight_rank_personreward_title");
|
||||||
|
|
||||||
int nowTime = TimeUtils.nowInt();
|
int nowTime = TimeUtils.nowInt();
|
||||||
int times=0;
|
int times=0;
|
||||||
for(ZSetOperations.TypedTuple<String> item : personRangeWithScores){
|
for(ZSetOperations.TypedTuple<String> rankInfo : personRangeWithScores){
|
||||||
rank++;
|
int uid = Integer.parseInt(rankInfo.getValue());
|
||||||
String value = item.getValue();
|
long score = rankInfo.getScore().longValue();
|
||||||
int uid = Integer.parseInt(value);
|
String rewardByRank = personRewardConfigTreeMap.floorEntry(score).getValue();
|
||||||
String rewardByRank = personRewardConfigTreeMap.floorEntry(rank).getValue();
|
String personContent = SErrorCodeEerverConfig.getI18NMessageNeedConvert("family_fight_rank_personreward_txt",new Object[]{score},new int[]{0},"#");
|
||||||
String personContent = SErrorCodeEerverConfig.getI18NMessageNeedConvert("family_fight_rank_personreward_txt",new Object[]{rank},new int[]{0},"#");
|
|
||||||
MailLogic.getInstance().sendMail(uid,personTitle,personContent,rewardByRank,nowTime, Global.MAIL_EFFECTIVE_TIME);
|
MailLogic.getInstance().sendMail(uid,personTitle,personContent,rewardByRank,nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||||
if(times++%20==0){
|
if(times++%20==0){
|
||||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||||
|
@ -89,32 +87,20 @@ public class CarDelayFunction implements FunctionManager {
|
||||||
}
|
}
|
||||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||||
|
|
||||||
// Map<Integer, Integer> userLevelGuildMap = RedisUtil.getInstence().getMapValues(RedisKey.USER_LEVEL_GUILD_INFO, "", Integer.class, Integer.class);
|
// 工会
|
||||||
// Map<Integer,Set<Integer>> usersByGuildId = new HashMap<>();
|
|
||||||
// userLevelGuildMap.forEach((userId,guildId)->{
|
|
||||||
// usersByGuildId.putIfAbsent(guildId,new HashSet<>());
|
|
||||||
// usersByGuildId.get(guildId).add(userId);
|
|
||||||
// });
|
|
||||||
rank=0;
|
|
||||||
String guildTitle = SErrorCodeEerverConfig.getI18NMessage("family_fight_rank_familyreward_title");
|
String guildTitle = SErrorCodeEerverConfig.getI18NMessage("family_fight_rank_familyreward_title");
|
||||||
for(ZSetOperations.TypedTuple<String> item : guildRangeWithScores){
|
for(ZSetOperations.TypedTuple<String> rankInfo : guildRangeWithScores){
|
||||||
rank++;
|
int guildId = Integer.parseInt(rankInfo.getValue());
|
||||||
|
|
||||||
String value = item.getValue();
|
|
||||||
int guildId = Integer.parseInt(value);
|
|
||||||
String rewardByRank = guildRewardConfigTreeMap.floorEntry(rank).getValue();
|
|
||||||
GuildInfo guildInfo = GuilidManager.getGuildInfo(guildId);
|
GuildInfo guildInfo = GuilidManager.getGuildInfo(guildId);
|
||||||
if(guildInfo==null){
|
if(guildInfo==null){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
long score = rankInfo.getScore().longValue();
|
||||||
|
String rewardByRank = guildRewardConfigTreeMap.floorEntry(score).getValue();
|
||||||
guildInfo.clearCarFightSb();
|
guildInfo.clearCarFightSb();
|
||||||
GuilidManager.saveOrUpdateGuildInfo(guildInfo);
|
GuilidManager.saveOrUpdateGuildInfo(guildInfo);
|
||||||
Collection<Set<Integer>> values = guildInfo.getMembers().values();
|
String guildContent = SErrorCodeEerverConfig.getI18NMessageNeedConvert("family_fight_rank_familyreward_txt",new Object[]{score},new int[0],"#");
|
||||||
// if(userLevelGuildMap.containsKey(guildId)){
|
for(Set<Integer> uids : guildInfo.getMembers().values()){
|
||||||
// values.add(usersByGuildId.get(guildId));
|
|
||||||
// }
|
|
||||||
String guildContent = SErrorCodeEerverConfig.getI18NMessageNeedConvert("family_fight_rank_familyreward_txt",new Object[]{rank},new int[0],"#");
|
|
||||||
for(Set<Integer> uids : values){
|
|
||||||
for(Integer uid:uids){
|
for(Integer uid:uids){
|
||||||
MailLogic.getInstance().sendMail(uid,guildTitle,guildContent,rewardByRank,nowTime, Global.MAIL_EFFECTIVE_TIME);
|
MailLogic.getInstance().sendMail(uid,guildTitle,guildContent,rewardByRank,nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||||
if(times++%20==0){
|
if(times++%20==0){
|
||||||
|
|
|
@ -249,7 +249,6 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
|
||||||
}break;
|
}break;
|
||||||
default:
|
default:
|
||||||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 公会人数处理
|
// 公会人数处理
|
||||||
|
@ -278,13 +277,15 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static int carDealyFightPeopleNum(int uid, int guildId){
|
public static int carDealyFightPeopleNum(int uid, int guildId){
|
||||||
HashSet value = RedisUtil.getInstence().getMapValue(RedisKey.CAR_DEALY_GUILD_FIGHT_PEOPLE_NUM, "", String.valueOf(guildId), HashSet.class);
|
String key = RedisKey.CAR_DEALY_GUILD_FIGHT_PEOPLE_NUM;
|
||||||
|
String guildIdStr = String.valueOf(guildId);
|
||||||
|
HashSet<Integer> value = RedisUtil.getInstence().getMapValue(key, "", guildIdStr, HashSet.class);
|
||||||
if (value == null){
|
if (value == null){
|
||||||
value = new HashSet();
|
value = new HashSet<>();
|
||||||
}
|
}
|
||||||
if (!value.contains(uid) && uid != 0){
|
if (!value.contains(uid) && uid != 0){
|
||||||
value.add(uid);
|
value.add(uid);
|
||||||
RedisUtil.getInstence().putMapEntry(RedisKey.CAR_DEALY_GUILD_FIGHT_PEOPLE_NUM, "", String.valueOf(guildId),value);
|
RedisUtil.getInstence().putMapEntry(key, "", guildIdStr,value);
|
||||||
}
|
}
|
||||||
return value.size();
|
return value.size();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.ljsd.jieling.handler;
|
package com.ljsd.jieling.handler;
|
||||||
|
|
||||||
import com.ljsd.jieling.logic.dao.HeroManager;
|
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
|
|
@ -4,14 +4,16 @@ import com.google.protobuf.GeneratedMessage;
|
||||||
import com.ljsd.jieling.exception.ErrorCode;
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import rpc.protocols.ActivityProto;
|
import rpc.protocols.ActivityProto;
|
||||||
import rpc.protocols.MessageTypeProto;
|
import rpc.protocols.MessageTypeProto;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Author hj
|
* @Author hj
|
||||||
|
|
|
@ -1,16 +1,12 @@
|
||||||
package com.ljsd.jieling.handler.activity;
|
package com.ljsd.jieling.handler.activity;
|
||||||
|
|
||||||
import com.google.protobuf.GeneratedMessage;
|
import com.google.protobuf.GeneratedMessage;
|
||||||
import com.ljsd.fight.FightType;
|
import com.ljsd.fight.FightType;
|
||||||
import com.ljsd.jieling.core.GlobalsDef;
|
|
||||||
import com.ljsd.jieling.exception.ErrorCode;
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
import com.ljsd.jieling.jbean.ActivityMission;
|
import com.ljsd.jieling.jbean.ActivityMission;
|
||||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
|
||||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
|
||||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
|
||||||
import com.ljsd.jieling.logic.activity.event.GoldRefreshEvent;
|
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
import com.ljsd.jieling.logic.activity.event.TaSuiLingXiaoEvent;
|
import com.ljsd.jieling.logic.activity.event.TaSuiLingXiaoEvent;
|
||||||
import com.ljsd.jieling.logic.dao.*;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
|
@ -21,7 +17,6 @@ import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||||
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.rank.RankLogic;
|
|
||||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||||
import com.ljsd.jieling.util.ItemUtil;
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
import config.SMonsterConfig;
|
import config.SMonsterConfig;
|
||||||
|
@ -30,8 +25,8 @@ import config.SNewHeroConfig;
|
||||||
import manager.STableManager;
|
import manager.STableManager;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import rpc.protocols.ActivityProto;
|
import rpc.protocols.ActivityProto;
|
||||||
import rpc.protocols.MessageTypeProto;
|
|
||||||
import rpc.protocols.CommonProto;
|
import rpc.protocols.CommonProto;
|
||||||
|
import rpc.protocols.MessageTypeProto;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class GetCarChallengeListHandler extends BaseHandler {
|
||||||
int matchNums = matchSection[0] + matchSection[1];
|
int matchNums = matchSection[0] + matchSection[1];
|
||||||
GuildInfo guildInfo = GuilidManager.getGuildInfo(guildId);
|
GuildInfo guildInfo = GuilidManager.getGuildInfo(guildId);
|
||||||
Set<Integer> members = new HashSet<>();
|
Set<Integer> members = new HashSet<>();
|
||||||
guildInfo.getMembers().values().forEach(integers ->members.addAll(integers));
|
guildInfo.getMembers().values().forEach(members::addAll);
|
||||||
|
|
||||||
List<ZsetTypedTupleWithRank> beforeList = new ArrayList<>(5);
|
List<ZsetTypedTupleWithRank> beforeList = new ArrayList<>(5);
|
||||||
List<ZsetTypedTupleWithRank> afterList = new ArrayList<>(5);
|
List<ZsetTypedTupleWithRank> afterList = new ArrayList<>(5);
|
||||||
|
@ -241,24 +241,6 @@ public class GetCarChallengeListHandler extends BaseHandler {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// private static void process(int start,int end,Set<Integer> members,int matchNums, Set<ZsetTypedTupleWithRank> infos){
|
|
||||||
// while (start>=0 && infos.size()<matchNums){
|
|
||||||
// int rank=start+1;
|
|
||||||
// Set<ZSetOperations.TypedTuple<String>> zsetreverseRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.CAR_DEALY_RANK, "", start, end);
|
|
||||||
// for(ZSetOperations.TypedTuple<String> item : zsetreverseRangeWithScores){
|
|
||||||
// if(!members.contains(Integer.parseInt(item.getValue()))){
|
|
||||||
// infos.add(new ZsetTypedTupleWithRank(item,rank));
|
|
||||||
// }
|
|
||||||
// rank++;
|
|
||||||
// }
|
|
||||||
// end=start;
|
|
||||||
// start-=matchNums;
|
|
||||||
// if(end<=0){
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
static class ZsetTypedTupleWithRank{
|
static class ZsetTypedTupleWithRank{
|
||||||
ZSetOperations.TypedTuple<String> item;
|
ZSetOperations.TypedTuple<String> item;
|
||||||
int rank;
|
int rank;
|
||||||
|
|
|
@ -242,7 +242,7 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
||||||
// 如果鸿蒙碑开启 返回鸿蒙系统中神将返回鸿蒙碑等级
|
// 如果鸿蒙碑开启 返回鸿蒙系统中神将返回鸿蒙碑等级
|
||||||
if (heroManager.getHongmengTablet() > 0) {
|
if (heroManager.getHongmengTablet() > 0) {
|
||||||
// 存在共鸣或者使者
|
// 存在共鸣或者使者
|
||||||
if (heroManager.getResonances().values().contains(id) || heroManager.getHongmengGuards().values().contains(id)) {
|
if (heroManager.getResonances().containsValue(id) || heroManager.getHongmengGuards().containsValue(id)) {
|
||||||
// 鸿蒙碑超过等级上限,返回鸿蒙碑等级
|
// 鸿蒙碑超过等级上限,返回鸿蒙碑等级
|
||||||
if (heroManager.getHongmengTablet() <= maxLevel) {
|
if (heroManager.getHongmengTablet() <= maxLevel) {
|
||||||
return heroManager.getHongmengTablet();
|
return heroManager.getHongmengTablet();
|
||||||
|
@ -251,12 +251,12 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
||||||
return scHero.getMaxRank() >= 10 ? heroManager.getHongmengTablet() : maxLevel;
|
return scHero.getMaxRank() >= 10 ? heroManager.getHongmengTablet() : maxLevel;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (heroManager.getResonances().values().contains(id)) {
|
if (heroManager.getResonances().containsValue(id)) {
|
||||||
// 模板
|
// 模板
|
||||||
HongMengAddAttribute hongMengAddAttribute = heroManager.getResonanceAddition().get(HongMengAttributeEnum.LEVEL);
|
HongMengAddAttribute hongMengAddAttribute = heroManager.getResonanceAddition().get(HongMengAttributeEnum.LEVEL);
|
||||||
if (hongMengAddAttribute != null) {
|
if (hongMengAddAttribute != null) {
|
||||||
// 是否达到限制等级
|
// 是否达到限制等级
|
||||||
return hongMengAddAttribute.value >= maxLevel ? maxLevel : hongMengAddAttribute.value;
|
return Math.min(hongMengAddAttribute.value, maxLevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return level;
|
return level;
|
||||||
|
@ -363,11 +363,11 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
||||||
public int getBreakIdByHongMeng(HeroManager heroManager) {
|
public int getBreakIdByHongMeng(HeroManager heroManager) {
|
||||||
// 英雄在共鸣池中
|
// 英雄在共鸣池中
|
||||||
if (heroManager.getHongmengTablet() > 0){
|
if (heroManager.getHongmengTablet() > 0){
|
||||||
if (heroManager.getResonances().values().contains(id) || heroManager.getHongmengGuards().values().contains(id)) {
|
if (heroManager.getResonances().containsValue(id) || heroManager.getHongmengGuards().containsValue(id)) {
|
||||||
return HeroLogic.getInstance().calRobotBreakByLevel(templateId, getLevel(heroManager));
|
return HeroLogic.getInstance().calRobotBreakByLevel(templateId, getLevel(heroManager));
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if (heroManager.getResonances().values().contains(id)) {
|
if (heroManager.getResonances().containsValue(id)) {
|
||||||
return HeroLogic.getInstance().calRobotBreakByLevel(templateId, getLevel(heroManager));
|
return HeroLogic.getInstance().calRobotBreakByLevel(templateId, getLevel(heroManager));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1265,9 +1265,9 @@ public class GuildFightLogic {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
carProgressTmp = 1;
|
carProgressTmp = 1;
|
||||||
calendar.set(calendar.HOUR_OF_DAY,battleTime[1][0]);
|
calendar.set(Calendar.HOUR_OF_DAY,battleTime[1][0]);
|
||||||
calendar.set(calendar.MINUTE,battleTime[1][1]);
|
calendar.set(Calendar.MINUTE,battleTime[1][1]);
|
||||||
calendar.set(calendar.SECOND,0);
|
calendar.set(Calendar.SECOND,0);
|
||||||
endTime = (int)(calendar.getTimeInMillis()/1000);
|
endTime = (int)(calendar.getTimeInMillis()/1000);
|
||||||
|
|
||||||
}else if(sourceCompare>=grapCompareStart && sourceCompare<grapCompaeEnd){
|
}else if(sourceCompare>=grapCompareStart && sourceCompare<grapCompaeEnd){
|
||||||
|
@ -1275,14 +1275,14 @@ public class GuildFightLogic {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
carProgressTmp = 3;
|
carProgressTmp = 3;
|
||||||
calendar.set(calendar.HOUR_OF_DAY,grabTime[1][0]);
|
calendar.set(Calendar.HOUR_OF_DAY,grabTime[1][0]);
|
||||||
calendar.set(calendar.MINUTE,grabTime[1][1]);
|
calendar.set(Calendar.MINUTE,grabTime[1][1]);
|
||||||
calendar.set(calendar.SECOND,0);
|
calendar.set(Calendar.SECOND,0);
|
||||||
endTime = (int)(calendar.getTimeInMillis()/1000);
|
endTime = (int)(calendar.getTimeInMillis()/1000);
|
||||||
|
|
||||||
}else if(sourceCompare>=battleCompaeEnd && sourceCompare<grapCompareStart){
|
}else if(sourceCompare>=battleCompaeEnd && sourceCompare<grapCompareStart){
|
||||||
carProgressTmp = 2;
|
carProgressTmp = 2;
|
||||||
} else if(timeControllerOfFunction==null){
|
}else if(timeControllerOfFunction==null){
|
||||||
carProgressTmp = -5;
|
carProgressTmp = -5;
|
||||||
}else{
|
}else{
|
||||||
carProgressTmp = -1;
|
carProgressTmp = -1;
|
||||||
|
@ -1294,25 +1294,24 @@ public class GuildFightLogic {
|
||||||
if(sourceCompare>grapCompaeEnd){
|
if(sourceCompare>grapCompaeEnd){
|
||||||
calendar.setTimeInMillis(calendar.getTimeInMillis() + 24*3600*1000L);
|
calendar.setTimeInMillis(calendar.getTimeInMillis() + 24*3600*1000L);
|
||||||
}
|
}
|
||||||
calendar.set(calendar.HOUR_OF_DAY,grabTime[0][0]);
|
calendar.set(Calendar.HOUR_OF_DAY,grabTime[0][0]);
|
||||||
calendar.set(calendar.MINUTE,grabTime[0][1]);
|
calendar.set(Calendar.MINUTE,grabTime[0][1]);
|
||||||
calendar.set(calendar.SECOND,0);
|
calendar.set(Calendar.SECOND,0);
|
||||||
grapStartTime = (int)(calendar.getTimeInMillis()/1000);
|
grapStartTime = (int)(calendar.getTimeInMillis()/1000);
|
||||||
|
|
||||||
|
|
||||||
calendar.set(calendar.HOUR_OF_DAY,battleTime[0][0]);
|
calendar.set(Calendar.HOUR_OF_DAY,battleTime[0][0]);
|
||||||
calendar.set(calendar.MINUTE,battleTime[0][1]);
|
calendar.set(Calendar.MINUTE,battleTime[0][1]);
|
||||||
calendar.set(calendar.SECOND,0);
|
calendar.set(Calendar.SECOND,0);
|
||||||
|
|
||||||
battleStartTime = (int)(calendar.getTimeInMillis()/1000);
|
battleStartTime = (int)(calendar.getTimeInMillis()/1000);
|
||||||
carProgress = carProgressTmp;
|
carProgress = carProgressTmp;
|
||||||
carDelayProgressIndication= Family.CarDelayProgressIndication.newBuilder().setBossIndexId(id).setProgress(carProgress).setEndTime(endTime).
|
carDelayProgressIndication = Family.CarDelayProgressIndication.newBuilder().setBossIndexId(id).setProgress(carProgress).setEndTime(endTime).
|
||||||
setBattleStartTime(battleStartTime).setGrabStartTime(grapStartTime).
|
setBattleStartTime(battleStartTime).setGrabStartTime(grapStartTime).
|
||||||
build();
|
build();
|
||||||
sendAllProgressUpdate();
|
sendAllProgressUpdate();
|
||||||
// System.out.println(JsonFormat.printToString(carDelayProgressIndication) + "--");
|
// System.out.println(JsonFormat.printToString(carDelayProgressIndication) + "--");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendAllProgressUpdate(){
|
public static void sendAllProgressUpdate(){
|
||||||
|
|
|
@ -21,30 +21,22 @@ public class SWorldBossRewardConfig implements BaseConfig {
|
||||||
|
|
||||||
private int bossId;
|
private int bossId;
|
||||||
|
|
||||||
|
private long score;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 类型,排名,奖励
|
* boss索引id,类型,积分,奖励
|
||||||
*/
|
*/
|
||||||
public static Map<Integer,TreeMap<Integer,String>> rewardByTypeAndRankMap = new HashMap<>();
|
public static Map<Integer,TreeMap<Integer, TreeMap<Long,String>>> rewardByBossIdMap = new HashMap<>();
|
||||||
/**
|
|
||||||
* boss索引id,类型,排名,奖励
|
|
||||||
*/
|
|
||||||
public static Map<Integer,TreeMap<Integer, TreeMap<Integer,String>>> rewardByBossIdMap = new HashMap<>();
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
Map<Integer, SWorldBossRewardConfig> config = STableManager.getConfig(SWorldBossRewardConfig.class);
|
Map<Integer, SWorldBossRewardConfig> config = STableManager.getConfig(SWorldBossRewardConfig.class);
|
||||||
Map<Integer, TreeMap<Integer,String>> rewardByTypeAndRankMapTmp = new HashMap<>();
|
Map<Integer,TreeMap<Integer, TreeMap<Long,String>>> rewardByBossIdMapTmp = new HashMap<>();
|
||||||
Map<Integer,TreeMap<Integer, TreeMap<Integer,String>>> rewardByBossIdMapTmp = new HashMap<>();
|
|
||||||
config.forEach((id,item)->{
|
config.forEach((id,item)->{
|
||||||
rewardByTypeAndRankMapTmp.putIfAbsent(item.getType(),new TreeMap<>());
|
|
||||||
rewardByTypeAndRankMapTmp.get(item.getType()).put(item.getSection()[0], StringUtil.parseArrayToString(item.getReward()));
|
|
||||||
|
|
||||||
rewardByBossIdMapTmp.putIfAbsent(item.getBossId(),new TreeMap<>());
|
rewardByBossIdMapTmp.putIfAbsent(item.getBossId(),new TreeMap<>());
|
||||||
rewardByBossIdMapTmp.get(item.getBossId()).putIfAbsent(item.getType(),new TreeMap<>());
|
rewardByBossIdMapTmp.get(item.getBossId()).putIfAbsent(item.getType(),new TreeMap<>());
|
||||||
rewardByBossIdMapTmp.get(item.getBossId()).get(item.getType()).put(item.getSection()[0], StringUtil.parseArrayToString(item.getReward()));
|
rewardByBossIdMapTmp.get(item.getBossId()).get(item.getType()).put(item.getScore(), StringUtil.parseArrayToString(item.getReward()));
|
||||||
});
|
});
|
||||||
|
|
||||||
rewardByTypeAndRankMap = rewardByTypeAndRankMapTmp;
|
|
||||||
rewardByBossIdMap = rewardByBossIdMapTmp;
|
rewardByBossIdMap = rewardByBossIdMapTmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,4 +59,8 @@ public class SWorldBossRewardConfig implements BaseConfig {
|
||||||
public int getBossId() {
|
public int getBossId() {
|
||||||
return bossId;
|
return bossId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getScore() {
|
||||||
|
return score;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue