Merge branch 'master_test_gn' into master_test_mingan

back_recharge
jiahuiwen 2021-10-22 15:40:02 +08:00
commit ea50ee77d1
7 changed files with 39 additions and 21 deletions

View File

@ -129,7 +129,9 @@ public class GameLogicService implements IService {
Thread.currentThread().setName("addShutdownHook");
try {
GameApplication.close();
}catch (Exception e){}
}catch (Exception e){
LOGGER.info("ShutdownHook Exception e={}", e);
}
}));
}

View File

@ -317,8 +317,8 @@ public class GetPlayerInfoHandler extends BaseHandler{
private void wishOldUserRandomNumInit(User user){
// 玩家创建时间
long createTime = user.getPlayerInfoManager().getCreateTime();
// 截止时间 2021-07-07 00:00:00
long endTime = 1625587200000L;
// 截止时间 2021-10-28 00:00:00
long endTime = 1635350400000L;
// 截止时间之前创建的角色
if (createTime <= endTime){
// 钻石卡池抽奖次数

View File

@ -13,6 +13,8 @@ import com.ljsd.jieling.util.ItemUtil;
import com.ljsd.jieling.util.MessageUtil;
import config.SFourQuadrantConfig;
import config.SPlayerSkill;
import config.SXiuXian;
import manager.STableManager;
import org.springframework.stereotype.Component;
import rpc.protocols.CommonProto;
import rpc.protocols.HeroInfoProto;
@ -39,10 +41,9 @@ public class PracticeSkillUpRequestHandler extends BaseHandler<HeroInfoProto.Pra
if (heroManager.getPracticeSkillMap().containsKey(skillId)){
skillLv=heroManager.getPracticeSkillMap().get(skillId);
}
int nextSkillLv=skillLv+1;
SPlayerSkill nextPlayerSkill=SPlayerSkill.GetSPlayerSkill(skillId,nextSkillLv);
if (nextPlayerSkill==null||practiceLv<nextPlayerSkill.getXiuxianId()){
LOGGER.error("修行等级不足");
SXiuXian xiuxianConfig= STableManager.getConfig(SXiuXian.class).get(practiceLv);
if (skillLv>=xiuxianConfig.getPlayerSkillLvMax()) {
LOGGER.error("修行技能等级已达上限");
throw new ErrorCodeException(ErrorCode.PRACTICE_LEVE_DOWN);
}
SPlayerSkill curPlayerSkill=SPlayerSkill.GetSPlayerSkill(skillId,skillLv);
@ -52,7 +53,7 @@ public class PracticeSkillUpRequestHandler extends BaseHandler<HeroInfoProto.Pra
LOGGER.error("修行技能升级材料不足");
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
}
heroManager.setPracticeSkillMap(skillId,nextSkillLv);
heroManager.setPracticeSkillMap(skillId,skillLv+1);
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.PRACTICE_SKILL_UP_RESPONSE_VALUE,null,true);
}
}

View File

@ -246,6 +246,7 @@ public class HardStageLogic {
.setPosition(teamPosHeroInfo.getPosition())
.setStar(hero.getStar())
.setSkinId(hero.getSkin())
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
.build();
heroFightInfos.add(heroFightInfo);
}
@ -258,6 +259,7 @@ public class HardStageLogic {
.addAllPokemonUnitList(HeroLogic.getInstance().getPokemonSkills(user))
.setTeamPassiveList(pokenmonPassiveSkills)
.setSpecialPassive(SpecialForTeamBuildEnum.toParm(teamId, user))
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
.build();
}

View File

