大闹天宫初版
parent
cb55e2af1f
commit
934b85dcd4
|
|
@ -1,12 +1,7 @@
|
||||||
package com.ljsd.jieling.core.function;
|
package com.ljsd.jieling.core.function;
|
||||||
|
|
||||||
import com.ljsd.jieling.core.FunctionManager;
|
import com.ljsd.jieling.core.FunctionManager;
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
|
||||||
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
||||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
|
||||||
import com.ljsd.jieling.util.InnerMessageUtil;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description: 猎妖之路
|
* Description: 猎妖之路
|
||||||
|
|
@ -18,7 +13,7 @@ public class ExpeditionFunction implements FunctionManager {
|
||||||
public void startAction(TimeControllerOfFunction timeControllerOfFunction) throws Exception {
|
public void startAction(TimeControllerOfFunction timeControllerOfFunction) throws Exception {
|
||||||
|
|
||||||
// int times = timeControllerOfFunction.getTimes();
|
// int times = timeControllerOfFunction.getTimes();
|
||||||
InnerMessageUtil.broadcastWithRandom(user -> ExpeditionLogic.getInstance().flushUserdataEveryDay(user),new ArrayList<>(OnlineUserManager.sessionMap.keySet()), 20);
|
// InnerMessageUtil.broadcastWithRandom(user -> ExpeditionLogic.getInstance().flushUserdataEveryDay(user),new ArrayList<>(OnlineUserManager.sessionMap.keySet()), 20);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -93,22 +93,13 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
||||||
int maxTime = sExpeditionSetting.getFightTime();
|
int maxTime = sExpeditionSetting.getFightTime();
|
||||||
CommonProto.FightTeamInfo fightTeamInfo = ExpeditionLogic.getFightTeamInfoWithDouble(user,teamId,user.getExpeditionManager().getHeroHP());
|
CommonProto.FightTeamInfo fightTeamInfo = ExpeditionLogic.getFightTeamInfoWithDouble(user,teamId,user.getExpeditionManager().getHeroHP());
|
||||||
|
|
||||||
|
|
||||||
SnapFightInfo deffightInfo = nodeInfo.getSnapFightInfo();
|
SnapFightInfo deffightInfo = nodeInfo.getSnapFightInfo();
|
||||||
|
|
||||||
ExpeditionManager expeditionManager = user.getExpeditionManager();
|
ExpeditionManager expeditionManager = user.getExpeditionManager();
|
||||||
|
|
||||||
LuaValue getFightData;
|
CommonProto.FightTeamInfo deffightTeamInfo = FightUtil.makeFightBySnapDataWithDouble(new DefFightSnapData(deffightInfo.getHeroAttribute(),deffightInfo.getHeroSkills(),deffightInfo.getPokenmonSkills(),deffightInfo.getPassiveSkills()),nodeInfo.getBossHP());
|
||||||
// if(nodeInfo.getType()==ExpeditionLogic.NODETYPE_GREED){
|
LuaValue getFightData = FightDataUtil.getFinalPlayerFightData(fightTeamInfo, deffightTeamInfo);
|
||||||
// int tid = deffightInfo.getUid();
|
|
||||||
// List<CommonProto.FightTeamInfo> gropFightTeamInfoWithDouble = ExpeditionLogic.getGropFightTeamInfoWithDouble(tid, nodeInfo.getBossHP());
|
|
||||||
// getFightData = FightDataUtil.getFinalFightData(fightTeamInfo, gropFightTeamInfoWithDouble);
|
|
||||||
// }else {
|
|
||||||
CommonProto.FightTeamInfo deffightTeamInfo = FightUtil.makeFightBySnapDataWithDouble(new DefFightSnapData(deffightInfo.getHeroAttribute(),deffightInfo.getHeroSkills(),deffightInfo.getPokenmonSkills(),deffightInfo.getPassiveSkills()),nodeInfo.getBossHP());
|
|
||||||
getFightData = FightDataUtil.getFinalPlayerFightData(fightTeamInfo, deffightTeamInfo);
|
|
||||||
// }
|
|
||||||
|
|
||||||
LuaValue getOptionData = FightDataUtil.getOptionData(uid+"");
|
LuaValue getOptionData = FightDataUtil.getOptionData(String.valueOf(uid));
|
||||||
long[] checkResult = CheckFight.getInstance().checkFight(seed, maxTime, getFightData, getOptionData, GameFightType.Expediton.getFightType());
|
long[] checkResult = CheckFight.getInstance().checkFight(seed, maxTime, getFightData, getOptionData, GameFightType.Expediton.getFightType());
|
||||||
FightResult fight = FightResult.newBuilder().setCheckResult(checkResult).build();
|
FightResult fight = FightResult.newBuilder().setCheckResult(checkResult).build();
|
||||||
|
|
||||||
|
|
@ -151,10 +142,6 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
||||||
|
|
||||||
if(ExpeditionLogic.NODETYPE_GREED == nodeInfo.getType()){
|
if(ExpeditionLogic.NODETYPE_GREED == nodeInfo.getType()){
|
||||||
//节点血量更新
|
//节点血量更新
|
||||||
|
|
||||||
// nodeInfo.getSnapFightInfo().getHeroAttribute().forEach((s, familyHeroInfo) ->
|
|
||||||
// nodeInfo.getBossHP().put(s, (double) remainHp.remove(0) / (double) familyHeroInfo.getAttribute().get(HeroAttributeEnum.CurHP.getPropertyId()))
|
|
||||||
// );
|
|
||||||
nodeInfo.getSnapFightInfo().getHeroAttribute().forEach((s, familyHeroInfo) ->{
|
nodeInfo.getSnapFightInfo().getHeroAttribute().forEach((s, familyHeroInfo) ->{
|
||||||
SMonsterConfig sMonsterConfig = STableManager.getConfig(SMonsterConfig.class).get(Integer.valueOf(s));
|
SMonsterConfig sMonsterConfig = STableManager.getConfig(SMonsterConfig.class).get(Integer.valueOf(s));
|
||||||
if(sMonsterConfig!=null){
|
if(sMonsterConfig!=null){
|
||||||
|
|
@ -162,7 +149,6 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
//节点血量更新
|
//节点血量更新
|
||||||
nodeInfo.getSnapFightInfo().getHeroAttribute().forEach((s, familyHeroInfo) ->
|
nodeInfo.getSnapFightInfo().getHeroAttribute().forEach((s, familyHeroInfo) ->
|
||||||
|
|
@ -201,7 +187,7 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
||||||
TeamPosHeroInfo teamPosHeroInfo = iterator.next();
|
TeamPosHeroInfo teamPosHeroInfo = iterator.next();
|
||||||
|
|
||||||
Hero hero = user.getExpeditionManager().getHero(teamPosHeroInfo.getHeroId());
|
Hero hero = user.getExpeditionManager().getHero(teamPosHeroInfo.getHeroId());
|
||||||
if (hero==null) {
|
if (hero == null) {
|
||||||
hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
hero = user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||||
}
|
}
|
||||||
if (hero==null) {
|
if (hero==null) {
|
||||||
|
|
@ -211,15 +197,13 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
||||||
double remain = remainHp.get(teamPosHeroInfo.getPosition()-1);
|
double remain = remainHp.get(teamPosHeroInfo.getPosition()-1);
|
||||||
user.getExpeditionManager().getHeroHPWithChange().put(teamPosHeroInfo.getHeroId(), remain / (double) heroAttributeMap.get(HeroAttributeEnum.CurHP.getPropertyId()));
|
user.getExpeditionManager().getHeroHPWithChange().put(teamPosHeroInfo.getHeroId(), remain / (double) heroAttributeMap.get(HeroAttributeEnum.CurHP.getPropertyId()));
|
||||||
ids.add(hero.getId());
|
ids.add(hero.getId());
|
||||||
if(remain==0d){
|
if(remain == 0d){
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//出队伍
|
//出队伍
|
||||||
user.getTeamPosManager().updateTeamPosByTeamId(1001,teamPosHeroInfos);
|
user.getTeamPosManager().updateTeamPosByTeamId(1001,teamPosHeroInfos);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (ExpeditionLogic.isBattleNode(nodeInfo.getType())) {
|
if (ExpeditionLogic.isBattleNode(nodeInfo.getType())) {
|
||||||
nodeInfo.setState(ExpeditionLogic.NODESTATE_NOT_GET);
|
nodeInfo.setState(ExpeditionLogic.NODESTATE_NOT_GET);
|
||||||
}
|
}
|
||||||
|
|
@ -252,7 +236,7 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
||||||
drop = ItemUtil.drop(user,new int[]{STableManager.getConfig(SExpeditionSetting.class).get(1).getSpecialReward()},1,0,BIReason.EXPEDITION_DROP_REWARD);
|
drop = ItemUtil.drop(user,new int[]{STableManager.getConfig(SExpeditionSetting.class).get(1).getSpecialReward()},1,0,BIReason.EXPEDITION_DROP_REWARD);
|
||||||
}else{
|
}else{
|
||||||
if(sExpeditionFloorConfig.getReward()!=null&&sExpeditionNodeConfig.getReward()!=0){
|
if(sExpeditionFloorConfig.getReward()!=null&&sExpeditionNodeConfig.getReward()!=0){
|
||||||
drop = ItemUtil.drop(user, sExpeditionFloorConfig.getReward(),sExpeditionNodeConfig.getReward(),0,BIReason.EXPEDITION_DROP_REWARD);
|
drop = ItemUtil.drop(user, sExpeditionFloorConfig.getReward(),sExpeditionNodeConfig.getReward(),0,BIReason.EXPEDITION_DROP_REWARD);
|
||||||
}else {
|
}else {
|
||||||
drop = CommonProto.Drop.newBuilder();
|
drop = CommonProto.Drop.newBuilder();
|
||||||
}
|
}
|
||||||
|
|
@ -295,7 +279,6 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
||||||
Jewel j = (Jewel) propertyItem;
|
Jewel j = (Jewel) propertyItem;
|
||||||
drop.addSoulEquip(CBean2Proto.getEquipProto(j));
|
drop.addSoulEquip(CBean2Proto.getEquipProto(j));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,19 @@
|
||||||
package com.ljsd.jieling.handler.Expedition;
|
package com.ljsd.jieling.handler.Expedition;
|
||||||
|
|
||||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
|
||||||
import com.ljsd.jieling.exception.ErrorCode;
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
|
||||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
|
||||||
import com.ljsd.jieling.logic.dao.*;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import rpc.protocols.CommonProto;
|
|
||||||
import rpc.protocols.Expedition;
|
|
||||||
import rpc.protocols.MessageTypeProto;
|
|
||||||
import com.ljsd.jieling.util.CBean2Proto;
|
import com.ljsd.jieling.util.CBean2Proto;
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
import config.SExpeditionSetting;
|
import config.SExpeditionSetting;
|
||||||
import config.SGlobalSystemConfig;
|
|
||||||
import manager.STableManager;
|
import manager.STableManager;
|
||||||
|
import rpc.protocols.CommonProto;
|
||||||
|
import rpc.protocols.Expedition;
|
||||||
|
import rpc.protocols.MessageTypeProto;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -66,40 +62,27 @@ public class GetExpeditionRequestHandler extends BaseHandler<Expedition.GetExped
|
||||||
manager.setSortid(0);
|
manager.setSortid(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.Expedition.getFunctionType());
|
builder.addAllLay(manager.getRewardBox());
|
||||||
if (GlobleSystemLogic.checkOpen(user,sGlobalSystemConfig)) {
|
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user));
|
||||||
builder.addAllLay(manager.getRewardBox());
|
builder.addAllNodeInfo(ExpeditionLogic.getInstance().getNodeInfo(user));
|
||||||
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user));
|
builder.addAllEquipIds(ExpeditionLogic.getInstance().getEquipnfo(user));
|
||||||
builder.addAllNodeInfo(ExpeditionLogic.getInstance().getNodeInfo(user));
|
|
||||||
builder.addAllEquipIds(ExpeditionLogic.getInstance().getEquipnfo(user));
|
|
||||||
|
|
||||||
List<CommonProto.Hero> heroList = new ArrayList<>();
|
|
||||||
Map<String, Hero> heroMap = user.getExpeditionManager().getHeroMap();
|
|
||||||
for(Hero hero : heroMap.values()){
|
|
||||||
heroList.add(CBean2Proto.getHero(hero));
|
|
||||||
}
|
|
||||||
builder.addAllHeroList(heroList);
|
|
||||||
Map<String, PropertyItem> equipMap = user.getExpeditionManager().getEquipMap();
|
|
||||||
List<CommonProto.Equip> equipList = new ArrayList<>();
|
|
||||||
// for(PropertyItem equipInfo: equipMap.values()){
|
|
||||||
// if(equipInfo instanceof Equip)
|
|
||||||
// equipList.add(CBean2Proto.getEquipProto(equipInfo));
|
|
||||||
// }
|
|
||||||
builder.addAllEquip(equipList);
|
|
||||||
List<CommonProto.Equip> soulEquipList = new ArrayList<>();
|
|
||||||
for(PropertyItem equipInfo: equipMap.values()){
|
|
||||||
if(equipInfo instanceof Jewel)
|
|
||||||
soulEquipList.add(CBean2Proto.getEquipProto(equipInfo));
|
|
||||||
}
|
|
||||||
builder.addAllSoulEquip(soulEquipList);
|
|
||||||
|
|
||||||
|
|
||||||
TimeControllerOfFunction timeControllerOfFunction = GlobalDataManaager.getInstance().getTimeControllerOfFunctionByFunctinoType(FunctionIdEnum.Expedition);
|
|
||||||
if( null != timeControllerOfFunction){
|
|
||||||
builder.setStartTime((int)(timeControllerOfFunction.getStartTime()/1000));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
List<CommonProto.Hero> heroList = new ArrayList<>();
|
||||||
|
Map<String, Hero> heroMap = user.getExpeditionManager().getHeroMap();
|
||||||
|
for(Hero hero : heroMap.values()){
|
||||||
|
heroList.add(CBean2Proto.getHero(hero));
|
||||||
}
|
}
|
||||||
|
builder.addAllHeroList(heroList);
|
||||||
|
Map<String, PropertyItem> equipMap = user.getExpeditionManager().getEquipMap();
|
||||||
|
List<CommonProto.Equip> equipList = new ArrayList<>();
|
||||||
|
builder.addAllEquip(equipList);
|
||||||
|
List<CommonProto.Equip> soulEquipList = new ArrayList<>();
|
||||||
|
for(PropertyItem equipInfo: equipMap.values()){
|
||||||
|
if(equipInfo instanceof Jewel)
|
||||||
|
soulEquipList.add(CBean2Proto.getEquipProto(equipInfo));
|
||||||
|
}
|
||||||
|
builder.addAllSoulEquip(soulEquipList);
|
||||||
|
|
||||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_GET_EXPEDITION_RESONSE_VALUE, builder.build(), true);
|
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_GET_EXPEDITION_RESONSE_VALUE, builder.build(), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,22 +3,17 @@ package com.ljsd.jieling.handler.Expedition;
|
||||||
import com.ljsd.jieling.exception.ErrorCode;
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
import com.ljsd.jieling.logic.dao.ExpeditionItem;
|
|
||||||
import com.ljsd.jieling.logic.dao.ExpeditionManager;
|
|
||||||
import com.ljsd.jieling.logic.dao.ExpeditionNodeInfo;
|
import com.ljsd.jieling.logic.dao.ExpeditionNodeInfo;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
import rpc.protocols.CommonProto;
|
import rpc.protocols.CommonProto;
|
||||||
import rpc.protocols.Expedition;
|
import rpc.protocols.Expedition;
|
||||||
import rpc.protocols.MessageTypeProto;
|
import rpc.protocols.MessageTypeProto;
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
|
||||||
import config.SExpeditionHolyConfig;
|
|
||||||
import manager.STableManager;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -49,59 +44,21 @@ public class TakeHolyEquipRequest extends BaseHandler<Expedition.TakeHolyEquipRe
|
||||||
if (nodeInfo.getState() != ExpeditionLogic.NODESTATE_NOT_GET) {
|
if (nodeInfo.getState() != ExpeditionLogic.NODESTATE_NOT_GET) {
|
||||||
throw new ErrorCodeException(ErrorCode.newDefineCode("节点信息错误 节点状态不正确"+nodeInfo.getState()));
|
throw new ErrorCodeException(ErrorCode.newDefineCode("节点信息错误 节点状态不正确"+nodeInfo.getState()));
|
||||||
}
|
}
|
||||||
|
|
||||||
//check node
|
//check node
|
||||||
List<Integer> nextNodeId = ExpeditionLogic.getNextNodeId(user.getExpeditionManager().getSortid(),user.getExpeditionManager().getExpeditionNodeInfos().size());
|
List<Integer> nextNodeId = ExpeditionLogic.getNextNodeId(user.getExpeditionManager().getSortid(),user.getExpeditionManager().getExpeditionNodeInfos().size());
|
||||||
if(!nextNodeId.contains(nodeId)){
|
if(!nextNodeId.contains(nodeId)){
|
||||||
throw new ErrorCodeException(ErrorCode.newDefineCode("节点信息错误 节点状态不正确"));
|
throw new ErrorCodeException(ErrorCode.newDefineCode("节点信息错误 节点状态不正确"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SExpeditionHolyConfig sExpeditionHolyConfig = STableManager.getConfig(SExpeditionHolyConfig.class).get(itemId);
|
|
||||||
if(sExpeditionHolyConfig==null){
|
|
||||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
//updata node
|
//updata node
|
||||||
Set<CommonProto.ExpeditionNodeInfo> nodeInfos = ExpeditionLogic.openLay(user,nodeInfo.getLay(),nodeId);
|
Set<CommonProto.ExpeditionNodeInfo> nodeInfos = ExpeditionLogic.openLay(user,nodeInfo.getLay(),nodeId);
|
||||||
|
|
||||||
|
|
||||||
//更新背包
|
|
||||||
ExpeditionItem expeditionItem = new ExpeditionItem(iSession.getUid(), itemId);
|
|
||||||
ExpeditionManager expeditionManager = user.getExpeditionManager();
|
|
||||||
expeditionManager.addPropertyItems(expeditionItem);
|
|
||||||
expeditionManager.setGetHolyTiem(expeditionManager.getGetHolyTiem()+1);
|
|
||||||
//更新effectitem 参与计算
|
|
||||||
if(expeditionManager.getEffectItems().size()==0){
|
|
||||||
ExpeditionLogic.getFirstRankHoly(expeditionManager);
|
|
||||||
}
|
|
||||||
Map<Integer,SExpeditionHolyConfig> effectItems = expeditionManager.getEffectItems();
|
|
||||||
SExpeditionHolyConfig orDefault = effectItems.getOrDefault(sExpeditionHolyConfig.geteffect(), null);
|
|
||||||
|
|
||||||
if(orDefault==null){
|
|
||||||
effectItems.put(sExpeditionHolyConfig.geteffect(),sExpeditionHolyConfig);
|
|
||||||
}else {
|
|
||||||
if(sExpeditionHolyConfig.gettype()>orDefault.gettype()){
|
|
||||||
effectItems.put(sExpeditionHolyConfig.geteffect(),sExpeditionHolyConfig);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//添加专属英雄圣物缓存
|
|
||||||
if(sExpeditionHolyConfig.getHeroId() > 0){
|
|
||||||
expeditionManager.addHeroItems(sExpeditionHolyConfig);
|
|
||||||
}
|
|
||||||
|
|
||||||
//notify client
|
|
||||||
Expedition.ExpeditionEquipIndication.Builder indication = Expedition.ExpeditionEquipIndication.newBuilder();
|
|
||||||
indication.addEquipIds(CommonProto.ExpeditionEquip.newBuilder().setId(expeditionItem.getId()).setEquiptId(expeditionItem.getEquipId()).build());
|
|
||||||
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_HOLY_BAG_INDICATION_VALUE, indication.build(), true);
|
|
||||||
|
|
||||||
Expedition.ExpeditionNodeInfoIndication.Builder builder = Expedition.ExpeditionNodeInfoIndication.newBuilder();
|
Expedition.ExpeditionNodeInfoIndication.Builder builder = Expedition.ExpeditionNodeInfoIndication.newBuilder();
|
||||||
builder.addAllNodeInfo(nodeInfos);
|
builder.addAllNodeInfo(nodeInfos);
|
||||||
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
|
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_NOINFO_INDICATION_VALUE, builder.build(), true);
|
||||||
|
|
||||||
Expedition.TakeHolyEquipResponse.Builder build = Expedition.TakeHolyEquipResponse.newBuilder().setEquipId(expeditionItem.getId());
|
// 领取圣遗物
|
||||||
|
String expeditionId = ExpeditionLogic.getInstance().takeHoly(iSession, itemId);
|
||||||
|
Expedition.TakeHolyEquipResponse.Builder build = Expedition.TakeHolyEquipResponse.newBuilder().setEquipId(expeditionId);
|
||||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_TAKE_HOLY_EQUIP_RESONSE_VALUE, build.build(), true);
|
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.EXPEDITION_TAKE_HOLY_EQUIP_RESONSE_VALUE, build.build(), true);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,6 @@ public class Cmd_role_gm extends GmRoleAbstract {
|
||||||
manager.clearPropertyItems();
|
manager.clearPropertyItems();
|
||||||
manager.getHeroHPWithChange().clear();
|
manager.getHeroHPWithChange().clear();
|
||||||
manager.clearHeroToTemp();
|
manager.clearHeroToTemp();
|
||||||
manager.clearEquipToTemp();
|
|
||||||
manager.clearExpeditionNodeInfos();
|
manager.clearExpeditionNodeInfos();
|
||||||
|
|
||||||
//创建节点束河
|
//创建节点束河
|
||||||
|
|
@ -112,7 +111,7 @@ public class Cmd_role_gm extends GmRoleAbstract {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
user.getExpeditionManager().putExpeditionNodeInfos(sortId, nodeInfo);
|
user.getExpeditionManager().putExpeditionNodeInfos(nodeInfo);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,14 @@ import com.ljsd.jieling.logic.activity.activityLogic.GmSingleActivityLogic;
|
||||||
import com.ljsd.jieling.logic.activity.activityLogic.WeekCardLogic;
|
import com.ljsd.jieling.logic.activity.activityLogic.WeekCardLogic;
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
||||||
|
import com.ljsd.jieling.logic.activity.event.ZeroRefreshEvent;
|
||||||
import com.ljsd.jieling.logic.activity.eventhandler.*;
|
import com.ljsd.jieling.logic.activity.eventhandler.*;
|
||||||
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
|
||||||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||||
import com.ljsd.jieling.logic.arena.ChallengeLogic;
|
import com.ljsd.jieling.logic.arena.ChallengeLogic;
|
||||||
import com.ljsd.jieling.logic.championship.ChampionshipLogic;
|
|
||||||
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
||||||
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
|
||||||
import com.ljsd.jieling.logic.family.GuildFightLogic;
|
import com.ljsd.jieling.logic.family.GuildFightLogic;
|
||||||
import com.ljsd.jieling.logic.family.GuildLogic;
|
import com.ljsd.jieling.logic.family.GuildLogic;
|
||||||
import com.ljsd.jieling.logic.friend.FriendLogic;
|
import com.ljsd.jieling.logic.friend.FriendLogic;
|
||||||
|
|
@ -425,7 +424,6 @@ public class GlobalDataManaager implements IManager {
|
||||||
PlayerLogic.getInstance().vipflushEveryDay(user,fBuilder);
|
PlayerLogic.getInstance().vipflushEveryDay(user,fBuilder);
|
||||||
PlayerLogic.getInstance().flushUserdataEvery(user,fBuilder);
|
PlayerLogic.getInstance().flushUserdataEvery(user,fBuilder);
|
||||||
GuildLogic.getInstance().flushEveryDay(user,fBuilder);
|
GuildLogic.getInstance().flushEveryDay(user,fBuilder);
|
||||||
ExpeditionLogic.getInstance().flushUserdataEveryDay(user);
|
|
||||||
MapLogic.getInstance().flushEndlessTreasure(user);
|
MapLogic.getInstance().flushEndlessTreasure(user);
|
||||||
//检测下称号
|
//检测下称号
|
||||||
CBean2Proto.getUserTitleList(user);
|
CBean2Proto.getUserTitleList(user);
|
||||||
|
|
@ -447,6 +445,8 @@ public class GlobalDataManaager implements IManager {
|
||||||
ArenaLogic.getInstance().takeTitleReward(user);
|
ArenaLogic.getInstance().takeTitleReward(user);
|
||||||
// gm单笔更新
|
// gm单笔更新
|
||||||
GmSingleActivityLogic.getInstance().updateGmSingle(user);
|
GmSingleActivityLogic.getInstance().updateGmSingle(user);
|
||||||
|
// 大闹天宫隔天刷新
|
||||||
|
Poster.getPoster().dispatchEvent(new ZeroRefreshEvent(user.getId()));
|
||||||
|
|
||||||
WeekCardLogic.getInstance().weekCardInfoIndication(user,0,0);
|
WeekCardLogic.getInstance().weekCardInfoIndication(user,0,0);
|
||||||
ChallengeLogic.getInstance().ChallengeInfoIndication(session);
|
ChallengeLogic.getInstance().ChallengeInfoIndication(session);
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,7 @@ public interface ActivityType {
|
||||||
int FABAO_BOOK_REWARD = 118;//法宝图鉴宝箱
|
int FABAO_BOOK_REWARD = 118;//法宝图鉴宝箱
|
||||||
int DRAW_FABAO_LV_CHEST = 119;//抽卡等级宝箱
|
int DRAW_FABAO_LV_CHEST = 119;//抽卡等级宝箱
|
||||||
int TIAN_JIANG_GIFT = 120;//天降礼包
|
int TIAN_JIANG_GIFT = 120;//天降礼包
|
||||||
|
int DA_NAO_TIAN_GONG = 121;//大闹天宫
|
||||||
|
|
||||||
//***************************************bt活动=====================================//
|
//***************************************bt活动=====================================//
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,7 @@ public enum ActivityTypeEnum {
|
||||||
FABAO_BOOK_REWARD(ActivityType.FABAO_BOOK_REWARD,FabaoBookRewardActivity::new),//法宝图鉴宝箱
|
FABAO_BOOK_REWARD(ActivityType.FABAO_BOOK_REWARD,FabaoBookRewardActivity::new),//法宝图鉴宝箱
|
||||||
DRAW_FABAO_LV_CHEST(ActivityType.DRAW_FABAO_LV_CHEST,DrawLvChestActivity::new),//抽卡等级宝箱
|
DRAW_FABAO_LV_CHEST(ActivityType.DRAW_FABAO_LV_CHEST,DrawLvChestActivity::new),//抽卡等级宝箱
|
||||||
TIAN_JIANG_GIFT(ActivityType.TIAN_JIANG_GIFT,DefaultEmptyActivity::new),//抽卡等级宝箱
|
TIAN_JIANG_GIFT(ActivityType.TIAN_JIANG_GIFT,DefaultEmptyActivity::new),//抽卡等级宝箱
|
||||||
|
DA_NAO_TIAN_GONG(ActivityType.DA_NAO_TIAN_GONG, DaNaoTianGongActivity::new),//大闹天宫
|
||||||
|
|
||||||
/****************************************************** bt **********************************************************/
|
/****************************************************** bt **********************************************************/
|
||||||
BRUSH_PRIVILEGE(ActivityType.BRUSH_PRIVILEGE, BrushPrivilegeActivity::new),//刷充特权
|
BRUSH_PRIVILEGE(ActivityType.BRUSH_PRIVILEGE, BrushPrivilegeActivity::new),//刷充特权
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,105 @@
|
||||||
|
package com.ljsd.jieling.logic.activity;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
|
import com.ljsd.jieling.jbean.ActivityMission;
|
||||||
|
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||||
|
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||||
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
|
import com.ljsd.jieling.logic.activity.event.ZeroRefreshEvent;
|
||||||
|
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.network.session.ISession;
|
||||||
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
|
import config.SSpecialConfig;
|
||||||
|
import rpc.protocols.CommonProto;
|
||||||
|
import rpc.protocols.PlayerInfoProto;
|
||||||
|
|
||||||
|
import java.text.MessageFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
public class DaNaoTianGongActivity extends AbstractActivity{
|
||||||
|
|
||||||
|
public DaNaoTianGongActivity(int id) {
|
||||||
|
super(id);
|
||||||
|
Poster.getPoster().listenEvent(this, ZeroRefreshEvent.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initActivity(User user) throws Exception {
|
||||||
|
ActivityMission mission = new ActivityMission();
|
||||||
|
ActivityLogic.getInstance().initOtherMission(mission,new ArrayList<>());
|
||||||
|
user.getActivityManager().getActivityMissionMap().put(id, mission);
|
||||||
|
|
||||||
|
ExpeditionLogic.getInstance().flushUserdataEveryDay(user);
|
||||||
|
refresh(user);
|
||||||
|
LOGGER.info("大闹天宫初始化...uid={} activityId={}",user.getId(), id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onEvent(IEvent event) throws Exception {
|
||||||
|
// 类型验证
|
||||||
|
if (!(event instanceof ZeroRefreshEvent)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 获取信息
|
||||||
|
ZeroRefreshEvent event1 = (ZeroRefreshEvent) event;
|
||||||
|
User user = UserManager.getUser(event1.getUid());
|
||||||
|
refresh(user);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refresh(User user){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean takeReward(ISession session, int missionId) throws Exception {
|
||||||
|
User user = UserManager.getUser(session.getUid());
|
||||||
|
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||||
|
if (mission == null || mission.getActivityState() != ActivityType.OPEN_STATE){
|
||||||
|
String format = MessageFormat.format("大闹天宫退出,活动数据未开启,uid:{0},活动id:{1}", user.getId(), id);
|
||||||
|
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN, format);
|
||||||
|
}
|
||||||
|
if (mission.getV() == 1) {
|
||||||
|
String format = MessageFormat.format("大闹天宫退出,奖励已领取,uid:{0},活动id:{1},档位id:{2}", user.getId(), id, missionId);
|
||||||
|
throw new ErrorCodeException(ErrorCode.HAD_TAKE_REWARD, format);
|
||||||
|
}
|
||||||
|
|
||||||
|
checkAndSetProgress(mission,missionId,ActivityType.HAD_TAKED);
|
||||||
|
|
||||||
|
int[] value = SSpecialConfig.getOnceArrayValue("Danaotiangong_daily_reward");
|
||||||
|
int[][] reward = {value};
|
||||||
|
|
||||||
|
// reward
|
||||||
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user, reward, BIReason.TAKE_ACTIVITY_REWARD);
|
||||||
|
PlayerInfoProto.TakeActivityRewardResponse build = PlayerInfoProto.TakeActivityRewardResponse.newBuilder().setDrop(drop).build();
|
||||||
|
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
||||||
|
// 状态推送
|
||||||
|
sendActivityProgress(session, null);
|
||||||
|
// 打点上报
|
||||||
|
reportTakeActivityReward(user,reward,missionId);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领奖后更新奖励进度
|
||||||
|
*/
|
||||||
|
public void checkAndSetProgress(ActivityMission activityMission, int missionId, int state) {
|
||||||
|
ActivityProgressInfo progressInfo = new ActivityProgressInfo();
|
||||||
|
progressInfo.setState(state);
|
||||||
|
activityMission.getActivityMissionMap().put(missionId, progressInfo);
|
||||||
|
activityMission.setV(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkActivityMissionFinishAndTake(int uid, int activityId, ActivityMission activityMission) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,11 +2,8 @@ package com.ljsd.jieling.logic.activity;
|
||||||
|
|
||||||
import com.ljsd.jieling.exception.ErrorCode;
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
import com.ljsd.jieling.jbean.ActivityMission;
|
import com.ljsd.jieling.jbean.ActivityMission;
|
||||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
|
||||||
import com.ljsd.jieling.logic.activity.activityLogic.WeekCardLogic;
|
import com.ljsd.jieling.logic.activity.activityLogic.WeekCardLogic;
|
||||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
|
|
@ -14,19 +11,9 @@ import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||||
import com.ljsd.jieling.logic.store.newRechargeInfo.NewRechargeInfo;
|
|
||||||
import com.ljsd.jieling.logic.store.newRechargeInfo.RechargeType;
|
|
||||||
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.AbstractWelfareBag;
|
|
||||||
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.PerpetualWelfareBag;
|
|
||||||
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.ReceiveWelfareBag;
|
|
||||||
import com.ljsd.jieling.logic.store.newRechargeInfo.rechargeHandler.RechargeHandler;
|
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
|
||||||
import com.ljsd.jieling.util.ItemUtil;
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
|
||||||
import config.*;
|
import config.*;
|
||||||
import manager.STableManager;
|
import manager.STableManager;
|
||||||
import rpc.protocols.CommonProto;
|
|
||||||
import rpc.protocols.PlayerInfoProto;
|
|
||||||
import util.TimeUtils;
|
import util.TimeUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
@ -52,7 +39,6 @@ public class WeekCardActivity extends AbstractActivity {
|
||||||
|
|
||||||
// 初始化礼包信息
|
// 初始化礼包信息
|
||||||
user.getPlayerInfoManager().setWeekCard(new HashMap<>());
|
user.getPlayerInfoManager().setWeekCard(new HashMap<>());
|
||||||
|
|
||||||
LOGGER.info("月卡初始化...uid={} activityId={}",user.getId(), id);
|
LOGGER.info("月卡初始化...uid={} activityId={}",user.getId(), id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.ljsd.jieling.logic.activity.event;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每日零点刷新
|
||||||
|
*/
|
||||||
|
public class ZeroRefreshEvent implements IEvent{
|
||||||
|
private int uid;
|
||||||
|
|
||||||
|
public ZeroRefreshEvent(int uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUid() {
|
||||||
|
return uid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUid(int uid) {
|
||||||
|
this.uid = uid;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
package com.ljsd.jieling.logic.dao;
|
package com.ljsd.jieling.logic.dao;
|
||||||
|
|
||||||
import com.ljsd.common.mogodb.MongoBase;
|
import com.ljsd.common.mogodb.MongoBase;
|
||||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
|
||||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
|
||||||
import config.SExpeditionHolyConfig;
|
import config.SExpeditionHolyConfig;
|
||||||
import manager.STableManager;
|
|
||||||
import org.springframework.data.annotation.Transient;
|
import org.springframework.data.annotation.Transient;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
|
|
@ -38,16 +37,15 @@ public class ExpeditionManager extends MongoBase {
|
||||||
|
|
||||||
private Map<String, Hero> heroMap = new HashMap<>();
|
private Map<String, Hero> heroMap = new HashMap<>();
|
||||||
private Map<String,PropertyItem> equipMap = new HashMap<>();
|
private Map<String,PropertyItem> equipMap = new HashMap<>();
|
||||||
private Map<String, Hero> heroMapTemp = new HashMap<>();
|
|
||||||
private Map<Integer,Map<String, Hero>> heroNodeMapTemp = new HashMap<>();
|
private Map<Integer,Map<String, Hero>> heroNodeMapTemp = new HashMap<>();
|
||||||
private Map<String,PropertyItem> equipMapTemp = new HashMap<>();
|
|
||||||
|
|
||||||
public ExpeditionManager(){
|
public ExpeditionManager(){
|
||||||
//初始化的时候把当前轮数赋值,不能使用0
|
//初始化的时候把当前轮数赋值,不能使用0
|
||||||
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Expedition);
|
// TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Expedition);
|
||||||
this.setCurrentTime(openTimeOfFuntionCacheByType==null?1:openTimeOfFuntionCacheByType.getTimes());
|
// this.setCurrentTime(openTimeOfFuntionCacheByType==null?1:openTimeOfFuntionCacheByType.getTimes());
|
||||||
}
|
}
|
||||||
public void putExpeditionNodeInfos(Integer key, ExpeditionNodeInfo nodeInfo) {
|
|
||||||
|
public void putExpeditionNodeInfos(ExpeditionNodeInfo nodeInfo) {
|
||||||
this.expeditionNodeInfos.put(nodeInfo.getSortId(), nodeInfo);
|
this.expeditionNodeInfos.put(nodeInfo.getSortId(), nodeInfo);
|
||||||
nodeInfo.init(this.getRootId(), getMongoKey() + ".expeditionNodeInfos." + nodeInfo.getSortId());
|
nodeInfo.init(this.getRootId(), getMongoKey() + ".expeditionNodeInfos." + nodeInfo.getSortId());
|
||||||
updateString("expeditionNodeInfos." + nodeInfo.getSortId(), nodeInfo);
|
updateString("expeditionNodeInfos." + nodeInfo.getSortId(), nodeInfo);
|
||||||
|
|
@ -124,26 +122,10 @@ public class ExpeditionManager extends MongoBase {
|
||||||
updateString("propertyItems", this.propertyItems);
|
updateString("propertyItems", this.propertyItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public int getForceSnap() {
|
|
||||||
return forceSnap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setForceSnap(int forceSnap) {
|
|
||||||
updateString("forceSnap", forceSnap);
|
|
||||||
this.forceSnap = forceSnap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<Integer, SExpeditionHolyConfig> getEffectItems() {
|
public Map<Integer, SExpeditionHolyConfig> getEffectItems() {
|
||||||
return effectItems;
|
return effectItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetTreasureReward(){
|
|
||||||
worldTreasureReward.reset();
|
|
||||||
onlyUpdateTreasureReward();
|
|
||||||
}
|
|
||||||
|
|
||||||
public WorldTreasureReward getWorldTreasureReward() {
|
public WorldTreasureReward getWorldTreasureReward() {
|
||||||
updateString("worldTreasureReward", worldTreasureReward);
|
updateString("worldTreasureReward", worldTreasureReward);
|
||||||
return worldTreasureReward;
|
return worldTreasureReward;
|
||||||
|
|
@ -181,14 +163,14 @@ public class ExpeditionManager extends MongoBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void addHero(Hero hero) throws Exception {
|
public void addHero(Hero hero) {
|
||||||
//绑定关系
|
//绑定关系
|
||||||
hero.init(this.getRootId(),getMongoKey() + ".heroMap." + hero.getId());
|
hero.init(this.getRootId(),getMongoKey() + ".heroMap." + hero.getId());
|
||||||
updateString("heroMap." + hero.getId(), hero);
|
updateString("heroMap." + hero.getId(), hero);
|
||||||
heroMap.put(hero.getId(), hero);
|
heroMap.put(hero.getId(), hero);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addHeroToTemp(Hero hero,int nodeID) throws Exception {
|
public void addHeroToTemp(Hero hero,int nodeID) {
|
||||||
//绑定关系
|
//绑定关系
|
||||||
hero.init(this.getRootId(),getMongoKey() + ".heroNodeMapTemp."+nodeID+"."+ hero.getId());
|
hero.init(this.getRootId(),getMongoKey() + ".heroNodeMapTemp."+nodeID+"."+ hero.getId());
|
||||||
Map<String, Hero> orDefault = heroNodeMapTemp.getOrDefault(nodeID, new HashMap<>());
|
Map<String, Hero> orDefault = heroNodeMapTemp.getOrDefault(nodeID, new HashMap<>());
|
||||||
|
|
@ -197,7 +179,7 @@ public class ExpeditionManager extends MongoBase {
|
||||||
heroNodeMapTemp.put(nodeID,orDefault);
|
heroNodeMapTemp.put(nodeID,orDefault);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearHeroToTemp() throws Exception {
|
public void clearHeroToTemp() {
|
||||||
heroNodeMapTemp.clear();
|
heroNodeMapTemp.clear();
|
||||||
updateString("heroNodeMapTemp" , heroNodeMapTemp);
|
updateString("heroNodeMapTemp" , heroNodeMapTemp);
|
||||||
}
|
}
|
||||||
|
|
@ -225,17 +207,6 @@ public class ExpeditionManager extends MongoBase {
|
||||||
updateString("equipMap", equipMap);
|
updateString("equipMap", equipMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clearEquipToTemp(){
|
|
||||||
equipMapTemp.clear();
|
|
||||||
updateString("equipMapTemp" , equipMapTemp);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void addEquipToTemp(PropertyItem equip){
|
|
||||||
equip.init(this.getRootId(),getMongoKey() + ".equipMapTemp." + equip.getId());
|
|
||||||
updateString("equipMapTemp." + equip.getId(), equip);
|
|
||||||
equipMapTemp.put(equip.getId(),equip);
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getFreshTime() {
|
public int getFreshTime() {
|
||||||
return freshTime;
|
return freshTime;
|
||||||
}
|
}
|
||||||
|
|
@ -249,10 +220,6 @@ public class ExpeditionManager extends MongoBase {
|
||||||
return heroNodeMapTemp.getOrDefault(sortid,new HashMap<>());
|
return heroNodeMapTemp.getOrDefault(sortid,new HashMap<>());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, PropertyItem> getEquipMapTemp() {
|
|
||||||
return equipMapTemp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, PropertyItem> getEquipMap() {
|
public Map<String, PropertyItem> getEquipMap() {
|
||||||
return equipMap;
|
return equipMap;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,10 +95,10 @@ public class BattleNode extends AbstractExpedition {
|
||||||
private void nodeHolyInfo(User user, int type, SExpeditionFloorConfig cfg, ExpeditionNodeInfo nodeInfo){
|
private void nodeHolyInfo(User user, int type, SExpeditionFloorConfig cfg, ExpeditionNodeInfo nodeInfo){
|
||||||
Set<Integer> staffsSet = new HashSet<>();
|
Set<Integer> staffsSet = new HashSet<>();
|
||||||
while (staffsSet.size()<3){
|
while (staffsSet.size()<3){
|
||||||
|
int[][] probability = cfg.getHolyProbability();
|
||||||
int[][] holyProbability = new int[cfg.getHolyProbability().length][2];
|
int[][] holyProbability = new int[probability.length][2];
|
||||||
for(int j = 0; j < holyProbability.length; j++){
|
for(int j = 0; j < holyProbability.length; j++){
|
||||||
System.arraycopy(cfg.getHolyProbability()[j], 0, holyProbability[j], 0, 2);
|
System.arraycopy(probability[j], 0, holyProbability[j], 0, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
SExpeditionNodeConfig sExpeditionNodeConfig = STableManager.getConfig(SExpeditionNodeConfig.class).get(type);
|
SExpeditionNodeConfig sExpeditionNodeConfig = STableManager.getConfig(SExpeditionNodeConfig.class).get(type);
|
||||||
|
|
@ -113,7 +113,7 @@ public class BattleNode extends AbstractExpedition {
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Map<Integer, Integer> type2holy2weight = getType2holy2weightRemoveHas(user,ints);
|
Map<Integer, Integer> type2holy2weight = getType2holy2weightRemoveHas(user, ints);
|
||||||
int i1 = ExpeditionLogic.ranndomFromWeight(type2holy2weight);
|
int i1 = ExpeditionLogic.ranndomFromWeight(type2holy2weight);
|
||||||
staffsSet.add(i1);
|
staffsSet.add(i1);
|
||||||
}
|
}
|
||||||
|
|
@ -161,7 +161,7 @@ public class BattleNode extends AbstractExpedition {
|
||||||
|
|
||||||
int level = originalLevel+offset;
|
int level = originalLevel+offset;
|
||||||
|
|
||||||
return level>1?level:1;
|
return Math.max(level, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -236,7 +236,7 @@ public class BattleNode extends AbstractExpedition {
|
||||||
Map<String, Hero> expeditonHeroMap = expeditionManager.getHeroMap();
|
Map<String, Hero> expeditonHeroMap = expeditionManager.getHeroMap();
|
||||||
Set<Integer> expeditonHeroIds = new HashSet<>();
|
Set<Integer> expeditonHeroIds = new HashSet<>();
|
||||||
expeditonHeroMap.values().forEach(v->expeditonHeroIds.add(v.getTemplateId()));
|
expeditonHeroMap.values().forEach(v->expeditonHeroIds.add(v.getTemplateId()));
|
||||||
expeditionManager.getGHeroSet().forEach(v->expeditonHeroIds.add(v));
|
expeditonHeroIds.addAll(expeditionManager.getGHeroSet());
|
||||||
|
|
||||||
// 已生成得节点圣物信息
|
// 已生成得节点圣物信息
|
||||||
Set<Integer> nodeHolyInfo = getNodeHolyInfo(user);
|
Set<Integer> nodeHolyInfo = getNodeHolyInfo(user);
|
||||||
|
|
@ -262,7 +262,6 @@ public class BattleNode extends AbstractExpedition {
|
||||||
// 已经生成过得圣物
|
// 已经生成过得圣物
|
||||||
if(nodeHolyInfo.contains(v)){
|
if(nodeHolyInfo.contains(v)){
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return valueMap;
|
return valueMap;
|
||||||
|
|
|
||||||
|
|
@ -3,14 +3,11 @@ package com.ljsd.jieling.logic.expedition;
|
||||||
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
||||||
import com.ljsd.jieling.config.clazzStaticCfg.PlayStaticConfig;
|
import com.ljsd.jieling.config.clazzStaticCfg.PlayStaticConfig;
|
||||||
import com.ljsd.jieling.config.clazzStaticCfg.WorldBossTreasureStaticConfig;
|
import com.ljsd.jieling.config.clazzStaticCfg.WorldBossTreasureStaticConfig;
|
||||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
|
||||||
import com.ljsd.jieling.exception.ErrorCode;
|
import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
import com.ljsd.jieling.handler.Expedition.expedtionItem.ExpedtionItemHandler;
|
import com.ljsd.jieling.handler.Expedition.expedtionItem.ExpedtionItemHandler;
|
||||||
import com.ljsd.jieling.handler.Expedition.expedtionItem.HolyEnum;
|
import com.ljsd.jieling.handler.Expedition.expedtionItem.HolyEnum;
|
||||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
|
||||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
import com.ljsd.jieling.logic.dao.*;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
|
@ -18,9 +15,7 @@ import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
|
||||||
import com.ljsd.jieling.logic.store.StoreLogic;
|
import com.ljsd.jieling.logic.store.StoreLogic;
|
||||||
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.ReceiveWelfareBag;
|
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import com.ljsd.jieling.util.ItemUtil;
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
|
|
@ -85,19 +80,8 @@ public class ExpeditionLogic {
|
||||||
//每日重置
|
//每日重置
|
||||||
public void flushUserdataEveryDay(User user) throws Exception {
|
public void flushUserdataEveryDay(User user) throws Exception {
|
||||||
LOGGER.info("大闹天宫刷新逻辑开始");
|
LOGGER.info("大闹天宫刷新逻辑开始");
|
||||||
checkAndResetTreasure(user);
|
|
||||||
|
|
||||||
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Expedition);
|
|
||||||
if (openTimeOfFuntionCacheByType == null){
|
|
||||||
LOGGER.error("大闹天宫刷新逻辑退出,大闹天宫功能类型为空");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ExpeditionManager manager = user.getExpeditionManager();
|
ExpeditionManager manager = user.getExpeditionManager();
|
||||||
if(manager.getCurrentTime()==openTimeOfFuntionCacheByType.getTimes()){
|
|
||||||
LOGGER.error("大闹天宫刷新逻辑退出 ,usertimes:{},systimes:{}",manager.getCurrentTime(),openTimeOfFuntionCacheByType.getTimes());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
takeAllReward(user);
|
takeAllReward(user);
|
||||||
manager.clearExpeditionNodeInfos();
|
manager.clearExpeditionNodeInfos();
|
||||||
manager.setLay(1);
|
manager.setLay(1);
|
||||||
|
|
@ -110,15 +94,12 @@ public class ExpeditionLogic {
|
||||||
manager.clearRewardBox();
|
manager.clearRewardBox();
|
||||||
manager.clearPropertyItems();
|
manager.clearPropertyItems();
|
||||||
manager.getHeroHPWithChange().clear();
|
manager.getHeroHPWithChange().clear();
|
||||||
manager.setCurrentTime(openTimeOfFuntionCacheByType.getTimes());
|
|
||||||
manager.clearHeroToTemp();
|
manager.clearHeroToTemp();
|
||||||
manager.getHeroMap().clear();
|
manager.getHeroMap().clear();
|
||||||
manager.clearEquipToTemp();
|
|
||||||
manager.clearEquip();//删除多余装备
|
manager.clearEquip();//删除多余装备
|
||||||
manager.getEffectItems().clear();
|
manager.getEffectItems().clear();
|
||||||
manager.clearHeroItems();
|
manager.clearHeroItems();
|
||||||
manager.getGHeroSet().clear();
|
manager.getGHeroSet().clear();
|
||||||
manager.setFreshTime((int)(openTimeOfFuntionCacheByType.getStartTime()/1000));
|
|
||||||
|
|
||||||
SExpeditionSetting sExpeditionSetting = STableManager.getConfig(SExpeditionSetting.class).get(1);
|
SExpeditionSetting sExpeditionSetting = STableManager.getConfig(SExpeditionSetting.class).get(1);
|
||||||
if(sExpeditionSetting == null){
|
if(sExpeditionSetting == null){
|
||||||
|
|
@ -132,9 +113,8 @@ public class ExpeditionLogic {
|
||||||
manager.setSortid(0);
|
manager.setSortid(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SGlobalSystemConfig sGlobalSystemConfig = STableManager.getConfig(SGlobalSystemConfig.class).get(FunctionIdEnum.Expedition.getFunctionType());
|
|
||||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||||
if (GlobleSystemLogic.checkOpen(user,sGlobalSystemConfig) && session !=null) {
|
if (session != null) {
|
||||||
builder.addAllLay(manager.getRewardBox());
|
builder.addAllLay(manager.getRewardBox());
|
||||||
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user));
|
builder.addAllHeroInfo(ExpeditionLogic.getInstance().getAllHeroInfo(user));
|
||||||
builder.addAllNodeInfo(ExpeditionLogic.getInstance().getNodeInfo(user));
|
builder.addAllNodeInfo(ExpeditionLogic.getInstance().getNodeInfo(user));
|
||||||
|
|
@ -143,8 +123,8 @@ public class ExpeditionLogic {
|
||||||
builder.addAllEquip(new ArrayList<>());
|
builder.addAllEquip(new ArrayList<>());
|
||||||
builder.addAllEquip(new ArrayList<>());
|
builder.addAllEquip(new ArrayList<>());
|
||||||
builder.setStartTime(manager.getFreshTime());
|
builder.setStartTime(manager.getFreshTime());
|
||||||
|
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.ExpeditionResetIndication.getNumber(), builder.build(), true);
|
||||||
}
|
}
|
||||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.ExpeditionResetIndication.getNumber(), builder.build(), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void takeAllReward(User user)throws Exception {
|
private void takeAllReward(User user)throws Exception {
|
||||||
|
|
@ -170,6 +150,49 @@ public class ExpeditionLogic {
|
||||||
MailLogic.getInstance().sendMail(user.getId(), title, content, mailReward, nowTime, Global.MAIL_EFFECTIVE_TIME);
|
MailLogic.getInstance().sendMail(user.getId(), title, content, mailReward, nowTime, Global.MAIL_EFFECTIVE_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领取圣遗物入库
|
||||||
|
* @param session
|
||||||
|
* @param itemId
|
||||||
|
* @return
|
||||||
|
* @throws ErrorCodeException
|
||||||
|
*/
|
||||||
|
public String takeHoly(ISession session, int itemId) throws Exception {
|
||||||
|
SExpeditionHolyConfig sExpeditionHolyConfig = STableManager.getConfig(SExpeditionHolyConfig.class).get(itemId);
|
||||||
|
if(sExpeditionHolyConfig==null){
|
||||||
|
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||||
|
}
|
||||||
|
User user = UserManager.getUser(session.getUid());
|
||||||
|
//更新背包
|
||||||
|
ExpeditionItem expeditionItem = new ExpeditionItem(user.getId(), itemId);
|
||||||
|
ExpeditionManager expeditionManager = user.getExpeditionManager();
|
||||||
|
expeditionManager.addPropertyItems(expeditionItem);
|
||||||
|
expeditionManager.setGetHolyTiem(expeditionManager.getGetHolyTiem()+1);
|
||||||
|
//更新effectitem 参与计算
|
||||||
|
if(expeditionManager.getEffectItems().size()==0){
|
||||||
|
ExpeditionLogic.getFirstRankHoly(expeditionManager);
|
||||||
|
}
|
||||||
|
Map<Integer,SExpeditionHolyConfig> effectItems = expeditionManager.getEffectItems();
|
||||||
|
SExpeditionHolyConfig orDefault = effectItems.getOrDefault(sExpeditionHolyConfig.geteffect(), null);
|
||||||
|
|
||||||
|
if(orDefault==null){
|
||||||
|
effectItems.put(sExpeditionHolyConfig.geteffect(),sExpeditionHolyConfig);
|
||||||
|
}else {
|
||||||
|
if(sExpeditionHolyConfig.gettype()>orDefault.gettype()){
|
||||||
|
effectItems.put(sExpeditionHolyConfig.geteffect(),sExpeditionHolyConfig);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//添加专属英雄圣物缓存
|
||||||
|
if(sExpeditionHolyConfig.getHeroId() > 0){
|
||||||
|
expeditionManager.addHeroItems(sExpeditionHolyConfig);
|
||||||
|
}
|
||||||
|
//推送背包
|
||||||
|
Expedition.ExpeditionEquipIndication.Builder indication = Expedition.ExpeditionEquipIndication.newBuilder();
|
||||||
|
indication.addEquipIds(CommonProto.ExpeditionEquip.newBuilder().setId(expeditionItem.getId()).setEquiptId(expeditionItem.getEquipId()).build());
|
||||||
|
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.EXPEDITION_HOLY_BAG_INDICATION_VALUE, indication.build(), true);
|
||||||
|
return expeditionItem.getId();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 初始化下一层
|
* 初始化下一层
|
||||||
*/
|
*/
|
||||||
|
|
@ -294,7 +317,7 @@ public class ExpeditionLogic {
|
||||||
/**
|
/**
|
||||||
* 获取节点结构 确定type id state
|
* 获取节点结构 确定type id state
|
||||||
*/
|
*/
|
||||||
private Set<ExpeditionNodeInfo> createNodeSet(User user,int leve) throws Exception {
|
private void createNodeSet(User user, int leve) throws Exception {
|
||||||
// 配置表信息
|
// 配置表信息
|
||||||
SExpeditionSetting sExpeditionSetting = STableManager.getConfig(SExpeditionSetting.class).get(1);
|
SExpeditionSetting sExpeditionSetting = STableManager.getConfig(SExpeditionSetting.class).get(1);
|
||||||
if(leve-1>sExpeditionSetting.getMatchForce().length){
|
if(leve-1>sExpeditionSetting.getMatchForce().length){
|
||||||
|
|
@ -307,7 +330,7 @@ public class ExpeditionLogic {
|
||||||
// 根据层数获取对应得每行id
|
// 根据层数获取对应得每行id
|
||||||
Set<Integer> ids = STableManager.getFigureConfig(CommonStaticConfig.class).leve2ids.get(leve);
|
Set<Integer> ids = STableManager.getFigureConfig(CommonStaticConfig.class).leve2ids.get(leve);
|
||||||
if(ids==null){
|
if(ids==null){
|
||||||
return nodeSets;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建节点
|
// 创建节点
|
||||||
|
|
@ -317,7 +340,6 @@ public class ExpeditionLogic {
|
||||||
createNodesByLay(user,sExpeditionFloorConfig.getId(),leve,nodeSets);
|
createNodesByLay(user,sExpeditionFloorConfig.getId(),leve,nodeSets);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nodeSets;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -344,7 +366,7 @@ public class ExpeditionLogic {
|
||||||
ExpeditionNodeInfo nodeInfo = expedition.creatNodes(user.getId(), id, leve, sort, config.getFloorLay());
|
ExpeditionNodeInfo nodeInfo = expedition.creatNodes(user.getId(), id, leve, sort, config.getFloorLay());
|
||||||
nodeSets.add(nodeInfo);
|
nodeSets.add(nodeInfo);
|
||||||
// mongodb:入库
|
// mongodb:入库
|
||||||
user.getExpeditionManager().putExpeditionNodeInfos(nodeInfo.getSortId(), nodeInfo);
|
user.getExpeditionManager().putExpeditionNodeInfos(nodeInfo);
|
||||||
sort++;
|
sort++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -518,47 +540,51 @@ public class ExpeditionLogic {
|
||||||
|
|
||||||
|
|
||||||
public static void openTreasure(User user,int type,int parm){
|
public static void openTreasure(User user,int type,int parm){
|
||||||
SExpeditionSetting sExpeditionSetting = STableManager.getConfig(SExpeditionSetting.class).get(1);
|
// SExpeditionSetting sExpeditionSetting = STableManager.getConfig(SExpeditionSetting.class).get(1);
|
||||||
int[] openRule = sExpeditionSetting.getOpenRules();
|
// int[] openRule = sExpeditionSetting.getOpenRules();
|
||||||
if(openRule[0] == type && openRule[1] == parm){
|
// if(openRule[0] == type && openRule[1] == parm){
|
||||||
//国服设置第十四天后开启
|
// //国服设置第十四天后开启
|
||||||
user.getExpeditionManager().getWorldTreasureReward().setFirstStartTime((int)((TimeUtils.now()+14*TimeUtils.ONE_DAY)/1000));
|
// user.getExpeditionManager().getWorldTreasureReward().setFirstStartTime((int)((TimeUtils.now()+14*TimeUtils.ONE_DAY)/1000));
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 天宫秘宝刷新逻辑,暂不用
|
||||||
|
* @param user
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
private static void checkAndResetTreasure(User user) throws Exception {
|
private static void checkAndResetTreasure(User user) throws Exception {
|
||||||
WorldTreasureReward worldTreasureReward = user.getExpeditionManager().getWorldTreasureReward();
|
// WorldTreasureReward worldTreasureReward = user.getExpeditionManager().getWorldTreasureReward();
|
||||||
int nowInt = TimeUtils.nowInt();
|
// int nowInt = TimeUtils.nowInt();
|
||||||
if(worldTreasureReward.getFirstStartTime()> nowInt){
|
// if(worldTreasureReward.getFirstStartTime()> nowInt){
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
int createTime =worldTreasureReward.getCreateTime();
|
// int createTime =worldTreasureReward.getCreateTime();
|
||||||
//重置
|
// //重置
|
||||||
if(nowInt >=createTime){
|
// if(nowInt >= createTime){
|
||||||
user.getExpeditionManager().resetTreasureReward();
|
// user.getExpeditionManager().resetTreasureReward();
|
||||||
// 天宫秘宝礼包刷新
|
// // 天宫秘宝礼包刷新
|
||||||
ReceiveWelfareBag bagInfo = (ReceiveWelfareBag) user.getPlayerInfoManager().getNewRechargeInfo().getReceiveMap().get(106);
|
// ReceiveWelfareBag bagInfo = (ReceiveWelfareBag) user.getPlayerInfoManager().getNewRechargeInfo().getReceiveMap().get(106);
|
||||||
if (bagInfo == null){
|
// if (bagInfo == null){
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
bagInfo.refresh();
|
// bagInfo.refresh();
|
||||||
sendAllTreasureInfo(user);
|
// sendAllTreasureInfo(user);
|
||||||
BuyGoodsNewLogic.sendGiftGooodsIndication(user.getId());
|
// BuyGoodsNewLogic.sendGiftGooodsIndication(user.getId());
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void sendAllTreasureInfo(User user){
|
private static void sendAllTreasureInfo(User user){
|
||||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
// ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||||
if(session!=null){
|
// if(session!=null){
|
||||||
WorldTreasureReward worldTreasureReward = user.getExpeditionManager().getWorldTreasureReward();
|
// WorldTreasureReward worldTreasureReward = user.getExpeditionManager().getWorldTreasureReward();
|
||||||
Map<Integer, Integer> rewardStatusMap = worldTreasureReward.getRewardStatusMap();
|
// Map<Integer, Integer> rewardStatusMap = worldTreasureReward.getRewardStatusMap();
|
||||||
WorldBossTreasureStaticConfig worldBossTreasureStaticConfig = STableManager.getFigureConfig(WorldBossTreasureStaticConfig.class);
|
// WorldBossTreasureStaticConfig worldBossTreasureStaticConfig = STableManager.getFigureConfig(WorldBossTreasureStaticConfig.class);
|
||||||
Map<Integer, Set<SWorldBossTreasureConfig>> idsByPeriods = worldBossTreasureStaticConfig.getIdsByPeriods();
|
// Map<Integer, Set<SWorldBossTreasureConfig>> idsByPeriods = worldBossTreasureStaticConfig.getIdsByPeriods();
|
||||||
Map<Integer,Integer> changeStateMap = new HashMap<>(rewardStatusMap);
|
// Map<Integer,Integer> changeStateMap = new HashMap<>(rewardStatusMap);
|
||||||
idsByPeriods.get(worldTreasureReward.getRound()).forEach(item->changeStateMap.putIfAbsent(item.getId(),0));
|
// idsByPeriods.get(worldTreasureReward.getRound()).forEach(item->changeStateMap.putIfAbsent(item.getId(),0));
|
||||||
sendTreasureRewardUpdate(session,0,changeStateMap,worldTreasureReward.getCreateTime(),worldTreasureReward.getIsBuy());
|
// sendTreasureRewardUpdate(session,0,changeStateMap,worldTreasureReward.getCreateTime(),worldTreasureReward.getIsBuy());
|
||||||
}
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendTreasureRewardUpdate(ISession iSession,int score,Map<Integer,Integer> changeStatusMap,int time,int isBuy){
|
public static void sendTreasureRewardUpdate(ISession iSession,int score,Map<Integer,Integer> changeStatusMap,int time,int isBuy){
|
||||||
|
|
@ -567,7 +593,6 @@ public class ExpeditionLogic {
|
||||||
changeStatusMap.forEach((id,status)-> builder.addTreasureRewardState(Expedition.TreasureRewardState.newBuilder().setId(id).setState(status).build()));
|
changeStatusMap.forEach((id,status)-> builder.addTreasureRewardState(Expedition.TreasureRewardState.newBuilder().setId(id).setState(status).build()));
|
||||||
builder.setIsBuy(isBuy);
|
builder.setIsBuy(isBuy);
|
||||||
MessageUtil.sendIndicationMessage(iSession,1, MessageTypeProto.MessageType.EXPEDITION_TREASURE_STATE_INDICATION_VALUE,builder.build(),true);
|
MessageUtil.sendIndicationMessage(iSession,1, MessageTypeProto.MessageType.EXPEDITION_TREASURE_STATE_INDICATION_VALUE,builder.build(),true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -724,7 +749,7 @@ public class ExpeditionLogic {
|
||||||
* 猎妖之路 使用
|
* 猎妖之路 使用
|
||||||
* 需要添加被动
|
* 需要添加被动
|
||||||
*/
|
*/
|
||||||
public static CommonProto.FightTeamInfo getFightTeamInfoWithDouble(User user, int teamId, Map<String, Double> attackBloodMap) {
|
public static CommonProto.FightTeamInfo getFightTeamInfoWithDouble(User user, int teamId, Map<String, Double> attackBloodMap) {
|
||||||
user.getTeamPosManager().setCurTeamPosId(teamId);
|
user.getTeamPosManager().setCurTeamPosId(teamId);
|
||||||
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
List<CommonProto.FightUnitInfo> heroFightInfos = new ArrayList<>();
|
||||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,11 @@ public class PushWelfareBag extends AbstractWelfareBag {
|
||||||
|
|
||||||
public PushWelfareBag(User user, SRechargeCommodityNewConfig config){
|
public PushWelfareBag(User user, SRechargeCommodityNewConfig config){
|
||||||
setModId(config.getId());
|
setModId(config.getId());
|
||||||
|
setOpen(true);
|
||||||
setStartTime(TimeUtils.now());
|
setStartTime(TimeUtils.now());
|
||||||
setEndTime(getStartTime() + getTime() * TimeUtils.HOUR);
|
setEndTime(getStartTime() + getTime() * TimeUtils.HOUR);
|
||||||
user.getPlayerInfoManager().getNewRechargeInfo().addPush(this);
|
|
||||||
this.setRootCollection(User._COLLECTION_NAME);
|
this.setRootCollection(User._COLLECTION_NAME);
|
||||||
|
user.getPlayerInfoManager().getNewRechargeInfo().addPush(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ public class PushHandler extends AbstractRechargeHandler {
|
||||||
boolean result = super.refreshStatus(user, rechargeId);
|
boolean result = super.refreshStatus(user, rechargeId);
|
||||||
AbstractWelfareBag bag = getBag(user, rechargeId);
|
AbstractWelfareBag bag = getBag(user, rechargeId);
|
||||||
if(bag.isOpen()){
|
if(bag.isOpen()){
|
||||||
SRechargeCommodityNewConfig config = SRechargeCommodityNewConfig.getConfigById(rechargeId);
|
|
||||||
long now = TimeUtils.now();
|
long now = TimeUtils.now();
|
||||||
// 结束时间到
|
// 结束时间到
|
||||||
if(bag.getEndTime() != 0 && now > bag.getEndTime()){
|
if(bag.getEndTime() != 0 && now > bag.getEndTime()){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue