十绝伤害超上限
parent
989f45f926
commit
4679fb5af2
|
@ -102,10 +102,10 @@ public class CheckFight {
|
|||
args.set("maxRound",maxTime);
|
||||
LuaValue result = func.call( args,fightData,optionData);
|
||||
int status = result.get("result").toint();
|
||||
int duration = result.get("duration").toint();
|
||||
long duration = result.get("duration").tolong();
|
||||
long[] resultCache = new long[8];//对方阵容走配置 Todo 后面结构走配置
|
||||
resultCache[0]= (long) status;
|
||||
resultCache[1]= (long) duration;
|
||||
resultCache[0]= status;
|
||||
resultCache[1]= duration;
|
||||
LOGGER.info(" lua check test fight result : "+ status);
|
||||
for (int i = 1; i <= result.length(); i++) {
|
||||
long tolong = result.rawget(i).tolong();
|
||||
|
|
|
@ -535,6 +535,9 @@ public class GlobalDataManaager implements IManager {
|
|||
|
||||
|
||||
public TimeControllerOfFunction getOpenTimeOfFuntionCacheByType(FunctionIdEnum functionIdEnum ) {
|
||||
if (functionIdEnum == null){
|
||||
return null;
|
||||
}
|
||||
List<Integer> ids = SGlobalSystemConfig.idsByType.get(functionIdEnum.getFunctionType());
|
||||
if(ids!=null && !ids.isEmpty()){
|
||||
for(Integer id : ids){
|
||||
|
|
|
@ -20,7 +20,7 @@ public class GuildMyInfo extends MongoBase {
|
|||
private long preMoveTimestamp; //上次更新时间
|
||||
private int maxBossHurt; //工会boss最高伤害
|
||||
private int lastHurt; //上一次伤害
|
||||
private Map<Integer,Integer> deathMaxDamage = new HashMap<>();
|
||||
private Map<Integer,Long> deathMaxDamage = new HashMap<>();
|
||||
|
||||
//公会祭祀
|
||||
private int fetetype;//祭祀类型
|
||||
|
@ -201,11 +201,11 @@ public class GuildMyInfo extends MongoBase {
|
|||
updateString("guildSkill",guildSkill);
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getDeathMaxDamage() {
|
||||
public Map<Integer, Long> getDeathMaxDamage() {
|
||||
return deathMaxDamage;
|
||||
}
|
||||
|
||||
public void setDeathMaxDamage(int pathId, int damage) {
|
||||
public void setDeathMaxDamage(int pathId, Long damage) {
|
||||
deathMaxDamage.put(pathId,damage);
|
||||
updateString("deathMaxDamage",deathMaxDamage);
|
||||
|
||||
|
|
|
@ -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();
|
||||
//操作每个关的公会、个人数据
|
||||
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());
|
||||
if(redisUtil.getZSetScore(everyPerson.getCrossRedisKey(),String.valueOf(pathId), String.valueOf(uid), false)==-1){
|
||||
//记录人数操作
|
||||
|
|
|
@ -362,7 +362,7 @@ public class DeathPathLogic {
|
|||
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);
|
||||
FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
int damage = (int) fightResult.getCheckResult()[1];
|
||||
long damage = fightResult.getCheckResult()[1];
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(SGuildSetting.sGuildSetting.getWarTime())
|
||||
.setFightSeed(fightResult.getSeed())
|
||||
|
@ -389,8 +389,8 @@ public class DeathPathLogic {
|
|||
RedisUtil.getInstence().putMapEntry(RedisKey.GUILD_INFO_CACHE,"",String.valueOf(guildId),guildInfoCache);
|
||||
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, config.getReward(), BIReason.DEATH_PATH_CHALLENGE);
|
||||
Map<Integer, Integer> deathMaxDamage = user.getGuildMyInfo().getDeathMaxDamage();
|
||||
int maxDamage = deathMaxDamage.getOrDefault(pathId, 0);
|
||||
Map<Integer, Long> deathMaxDamage = user.getGuildMyInfo().getDeathMaxDamage();
|
||||
long maxDamage = deathMaxDamage.getOrDefault(pathId, 0L);
|
||||
Family.ChallengeDeathPathResponse response = Family.ChallengeDeathPathResponse.newBuilder().setDamage(damage).setFightData(fightData).setDrop(drop).setHistoryMax(maxDamage).build();
|
||||
if(!deathMaxDamage.containsKey(pathId)||deathMaxDamage.get(pathId)<damage){
|
||||
user.getGuildMyInfo().setDeathMaxDamage(pathId,damage);
|
||||
|
@ -437,7 +437,7 @@ public class DeathPathLogic {
|
|||
//跨服
|
||||
if(getInstance().getGroupId()>0){
|
||||
try {
|
||||
CrossDeathPathLogic.getInstance().addCrossDeathPathRank(task.getUid(),task.getDamage(),task.getGuildId(),task.getPathId());
|
||||
CrossDeathPathLogic.getInstance().addCrossDeathPathRank(task);
|
||||
LOGGER.info("==================跨服十绝阵上榜处理:{}",task.toString());
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("==================跨服十绝阵上榜异常:{}",e.getMessage());
|
||||
|
|
|
@ -10,13 +10,13 @@ public class DeathPathTask {
|
|||
|
||||
private int guildId;
|
||||
|
||||
private int damage;
|
||||
private long damage;
|
||||
|
||||
private int pathId;
|
||||
|
||||
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.guildId = guildId;
|
||||
this.damage = damage;
|
||||
|
@ -40,11 +40,11 @@ public class DeathPathTask {
|
|||
this.guildId = guildId;
|
||||
}
|
||||
|
||||
public int getDamage() {
|
||||
public long getDamage() {
|
||||
return damage;
|
||||
}
|
||||
|
||||
public void setDamage(int damage) {
|
||||
public void setDamage(long damage) {
|
||||
this.damage = damage;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue