Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn

back_recharge
yuanshuai 2022-02-10 15:04:05 +08:00
commit 3544b10c47
4 changed files with 31 additions and 4 deletions

View File

@ -6,6 +6,7 @@ import com.ljsd.jieling.config.clazzStaticCfg.HeroStaticConfig;
import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.exception.ErrorCode;
import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.globals.Global;
@ -147,6 +148,10 @@ public class GMRequestHandler extends BaseHandler{
break;
case GlobalGm.HERO_STAR:
CommonProto.Drop.Builder drop = ItemUtil.drop(cUser, new int[][]{{prarm1, 1}},BIReason.GM_REWARD);
if (drop.getHeroCount() <= 0) {
MessageUtil.sendErrorCode(iSession, ErrorCode.HANDLE_FAILED.code(),"添加失败");
return;
}
CommonProto.Hero heroProto = drop.getHero(0);
String heroId = heroProto.getId();
Hero hero = cUser.getHeroManager().getHeroMap().get(heroId);

View File

@ -961,7 +961,7 @@ public class HeroLogic {
// }
if (sLotteryRewardConfig != null) {
currStarId = sLotteryRewardConfig.getStar();
LOGGER.info("随机到了{}-->对应star-->{}", sLotteryRewardConfig.getId(), currStarId);
// LOGGER.info("随机到了{}-->对应star-->{}", sLotteryRewardConfig.getId(), currStarId);
}
} else {
@ -970,7 +970,7 @@ public class HeroLogic {
for (int mustId : mustSet) {
maxId = mustId > maxId ? mustId : maxId;
}
LOGGER.info("randomOne uid=>{} 触发必出=>{}", user.getId(), maxId);
// LOGGER.info("randomOne uid=>{} 触发必出=>{}", user.getId(), maxId);
SLotterySpecialConfig onConfig = null;
for (SLotterySpecialConfig everyConfig : specialConfigs) {
if (everyConfig.getDifferentType() != maxId) {
@ -990,7 +990,7 @@ public class HeroLogic {
//如果生效次数是0可重置
List<SLotterySpecialConfig> lotteryListByDifferentType = SLotterySpecialConfig.getLotteryListByDifferentType(key);
if (currStarId >= key && lotteryListByDifferentType != null && lotteryListByDifferentType.iterator().hasNext() && lotteryListByDifferentType.iterator().next().getMin_num() == 0) {
LOGGER.info("清除计数{}下的--->{}", mergePool, key);
// LOGGER.info("清除计数{}下的--->{}", mergePool, key);
randomPoolByType.get(mergePool).put(key, 0);
} else {
int curValue = randomPoolByType.get(mergePool).getOrDefault(key, 0);

View File

@ -1,5 +1,6 @@
package com.ljsd.jieling.util;
import com.ljsd.GameApplication;
import com.ljsd.jieling.chat.logic.ChatLogic;
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
import com.ljsd.jieling.core.GlobalsDef;
@ -1446,6 +1447,20 @@ public class ItemUtil {
HeroManager heroManager = user.getHeroManager();
PlayerManager playerInfoManager = user.getPlayerInfoManager();
int[] heroStar = SItem.getsItemMap().get(cardId).getHeroStar();
SCHero scHero = SCHero.getsCHero().get(heroStar[0]);
if (scHero == null) {
LOGGER.info("addCard uid={} no this hero={}", user.getId(), heroStar[0]);
return;
}
if (scHero.getVersion() > 0) {
long cacheOpenTime = GameApplication.serverConfig.getCacheOpenTime();
long now = TimeUtils.now();
int days = TimeUtils.differentDays(cacheOpenTime, now);
if (days < scHero.getVersion()) {
LOGGER.info("addCard uid={} scHero.getVersion()={} days={}", user.getId(), scHero.getVersion(), days);
return;
}
}
Hero hero = new Hero(user.getId(),heroStar[0],heroStar[1]);
if (reason != BIReason.HERO_RETURN) {
if (hero.getStar() == GlobalsDef.WUJINGMIBAO_STAR){
@ -1457,7 +1472,6 @@ public class ItemUtil {
HeroLogic.getInstance().addOrUpdateHongmeng(OnlineUserManager.getSessionByUid(user.getId()));
heroList.add(CBean2Proto.getHero(hero));
if (reason != BIReason.HERO_RETURN) {
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
if (scHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert("lamp_lottery_content", new Object[]{playerInfoManager.getNameColor(), playerInfoManager.getNickName(), scHero.getStar(), scHero.getReadingName()},new int[]{0,0,0,1});
if (!message.isEmpty()){

View File

@ -76,6 +76,10 @@ public class SCHero implements BaseConfig{
private int[][] returnBook;
private int[] orientation;
private int version;
// 觉醒增加的技能属性
private Map<Integer,TreeMap<Integer,List<Integer>>> awakSkillMap;
@ -389,4 +393,8 @@ public class SCHero implements BaseConfig{
public int[][] getReturnBook() {
return returnBook;
}
public int getVersion() {
return version;
}
}