@ -2894,7 +2894,7 @@ public class HeroLogic {
SXiuXian shuxingTable = SXiuXian.sXiuXianMap.get(sXiuXian.getRealmId()).get(0);
if (shuxingTable != null) {
int[][] proRank = shuxingTable.getProRank();
float[][] proLevel = shuxingTable.getProLevel();
int[][] proLevel = shuxingTable.getProLevel();
Map<Integer, Long> otherAttriMaop = new HashMap<>(5);
for (int i = 0; i < proRank.length; i++) {
float addValue = proRank[i][1] + proLevel[i][1] * xiuweiLevel;

View File

@ -61,6 +61,11 @@ public class RidingSwardLogic{
if (endTime == 0 && startTime == 0){
return 0;
}
// 比赛结算阶段
int size = getRankMap("").size();
if (getRound() >= size){
return 3;
}
int now = TimeUtils.nowInt();
// 活动过期
if (now > endTime || now < startTime){
@ -74,10 +79,7 @@ public class RidingSwardLogic{
SRidingSwardConfig config = STableManager.getConfig(SRidingSwardConfig.class).get(1);
// 一场比赛得时间,投注时间+比赛时间
int oneGameTime = config.getTime()[0] + config.getTime()[1];
if (now + oneGameTime >= endTime){
return 3;
}
// (当前时间-开始时间)%场次时间,取模,可以获得限制位于哪个阶段
// (当前时间-开始时间)%场次时间,取模,可以获得现在位于哪个阶段
return (now - startTime) % (oneGameTime) > config.getTime()[0] ? 2 : 1;
}catch (Exception e){
e.printStackTrace();
@ -94,17 +96,14 @@ public class RidingSwardLogic{
SRidingSwardConfig config = STableManager.getConfig(SRidingSwardConfig.class).get(1);
// 一场比赛得时间,投注时间+比赛时间
int oneGameTime = config.getTime()[0] + config.getTime()[1];
// 第几轮
int time = TimeUtils.nowInt() - startTime;
// 第几轮
int round = 0;
if (time % oneGameTime == 0){
round = time / oneGameTime;
}else {
round = time / oneGameTime +1;
}
if (getState() == 3){
round -= 1;
}
return round;
}
@ -250,6 +249,9 @@ public class RidingSwardLogic{
for (ZSetOperations.TypedTuple<String> tuple : tupleSet) {
// 跨服排行榜玩家数据
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(Integer.parseInt(tuple.getValue()));
if (csPlayer == null){
continue;
}
CommonProto.ModelUserInfo.Builder builder = CommonProto.ModelUserInfo.newBuilder()
.setUserName(csPlayer.getName())
.setSex(csPlayer.getSex())
@ -396,8 +398,13 @@ public class RidingSwardLogic{
* @return
*/
private CommonProto.RidingSwardLastRank getRidingSwardLastRank() throws ErrorCodeException {
int round = getRound()-1;
if (getState() == 3){
int size = getRankMap("").size();
round = size - 1;
}
// 配置
RidingSwardRank swardRank = getRankMap("").getOrDefault(getRound(), new RidingSwardRank());
RidingSwardRank swardRank = getRankMap("").getOrDefault(round, new RidingSwardRank());
return CommonProto.RidingSwardLastRank.newBuilder()
.setRankTime(swardRank.getTime())
.setRankId(swardRank.getRankId())
@ -420,7 +427,7 @@ public class RidingSwardLogic{
boolean judge = false;
for (RidingSwardRecord record : entry.getValue()) {
// 当前比赛结果不能显示
if (record.getTime() > (getTime()-config.getTime()[1])){
if (record.getRound() >= getRound()){
break;
}
judge = recordBuild(record,getRankMap(""));

View File

@ -30,7 +30,9 @@ public class SXiuXian implements BaseConfig {
private int[][] proRank;
private float[][] proLevel;
private int[][] proLevel;
private int playerSkillLvMax;
// 目前只为主角修行等级属性使用
public static Map<Integer, Map<Integer, SXiuXian>> sXiuXianMap;
@ -91,7 +93,11 @@ public class SXiuXian implements BaseConfig {
return proRank;
}
public float[][] getProLevel() {
public int[][] getProLevel() {
return proLevel;
}
public int getPlayerSkillLvMax() {
return playerSkillLvMax;
}
}