Merge branch 'master' into master_test_combin
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/db/redis/RedisKey.javaback_recharge
commit
60abb970a9
|
@ -24,11 +24,21 @@ public abstract class MongoBase implements Serializable {
|
|||
}
|
||||
|
||||
public void updateString(String fieldName, Object value) {
|
||||
if(null == value){
|
||||
if("".equals(mongoKey)){
|
||||
MongoUpdateCacheThreadLocal.removeRequest(this, fieldName);
|
||||
}else{
|
||||
MongoUpdateCacheThreadLocal.removeRequest(this, mongoKey + "." + fieldName);
|
||||
}
|
||||
|
||||
}else {
|
||||
if("".equals(mongoKey)){
|
||||
MongoUpdateCacheThreadLocal.addUpdateRequest(this, fieldName, value);
|
||||
}else{
|
||||
MongoUpdateCacheThreadLocal.addUpdateRequest(this, mongoKey + "." + fieldName, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1129,6 +1129,17 @@ public class TimeUtils {
|
|||
int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
return hour;
|
||||
}
|
||||
/**
|
||||
* 获得当前时间是今天的几点(整点)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static int getMiunte() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTimeInMillis(System.currentTimeMillis());
|
||||
int minute = calendar.get(Calendar.MINUTE);
|
||||
return minute;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 获取的一个月的最大的天数
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
package com.ljsd.jieling.config.clazzStaticCfg;
|
||||
|
||||
import config.SExpeditionFloorConfig;
|
||||
import config.SRaceTowerRewardConfig;
|
||||
import manager.AbstractClassStaticConfig;
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/9/7
|
||||
* @discribe
|
||||
*/
|
||||
public class RewardStaticConfig extends AbstractClassStaticConfig {
|
||||
|
||||
private static Map<Integer,SRaceTowerRewardConfig> raceRewardConfigMap;
|
||||
|
||||
@Override
|
||||
public void registConfigs(Set<String> registConfigs) {
|
||||
registConfigs.add(SRaceTowerRewardConfig.class.getAnnotation(Table.class).name());
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void figureConfigs() {
|
||||
Map<Integer,SRaceTowerRewardConfig> raceRewardConfigMapTemp = new HashMap<>();
|
||||
for(SRaceTowerRewardConfig value:STableManager.getConfig(SRaceTowerRewardConfig.class).values()){
|
||||
int[] section = value.getSection();
|
||||
for(int i = section[0];i<=section[1];i++){
|
||||
raceRewardConfigMapTemp.put(i,value);
|
||||
}
|
||||
}
|
||||
raceRewardConfigMap = raceRewardConfigMapTemp;
|
||||
|
||||
}
|
||||
|
||||
public static Map<Integer, SRaceTowerRewardConfig> getRaceRewardConfigMap() {
|
||||
return raceRewardConfigMap;
|
||||
}
|
||||
}
|
|
@ -62,6 +62,7 @@ public enum FunctionIdEnum {
|
|||
Achieve(65,null),
|
||||
DeathPath(72,null),
|
||||
Car_Delay(73,new CarDelayFunction()),
|
||||
Situation_challenge(74,null),
|
||||
;
|
||||
|
||||
private int functionType;
|
||||
|
|
|
@ -234,6 +234,14 @@ public class RedisKey {
|
|||
public static final String DEATH_PATH_CHALLENGE_COUNT = "DEATH_PATH_CHALLENGE_COUNT";
|
||||
|
||||
|
||||
public static final String DEATH_PATH_TOTAL_PERSON_RANK = "DEATH_PATH_TOTAL_PERSON_RANK";
|
||||
|
||||
public static final String DEATH_PATH_TOTAL_GUILD_RANK = "DEATH_PATH_TOTAL_GUILD_RANK";
|
||||
|
||||
public static final String SITUATION_RANK = "SITUATION_RANK";
|
||||
|
||||
|
||||
|
||||
public static final String DEATH_PAHT_TOTAL_CHALLENGE_COUNT = "DEATH_PAHT_TOTAL_CHALLENGE_COUNT";
|
||||
|
||||
|
||||
|
|
|
@ -141,7 +141,12 @@ public interface BIReason {
|
|||
int EXCEPTION_TREASURE_REWARD = 77;//天空密境积分奖励
|
||||
|
||||
int PROUD_REWARD = 78;//膜拜获得金币奖励
|
||||
int EQUIP_UNLOAD_REWARD = 79;
|
||||
|
||||
int EQUIP_UNLOAD_REWARD = 79;//卸下装备
|
||||
int ESPECIAL_BACK = 80;//法宝归元获得
|
||||
|
||||
int SITUATION_CHALLENGE_REWARD = 81;//轩辕宝镜获得
|
||||
int HERO_CHANGE= 82;//抽卡
|
||||
|
||||
int ADVENTURE_UPLEVEL_CONSUME = 1000;//秘境升级
|
||||
int SECRETBOX_CONSUME = 1001;//秘盒抽卡
|
||||
|
|
|
@ -7,6 +7,8 @@ import com.ljsd.jieling.exception.ErrorCode;
|
|||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||
|
@ -124,6 +126,7 @@ public class StartExpeditionBattleRequest extends BaseHandler<Expedition.StartEx
|
|||
.addMonsterList(deffightTeamInfo)
|
||||
.build());
|
||||
MessageUtil.sendMessage(iSession, 1,MessageTypeProto.MessageType.EXPEDITION_START_BATTLE_RESONSE_VALUE, fightStartResponse.build(), true);
|
||||
// ReportUtil.onReportEvent(user, ReportEventEnum);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@ 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.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
|
@ -25,12 +27,15 @@ import com.ljsd.jieling.protocols.CommonProto;
|
|||
import com.ljsd.jieling.protocols.FightInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import com.ljsd.jieling.util.MonsterUtil;
|
||||
import config.SErrorCodeEerverConfig;
|
||||
import config.SWorldBossConfig;
|
||||
import config.SWorldBossSetting;
|
||||
import manager.STableManager;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightChallengeRequest>{
|
||||
|
@ -94,7 +99,6 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
|
|||
RankEnum.toRank(RankEnum.CAR_DEALY_RANK.getType()).incrementRankScore(uid,"",myscore);
|
||||
RankEnum.toRank(RankEnum.CAR_DEALY_GUILD_RANK.getType()).incrementRankScore(guildInfo.getId(),"",gainScore,isNew?1:0);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.CAR_PLAY,1);
|
||||
|
||||
}break;
|
||||
case 2:{
|
||||
PVPFightEvent pvpFightEvent = new PVPFightEvent(uid,GlobalsDef.CAR_DELAY_TEAM, battleRound,"", GameFightType.CarPersonChallenge,challeageId,GlobalsDef.CAR_DELAY_TEAM);
|
||||
|
@ -141,5 +145,6 @@ public class FastChallengeHandler extends BaseHandler<FightInfoProto.FastFightCh
|
|||
user.getGuildMyInfo().setCarPlayTime(TimeUtils.nowInt());
|
||||
FightInfoProto.FastFightChallengeResponse build = FightInfoProto.FastFightChallengeResponse.newBuilder().setHurt(hurt).setScore(gainScore).setFightData(fightData).build();
|
||||
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.FAST_FIGHT_CHALLENGE_RESPONSE_VALUE,build,true);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.COMPLETE_CHECHI.getType(),sWorldBossSetting.getid(),type,1,gainScore);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
for(Map.Entry<Integer,VipInfo> vipInfoItem : vipInfo.entrySet()){
|
||||
privilegeList.add(CommonProto.Privilege.newBuilder()
|
||||
.setId(vipInfoItem.getKey())
|
||||
. setUsedTimes(vipInfoItem.getValue().getCount())
|
||||
.setUsedTimes(vipInfoItem.getValue().getCount())
|
||||
.setEffectTime(vipInfoItem.getValue().getEffectTime())
|
||||
.build());
|
||||
}
|
||||
|
|
|
@ -5,6 +5,8 @@ import com.ljsd.jieling.exception.ErrorCode;
|
|||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.Equip;
|
||||
import com.ljsd.jieling.logic.dao.Item;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
@ -86,10 +88,12 @@ public class ComplexEquipHandler extends BaseHandler<HeroInfoProto.ComplexEquipR
|
|||
dropItems[0] = new int[2];
|
||||
dropItems[0][0] = targetEquip;
|
||||
dropItems[0][1] = proto.getNum();
|
||||
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, dropItems, BIReason.COMPLEX_EQUIP);
|
||||
HeroInfoProto.ComplexEquipResponse.Builder response = HeroInfoProto.ComplexEquipResponse.newBuilder();
|
||||
response.setDrop(drop);
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EQUIP_COMPLEX_RESPONSE_VALUE, response.build(), true);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.EQUIP_SYNTHESIS.getType(),targetEquip,proto.getNum(),new ArrayList<>(consumeMap.keySet()),consumeMap.values());
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -184,6 +188,7 @@ public class ComplexEquipHandler extends BaseHandler<HeroInfoProto.ComplexEquipR
|
|||
CommonProto.Drop.Builder drop = ItemUtil.drop(user,createArray,BIReason.COMPLEX_EQUIP);
|
||||
HeroInfoProto.ComplexEquipResponse.Builder response = HeroInfoProto.ComplexEquipResponse.newBuilder();
|
||||
response.setDrop(drop);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.EQUIP_SYNTHESIS.getType(),new ArrayList<>(countMap.keySet()),"",new ArrayList<>(consumeMap.keySet()),consumeMap.values());
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EQUIP_COMPLEX_RESPONSE_VALUE, response.build(), true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@ import com.ljsd.jieling.exception.ErrorCode;
|
|||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.Jewel;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
@ -114,6 +116,8 @@ public class ComplexJewelEquipRequestHandler extends BaseHandler<HeroInfoProto.C
|
|||
}
|
||||
response.setDrop(drop);
|
||||
MessageUtil.sendIndicationMessage(user.getId(), response.build());
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.TREASURE_SYNTHESIS.getType(),targetEquip,proto.getNum(),new ArrayList<>(consumeMap.keySet()),consumeMap.values());
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
@ -204,6 +208,7 @@ public class ComplexJewelEquipRequestHandler extends BaseHandler<HeroInfoProto.C
|
|||
for (String id:newids) {
|
||||
equips.add(CBean2Proto.getEquipProto( user.getEquipManager().getEquipMap().get(id)));
|
||||
}
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.TREASURE_SYNTHESIS.getType(),new ArrayList<>(consumeMap.keySet()),new ArrayList<>(consumeMap.values()),new ArrayList<>(consumeMap.keySet()),consumeMap.values());
|
||||
ItemUtil.itemCost(user, consumeMap, BIReason.COMPLEX_EQUIP_CONSUME, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package com.ljsd.jieling.handler.equip;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/8/5
|
||||
* @discribe
|
||||
*/
|
||||
@Component
|
||||
public class EspecialEquipBackHandler extends BaseHandler<HeroInfoProto.EspecialEquipBackRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.ESPECIAL_EQUIP_BACK_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.EspecialEquipBackRequest proto) throws Exception {
|
||||
HeroLogic.getInstance().especialEquipBack(iSession,proto.getHeroIdLsitList());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
||||
/**
|
||||
* Description: 清除英雄
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/8/10 10:51
|
||||
*/
|
||||
public class CancelHeroChangeRequestHandler extends BaseHandler<HeroInfoProto.CancelHeroChangeRequest> {
|
||||
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeneratedMessage processWithProto(int uid, HeroInfoProto.CancelHeroChangeRequest proto) throws Exception {
|
||||
|
||||
User user = UserManager.getUser(uid);
|
||||
Hero hero = user.getHeroManager().getHero(proto.getHeroId());
|
||||
if (hero == null){
|
||||
throw new ErrorCodeException( ErrorCode.ITEM_DECOMPOSE_NO_HERO);
|
||||
}
|
||||
hero.setChangeId(0);
|
||||
return HeroInfoProto.CancelHeroChangeResponse.newBuilder().build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import config.SCHero;
|
||||
import config.SSpecialConfig;
|
||||
|
||||
/**
|
||||
* Description: des
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/8/10 10:51
|
||||
*/
|
||||
public class DoHeroChangeRequestHandler extends BaseHandler<HeroInfoProto.DoHeroChangeRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeneratedMessage processWithProto(int uid, HeroInfoProto.DoHeroChangeRequest proto) throws Exception {
|
||||
|
||||
User user = UserManager.getUser(uid);
|
||||
Hero hero = user.getHeroManager().getHero(proto.getHeroId());
|
||||
if (hero == null){
|
||||
throw new ErrorCodeException( ErrorCode.ITEM_DECOMPOSE_NO_HERO);
|
||||
}
|
||||
if(hero.getChangeId()==0){
|
||||
throw new ErrorCodeException("未置换");
|
||||
}
|
||||
//check lock
|
||||
if(hero.getIsLock() == 1){
|
||||
throw new ErrorCodeException( ErrorCode.ITEM_DECOMPOSE_HERO_LOCK);
|
||||
}
|
||||
//check cfg
|
||||
SCHero hero1 = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
if(null == hero1){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
|
||||
// int[][] ints = new int[1][2];
|
||||
// ints[0][0]=hero.getChangeId();
|
||||
// ints[0][1]= 1;
|
||||
|
||||
//check in team
|
||||
int[] teamId = SSpecialConfig.getOnceArrayValue(SSpecialConfig.HERO_RESOLVE_LICENCE);
|
||||
boolean battleArray = HeroLogic.getInstance().isBattleArray(user, proto.getHeroId(),teamId);
|
||||
if (!battleArray){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_DECOMPOSE_HERO_TEAM);
|
||||
}
|
||||
|
||||
user.getHeroManager().removeHero(uid,hero.getId());
|
||||
|
||||
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder();
|
||||
//random tempid
|
||||
Hero newHero = new Hero(uid,hero.getChangeId(),hero.getLevel(),hero);
|
||||
newHero.setCreateTime(0);
|
||||
newHero.setEquipByPositionMap(hero.getEquipByPositionMap());
|
||||
newHero.setJewelInfo(hero.getJewelInfo());
|
||||
user.getHeroManager().addHero(newHero);
|
||||
drop.addHero(CBean2Proto.getHero(newHero));
|
||||
return HeroInfoProto.DoHeroChangeResponse.newBuilder().setDrop(drop).build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import config.SCHero;
|
||||
import config.SLotteryRewardConfig;
|
||||
import config.SLotterySetting;
|
||||
import config.SSpecialConfig;
|
||||
import manager.STableManager;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Description: des
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/8/10 10:51
|
||||
*/
|
||||
public class SaveHeroChangeRequestHandler extends BaseHandler<HeroInfoProto.SaveHeroChangeRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeneratedMessage processWithProto(int uid, HeroInfoProto.SaveHeroChangeRequest proto) throws Exception {
|
||||
|
||||
User user = UserManager.getUser(uid);
|
||||
Hero hero = user.getHeroManager().getHero(proto.getHeroId());
|
||||
if (hero == null){
|
||||
throw new ErrorCodeException( ErrorCode.ITEM_DECOMPOSE_NO_HERO);
|
||||
}
|
||||
//check lock
|
||||
if(hero.getIsLock() == 1){
|
||||
throw new ErrorCodeException( ErrorCode.ITEM_DECOMPOSE_HERO_LOCK);
|
||||
}
|
||||
//check cfg
|
||||
SCHero hero1 = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
if(null == hero1){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
|
||||
|
||||
//check in team
|
||||
int[] teamId = SSpecialConfig.getOnceArrayValue(SSpecialConfig.HERO_RESOLVE_LICENCE);
|
||||
AtomicBoolean inTeams = HeroLogic.getInstance().isInTeams(user, proto.getHeroId(), teamId);
|
||||
if(!inTeams.get()){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_DECOMPOSE_HERO_TEAM);
|
||||
}
|
||||
|
||||
int propertyName = hero1.getPropertyName();
|
||||
int heroStar = hero.getStar();
|
||||
Map<Integer, Integer> integerIntegerMap = SLotterySetting.getChangeIds().get(heroStar);
|
||||
if(null == integerIntegerMap|| integerIntegerMap.size() ==0){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
|
||||
int type =integerIntegerMap.get(propertyName);
|
||||
|
||||
SLotterySetting sLotterySetting = STableManager.getConfig(SLotterySetting.class).get(type);
|
||||
int perCount = sLotterySetting.getPerCount();
|
||||
|
||||
//check item
|
||||
boolean enoughCost = false;
|
||||
for (int[] cost:sLotterySetting.getCostItem()){
|
||||
int [][] costItems = new int[][]{cost};
|
||||
enoughCost = ItemUtil.itemCost(user, costItems,BIReason.RANDOM_HERO_CONSUME,type);
|
||||
if(enoughCost){
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(!enoughCost){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
|
||||
|
||||
//random Hero
|
||||
int result =hero.getTemplateId();
|
||||
int j=0;
|
||||
while (j<1000&&result==hero.getTemplateId()){
|
||||
j++;
|
||||
//所有获得物品
|
||||
int[][] resultRandom = new int[perCount][];
|
||||
//进行抽取
|
||||
for(int i = 0 ;i<perCount;i++){
|
||||
int rewardId = HeroLogic.randomOne(user, type);
|
||||
SLotteryRewardConfig sLotteryRewardConfig = STableManager.getConfig(SLotteryRewardConfig.class).get(rewardId);
|
||||
resultRandom[i] =sLotteryRewardConfig.getReward();
|
||||
}
|
||||
result = resultRandom[0][0];
|
||||
}
|
||||
|
||||
if(result==0){
|
||||
LOGGER.error("随机失败"+j);
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
hero.getTemplateId();
|
||||
hero.setChangeId(result);
|
||||
return HeroInfoProto.SaveHeroChangeResponse.newBuilder().setHeroTempId(result).build();
|
||||
|
||||
}
|
||||
}
|
|
@ -2147,7 +2147,7 @@ public class MapLogic {
|
|||
// String rankKey = RedisKey.getKey(RedisKey.MAINLEVEL_RANK, "", false);
|
||||
// RedisUtil.getInstence().zsetAddOne(rankKey, String.valueOf(user.getId()), sMainLevelConfig.getVirtureId());
|
||||
RankContext.getRankEnum(RankEnum.MAIN_LEVEL_RANK.getType()).addRank(uid,"",sMainLevelConfig.getVirtureId(),user.getPlayerInfoManager().getMaxForce());
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.PASS_STAGE.getType(),String.valueOf(fightId),"",sMainLevelConfig.getReward());
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.PASS_STAGE.getType(),String.valueOf(fightId),"",sMainLevelConfig.getReward(),new Date());
|
||||
|
||||
}
|
||||
|
||||
|
@ -2229,6 +2229,7 @@ public class MapLogic {
|
|||
BehaviorUtil.getLevelDifficultyifficuFightInfo(user,FightType.MonterFight, sFloodConfig.getMonster(), teamId, sFloodConfig.getBattleTime(), fightStartResponse, RedisKey.CHALLENGE_MONSTER_ATTACK);
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.MONSTER_ATTACK_PLAY);
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightStartResponse.build(), true);
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.COMPLETE_XINMO.getType(),fightId,sFloodConfig.getMonster(),MonsterUtil.getMonsterForce(new int[]{sFloodConfig.getMonster()}),"");
|
||||
}
|
||||
|
||||
|
||||
|
@ -2283,6 +2284,15 @@ public class MapLogic {
|
|||
user.getMapManager().setLastMonsterAttack(checkFightId + 1);
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.MONSTER_ATTACK_LEVEL);
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), fightEndResponse.build(), true);
|
||||
|
||||
List<CommonProto.Item> itemDrop = drop.getItemlistList();
|
||||
List<Integer> itemIdList = new ArrayList<>();
|
||||
List<Integer> itemNumList = new ArrayList<>();
|
||||
itemDrop.forEach(item->{
|
||||
itemIdList.add(item.getItemId());
|
||||
itemIdList.add(item.getItemNum());
|
||||
});
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.COMPLETE_XINMO.getType(),checkFightId,sFloodConfig.getMonster(),MonsterUtil.getMonsterForce(new int[]{sFloodConfig.getMonster()}),new Date(),"",itemIdList,itemNumList);
|
||||
}
|
||||
|
||||
|
||||
|
@ -3013,6 +3023,7 @@ public class MapLogic {
|
|||
// throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT);
|
||||
// }
|
||||
boolean consumeCount = false;
|
||||
boolean isFailed = false;
|
||||
Set<Integer> dailyPass = playerInfoManager.getDailyPass();
|
||||
if(type==2){
|
||||
if(!dailyPass.contains(id)){
|
||||
|
@ -3067,17 +3078,29 @@ public class MapLogic {
|
|||
builder.setDrop(drop);
|
||||
playerInfoManager.addDailyPass(id);
|
||||
consumeCount = true;
|
||||
}else{
|
||||
isFailed = true;
|
||||
}
|
||||
}else{
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
|
||||
if(consumeCount){
|
||||
boolean consume = PlayerLogic.getInstance().checkAndUpdate(user, sDailyChallengeConfig.getPrivilegeId()[1], 1);
|
||||
if(!consume){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
CommonProto.Drop drop = builder.getDrop();
|
||||
if(!isFailed){
|
||||
List<CommonProto.Item> itemDrop = drop.getItemlistList();
|
||||
List<Integer> itemIdList = new ArrayList<>();
|
||||
List<Integer> itemNumList = new ArrayList<>();
|
||||
itemDrop.forEach(item->{
|
||||
itemIdList.add(item.getItemId());
|
||||
itemIdList.add(item.getItemNum());
|
||||
});
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.COMPLETE_DAILY_DUNGEON.getType(),id,sDailyChallengeConfig.getMonsterId(),MonsterUtil.getMonsterForce(new int[]{sDailyChallengeConfig.getMonsterId()}),new Date(),"",0,itemIdList,itemNumList,type==1?"挑战":"扫荡");
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_CHALLENGE,sDailyChallengeConfig.getType());
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),builder.build());
|
||||
}
|
||||
|
|
|
@ -77,13 +77,13 @@ public abstract class AbstractMap implements IMap {
|
|||
MapManager mapManager = user.getMapManager();
|
||||
if (teamId == 0) {
|
||||
LOGGER.info("enterMap() uid=>{} teamId =>{} ", uid, teamId);
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
if (mapManager.getCurMapId() == 0) {
|
||||
if (mapManager.getCurMapId() == 0||mapManager.getCurXY()==0) {
|
||||
enterNewMap(user,mapId,teamId,mapEnterResponse);
|
||||
} else if (mapManager.getCurMapId() != mapId) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("地图错误,应进入" + mapManager.getCurMapId()));
|
||||
// throw new ErrorCodeException(ErrorCode.newDefineCode("地图错误,应进入" + mapManager.getCurMapId()));
|
||||
}else{
|
||||
mapEnterResponse.setCurXY(mapManager.getCurXY());
|
||||
}
|
||||
|
@ -173,12 +173,12 @@ public abstract class AbstractMap implements IMap {
|
|||
Map<Integer, SCMap> scMap = SCMap.sCMap.get(mapId);
|
||||
if (scMap == null) {
|
||||
LOGGER.info("enterMap() uid=>{} scMap == null =>{} ", user.getId(), mapId);
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
SChallengeConfig sChallengeConfig = STableManager.getConfig(SChallengeConfig.class).get(mapId);
|
||||
if (sChallengeConfig == null) {
|
||||
LOGGER.info("enterMap() uid=>{} sChallengeConfig == null =>{} ", user.getId(), mapId);
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("该地图不存在"));
|
||||
// throw new ErrorCodeException(ErrorCode.newDefineCode("该地图不存在"));
|
||||
}
|
||||
// 可进入地图条件判断
|
||||
int[][] openRule = sChallengeConfig.getOpenRule();
|
||||
|
@ -232,12 +232,12 @@ public abstract class AbstractMap implements IMap {
|
|||
MapManager mapManager = user.getMapManager();
|
||||
if (mapManager.getMapInfo() == null) {
|
||||
LOGGER.info("mapManager.getMapInfo() == null");
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
if (mapManager.getCanMoveTime() > 0) {
|
||||
long leftTime = mapManager.getCanMoveTime() - TimeUtils.now();
|
||||
if (leftTime > 0) {
|
||||
throw new ErrorCodeException(ErrorCode.HERO_LIVE_AGAIN,Collections.singletonList((leftTime / 1000)+""));
|
||||
// throw new ErrorCodeException(ErrorCode.HERO_LIVE_AGAIN,Collections.singletonList((leftTime / 1000)+""));
|
||||
}
|
||||
}
|
||||
Cell cell = mapManager.getMapInfo().get(mapManager.getTriggerXY());
|
||||
|
@ -245,14 +245,14 @@ public abstract class AbstractMap implements IMap {
|
|||
cell = mapManager.getMapInfo().get(mapManager.getCurXY());
|
||||
if (cell == null) {
|
||||
LOGGER.info("cell == null xy is wrong =>{} triggerXY=>{}", mapManager.getCurXY(), mapManager.getTriggerXY());
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("cell == null"));
|
||||
// throw new ErrorCodeException(ErrorCode.newDefineCode("cell == null"));
|
||||
}
|
||||
}
|
||||
int bigEventId = cell.getEventId();
|
||||
SEventPointConfig sEventPointConfig = STableManager.getConfig(SEventPointConfig.class).get(bigEventId);
|
||||
if (sEventPointConfig == null) {
|
||||
LOGGER.info("sEventPointConfig == null");
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
String fightReadyKey = RedisKey.getKey(RedisKey.FIGHT_READY, Integer.toString(uid), false);
|
||||
String fightReady = (String) RedisUtil.getInstence().get(fightReadyKey);
|
||||
|
@ -269,7 +269,7 @@ public abstract class AbstractMap implements IMap {
|
|||
int[] option = sEventPointConfig.getOption();
|
||||
if (option == null||option.length<1) {
|
||||
LOGGER.info("option == null sEventPointConfig.getId()=>{}", sEventPointConfig.getId());
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
groupId = monsterGroupChange(option[0]);
|
||||
}
|
||||
|
|
|
@ -82,9 +82,9 @@ public class TowerMap extends AbstractMap {
|
|||
|
||||
@Override
|
||||
public void enterMap(int uid, int mapId, int teamId, MapInfoProto.MapEnterResponse.Builder mapEnterResponse) throws Exception {
|
||||
if(teamId!= GlobalsDef.TRIAL_TEAM){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
// if(teamId!= GlobalsDef.TRIAL_TEAM){
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// }
|
||||
//进图时检测是否需要重置
|
||||
MapLogic.getInstance().checkTrialReset(UserManager.getUser(uid));
|
||||
|
||||
|
@ -94,7 +94,8 @@ public class TowerMap extends AbstractMap {
|
|||
if(curFloor<10000){
|
||||
STrialConfig sTrialConfig = STrialConfig.sTrialConfigMap.get(curFloor);
|
||||
if(sTrialConfig.getMapId()!=mapId){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
mapId = sTrialConfig.getMapId();
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
if(!trialInfo.getMapInfo().isEmpty()&&mapManager.getCurMapId()==0){
|
||||
|
@ -171,9 +172,9 @@ public class TowerMap extends AbstractMap {
|
|||
return;
|
||||
}
|
||||
int floor = mapManager.getTrialInfo().getFloor();
|
||||
if(floor>=101&&floor<=200){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
// if(floor>=101&&floor<=200){
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// }
|
||||
STrialConfig sTrialConfig;
|
||||
if(floor>10000){
|
||||
TreeMap<Integer,STrialConfig> sTrialConfigMap = (TreeMap<Integer,STrialConfig>) STrialConfig.sTrialConfigMap;
|
||||
|
@ -341,26 +342,26 @@ public class TowerMap extends AbstractMap {
|
|||
MapManager mapManager = user.getMapManager();
|
||||
if (mapManager.getMapInfo() == null) {
|
||||
LOGGER.info("fastFight mapManager.getMapInfo() == null");
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
Cell cell = mapManager.getMapInfo().get(mapManager.getTriggerXY());
|
||||
if (cell == null) {
|
||||
cell = mapManager.getMapInfo().get(mapManager.getCurXY());
|
||||
if (cell == null) {
|
||||
LOGGER.info("cell == null xy is wrong =>{} triggerXY=>{}", mapManager.getCurXY(), mapManager.getTriggerXY());
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
int bigEventId = cell.getEventId();
|
||||
SEventPointConfig sEventPointConfig = STableManager.getConfig(SEventPointConfig.class).get(bigEventId);
|
||||
if (sEventPointConfig == null) {
|
||||
LOGGER.info("sEventPointConfig == null");
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
int[] option = sEventPointConfig.getOption();
|
||||
if (option == null) {
|
||||
LOGGER.info("option == null sEventPointConfig.getId()=>{}", sEventPointConfig.getId());
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
int groupId = option[0];
|
||||
int destoryXY = mapManager.getTriggerXY();
|
||||
|
@ -373,14 +374,14 @@ public class TowerMap extends AbstractMap {
|
|||
//校验结果码 1:胜利
|
||||
int resultCode = checkResult[0];
|
||||
if (resultCode == -1) {
|
||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
// throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
}
|
||||
mapManager.setLastFightResult(resultCode);
|
||||
//更新血量
|
||||
TrialInfo trialInfo = mapManager.getTrialInfo();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(mapManager.getTeamId());
|
||||
if(teamPosHeroInfos==null||teamPosHeroInfos.size()!=1){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
// throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
|
||||
TrailHero trailHero = trialInfo.getHeroInfo().get(teamPosHeroInfos.get(0).getHeroId());
|
||||
|
@ -464,7 +465,7 @@ public class TowerMap extends AbstractMap {
|
|||
MapManager mapManager = user.getMapManager();
|
||||
// LOGGER.info("进入召唤boss");
|
||||
if(mapManager.getTrialInfo().getEnergy()<100){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("精气值不足!!"));
|
||||
// throw new ErrorCodeException(ErrorCode.newDefineCode("精气值不足!!"));
|
||||
}
|
||||
int currTower = mapManager.getTrialInfo().getFloor();
|
||||
STrialConfig config = STrialConfig.sTrialConfigMap.get(currTower);
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
package com.ljsd.jieling.handler.situationHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.SituationLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/8/6
|
||||
* @discribe
|
||||
*/
|
||||
@Component
|
||||
public class GetAllSituationStatusHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.SITUATION_INFO_GET_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
SituationLogic.getInstance().getAllSituationStatus(iSession, MessageTypeProto.MessageType.SITUATION_INFO_GET_RESPONSE);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.ljsd.jieling.handler.situationHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.SituationLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/8/6
|
||||
* @discribe
|
||||
*/
|
||||
@Component
|
||||
public class SituationChallengeHandler extends BaseHandler<MapInfoProto.SituationChallengeRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.SITUATION_CHALLENGE_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, MapInfoProto.SituationChallengeRequest proto) throws Exception {
|
||||
SituationLogic.getInstance().situationsChallenge(iSession,proto.getId(),proto.getType(), MessageTypeProto.MessageType.SITUATION_CHALLENGE_RESPONSE);
|
||||
}
|
||||
}
|
|
@ -45,16 +45,12 @@ public enum ReportEventEnum {
|
|||
ALLOW_FRIENDS_ASK(31,"allow_friends_ask", new CommonEventHandler(),new String[]{"target_id","target_name","target_level","entrance"}),
|
||||
SEND_MESSAGE(32,"send_message", new CommonEventHandler(),new String[]{"message_type","message_content"}),
|
||||
OPEN_MAIL(33,"open_mail", new CommonEventHandler(),new String[]{""}),
|
||||
START_DAILY_DUNGEON(34,"start_daily_dungeon", new CommonEventHandler(),new String[]{""}),
|
||||
COMPLETE_DAILY_DUNGEON(35,"complete_daily_dungeon", new CommonEventHandler(),new String[]{""}),
|
||||
START_XINMO(36,"start_xinmo", new CommonEventHandler(),new String[]{""}),
|
||||
//-------新一期
|
||||
COMPLETE_DAILY_DUNGEON(35,"complete_daily_dungeon", new CommonEventHandler(),new String[]{"stage_id","enemy_id","enemy_capacity","start_time","enemy_hero_list","left_challenge_nums","rewards_id_list","rewards_num_list","pass_type"}),
|
||||
|
||||
COMPLETE_XINMO(37,"complete_xinmo", new CommonEventHandler(),new String[]{""}),
|
||||
COMPLETE_XINMO(37,"complete_xinmo", new CommonEventHandler(),new String[]{"stage_id","enemy_id","enemy_capacity","start_time","enemy_hero_list","rewards_id_list","rewards_num_list"}),
|
||||
|
||||
|
||||
START_CHECHI(38,"start_chechi", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
COMPLETE_CHECHI(39,"complete_chechi", new CommonEventHandler(),new String[]{""}),
|
||||
COMPLETE_CHECHI(39,"start_chechi", new CommonEventHandler(),new String[]{"stage_id","stage_type","Integral_entrance","Integral"}),
|
||||
|
||||
START_PANOPTIC_MIRROR(40,"start_panoptic_mirror", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
|
@ -62,21 +58,22 @@ public enum ReportEventEnum {
|
|||
|
||||
COMPLETE_PANOPTIC_MIRROR(42,"complete_panoptic_mirror", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
EQUIP_SYNTHESIS(43,"equip_synthesis", new CommonEventHandler(),new String[]{""}),
|
||||
EQUIP_SYNTHESIS(43,"equip_synthesis", new CommonEventHandler(),new String[]{"item_id","item_name","cost_item_id","cost_amount"}),
|
||||
|
||||
TREASURE_SYNTHESIS(44,"treasure_synthesis", new CommonEventHandler(),new String[]{""}),
|
||||
TREASURE_SYNTHESIS(44,"treasure_synthesis", new CommonEventHandler(),new String[]{"item_id","item_name","cost_item_id","cost_amount"}),
|
||||
|
||||
FATALITY_SYNTHESIS(45,"fatality_synthesis", new CommonEventHandler(),new String[]{""}),
|
||||
FATALITY_SYNTHESIS(45,"fatality_synthesis", new CommonEventHandler(),new String[]{"item_id","item_name","cost_item_id"}),
|
||||
NORMAL_SUMMON(46,"Normal_summon", new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||
|
||||
FRIENDSHIP_SUMMON(47,"friendship_summon", new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||
|
||||
GODS_SUMMON(48,"gods_summon", new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||
SUMMON_HERO(49,"summon_hero", new CommonEventHandler(),new String[]{""}),//四元阵
|
||||
|
||||
HERO_COMPOSITION(50,"hero_composition", new CommonEventHandler(),new String[]{""}),
|
||||
SUMMON_HERO(49,"summon_hero", new CommonEventHandler(),new String[]{"item_id","hero_group","get_amount"}),//四元阵
|
||||
|
||||
SEND_HERO(51,"send_hero", new CommonEventHandler(),new String[]{""}),
|
||||
HERO_COMPOSITION(50,"hero_composition", new CommonEventHandler(),new String[]{"hero_id","hero_level","hero_quality","reward_list","reward_nums_list"}),
|
||||
|
||||
SEND_HERO(51,"send_hero", new CommonEventHandler(),new String[]{"hero_id","hero_level","hero_quality","reward_list","reward_nums_list"}),
|
||||
TREASURE_DECOMPOSITION(52,"treasure_decomposition", new CommonEventHandler(),new String[]{""}),
|
||||
|
||||
VIP_LEVEL_UP(100,"", new VipLevelUpEventHandler(),new String[]{""});
|
||||
|
|
|
@ -334,7 +334,9 @@ public class GlobalDataManaager implements IManager {
|
|||
FriendLogic.getInstance().refreshState(session);
|
||||
PlayerLogic.getInstance().sendTimingMail(user);
|
||||
user.getGuildMyInfo().setLastHurt(0);
|
||||
|
||||
if(TimeUtils.isSpanTime(user.getPlayerInfoManager().getLoginTime(),TimeUtils.now(),1,5)){
|
||||
user.getPlayerInfoManager().updateSituationPass(new HashMap<>());
|
||||
}
|
||||
if(fBuilder!=null){
|
||||
fBuilder.setSignInInfo(CommonProto.SignInInfo.newBuilder().setDays(user.getPlayerInfoManager().getSign()+1).setState(user.getPlayerInfoManager().getSignTotay()).build());
|
||||
user.getPlayerInfoManager().setLoginTime(TimeUtils.now());
|
||||
|
|
|
@ -0,0 +1,303 @@
|
|||
package com.ljsd.jieling.logic;
|
||||
|
||||
|
||||
import com.ljsd.fight.CheckFight;
|
||||
import com.ljsd.jieling.config.clazzStaticCfg.RewardStaticConfig;
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
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;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.*;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||
import com.ljsd.jieling.util.FightDataUtil;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import com.ljsd.jieling.util.MonsterUtil;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
import org.luaj.vm2.LuaValue;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static com.ljsd.jieling.logic.fight.FightUtil.makePersonFightData;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/8/6
|
||||
* @discribe
|
||||
*/
|
||||
public class SituationLogic {
|
||||
|
||||
public static SituationLogic getInstance() {
|
||||
return SituationLogic.Instance.instance;
|
||||
}
|
||||
|
||||
public static class Instance {
|
||||
public final static SituationLogic instance = new SituationLogic();
|
||||
}
|
||||
|
||||
private int[][] openConfig ;
|
||||
|
||||
private int[] status ;
|
||||
|
||||
private int[] overTime;
|
||||
|
||||
|
||||
public void createCheckStatusTask(){
|
||||
Runnable runnable = this::checkStatus;
|
||||
runnable.run();
|
||||
}
|
||||
private void checkStatus(){
|
||||
if(status==null||overTime==null||openConfig==null){
|
||||
status = new int[4];
|
||||
openConfig = SSpecialConfig.getTwiceArrayValue(SSpecialConfig.XUANYUAN_OPEN_TIME);
|
||||
overTime = new int[4];
|
||||
doCheck();
|
||||
}else{
|
||||
if(TimeUtils.getHourOfDay()!=5){
|
||||
return;
|
||||
}
|
||||
doCheck();
|
||||
}
|
||||
}
|
||||
private void doCheck(){
|
||||
long now = TimeUtils.now();
|
||||
int hourOfDay = TimeUtils.getHourOfDay();
|
||||
int week = TimeUtils.getDayOfWeek();
|
||||
if(hourOfDay<5){
|
||||
week = week==0?7:week-1;
|
||||
}
|
||||
boolean isIndication = false;
|
||||
for(int[] config:openConfig){
|
||||
boolean isOpen = false;
|
||||
for(int i = 1;i<config.length;i++){
|
||||
if(week!=config[i]){
|
||||
continue;
|
||||
}
|
||||
isOpen = true;
|
||||
}
|
||||
if((isOpen&&status[config[0]-1]==0)||(!isOpen&&status[config[0]-1]==1)){
|
||||
isIndication = true;
|
||||
}
|
||||
status[config[0]-1] = isOpen?1:0;
|
||||
overTime[config[0]-1] =isOpen?(int)(TimeUtils.getLastOrUnderHour(now,5,0,false)/1000):0;
|
||||
}
|
||||
if(isIndication){
|
||||
//周一刷新
|
||||
boolean remove = false;
|
||||
if(TimeUtils.getDayOfWeek()==1&&TimeUtils.getHourOfDay()==5&&TimeUtils.getMiunte()==0){
|
||||
remove = true;
|
||||
}
|
||||
if(remove){
|
||||
//发排行奖励,删除排行信息
|
||||
Runnable runnable = this::rankReward;
|
||||
runnable.run();
|
||||
}
|
||||
try {
|
||||
Map<Integer, ISession> sessionMap = OnlineUserManager.sessionMap;
|
||||
for(Map.Entry<Integer, ISession> entry:sessionMap.entrySet()){
|
||||
//发推送
|
||||
PlayerManager playerInfoManager= UserManager.getUser(entry.getKey()).getPlayerInfoManager();
|
||||
if (remove){
|
||||
playerInfoManager.updateSituationPass(new HashMap<>());
|
||||
}
|
||||
MapInfoProto.GetAllSituationInfoResponse.Builder indication = MapInfoProto.GetAllSituationInfoResponse.newBuilder();
|
||||
for(int i = 0 ; i < status.length;i++){
|
||||
if(status[i]==0){
|
||||
continue;
|
||||
}
|
||||
CommonProto.SituationInfo info = CommonProto.SituationInfo.newBuilder().setId(i+1)
|
||||
.setOverTime(overTime[i])
|
||||
.setPassId(playerInfoManager.getSituationPass().getOrDefault(i+1,0)).build();
|
||||
indication.addInfos(info);
|
||||
}
|
||||
MessageUtil.sendIndicationMessage(entry.getValue(),1,MessageTypeProto.MessageType.SITUATION_INFO_INDICATION_VALUE,indication.build(),true);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void rankReward() {
|
||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.SITUATION_RANK.getType());
|
||||
Map<Integer, SRaceTowerRewardConfig> rewardConfigMap = RewardStaticConfig.getRaceRewardConfigMap();
|
||||
Set<ZSetOperations.TypedTuple<String>> rankInfos = rank.getRankByKey("", 0, rewardConfigMap.size());
|
||||
if(rankInfos.size()<1){
|
||||
return;
|
||||
}
|
||||
try{
|
||||
int index = 1;
|
||||
for(ZSetOperations.TypedTuple<String> rankInfo:rankInfos){
|
||||
System.out.println("fasong11111111111");
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("xuanyuan_Ranking_reward_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("xuanyuan_Ranking_reward_txt", new Object[]{index});
|
||||
SRaceTowerRewardConfig sRaceTowerRewardConfig = rewardConfigMap.get(index);
|
||||
if(sRaceTowerRewardConfig==null){
|
||||
continue;
|
||||
}
|
||||
String mailReward = ItemUtil.getMailReward(sRaceTowerRewardConfig.getReward());
|
||||
MailLogic.getInstance().sendMail(Integer.parseInt(rankInfo.getValue()), title, content, mailReward, TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
|
||||
index++;
|
||||
}
|
||||
RedisUtil.getInstence().del(RedisKey.getKey(rank.getRedisKey(),"",false));
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void getAllSituationStatus(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
MapInfoProto.GetAllSituationInfoResponse.Builder response = MapInfoProto.GetAllSituationInfoResponse.newBuilder();
|
||||
Map<Integer, Integer> situationPass = user.getPlayerInfoManager().getSituationPass();
|
||||
if(status==null){
|
||||
checkStatus();
|
||||
}
|
||||
for(int i = 0 ; i < status.length;i++){
|
||||
if(status[i]==0){
|
||||
continue;
|
||||
}
|
||||
CommonProto.SituationInfo info = CommonProto.SituationInfo.newBuilder().setId(i+1)
|
||||
.setOverTime(overTime[i])
|
||||
.setPassId(situationPass.getOrDefault(i+1,0)).build();
|
||||
response.addInfos(info);
|
||||
}
|
||||
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||
}
|
||||
|
||||
public void situationsChallenge(ISession session, int id, int type , MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
MapInfoProto.SituationChallengeResponse.Builder builder= MapInfoProto.SituationChallengeResponse.newBuilder();
|
||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
// //次数校验
|
||||
SRaceTowerConfig sRaceTowerConfig = STableManager.getConfig(SRaceTowerConfig.class).get(id);
|
||||
Map<Integer,Integer> situationPass = playerInfoManager.getSituationPass();
|
||||
|
||||
boolean check = PlayerLogic.getInstance().check(user, sRaceTowerConfig.getPrivilege()[0], 1);
|
||||
if(!check){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
|
||||
boolean consumeCount = false;
|
||||
if(type==2){
|
||||
if(!situationPass.containsKey(sRaceTowerConfig.getType())||situationPass.get(sRaceTowerConfig.getType())<id){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sRaceTowerConfig.getReward(), 1, 0, BIReason.SITUATION_CHALLENGE_REWARD);
|
||||
builder.setDrop(drop);
|
||||
consumeCount = true;
|
||||
}else if(type==1){
|
||||
//判断本关是否已过
|
||||
if(situationPass.containsKey(sRaceTowerConfig.getType())&&situationPass.get(sRaceTowerConfig.getType())>=id){
|
||||
throw new ErrorCodeException(ErrorCode.DAILY_ALREADY_PASS);
|
||||
}
|
||||
// //判断上一关是否已过
|
||||
int openRules = sRaceTowerConfig.getOpenRules();
|
||||
if(openRules!=0&&situationPass.get(sRaceTowerConfig.getType())!=openRules){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
//编队规则校验
|
||||
int formation = sRaceTowerConfig.getFormation();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(formation);
|
||||
if(teamPosHeroInfos==null||teamPosHeroInfos.isEmpty()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
int[] heroType = new int[5];
|
||||
teamPosHeroInfos.forEach(hero->{
|
||||
int tempId = user.getHeroManager().getHero(hero.getHeroId()).getTemplateId();
|
||||
int profession = SCHero.getsCHero().get(tempId).getPropertyName();
|
||||
heroType[profession] = heroType[profession]+1;
|
||||
});
|
||||
for(int[] rule:sRaceTowerConfig.getTeamRules()){
|
||||
if(heroType[rule[0]]<rule[1]){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
Map<Integer,List<Integer>> buffMap = new HashMap<>();
|
||||
for(int[] buffid:sRaceTowerConfig.getAttribute()){
|
||||
buffMap.computeIfAbsent(buffid[0],n->new ArrayList<>()).add(buffid[1]);
|
||||
}
|
||||
//组装战斗数据
|
||||
PVEFightEvent pveFightEvent = new PVEFightEvent(user.getId(), formation, 20, "", GameFightType.DailyChallenge, sRaceTowerConfig.getMonsterId(), 3);
|
||||
// FightResult fightResult = FightDispatcher.dispatcher(pveFightEvent);
|
||||
FightResult fightResult = getFightForSituation(pveFightEvent, buffMap);
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder()
|
||||
.setFightMaxTime(20)
|
||||
.setFightSeed(fightResult.getSeed())
|
||||
.setHeroFightInfos(fightResult.getFightTeamInfo())
|
||||
.addAllMonsterList(fightResult.getMonsterTeamList())
|
||||
.build();
|
||||
int[] checkResult = fightResult.getCheckResult();
|
||||
builder.setFightData(fightData);
|
||||
//挑战成功
|
||||
if(checkResult[0]>0){
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sRaceTowerConfig.getFirstReward(), 1, 0, BIReason.SITUATION_CHALLENGE_REWARD);
|
||||
builder.setDrop(drop);
|
||||
situationPass.put(sRaceTowerConfig.getType(),id);
|
||||
playerInfoManager.updateSituationPass(situationPass);
|
||||
AbstractRank rankEnum = RankContext.getRankEnum(RankEnum.SITUATION_RANK.getType());
|
||||
int score = Double.valueOf(rankEnum.getScoreById(user.getId(), "")).intValue();
|
||||
rankEnum.addRank(user.getId(),"",score==-1?1:score+1);
|
||||
consumeCount = true;
|
||||
}
|
||||
}else{
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
// ReportUtil.onReportEvent(user, ReportEventEnum.START_DAILY_DUNGEON.getType(),id,sDailyChallengeConfig.getMonsterId(), MonsterUtil.getMonsterForce(new int[]{sDailyChallengeConfig.getMonsterId()}),"",0);
|
||||
if(consumeCount){
|
||||
boolean consume = PlayerLogic.getInstance().checkAndUpdate(user, sRaceTowerConfig.getPrivilege()[0], 1);
|
||||
if(!consume){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
// user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_CHALLENGE,sDailyChallengeConfig.getType());
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),builder.build());
|
||||
}
|
||||
public static FightResult getFightForSituation(FightEvent fightEvent,Map<Integer,List<Integer>> buffInfo){
|
||||
PVEFightEvent pveFightEvent = (PVEFightEvent)fightEvent;
|
||||
User userInMem = UserManager.getUserInMem(pveFightEvent.getAttackUid());
|
||||
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.getFightTeamInfoWithSomeBuff(userInMem, pveFightEvent.getTeamId(),pveFightEvent.getAttackBloodMap(),buffInfo);
|
||||
int fightSeed = FightUtil.getFightSeed();
|
||||
List<CommonProto.FightTeamInfo> monsterfightTeamInfos = FightUtil.makeMonsterFightData(pveFightEvent.getMonsterGroupId(), pveFightEvent.getNums());
|
||||
LuaValue getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, monsterfightTeamInfos);
|
||||
LuaValue getOptionData = FightDataUtil.getOptionData(pveFightEvent.getAttackUid()+"");
|
||||
int[] fightResult = CheckFight.getInstance().checkFight(fightSeed, fightEvent.getMostTime(), getFightData, getOptionData, fightEvent.getFightType().getFightType());
|
||||
|
||||
FightResult.Builder builder = FightResult.newBuilder();
|
||||
builder.setCheckResult(fightResult);
|
||||
builder.setSeed(fightSeed);
|
||||
builder.setFightTeamInfo(fightTeamInfo);
|
||||
builder.setMonsterTeamList(monsterfightTeamInfos);
|
||||
CommonProto.FightData fightData = CommonProto.FightData.newBuilder().setFightType(fightEvent.getFightType().getFightType().getType()).setHeroFightInfos(fightTeamInfo).addAllMonsterList(monsterfightTeamInfos).setFightSeed(fightSeed).setFightMaxTime(fightEvent.getMostTime()).build();
|
||||
builder.setFightData(fightData);
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -164,7 +164,7 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
|||
}
|
||||
}
|
||||
// KtEventUtils.onKtEvent(user, ParamEventBean.UserActivityEvent, id, missionId);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.COMPLETE_ACTIVITY.getType(),String.valueOf(id),String.valueOf(missionId),reward);
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.COMPLETE_ACTIVITY.getType(),String.valueOf(id),String.valueOf(missionId),reward[0]);
|
||||
PlayerInfoProto.TakeActivityRewardResponse build = PlayerInfoProto.TakeActivityRewardResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
||||
return true;
|
||||
|
|
|
@ -47,7 +47,7 @@ public class Hero extends MongoBase {
|
|||
private int isLock;
|
||||
|
||||
private int createType ;
|
||||
|
||||
private int changeId ;
|
||||
private Set<String> jewelInfo = new HashSet<>();
|
||||
|
||||
public Hero(){
|
||||
|
@ -189,7 +189,13 @@ public class Hero extends MongoBase {
|
|||
|
||||
|
||||
public Map<Integer, Integer> getSoulEquipByPositionMap() {
|
||||
return soulEquipByPositionMap==null?new HashMap<>():soulEquipByPositionMap;
|
||||
if(soulEquipByPositionMap == null){
|
||||
Map<Integer,Integer> map = new HashMap<>();
|
||||
updateString("soulEquipByPositionMap" ,map);
|
||||
return map;
|
||||
}else {
|
||||
return soulEquipByPositionMap;
|
||||
}
|
||||
}
|
||||
|
||||
public void updateSoulEquipPositionMap(int position,int equipId) {
|
||||
|
@ -273,6 +279,11 @@ public class Hero extends MongoBase {
|
|||
updateString("jewelInfo",jewelInfo);
|
||||
}
|
||||
|
||||
public void setJewelInfo(Set<String> jewelInfo) {
|
||||
this.jewelInfo = jewelInfo;
|
||||
updateString("jewelInfo",this.jewelInfo);
|
||||
}
|
||||
|
||||
public int getCreateType() {
|
||||
return createType;
|
||||
}
|
||||
|
@ -283,5 +294,11 @@ public class Hero extends MongoBase {
|
|||
}
|
||||
|
||||
|
||||
public void setChangeId(int changeId) {
|
||||
this.changeId = changeId;
|
||||
}
|
||||
|
||||
public int getChangeId() {
|
||||
return changeId;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,6 +116,8 @@ public class PlayerManager extends MongoBase {
|
|||
|
||||
private String ip;
|
||||
|
||||
private Map<Integer,Integer> situationPass = new HashMap<>();
|
||||
|
||||
|
||||
public PlayerManager(){
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
|
@ -774,4 +776,14 @@ public class PlayerManager extends MongoBase {
|
|||
updateString("bundle_id",bundle_id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
public Map<Integer, Integer> getSituationPass() {
|
||||
return situationPass;
|
||||
}
|
||||
|
||||
public void updateSituationPass(Map<Integer, Integer> situationPass){
|
||||
this.situationPass = situationPass;
|
||||
updateString("situationPass",situationPass);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -211,10 +211,8 @@ public class GuildLogic {
|
|||
if(StringUtil.isEmpty(familyName)){
|
||||
throw new ErrorCodeException(ErrorCode.NULL_NAME);
|
||||
}
|
||||
boolean result = true;
|
||||
if(!StringUtil.isEmpty(announce)){
|
||||
result = ShieldedWordUtils.checkName(user,announce,false,ChatContentType.FAMILY_NAME);
|
||||
if (!result) {
|
||||
if (!ShieldedWordUtils.checkName(user,familyName,false,ChatContentType.FAMILY_NAME)||!ShieldedWordUtils.checkName(user,announce,false,ChatContentType.FAMILY_NAME)) {
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_IN_SENSITIVE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ public class CombatLogic {
|
|||
}
|
||||
}
|
||||
for(Map.Entry<Integer,Integer> entry:effectValueMap.entrySet()){
|
||||
int finalValue = value.get(entry.getKey()) + entry.getValue();
|
||||
int finalValue = value.getOrDefault(entry.getKey(),0) + entry.getValue();
|
||||
if(finalValue < 0){
|
||||
finalValue = 0;
|
||||
}
|
||||
|
|
|
@ -287,6 +287,43 @@ public class FightUtil {
|
|||
.setSpecialPassive(SpecialForTeamBuildEnum.toParm(teamId,user))
|
||||
.build();
|
||||
}
|
||||
//
|
||||
public static CommonProto.FightTeamInfo getFightTeamInfoWithSomeBuff(User user, int teamId, Map<String, Integer> attackBloodMap,Map<Integer,List<Integer>> buffInfo) {
|
||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
Hero hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||
if (hero == null) {
|
||||
continue;
|
||||
}
|
||||
Map<Integer, Integer> heroAttributeMap = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero, false, teamId);
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
if(buffInfo.containsKey(scHero.getPropertyName())){
|
||||
CombatLogic.getInstance().bufferOneHeroAttrAfterEat(heroAttributeMap,buffInfo.get(scHero.getPropertyName()));
|
||||
}
|
||||
StringBuilder skillSb = new StringBuilder();
|
||||
StringBuilder propertySb = new StringBuilder();
|
||||
String heroSkill = HeroLogic.getInstance().getHeroSkills(user,hero,skillSb).toString();
|
||||
String property = HeroLogic.getInstance().getHeroPropertyBuilder(propertySb, hero.getTemplateId(),hero.getLevel(), heroAttributeMap).toString();
|
||||
CommonProto.FightUnitInfo heroFightInfo = CommonProto.FightUnitInfo
|
||||
.newBuilder()
|
||||
.setUnitId(Integer.toString(hero.getTemplateId()))
|
||||
.setUnitSkillIds(heroSkill.substring(0,heroSkill.length()-1))
|
||||
.setProperty(property.substring(0, property.length()-1))
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(hero.getStar())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
return CommonProto.FightTeamInfo.
|
||||
newBuilder()
|
||||
.addAllFightUnitList(heroFightInfos)
|
||||
.setTeamSkillList(HeroLogic.getInstance().getPokenmonSkills(user,teamId))
|
||||
.setTeamPassiveList(HeroLogic.getInstance().getPokenmonPassiveSkills(user,teamId))
|
||||
.setSpecialPassive(SpecialForTeamBuildEnum.toParm(teamId,user))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -220,6 +220,7 @@ public class HeroLogic{
|
|||
|
||||
//检验消耗
|
||||
boolean allowFree = false;
|
||||
int[] costAmount = new int[1];
|
||||
int privilege = sLotterySetting.getFreeTimes();
|
||||
if(privilege!=0){
|
||||
allowFree = PlayerLogic.getInstance().checkAndUpdate(user,privilege, perCount);
|
||||
|
@ -230,6 +231,7 @@ public class HeroLogic{
|
|||
int [][] costItems = new int[][]{cost};
|
||||
enoughCost = ItemUtil.itemCost(user, costItems,BIReason.RANDOM_HERO_CONSUME,type);
|
||||
if(enoughCost){
|
||||
costAmount = cost;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -250,9 +252,13 @@ public class HeroLogic{
|
|||
resultRandom[i] =sLotteryRewardConfig.getReward();
|
||||
index = i;
|
||||
}
|
||||
//上报抽卡
|
||||
reportRandom(user,sLotterySetting,resultRandom,costAmount);
|
||||
for(int i = 0;i<tenTimesMustGetItem.length;i++) {
|
||||
resultRandom[i+index+1] = tenTimesMustGetItem[i];
|
||||
}
|
||||
|
||||
|
||||
Poster.getPoster().dispatchEvent(new RandomCardEvent(user.getId(),sLotterySetting.getActivityId(),heroManager.getRandomPoolByType().get(sLotterySetting.getMergePool()),sLotterySetting.getPerCount()));
|
||||
// //1群英招募
|
||||
HeroInfoProto.HeroRandResponse.Builder builder = HeroInfoProto.HeroRandResponse.newBuilder();
|
||||
|
@ -267,6 +273,53 @@ public class HeroLogic{
|
|||
System.out.println(System.currentTimeMillis()-time);
|
||||
}
|
||||
|
||||
|
||||
private void reportRandom(User user,SLotterySetting sLotterySetting,int[][] resultRandom,int[] costItem){
|
||||
int lotteryType = sLotterySetting.getLotteryType();
|
||||
ReportEventEnum eventEnum = null;
|
||||
switch (lotteryType){
|
||||
case 5:
|
||||
eventEnum = ReportEventEnum.NORMAL_SUMMON;
|
||||
break;
|
||||
case 4:
|
||||
eventEnum = ReportEventEnum.FRIENDSHIP_SUMMON;
|
||||
break;
|
||||
case 1:
|
||||
eventEnum = ReportEventEnum.GODS_SUMMON;
|
||||
break;
|
||||
case 2:
|
||||
eventEnum = ReportEventEnum.SUMMON_HERO;
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
if(eventEnum==null){
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if(eventEnum == ReportEventEnum.SUMMON_HERO){
|
||||
ReportUtil.onReportEvent(user,eventEnum.getType(),String.valueOf(resultRandom[0][0]),resultRandom[0][1]);
|
||||
return;
|
||||
}
|
||||
List<String> result = new ArrayList<>(resultRandom.length);
|
||||
for(int[] random:resultRandom){
|
||||
if(random==null){
|
||||
continue;
|
||||
}
|
||||
SCHero scHero = SCHero.getsCHero().get(random[0]);
|
||||
if(scHero==null){
|
||||
result.add(String.valueOf(random[0]));
|
||||
}else{
|
||||
result.add(random[0]+"-"+scHero.getStar());
|
||||
}
|
||||
}
|
||||
ReportUtil.onReportEvent(user,eventEnum.getType(),"",String.valueOf(sLotterySetting.getPerCount()),String.valueOf(costItem[0]),String.valueOf(costItem[1]),result);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 每次抽取
|
||||
* @param user
|
||||
|
@ -274,7 +327,7 @@ public class HeroLogic{
|
|||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private int randomOne(User user,int type) throws Exception {
|
||||
public static int randomOne(User user,int type) throws Exception {
|
||||
SLotterySetting sLotterySetting = STableManager.getConfig(SLotterySetting.class).get(type);
|
||||
int mergePool = sLotterySetting.getMergePool();
|
||||
List<SLotterySpecialConfig> specialConfigs = SLotterySpecialConfig.getLotterySpecialConfigListByType(mergePool);
|
||||
|
@ -401,7 +454,7 @@ public class HeroLogic{
|
|||
return poolId;
|
||||
}
|
||||
|
||||
private int getPooId(SLotterySetting sLotterySetting) throws Exception {
|
||||
private static int getPooId(SLotterySetting sLotterySetting) throws Exception {
|
||||
int[][] diamondBoxContain = sLotterySetting.getDiamondBoxContain();
|
||||
int totalWeight = 0;
|
||||
for(int i=0;i<diamondBoxContain.length;i++){
|
||||
|
@ -436,7 +489,7 @@ public class HeroLogic{
|
|||
|
||||
|
||||
|
||||
public SLotteryRewardConfig randomHeroByPoolId(int poolId,int randomCount,int userLevel){
|
||||
public static SLotteryRewardConfig randomHeroByPoolId(int poolId,int randomCount,int userLevel){
|
||||
List<SLotteryRewardConfig> sLotteryRewardConfigs = new ArrayList<>();
|
||||
List<SLotteryRewardConfig> sLotteryRewardConfigListByPoolId = SLotteryRewardConfig.getSLotteryRewardConfigListByPoolId(poolId);
|
||||
int totalCountByPoolId =0;
|
||||
|
@ -864,12 +917,15 @@ public class HeroLogic{
|
|||
}
|
||||
|
||||
//删除hero
|
||||
CommonProto.Drop.Builder baseBuilder = ItemLogic.getInstance().decomposeHero(session,new LinkedList<>(removeHeroIds),Collections.singleton(26),MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE);
|
||||
//改成归元获得
|
||||
// CommonProto.Drop.Builder baseBuilder = heroBackDrop(user,new ArrayList<>(removeHeroIds),10000,BIReason.UPHERO_DECOMPOS_HERO_REWARD,true);
|
||||
// CommonProto.Drop.Builder baseBuilder = ItemLogic.getInstance().decomposeHero(session,new LinkedList<>(removeHeroIds),Collections.singleton(26),MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE);
|
||||
//改成归元获得,同时返还法宝获得
|
||||
CommonProto.Drop.Builder baseBuilder = heroBackDrop(user,new ArrayList<>(removeHeroIds),10000,BIReason.UPHERO_DECOMPOS_HERO_REWARD,true);
|
||||
|
||||
for(String rmHeroId:removeHeroIds){
|
||||
heroManager.removeHero(uid,rmHeroId);
|
||||
}
|
||||
|
||||
// recyleHeroBySystem(user,removeHeroIds);
|
||||
// recyleHeroBySystem(user,removeHeroIds);
|
||||
rankUpHeroExecute(targetHero);
|
||||
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),targetHero.getTemplateId(),targetHero.getStar()));
|
||||
if(targetHero.getStar()>=5&&targetHero.getStar()!=15){
|
||||
|
@ -2189,19 +2245,16 @@ public class HeroLogic{
|
|||
|
||||
|
||||
//妖灵师是否在阵容中
|
||||
public boolean isBattleArray (User user,String heroId){
|
||||
public boolean isBattleArray (User user,String heroId,int[] teamId){
|
||||
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero();
|
||||
//判断是否不可下阵中有该英雄
|
||||
AtomicBoolean result = new AtomicBoolean(true);
|
||||
int[] teamId = SSpecialConfig.getOnceArrayValue(SSpecialConfig.HERO_RESOLVE_LICENCE);
|
||||
|
||||
|
||||
List<Integer> list = new ArrayList<>();
|
||||
Arrays.stream(teamId).forEach(i->list.add(i));
|
||||
|
||||
list.stream().filter(tId->teamPosForHero.containsKey(tId)).forEach(tId->teamPosForHero.get(tId).forEach(hero->{
|
||||
if(hero.getHeroId().equals(heroId)){
|
||||
result.set(false);
|
||||
}
|
||||
}));
|
||||
AtomicBoolean result = isInTeams(user, heroId, teamId);
|
||||
|
||||
//直接删除英雄
|
||||
if(result.get()){
|
||||
teamPosForHero.entrySet().stream().filter(entry->
|
||||
|
@ -2227,6 +2280,22 @@ public class HeroLogic{
|
|||
return result.get();
|
||||
}
|
||||
|
||||
public AtomicBoolean isInTeams(User user,String heroId,int[] teamId){
|
||||
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero();
|
||||
//判断是否不可下阵中有该英雄
|
||||
AtomicBoolean result = new AtomicBoolean(true);
|
||||
|
||||
List<Integer> list = new ArrayList<>();
|
||||
Arrays.stream(teamId).forEach(i->list.add(i));
|
||||
|
||||
list.stream().filter(tId->teamPosForHero.containsKey(tId)).forEach(tId->teamPosForHero.get(tId).forEach(hero->{
|
||||
if(hero.getHeroId().equals(heroId)){
|
||||
result.set(false);
|
||||
}
|
||||
}));
|
||||
return result;
|
||||
}
|
||||
|
||||
public int calPokenmonForce(Pokemon pokemon){
|
||||
Map<Integer,Integer> pokemonAttributeMap = new HashMap<>();
|
||||
combinePokemonAttribute(pokemonAttributeMap, pokemon,false);
|
||||
|
@ -2356,7 +2425,16 @@ public class HeroLogic{
|
|||
if(!b){
|
||||
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
|
||||
}
|
||||
//单纯归元神将,不归元法宝
|
||||
CommonProto.Drop.Builder drop = heroBackDrop(user, heroList, returnPercent, BIReason.HERO_BACK_REWARD,false);
|
||||
List<CommonProto.Item> itemList = drop.getItemlistList();
|
||||
List<Integer> itemId = new ArrayList<>(itemList.size());
|
||||
List<Integer> itemNum = new ArrayList<>(itemList.size());
|
||||
itemList.forEach(item->{
|
||||
itemId.add(item.getItemId());
|
||||
itemNum.add(item.getItemNum());
|
||||
});
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.HERO_COMPOSITION.getType(),String.valueOf(hero.getTemplateId()),hero.getLevel(),hero.getStar(),itemId,itemNum);
|
||||
hero.setLevel(user,1);
|
||||
hero.setBreakId(0);
|
||||
HeroInfoProto.HeroReturnResponse build = HeroInfoProto.HeroReturnResponse.newBuilder().setDrop(drop).build();
|
||||
|
@ -2364,6 +2442,34 @@ public class HeroLogic{
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 法宝归元
|
||||
* @param session
|
||||
* @param heroIdList
|
||||
* @throws Exception
|
||||
*/
|
||||
public void especialEquipBack(ISession session,List<String> heroIdList) throws Exception{
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
Map<Integer,Integer> dropMap = new HashMap<>();
|
||||
for(String heroId:heroIdList){
|
||||
Hero hero = user.getHeroManager().getHero(heroId);
|
||||
if(hero==null||hero.getEspecialEquipLevel()<=1){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
Map<Integer, Integer> dropTempMap = ItemLogic.getInstance().heroEspecialEquipReturnItem(hero);
|
||||
if(dropTempMap==null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
dropTempMap.forEach((k,v)->dropMap.put(k,dropMap.getOrDefault(k,0)+v));
|
||||
hero.updateEspecial(1);
|
||||
}
|
||||
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, ItemUtil.mapToArray(dropMap), BIReason.ESPECIAL_BACK);
|
||||
HeroInfoProto.EspecialEquipBackResponse response = HeroInfoProto.EspecialEquipBackResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.ESPECIAL_EQUIP_BACK_RESPONSE_VALUE,response,true);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 归元掉落
|
||||
* @param user
|
||||
|
@ -2376,6 +2482,17 @@ public class HeroLogic{
|
|||
Map<Integer,Integer> returnItemMap = new HashMap<>();
|
||||
for(String heroId:heroIds){
|
||||
Hero hero = user.getHeroManager().getHero(heroId);
|
||||
//如果是进阶把装备返还
|
||||
if(reason==BIReason.UPHERO_DECOMPOS_HERO_REWARD){
|
||||
Map<Integer, Integer> equipByPositionMap = hero.getEquipByPositionMap();
|
||||
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||
if(equipByPositionMap!=null&&equipByPositionMap.size()>0){
|
||||
equipByPositionMap.forEach((k,v)->returnItemMap.put(v,returnItemMap.getOrDefault(v,0)+1));
|
||||
}
|
||||
if(soulEquipByPositionMap!=null&&soulEquipByPositionMap.size()>0){
|
||||
soulEquipByPositionMap.forEach((k,v)->returnItemMap.put(v,returnItemMap.getOrDefault(v,0)+1));
|
||||
}
|
||||
}
|
||||
int breakId = hero.getBreakId();
|
||||
int templateId = hero.getTemplateId();
|
||||
Map<Integer, SHeroReturn> sHeroReturnMap = SHeroReturn.sheroReturnMap.get(templateId);
|
||||
|
@ -2396,21 +2513,10 @@ public class HeroLogic{
|
|||
continue;
|
||||
}
|
||||
//返还法宝修炼材料
|
||||
int especialEquipLevel = hero.getEspecialEquipLevel();
|
||||
if(especialEquipLevel!=1&&especialEquipLevel!=0){
|
||||
continue;
|
||||
}
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
int[] equipTalismana = scHero.getEquipTalismana();
|
||||
if(equipTalismana!=null&&equipTalismana.length>1){
|
||||
continue;
|
||||
}
|
||||
TreeMap<Integer, SEquipTalismana> levelMap = (TreeMap<Integer, SEquipTalismana>) SEquipTalismana.equipTalismanaStarMap.get(equipTalismana[1]);
|
||||
Map<Integer, SEquipTalismana> returnMap = levelMap.subMap(1, hero.getEspecialEquipLevel());
|
||||
for(Map.Entry<Integer, SEquipTalismana> entry:returnMap.entrySet()){
|
||||
int[][] rankupBasicMaterial = entry.getValue().getRankupBasicMaterial();
|
||||
for(int[] rankUpConsume:rankupBasicMaterial){
|
||||
returnItemMap.put(rankUpConsume[0],returnItemMap.getOrDefault(rankUpConsume[0],0)+rankUpConsume[1]);
|
||||
Map<Integer, Integer> especialEquipReturnItem = ItemLogic.getInstance().heroEspecialEquipReturnItem(hero);
|
||||
if(especialEquipReturnItem!=null&&especialEquipReturnItem.size()>0){
|
||||
for(Map.Entry<Integer,Integer> entry:especialEquipReturnItem.entrySet()){
|
||||
returnItemMap.put(entry.getKey(),returnItemMap.getOrDefault(entry.getKey(),0)+entry.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2420,7 +2526,6 @@ public class HeroLogic{
|
|||
resultDrop[index] = new int[]{entry.getKey(),entry.getValue()};
|
||||
index++;
|
||||
}
|
||||
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, resultDrop, reason);
|
||||
return drop;
|
||||
|
||||
|
@ -2579,7 +2684,7 @@ public class HeroLogic{
|
|||
|
||||
HeroInfoProto.MergeSoulResponse build = HeroInfoProto.MergeSoulResponse.newBuilder().setDrop(dropBuilder).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.SOUL_MERGE_RESPONSE_VALUE,build,true);
|
||||
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.FATALITY_SYNTHESIS.getType(),targetId,"",soulIdList);
|
||||
}
|
||||
|
||||
public static void unloadSoulEquipOpt(ISession iSession, String heroId, List<HeroInfoProto.SoulEquipPos> equipIdsList) throws Exception {
|
||||
|
@ -2598,7 +2703,7 @@ public class HeroLogic{
|
|||
}
|
||||
Map<Integer,Integer> returnItems = new HashMap<>();
|
||||
equipIdsList.forEach(e->{
|
||||
soulEquipByPositionMap.remove(e.getPosition());
|
||||
hero.removeSoulEquip(e.getPosition());
|
||||
returnItems.put(e.getEquipId(),1);
|
||||
});
|
||||
ItemUtil.dropMap(user,returnItems,BIReason.UNLOAD_SOUL_REWARD);
|
||||
|
|
|
@ -8,6 +8,8 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.handler.map.MapManager;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.activity.event.EspecialEquipUpEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.UserMainTeamForceEvent;
|
||||
|
@ -272,6 +274,9 @@ public class ItemLogic {
|
|||
Map<String, PropertyItem> equipMap = user.getEquipManager().getEquipMap();
|
||||
List<int[]> items = new ArrayList<>();
|
||||
StringBuilder reward = new StringBuilder();
|
||||
List<Integer> jewelIdReport = new ArrayList<>();
|
||||
List<Integer> jewelLevelReport = new ArrayList<>();
|
||||
List<Integer> jewelQualityReport = new ArrayList<>();
|
||||
for (String jewelId : jewelList) {
|
||||
if(!equipMap.containsKey(jewelId))
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_DECOMPOSE_NO_EQUIP);
|
||||
|
@ -317,14 +322,21 @@ public class ItemLogic {
|
|||
}
|
||||
}
|
||||
SItem sItem = SItem.getsItemMap().get(propertyItem.getEquipId());
|
||||
jewelIdReport.add(propertyItem.getEquipId());
|
||||
jewelLevelReport.add(propertyItem.getLevel());
|
||||
jewelQualityReport.add(((Jewel) propertyItem).getBuildLevel());
|
||||
reward = getStringBuilder(reward, 1, sItem.getResolveReward());
|
||||
}
|
||||
|
||||
|
||||
for (String jewelId : jewelList) {
|
||||
user.getEquipManager().remove(jewelId);
|
||||
|
||||
}
|
||||
|
||||
int[][] dropItems = items.toArray(new int[items.size()][]);
|
||||
Map<Integer, Integer> reportMap = ItemUtil.arrayToMap(dropItems);
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.TREASURE_DECOMPOSITION.getType(),jewelIdReport,jewelLevelReport,jewelQualityReport,new ArrayList<>(reportMap.keySet()),reportMap.values());
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, StringUtil.parseFiledInt(reward.toString()), 1, 0,BIReason.JEWEL_DECOMPOSE);
|
||||
ItemUtil.drop(user,dropItems,drop,BIReason.JEWEL_DECOMPOSE);
|
||||
sendUseAndPriceItemMessage(session,MessageTypeProto.MessageType.USER_AND_PRICE_ITEM_RESPONSE_VALUE,drop);
|
||||
|
@ -378,8 +390,24 @@ public class ItemLogic {
|
|||
//2有过突破的卡 =当前等级返还升级材料+突破表返还材料
|
||||
Map<Integer, Integer> baseItemMap = new HashMap<>();
|
||||
int rankUpReturnPercent= SSpecialConfig.getIntegerValue(SSpecialConfig.HERO_SACRIFICE_PERCENT);
|
||||
List<Integer> heroIdReport = new ArrayList<>();
|
||||
List<Integer> heroLevelReport = new ArrayList<>();
|
||||
List<Integer> heroStarReport = new ArrayList<>();
|
||||
for (String heroId : heroIdsList) {
|
||||
Hero hero = heroManager.getHeroMap().get(heroId);
|
||||
Map<Integer, Integer> equipByPositionMap = hero.getEquipByPositionMap();
|
||||
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||
if(equipByPositionMap!=null&&equipByPositionMap.size()>0){
|
||||
equipByPositionMap.forEach((k,v)->baseItemMap.put(v,baseItemMap.getOrDefault(v,0)+1));
|
||||
}
|
||||
if(soulEquipByPositionMap!=null&&soulEquipByPositionMap.size()>0){
|
||||
soulEquipByPositionMap.forEach((k,v)->baseItemMap.put(v,baseItemMap.getOrDefault(v,0)+1));
|
||||
}
|
||||
|
||||
heroIdReport.add(hero.getTemplateId());
|
||||
heroLevelReport.add(hero.getLevel());
|
||||
heroStarReport.add(hero.getStar());
|
||||
|
||||
heroManager.removeHero(uid,heroId);
|
||||
int[][] sumConsume = SHeroLevlConfig.getsHeroLevlConfigMap().get(hero.getLevel()).getSumConsume();
|
||||
SHeroSacrifice starSHeroSacrifice = STableManager.getFigureConfig(HeroStaticConfig.class).getsHeroSacrificeMap(1, hero.getStar());
|
||||
|
@ -395,23 +423,28 @@ public class ItemLogic {
|
|||
for(int[] item:breakSHeroSacrifice.getValue()){
|
||||
baseItemMap.put(item[0],baseItemMap.getOrDefault(item[0],0)+item[1]);
|
||||
}
|
||||
// 返还法宝修炼材料
|
||||
int especialEquipLevel = hero.getEspecialEquipLevel();
|
||||
if(especialEquipLevel==1||especialEquipLevel==0){
|
||||
continue;
|
||||
}
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
int[] equipTalismana = scHero.getEquipTalismana();
|
||||
if(equipTalismana==null||equipTalismana.length<2){
|
||||
continue;
|
||||
}
|
||||
TreeMap<Integer, SEquipTalismana> levelMap = (TreeMap<Integer, SEquipTalismana>) (SEquipTalismana.equipTalismanaStarMap.get(equipTalismana[1]));
|
||||
Map<Integer, SEquipTalismana> returnMap = levelMap.subMap(1, hero.getEspecialEquipLevel());
|
||||
for(Map.Entry<Integer, SEquipTalismana> entry:returnMap.entrySet()){
|
||||
int[][] rankupBasicMaterial = entry.getValue().getRankupBasicMaterial();
|
||||
for(int[] rankUpConsume:rankupBasicMaterial){
|
||||
baseItemMap.put(rankUpConsume[0],baseItemMap.getOrDefault(rankUpConsume[0],0)+rankUpConsume[1]);
|
||||
}
|
||||
//// 返还法宝修炼材料
|
||||
// int especialEquipLevel = hero.getEspecialEquipLevel();
|
||||
// if(especialEquipLevel==1||especialEquipLevel==0){
|
||||
// continue;
|
||||
// }
|
||||
// SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
// int[] equipTalismana = scHero.getEquipTalismana();
|
||||
// if(equipTalismana==null||equipTalismana.length<2){
|
||||
// continue;
|
||||
// }
|
||||
// TreeMap<Integer, SEquipTalismana> levelMap = (TreeMap<Integer, SEquipTalismana>) (SEquipTalismana.equipTalismanaStarMap.get(equipTalismana[1]));
|
||||
// Map<Integer, SEquipTalismana> returnMap = levelMap.subMap(1, hero.getEspecialEquipLevel());
|
||||
// for(Map.Entry<Integer, SEquipTalismana> entry:returnMap.entrySet()){
|
||||
// int[][] rankupBasicMaterial = entry.getValue().getRankupBasicMaterial();
|
||||
// for(int[] rankUpConsume:rankupBasicMaterial){
|
||||
// baseItemMap.put(rankUpConsume[0],baseItemMap.getOrDefault(rankUpConsume[0],0)+rankUpConsume[1]);
|
||||
// }
|
||||
// }
|
||||
//法宝获得
|
||||
Map<Integer, Integer> especialReturn = heroEspecialEquipReturnItem(hero);
|
||||
if(especialReturn!=null){
|
||||
especialReturn.forEach((k,v)->baseItemMap.put(k,baseItemMap.getOrDefault(k,0)+v));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -427,9 +460,37 @@ public class ItemLogic {
|
|||
}else {
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DESPOSE_HERO,heroIdsList.size());
|
||||
}
|
||||
if(reson== BIReason.DECOMPOS_HERO_REWARD){
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.SEND_HERO.getType(),heroIdReport,heroLevelReport,heroStarReport,new ArrayList<>(baseItemMap.keySet()),baseItemMap.values());
|
||||
}
|
||||
return ItemUtil.drop(user,itemReturnPercent(itemArray,rankUpReturnPercent),reson);
|
||||
}
|
||||
|
||||
/**
|
||||
* 法宝归元所得
|
||||
*/
|
||||
public Map<Integer,Integer> heroEspecialEquipReturnItem(Hero hero){
|
||||
int especialEquipLevel = hero.getEspecialEquipLevel();
|
||||
if(especialEquipLevel==1||especialEquipLevel==0){
|
||||
return null;
|
||||
}
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
int[] equipTalismana = scHero.getEquipTalismana();
|
||||
if(equipTalismana==null||equipTalismana.length<2){
|
||||
return null;
|
||||
}
|
||||
Map<Integer,Integer> baseItemMap = new HashMap<>();
|
||||
TreeMap<Integer, SEquipTalismana> levelMap = (TreeMap<Integer, SEquipTalismana>) (SEquipTalismana.equipTalismanaStarMap.get(equipTalismana[1]));
|
||||
Map<Integer, SEquipTalismana> returnMap = levelMap.subMap(1, hero.getEspecialEquipLevel());
|
||||
for(Map.Entry<Integer, SEquipTalismana> entry:returnMap.entrySet()){
|
||||
int[][] rankupBasicMaterial = entry.getValue().getRankupBasicMaterial();
|
||||
for(int[] rankUpConsume:rankupBasicMaterial){
|
||||
baseItemMap.put(rankUpConsume[0],baseItemMap.getOrDefault(rankUpConsume[0],0)+rankUpConsume[1]);
|
||||
}
|
||||
}
|
||||
return baseItemMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回数量乘比值
|
||||
* @param sumConsume
|
||||
|
@ -455,7 +516,8 @@ public class ItemLogic {
|
|||
if(hero.getIsLock() == 1){
|
||||
return ErrorCode.ITEM_DECOMPOSE_HERO_LOCK;
|
||||
}
|
||||
boolean battleArray = HeroLogic.getInstance().isBattleArray(user, heroId);
|
||||
int[] teamId = SSpecialConfig.getOnceArrayValue(SSpecialConfig.HERO_RESOLVE_LICENCE);
|
||||
boolean battleArray = HeroLogic.getInstance().isBattleArray(user, heroId,teamId);
|
||||
if (!battleArray){
|
||||
return ErrorCode.ITEM_DECOMPOSE_HERO_TEAM;
|
||||
}
|
||||
|
@ -582,7 +644,7 @@ public class ItemLogic {
|
|||
* @param equipid
|
||||
* @return
|
||||
*/
|
||||
public static int getEquipByID(User user, int equipId) throws Exception {
|
||||
public static int getEquipByID(User user, int equipId){
|
||||
Item item = user.getItemManager().getItemMap().get(equipId);
|
||||
if(item==null){
|
||||
return 0;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.logic.rank;
|
||||
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.logic.rank.rankImpl.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
@ -30,8 +31,10 @@ public enum RankEnum {
|
|||
DEATH_PATH_TOTAL_GUILD_RANK(18,RedisKey.DEATH_PATH_TOTAL_GUILD_RANK,DeathPathTotalGuildRank::new),//param1:工会总伤害 param2:无 param3:无
|
||||
GUILD_FORCE_RANK(20,RedisKey.GUILD_FORCE_RANK,GuildForceRank::new),//param1:公会总战力 param2:无 param3:无
|
||||
EXPERT_RANK(21,RedisKey.EXPERT_RANK,GoldRank::new),//param1:活动进度 param2:无 param3:无
|
||||
FORCE_CURR_RANK(22,RedisKey.FORCE_CURR_RANK,ForceCurrRank::new);//param1:人物战力 param2:无 param3:无
|
||||
FORCE_CURR_RANK(22,RedisKey.FORCE_CURR_RANK,ForceCurrRank::new),//param1:人物战力 param2:无 param3:无
|
||||
SITUATION_RANK(24,RedisKey.SITUATION_RANK,SituationRank::new),//param1:通关次数 param2:无 param3:无
|
||||
|
||||
;
|
||||
|
||||
private int type;
|
||||
private String redisKey;
|
||||
|
|
|
@ -60,6 +60,7 @@ public class ForceCurrRank extends AbstractRank implements IEventHandler{
|
|||
if(infoQueue.isEmpty()){
|
||||
return;
|
||||
}
|
||||
try{
|
||||
int size = infoQueue.size();
|
||||
List<UserMainTeamForceEvent> eventList = new ArrayList<>(size);
|
||||
|
||||
|
@ -67,7 +68,10 @@ public class ForceCurrRank extends AbstractRank implements IEventHandler{
|
|||
int transport = Math.min(size,TRANSPORT_SIZE);
|
||||
|
||||
for(int i = 0 ; i < transport;i++){
|
||||
eventList.add(infoQueue.poll());
|
||||
UserMainTeamForceEvent event = infoQueue.poll();
|
||||
if(event!=null){
|
||||
eventList.add(event);
|
||||
}
|
||||
}
|
||||
|
||||
Set<Integer> changeId = new HashSet<>();
|
||||
|
@ -81,6 +85,10 @@ public class ForceCurrRank extends AbstractRank implements IEventHandler{
|
|||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.ljsd.jieling.logic.rank.rankImpl;
|
||||
|
||||
import util.TimeUtils;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
* @date 2020/8/14
|
||||
* @discribe
|
||||
*/
|
||||
public class SituationRank extends AbstractRank {
|
||||
|
||||
public SituationRank(int type, String redisKey) {
|
||||
super(type, redisKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long[] getDataByScore(Double score) {
|
||||
return new long[]{score.longValue()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getScore(double... data) {
|
||||
return data[0]+ TimeUtils.getDoubleTime();
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@ import com.ljsd.jieling.ktbeans.sendbeans.KTAppOnline;
|
|||
import com.ljsd.jieling.ktbeans.sendbeans.ReportServerEvent;
|
||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.SituationLogic;
|
||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||
import com.ljsd.jieling.logic.activity.event.MinuteTaskEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
|
@ -71,7 +72,7 @@ public class MinuteTask extends Thread {
|
|||
ActivityLogic.getInstance().checkSecretBoxSeason();
|
||||
StoreLogic.checkGlobalStore(false);
|
||||
MapLogic.getInstance().minuteCheckAndRemoveMapRank();
|
||||
|
||||
SituationLogic.getInstance().createCheckStatusTask();
|
||||
everyZeroTask();
|
||||
everyFiveTask();
|
||||
everyMondyFiveClockTask();
|
||||
|
@ -134,8 +135,6 @@ public class MinuteTask extends Thread {
|
|||
LOGGER.info("everyHourTask end ...");
|
||||
}
|
||||
}
|
||||
|
||||
//每日凌晨执行
|
||||
public void everyZeroTask() throws Exception {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
int hour = calendar.get(Calendar.HOUR_OF_DAY);
|
||||
|
|
|
@ -105,6 +105,7 @@ public class CBean2Proto {
|
|||
.setLockState(hero.getIsLock())
|
||||
.addAllJewels(hero.getJewelInfo())
|
||||
.setCreatetype(hero.getCreateType())
|
||||
.setChangeId(hero.getChangeId())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ public class FightDataUtil {
|
|||
if(length<3){
|
||||
return passivityData;
|
||||
}
|
||||
|
||||
int passivityIndex = 1;
|
||||
for(int i=2;i<length;i++){
|
||||
LuaValue detail = new LuaTable();
|
||||
int passivityId = Integer.parseInt(unitSkill[i]);
|
||||
|
@ -150,7 +150,8 @@ public class FightDataUtil {
|
|||
detail.rawset(j + 2, effectList.get(j));
|
||||
}
|
||||
}
|
||||
passivityData.rawset(i-1,detail);
|
||||
passivityData.rawset(passivityIndex,detail);
|
||||
passivityIndex++;
|
||||
|
||||
}
|
||||
return passivityData;
|
||||
|
|
|
@ -598,7 +598,7 @@ public class ItemUtil {
|
|||
// }
|
||||
// KtEventUtils.onKtEvent(user, eventType,reason,GlobalsDef.addReason,entry.getKey(),itemNum,item.getItemNum());
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.GET_ITEM.getType(),itemNum,String.valueOf(reason),item.getItemId());
|
||||
baseItemReport(user,item.getItemId(),itemNum,2,reason);
|
||||
baseItemReport(user,item.getItemId(),itemNum,1,reason);
|
||||
|
||||
if(sItem.getItemType() == GlobalItemType.POKENMON_COMONPENT && sItem.getQuantity()>=SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_differ_content_parm)){
|
||||
SDifferDemonsConfig sDifferDemonsConfig = SDifferDemonsConfig.sDifferDemonsConfigMapByComId.get(sItem.getId());
|
||||
|
@ -615,7 +615,10 @@ public class ItemUtil {
|
|||
extraDropAop(user,dropBuilder,sItem);
|
||||
sendToFront.add(CBean2Proto.getItem(item,-1));
|
||||
if(sItem.getItemType()==GlobalItemType.EQUIP){
|
||||
if(reason!=BIReason.EQUIP_UNLOAD_REWARD&&reason!=BIReason.DECOMPOS_HERO_REWARD){
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.GET_EQUIP,sItem.getId(),itemNum);
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.GET_EQUIP.getType(),sItem.getId(),itemNum,reason);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dropBuilder != null) {
|
||||
|
|
|
@ -1,38 +1,56 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="LotterySetting")
|
||||
public class SLotterySetting implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int diamondBoxInterval;
|
||||
|
||||
private int[][] cost;
|
||||
|
||||
|
||||
private int[][] diamondBoxContain;
|
||||
|
||||
private int[][] tenTimesMustGetItem;
|
||||
|
||||
private int[][] costItem;
|
||||
|
||||
private int perCount;
|
||||
|
||||
private int lotteryType;
|
||||
|
||||
private int mergePool;
|
||||
private int propertyType;
|
||||
|
||||
private int activityId;
|
||||
private int diamondBoxInterval;
|
||||
|
||||
private int[][] costItem;
|
||||
|
||||
private int freeTimes;
|
||||
|
||||
private int maxTimes;
|
||||
|
||||
private int[][] diamondBoxContain;
|
||||
|
||||
private int[][] tenTimesMustGetItem;
|
||||
|
||||
private int perCount;
|
||||
|
||||
private int mergePool;
|
||||
|
||||
private int activityId;
|
||||
|
||||
public static Map<Integer,Map<Integer,Integer>> changeIds = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, Map<Integer, Integer>> integerMapMap = new HashMap<>();
|
||||
Map<Integer, SLotterySetting> config = STableManager.getConfig(SLotterySetting.class);
|
||||
for (Map.Entry<Integer,SLotterySetting> entry:config.entrySet()) {
|
||||
if(entry.getValue().getLotteryType()==7){
|
||||
Map<Integer, Integer> orDefault = integerMapMap.getOrDefault(4, new HashMap<>());
|
||||
orDefault.put(entry.getValue().getPropertyType(),entry.getKey());
|
||||
integerMapMap.put(4,orDefault);
|
||||
}else if (entry.getValue().getLotteryType()==8){
|
||||
Map<Integer, Integer> orDefault = integerMapMap.getOrDefault(5, new HashMap<>());
|
||||
orDefault.put(entry.getValue().getPropertyType(),entry.getKey());
|
||||
integerMapMap.put(5,orDefault);
|
||||
}
|
||||
}
|
||||
changeIds = integerMapMap;
|
||||
|
||||
}
|
||||
|
||||
|
@ -41,14 +59,29 @@ public class SLotterySetting implements BaseConfig {
|
|||
return id;
|
||||
}
|
||||
|
||||
public int getLotteryType() {
|
||||
return lotteryType;
|
||||
}
|
||||
|
||||
public int getPropertyType() {
|
||||
return propertyType;
|
||||
}
|
||||
|
||||
public int getDiamondBoxInterval() {
|
||||
return diamondBoxInterval;
|
||||
}
|
||||
|
||||
public int[][] getCost() {
|
||||
return cost;
|
||||
public int[][] getCostItem() {
|
||||
return costItem;
|
||||
}
|
||||
|
||||
public int getFreeTimes() {
|
||||
return freeTimes;
|
||||
}
|
||||
|
||||
public int getMaxTimes() {
|
||||
return maxTimes;
|
||||
}
|
||||
|
||||
public int[][] getDiamondBoxContain() {
|
||||
return diamondBoxContain;
|
||||
|
@ -62,28 +95,20 @@ public class SLotterySetting implements BaseConfig {
|
|||
return perCount;
|
||||
}
|
||||
|
||||
public int[][] getCostItem() {
|
||||
return costItem;
|
||||
}
|
||||
|
||||
public int getLotteryType() {
|
||||
return lotteryType;
|
||||
}
|
||||
|
||||
public int getMergePool() {
|
||||
return mergePool;
|
||||
}
|
||||
|
||||
|
||||
public int getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
public int getFreeTimes() {
|
||||
return freeTimes;
|
||||
|
||||
public static Map<Integer, Map<Integer, Integer>> getChangeIds() {
|
||||
return changeIds;
|
||||
}
|
||||
|
||||
public int getMaxTimes() {
|
||||
return maxTimes;
|
||||
public static void setChangeIds(Map<Integer, Map<Integer, Integer>> changeIds) {
|
||||
SLotterySetting.changeIds = changeIds;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,77 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="RaceTowerConfig")
|
||||
public class SRaceTowerConfig implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int type;
|
||||
|
||||
private int openRules;
|
||||
|
||||
private int[] reward;
|
||||
|
||||
private int[] firstReward;
|
||||
|
||||
private int monsterId;
|
||||
|
||||
private int[][] teamRules;
|
||||
|
||||
private int[][] attribute;
|
||||
|
||||
private int[] privilege;
|
||||
|
||||
private int formation;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getOpenRules() {
|
||||
return openRules;
|
||||
}
|
||||
|
||||
public int[] getReward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
public int[] getFirstReward() {
|
||||
return firstReward;
|
||||
}
|
||||
|
||||
public int getMonsterId() {
|
||||
return monsterId;
|
||||
}
|
||||
|
||||
public int[][] getTeamRules() {
|
||||
return teamRules;
|
||||
}
|
||||
|
||||
public int[][] getAttribute() {
|
||||
return attribute;
|
||||
}
|
||||
|
||||
public int[] getPrivilege() {
|
||||
return privilege;
|
||||
}
|
||||
|
||||
public int getFormation() {
|
||||
return formation;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="RaceTowerRewardConfig")
|
||||
public class SRaceTowerRewardConfig implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int[] section;
|
||||
|
||||
private int[][] reward;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int[] getSection() {
|
||||
return section;
|
||||
}
|
||||
|
||||
public int[][] getReward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -67,6 +67,13 @@ public class SSpecialConfig implements BaseConfig {
|
|||
public static final String DISCOUNT_LEVEL= "discount_level";//限时折扣推送等级#推送间隔等级
|
||||
public static final String GUILD_WAR_ISOPEN = "Guild_war_isopen";//老公会战是否开启
|
||||
public static final String LUCKYTURNDAILYLIMIT = "LuckyTurnDailyLimit";//幸运探宝每日上限
|
||||
|
||||
|
||||
public static final String REPLACE_ITEM_ID = "replace_item_id";//置换玉道具ID
|
||||
public static final String REPLACE_COST = "replace_cost";//置换玉消耗
|
||||
|
||||
public static final String XUANYUAN_OPEN_TIME = "xuanyuan_open_time";//轩辕开始时间(星期)
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
|
Loading…
Reference in New Issue