Merge branch 'master_test_gn' into master_prb_gn

back_recharge
jiahuiwen 2021-09-17 16:47:07 +08:00
commit a5e82c01a0
14 changed files with 288 additions and 229 deletions

View File

@ -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();

View File

@ -20,7 +20,7 @@ public class ConfMessage {
File file = new File("conf/plat-configure.json");
// File file = new File("C://ljsd/gameserver_new/conf/plat-configure.json");
if (!file.exists()) {
LOGGER.error("the file plat-configure.json is not exists");
// LOGGER.error("the file plat-configure.json is not exists");
return;
}
InputStream in = new FileInputStream(file);

View File

@ -28,5 +28,6 @@ public interface GlobalGm {
// int TECNOLOGY_MAX = 21;//科技树一键满级
// int POKEMAN_MAX = 22;//一键获得所有满级异妖
int HARD_STAGE =25;//一键通关山河社稷图特定关卡之前的所有关卡
int FOUR_SPIRITS =26;//一键通关山河社稷图特定关卡之前的所有关卡
}

View File

@ -60,7 +60,7 @@ public class GMRequestHandler extends BaseHandler{
CommonProto.GMCommand gmCommand = CommonProto.GMCommand.parseFrom(message);
String command = gmCommand.getCommand();
int uid = iSession.getUid();
LOGGER.error("gm commond is {}",command);
LOGGER.info("gm commond is {}",command);
// if(command.startsWith("//check_fight")){
// FIGHT_LOGGER.error(command);
// CommonProto.GmResponse.Builder gmBuilder = CommonProto.GmResponse.newBuilder();
@ -97,9 +97,9 @@ public class GMRequestHandler extends BaseHandler{
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GM_RESPONSE_VALUE, gmBuilder.build(), true);
return;
}
if(!GameApplication.serverProperties.isDebug()){
throw new ErrorCodeException("In a formal setting");
}
// if(!GameApplication.serverProperties.isDebug()){
// throw new ErrorCodeException("In a formal setting");
// }
if (!command.contains("#") || command.split("#").length < 3) {
LOGGER.error("wrong command :" + command);
return;
@ -456,6 +456,12 @@ public class GMRequestHandler extends BaseHandler{
HardStageLogic.test(cUser,id);
HardStageLogic.sendHardStageIndication(cUser);
break;
case GlobalGm.FOUR_SPIRITS:
//四灵试炼跳关
prarm1 = Integer.parseInt(commandArray[1]);
prarm2 = Integer.parseInt(commandArray[2]);
cUser.getPlayerInfoManager().updateFourChallengeByIndex(prarm1, prarm2);
break;
default:
break;
}

View File

@ -8,14 +8,14 @@ import rpc.protocols.HeroInfoProto;
import rpc.protocols.MessageTypeProto;
@Component
public class HongmengGetInfoRequestHandler extends BaseHandler<HeroInfoProto.ResonanceRequest> {
public class HongmengGetInfoRequestHandler extends BaseHandler<HeroInfoProto.GetHongmengInfoRequest> {
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.HONGMENG_GET_INFO_REQUEST;
}
@Override
public void processWithProto(ISession session, HeroInfoProto.ResonanceRequest proto) throws Exception {
HeroLogic.getInstance().getHongmengInfo(session, MessageTypeProto.MessageType.HONGMENG_GET_INFO_RESPONSE);
public void processWithProto(ISession session, HeroInfoProto.GetHongmengInfoRequest proto) throws Exception {
HeroLogic.getInstance().addOrUpdateHongmeng(session, true);
}
}

View File

@ -537,6 +537,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){

View File

@ -82,7 +82,7 @@ public enum ActivityTypeEnum {
SUPERFUND328(ActivityType.SUPERFUND328,SuperFundActivity::new),//超值基金328
PREPARE_FIFTEEN_ACTIVITY(ActivityType.PREPARE_FIFTEEN_ACTIVITY,DefaultEmptyActivity::new),//超值基金328
THEME_ACTIVITY_SHOP(ActivityType.THEME_ACTIVITY_SHOP,DefaultEmptyActivity::new),
//XUN_BAO_MI_ZONG(ActivityType.XUN_BAO_MI_ZONG,XunBaoMiZongActivity::new)
XUN_BAO_MI_ZONG(ActivityType.XUN_BAO_MI_ZONG,XunBaoMiZongActivity::new)
;
private int type;

View File

@ -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);

View File

@ -84,16 +84,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){
//记录人数操作

View File

@ -361,7 +361,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())
@ -388,8 +388,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);
@ -436,7 +436,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());
@ -516,9 +516,9 @@ public class DeathPathLogic {
.setPathId(pathId).setServerName(serverName).build();
Family.DeathPathFirstChangeIndication indication = Family.DeathPathFirstChangeIndication.newBuilder().setChangeInfo(info).build();
GuildLogic.sendIndicationToMember(guildInfo, MessageTypeProto.MessageType.DEATH_PATH_FIRST_CHANGE_INDICATION,indication);
}else{
}/*else{
LOGGER.error("Exception公会信息为空不能发送推送公会id为{}",n.getValue());
}
}*/
}
LOGGER.info("信息修改,需要推送");
}

