十绝伤害超上限

duhui 2021-09-27 11:09:52 +08:00
parent 989f45f926
commit 4679fb5af2
6 changed files with 24 additions and 20 deletions

View File

@ -102,10 +102,10 @@ public class CheckFight {
args.set("maxRound",maxTime); args.set("maxRound",maxTime);
LuaValue result = func.call( args,fightData,optionData); LuaValue result = func.call( args,fightData,optionData);
int status = result.get("result").toint(); int status = result.get("result").toint();
int duration = result.get("duration").toint(); long duration = result.get("duration").tolong();
long[] resultCache = new long[8];//对方阵容走配置 Todo 后面结构走配置 long[] resultCache = new long[8];//对方阵容走配置 Todo 后面结构走配置
resultCache[0]= (long) status; resultCache[0]= status;
resultCache[1]= (long) duration; resultCache[1]= duration;
LOGGER.info(" lua check test fight result : "+ status); LOGGER.info(" lua check test fight result : "+ status);
for (int i = 1; i <= result.length(); i++) { for (int i = 1; i <= result.length(); i++) {
long tolong = result.rawget(i).tolong(); long tolong = result.rawget(i).tolong();

View File

@ -535,6 +535,9 @@ public class GlobalDataManaager implements IManager {
public TimeControllerOfFunction getOpenTimeOfFuntionCacheByType(FunctionIdEnum functionIdEnum ) { public TimeControllerOfFunction getOpenTimeOfFuntionCacheByType(FunctionIdEnum functionIdEnum ) {
if (functionIdEnum == null){
return null;
}
List<Integer> ids = SGlobalSystemConfig.idsByType.get(functionIdEnum.getFunctionType()); List<Integer> ids = SGlobalSystemConfig.idsByType.get(functionIdEnum.getFunctionType());
if(ids!=null && !ids.isEmpty()){ if(ids!=null && !ids.isEmpty()){
for(Integer id : ids){ for(Integer id : ids){

View File

@ -20,7 +20,7 @@ public class GuildMyInfo extends MongoBase {
private long preMoveTimestamp; //上次更新时间 private long preMoveTimestamp; //上次更新时间
private int maxBossHurt; //工会boss最高伤害 private int maxBossHurt; //工会boss最高伤害
private int lastHurt; //上一次伤害 private int lastHurt; //上一次伤害
private Map<Integer,Integer> deathMaxDamage = new HashMap<>(); private Map<Integer,Long> deathMaxDamage = new HashMap<>();
//公会祭祀 //公会祭祀
private int fetetype;//祭祀类型 private int fetetype;//祭祀类型
@ -201,11 +201,11 @@ public class GuildMyInfo extends MongoBase {
updateString("guildSkill",guildSkill); updateString("guildSkill",guildSkill);
} }
public Map<Integer, Integer> getDeathMaxDamage() { public Map<Integer, Long> getDeathMaxDamage() {
return deathMaxDamage; return deathMaxDamage;
} }
public void setDeathMaxDamage(int pathId, int damage) { public void setDeathMaxDamage(int pathId, Long damage) {
deathMaxDamage.put(pathId,damage); deathMaxDamage.put(pathId,damage);
updateString("deathMaxDamage",deathMaxDamage); updateString("deathMaxDamage",deathMaxDamage);

View File

@ -83,16 +83,17 @@ public class CrossDeathPathLogic {
/** /**
* *
* @param uid
* @param damage
* @param guildId
* @param pathId
*/ */
void addCrossDeathPathRank(int uid, int damage, int guildId, int pathId) throws Exception { void addCrossDeathPathRank(DeathPathTask task) throws Exception {
long damage = task.getDamage();
int uid = task.getUid();
int pathId = task.getPathId();
int guildId = task.getGuildId();
RedisUtil redisUtil = RedisUtil.getInstence(); RedisUtil redisUtil = RedisUtil.getInstence();
//操作每个关的公会、个人数据 //操作每个关的公会、个人数据
BigDecimal decimal = new BigDecimal(String.valueOf(damage)).divide(new BigDecimal(String.valueOf(Math.pow(10,15)))); BigDecimal decimal = new BigDecimal(String.valueOf(damage)).divide(new BigDecimal(String.valueOf(Math.pow(10,15))));
long everyGuildChangeScore = (long)damage*1000; long everyGuildChangeScore = damage*1000;
AbstractRank everyPerson = RankContext.getRankEnum(RankEnum.DEATH_PATH_EVERY_PERSON_RANK.getType()); AbstractRank everyPerson = RankContext.getRankEnum(RankEnum.DEATH_PATH_EVERY_PERSON_RANK.getType());
if(redisUtil.getZSetScore(everyPerson.getCrossRedisKey(),String.valueOf(pathId), String.valueOf(uid), false)==-1){ if(redisUtil.getZSetScore(everyPerson.getCrossRedisKey(),String.valueOf(pathId), String.valueOf(uid), false)==-1){
//记录人数操作 //记录人数操作

View File

@ -362,7 +362,7 @@ public class DeathPathLogic {
SGuildWarConfig config = STableManager.getConfig(SGuildWarConfig.class).get(pathId); SGuildWarConfig config = STableManager.getConfig(SGuildWarConfig.class).get(pathId);
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), GlobalsDef.DEATH_PATH_TEAM, SGuildSetting.sGuildSetting.getWarTime(), "", GameFightType.DeathPathChallenge, config.getMonsterId(), 3); PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), GlobalsDef.DEATH_PATH_TEAM, SGuildSetting.sGuildSetting.getWarTime(), "", GameFightType.DeathPathChallenge, config.getMonsterId(), 3);
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent); FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
int damage = (int) fightResult.getCheckResult()[1]; long damage = fightResult.getCheckResult()[1];
CommonProto.FightData fightData = CommonProto.FightData.newBuilder() CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
.setFightMaxTime(SGuildSetting.sGuildSetting.getWarTime()) .setFightMaxTime(SGuildSetting.sGuildSetting.getWarTime())
.setFightSeed(fightResult.getSeed()) .setFightSeed(fightResult.getSeed())
@ -389,8 +389,8 @@ public class DeathPathLogic {
RedisUtil.getInstence().putMapEntry(RedisKey.GUILD_INFO_CACHE,"",String.valueOf(guildId),guildInfoCache); RedisUtil.getInstence().putMapEntry(RedisKey.GUILD_INFO_CACHE,"",String.valueOf(guildId),guildInfoCache);
CommonProto.Drop.Builder drop = ItemUtil.drop(user, config.getReward(), BIReason.DEATH_PATH_CHALLENGE); CommonProto.Drop.Builder drop = ItemUtil.drop(user, config.getReward(), BIReason.DEATH_PATH_CHALLENGE);
Map<Integer, Integer> deathMaxDamage = user.getGuildMyInfo().getDeathMaxDamage(); Map<Integer, Long> deathMaxDamage = user.getGuildMyInfo().getDeathMaxDamage();
int maxDamage = deathMaxDamage.getOrDefault(pathId, 0); long maxDamage = deathMaxDamage.getOrDefault(pathId, 0L);
Family.ChallengeDeathPathResponse response = Family.ChallengeDeathPathResponse.newBuilder().setDamage(damage).setFightData(fightData).setDrop(drop).setHistoryMax(maxDamage).build(); Family.ChallengeDeathPathResponse response = Family.ChallengeDeathPathResponse.newBuilder().setDamage(damage).setFightData(fightData).setDrop(drop).setHistoryMax(maxDamage).build();
if(!deathMaxDamage.containsKey(pathId)||deathMaxDamage.get(pathId)<damage){ if(!deathMaxDamage.containsKey(pathId)||deathMaxDamage.get(pathId)<damage){
user.getGuildMyInfo().setDeathMaxDamage(pathId,damage); user.getGuildMyInfo().setDeathMaxDamage(pathId,damage);
@ -437,7 +437,7 @@ public class DeathPathLogic {
//跨服 //跨服
if(getInstance().getGroupId()>0){ if(getInstance().getGroupId()>0){
try { try {
CrossDeathPathLogic.getInstance().addCrossDeathPathRank(task.getUid(),task.getDamage(),task.getGuildId(),task.getPathId()); CrossDeathPathLogic.getInstance().addCrossDeathPathRank(task);
LOGGER.info("==================跨服十绝阵上榜处理:{}",task.toString()); LOGGER.info("==================跨服十绝阵上榜处理:{}",task.toString());
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("==================跨服十绝阵上榜异常:{}",e.getMessage()); LOGGER.error("==================跨服十绝阵上榜异常:{}",e.getMessage());

View File

@ -10,13 +10,13 @@ public class DeathPathTask {
private int guildId; private int guildId;
private int damage; private long damage;
private int pathId; private int pathId;
private int groupId; private int groupId;
public DeathPathTask(int uid, int guildId, int damage, int pathId,int groupId) { public DeathPathTask(int uid, int guildId, long damage, int pathId,int groupId) {
this.uid = uid; this.uid = uid;
this.guildId = guildId; this.guildId = guildId;
this.damage = damage; this.damage = damage;
@ -40,11 +40,11 @@ public class DeathPathTask {
this.guildId = guildId; this.guildId = guildId;
} }
public int getDamage() { public long getDamage() {
return damage; return damage;
} }
public void setDamage(int damage) { public void setDamage(long damage) {
this.damage = damage; this.damage = damage;
} }