View File

@ -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;
}

View File

@ -1,6 +1,8 @@
package com.ljsd.jieling.logic.fight.passiveSkillCal;
import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import config.SCHero;
import config.SPropertyConfig;
@ -52,10 +54,15 @@ public enum PassiveskillCalEnum {
heroSkillAdMap.put(sPropertyConfig.getPropertyId(),heroSkillAdMap.getOrDefault(sPropertyConfig.getPropertyId(), Long.valueOf(0))+extraValue);
}),
HEROAFTER100ADD(171,(config,hero,heroSkillAdMap)->{
int uid = Integer.parseInt(hero.getId().substring(0, 8));
User user = UserManager.getUserInMem(uid);
if (user == null){
return;
}
float[] value = config.getValue();
int battlePropertyId = (int) value[0];
SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByBattlePID(battlePropertyId);
int level = hero.getOriginalLevel();
int level = hero.getLevel(user.getHeroManager());
int times=level-100;
if(times<=0){
return;

View File

@ -17,6 +17,10 @@ public enum HeroAttributeEnum {
TreatFacter(58),
DifferDemonsReduceFactor(59),
AntiCritDamageFactor(60),
HP_ADD_PERCENT(61), // 血量 加成百分比
ATTACK_ADD_PERCENT(62), // 攻击 加成百分比
PHYSICAL_DEFENCE_ADD_PERCENT(63), // 护甲 加成百分比
MAGIC_DEFENCE_ADD_PERCENT(64), // 魔抗 加成百分比
DifferDemonsBocusFactor(66),
CurHpExtra(67),
CurHpSpecialExtra(68),
@ -34,6 +38,7 @@ public enum HeroAttributeEnum {
LandDamageReduceFactor(110),
LightDamageReduceFactor(111),
DarkDamageReduceFactor(112),
CritDamageReduceFactor(113), // 暴伤减免
EquipForce(9999),
;

View File

@ -2747,11 +2747,11 @@ public class HeroLogic{
public int calForce( Map<Integer, Long> heroAllAttribute ){
double result = 0;
// 旧战力计算
for(Map.Entry<Integer, Long> item : heroAllAttribute.entrySet()){
Integer propertyId = item.getKey();
float propertyValue = item.getValue();
if(propertyId == HeroAttributeEnum.EquipForce.getPropertyId()){
// LOGGER.info("the equipScore={}",propertyValue);
continue;
}
SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByPID(propertyId);
@ -2761,9 +2761,52 @@ public class HeroLogic{
float score = sPropertyConfig.getScore();
result += propertyValue*score;
// LOGGER.info("the propertyId={} the value is ={},propertyValue={},score={}result ={},the value={}",propertyId,propertyValue*score,propertyValue,score,result,propertyValue*score);
}
// System.out.println(result);
// SPropertyConfig sPropertyConfigHP = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.Hp.getPropertyId());
// float hpScore = sPropertyConfigHP.getScore();
// SPropertyConfig sPropertyConfigAttack = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.Attack.getPropertyId());
// float attackScore = sPropertyConfigAttack.getScore();
// SPropertyConfig sPropertyConfigPhysicalDefence = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.PhysicalDefence.getPropertyId());
// float pdScore = sPropertyConfigPhysicalDefence.getScore();
// SPropertyConfig sPropertyConfigMagicDefence = SPropertyConfig.getsPropertyConfigByPID(HeroAttributeEnum.MagicDefence.getPropertyId());
// float mdScore = sPropertyConfigMagicDefence.getScore();
//
// // 新战力计算2021 9 17
// // 面板最大生命值
// float xishu = 10000;
// float finalHp = heroAllAttribute.getOrDefault(HeroAttributeEnum.Hp.getPropertyId(), 0L).floatValue();
// // 面板攻击
// float finalAttack = heroAllAttribute.getOrDefault(HeroAttributeEnum.Attack.getPropertyId(), 0L).floatValue();
// // 面板护甲
// float finalPhysicalDefence = heroAllAttribute.getOrDefault(HeroAttributeEnum.PhysicalDefence.getPropertyId(), 0L).floatValue();
// // 面板魔抗
// float magicDefence = heroAllAttribute.getOrDefault(HeroAttributeEnum.MagicDefence.getPropertyId(), 0L).floatValue();
// // 伤害加成
// float damageBocusFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.DamageBocusFactor.getPropertyId(), 0L).floatValue();
// // 伤害减免
// float damageReduceFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.DamageReduceFactor.getPropertyId(), 0L).floatValue();
// // 命中几率
// float hit = heroAllAttribute.getOrDefault(HeroAttributeEnum.Hit.getPropertyId(), 0L).floatValue();
// // 闪避几率
// float dodge = heroAllAttribute.getOrDefault(HeroAttributeEnum.Dodge.getPropertyId(), 0L).floatValue();
// // 暴击几率
// float critFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.CritFactor.getPropertyId(), 0L).floatValue();
// // 抗暴几率
// float antiCritDamageFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.AntiCritDamageFactor.getPropertyId(), 0L).floatValue();
// // 暴伤加成
// float critDamageFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.CritDamageFactor.getPropertyId(), 0L).floatValue();
// // 暴伤减免
// float critDamageReduceFactor = heroAllAttribute.getOrDefault(HeroAttributeEnum.CritDamageReduceFactor.getPropertyId(), 0L).floatValue();
// // 受疗加成
// float cureFacter = heroAllAttribute.getOrDefault(HeroAttributeEnum.CureFacter.getPropertyId(), 0L).floatValue();
// // 治疗加成
// float treatFacter = heroAllAttribute.getOrDefault(HeroAttributeEnum.TreatFacter.getPropertyId(), 0L).floatValue();
//
// result = (finalHp * hpScore + finalAttack * attackScore + finalPhysicalDefence * pdScore + magicDefence * mdScore)
// * (1 + (damageBocusFactor + damageReduceFactor + hit + dodge + critFactor +
// antiCritDamageFactor + critDamageFactor + critDamageReduceFactor + cureFacter + treatFacter) / 2 / xishu);
return (int)result;
}
@ -4316,41 +4359,33 @@ public class HeroLogic{
if(isInTeam(user,heroId,1)){
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
}
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
}
// ================================共鸣、鸿蒙碑========================= //
/**
* 鸿
* 鸿
* @param session
* @param messageType
* @throws Exception
*/
public void getHongmengInfo(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
// 刷新鸿蒙阵
addOrUpdateHongmeng(session);
HeroInfoProto.GetHongmengInfoResponse getHongmengInfoResponse = HeroInfoProto.GetHongmengInfoResponse.newBuilder().build();
MessageUtil.sendMessage(session, 1, messageType.getNumber(), getHongmengInfoResponse);
public void addOrUpdateHongmeng(ISession session) throws Exception {
addOrUpdateHongmeng(session,false);
}
/**
* 鸿
* @param session
* @param judge truefalse
*/
public void addOrUpdateHongmeng(ISession session) throws Exception {
public void addOrUpdateHongmeng(ISession session, boolean judge) throws Exception {
User user = UserManager.getUser(session.getUid());
HeroInfoProto.HongmengInfoIndication.Builder hongmengInfoIndication = HeroInfoProto.HongmengInfoIndication.newBuilder();
// 鸿蒙阵开启条件
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.HongMeng.getFunctionType());
boolean open = HandlerLogicThread.checkOpen(user, sGlobalSystemConfig);
if (!open) {
return;
}
// 鸿蒙阵开启条件
if (open) {
/** ========================== 共鸣信息初始化 =========================== **/
// 限制表 鸿蒙守卫数量#鸿蒙碑使者等级
String[] openLevel = SSpecialConfig.getStringValue(SSpecialConfig.HONGMENG_UPGRADE_LIMIT).split("#");
@ -4545,14 +4580,15 @@ public class HeroLogic{
.build();
hongmengResonancesProto.add(hongmengHeroInfo);
}
HeroInfoProto.HongmengInfoIndication hongmengInfoIndication = HeroInfoProto.HongmengInfoIndication.newBuilder()
.addAllHongmengGuards(hongmengGuardsProto)
.addAllHongmengAdditions(hongmengAdditions)
.addAllHongmengResonacnes(hongmengResonancesProto)
.setHongmengTabletMax(tabletMax)
.build();
MessageUtil.sendIndicationMessage(session,1,MessageTypeProto.MessageType.HONGMENG_INFO_INDICATION.getNumber(),hongmengInfoIndication,true);
hongmengInfoIndication.addAllHongmengGuards(hongmengGuardsProto).addAllHongmengAdditions(hongmengAdditions)
.addAllHongmengResonacnes(hongmengResonancesProto).setHongmengTabletMax(tabletMax).build();
}
// 返回协议
if (judge){
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.HONGMENG_GET_INFO_RESPONSE_VALUE, hongmengInfoIndication.build(), true);
}else {
MessageUtil.sendIndicationMessage(session,1,MessageTypeProto.MessageType.HONGMENG_INFO_INDICATION_VALUE,hongmengInfoIndication.build(),true);
}
}
/**