TASK【ID1005460】【玩法需求】猎妖之路
parent
9593490df6
commit
da646a7f5c
|
|
@ -42,4 +42,5 @@ public class MongoKey {
|
|||
public final static String questionManager = "questionManager";
|
||||
public final static String bloodyInfo = "bloodyInfo";
|
||||
public final static String mainLevelManager = "mainLevelManager";
|
||||
public final static String expeditionManager = "expeditionManager";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
package com.ljsd.jieling.handler.Expedition;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.Expedition;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
||||
/**
|
||||
* Description: des
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/1/7 16:23
|
||||
*/
|
||||
public class TakeLayRewardHandler extends BaseHandler<Expedition.TakeExpeditionBoxRewardRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, Expedition.TakeExpeditionBoxRewardRequest proto) throws Exception {
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
int lay = proto.getLay();
|
||||
if(user.getExpeditionManager().getLay()<=lay){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("条件未达成"));
|
||||
}
|
||||
//TODO cfg check
|
||||
|
||||
|
||||
|
||||
//up miss
|
||||
// int[][] reward ;
|
||||
// CommonProto.Drop.Builder drop = ItemUtil.drop(user, reward, BIReason.TAKE_ACTIVITY_REWARD);
|
||||
//
|
||||
//
|
||||
//
|
||||
// PlayerInfoProto.TakeActivityRewardResponse build = PlayerInfoProto.TakeActivityRewardResponse.newBuilder().setDrop(drop).build();
|
||||
// MessageUtil.sendMessage(iSession, 1, rewardResponseValue, build, true);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -18,10 +18,12 @@ import com.ljsd.jieling.logic.activity.UserLevelEventHandler;
|
|||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||
import com.ljsd.jieling.logic.blood.BloodLogic;
|
||||
import com.ljsd.jieling.logic.championship.ChampionshipLogic;
|
||||
import com.ljsd.jieling.logic.dao.ExpeditionManager;
|
||||
import com.ljsd.jieling.logic.dao.ServerConfig;
|
||||
import com.ljsd.jieling.logic.dao.TimeControllerOfFunction;
|
||||
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
||||
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.friend.FriendLogic;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
|
|
@ -322,6 +324,7 @@ public class GlobalDataManaager implements IManager {
|
|||
PlayerLogic.getInstance().vipflushEveryDay(user,fBuilder);
|
||||
PlayerLogic.getInstance().flushUserdataEvery(user,fBuilder);
|
||||
BuyGoodsLogic.flushEveryDay(user);
|
||||
ExpeditionLogic.getInstance().flushUserdataEveryDay(user);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_REFRESH,0);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.BLOODY_REFRESH,0);
|
||||
FriendLogic.getInstance().refreshState(session);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
package com.ljsd.jieling.logic.dao;
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/1/7 11:46
|
||||
*/
|
||||
public class ExpeditionManager extends MongoBase {
|
||||
|
||||
private Map<Integer,Double> heroHP = new HashMap<>();//英雄血量
|
||||
private Map<Integer,ExpeditionNodeInfo> expeditionNodeInfos = new HashMap<>();
|
||||
private int lay=1;//当前层数
|
||||
|
||||
public void putExpeditionNodeInfos(Integer key,ExpeditionNodeInfo nodeInfo) {
|
||||
this.expeditionNodeInfos.put(key,nodeInfo);
|
||||
updateString("ExpeditionNodeInfo." + key, nodeInfo);
|
||||
}
|
||||
|
||||
public void setExpeditionNodeInfos(Map<Integer, ExpeditionNodeInfo> expeditionNodeInfos) {
|
||||
this.expeditionNodeInfos = expeditionNodeInfos;
|
||||
}
|
||||
|
||||
public int getLay() {
|
||||
return lay;
|
||||
}
|
||||
|
||||
public void setLay(int lay) {
|
||||
this.lay = lay;
|
||||
}
|
||||
|
||||
public Map<Integer, Double> getHeroHP() {
|
||||
return heroHP;
|
||||
}
|
||||
|
||||
public void setHeroHP(Map<Integer, Double> heroHP) {
|
||||
this.heroHP = heroHP;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.ljsd.jieling.logic.dao;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description: des
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/1/7 14:49
|
||||
*/
|
||||
public class ExpeditionNodeInfo {
|
||||
private int sortId;//节点id
|
||||
private int lay;//节点层数
|
||||
private int type;//节点类型
|
||||
private int bossinfo;
|
||||
private int state;//节点状态//0未开启 1未通过 2未领取圣物 3已完成
|
||||
private Map<Integer,Double> bossHP = new HashMap<>();//怪物血量
|
||||
|
||||
|
||||
public int getSortId() {
|
||||
return sortId;
|
||||
}
|
||||
|
||||
public void setSortId(int sortId) {
|
||||
this.sortId = sortId;
|
||||
}
|
||||
|
||||
public int getLay() {
|
||||
return lay;
|
||||
}
|
||||
|
||||
public void setLay(int lay) {
|
||||
this.lay = lay;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getBossinfo() {
|
||||
return bossinfo;
|
||||
}
|
||||
|
||||
public void setBossinfo(int bossinfo) {
|
||||
this.bossinfo = bossinfo;
|
||||
}
|
||||
|
||||
public int getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(int state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public Map<Integer, Double> getBossHP() {
|
||||
return bossHP;
|
||||
}
|
||||
|
||||
public void setBossHP(Map<Integer, Double> bossHP) {
|
||||
this.bossHP = bossHP;
|
||||
}
|
||||
}
|
||||
|
|
@ -46,6 +46,7 @@ public class User {
|
|||
private QuestionManager questionManager;
|
||||
private BloodyInfo bloodyInfo;
|
||||
private MainLevelManager mainLevelManager;
|
||||
private ExpeditionManager expeditionManager;
|
||||
|
||||
//构造函数必须要声明,否则从mongodb读出来反编译成类不通过
|
||||
public User(){
|
||||
|
|
@ -72,6 +73,7 @@ public class User {
|
|||
this.questionManager = new QuestionManager();
|
||||
this.bloodyInfo = new BloodyInfo();
|
||||
this.mainLevelManager = new MainLevelManager();
|
||||
this.expeditionManager = new ExpeditionManager();
|
||||
|
||||
//綁定关系
|
||||
|
||||
|
|
@ -94,6 +96,7 @@ public class User {
|
|||
this.questionManager.init(id,MongoKey.questionManager);
|
||||
this.bloodyInfo.init(id,MongoKey.bloodyInfo);
|
||||
this.mainLevelManager.init(id,MongoKey.mainLevelManager);
|
||||
this.expeditionManager.init(id,MongoKey.expeditionManager);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
|
|
@ -196,6 +199,10 @@ public class User {
|
|||
return guildMyInfo;
|
||||
}
|
||||
|
||||
public ExpeditionManager getExpeditionManager() {
|
||||
return expeditionManager;
|
||||
}
|
||||
|
||||
public RoomInfo getRoomInfo() {
|
||||
if(roomInfo == null){
|
||||
roomInfo = new RoomInfo();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
package com.ljsd.jieling.logic.expedition;
|
||||
|
||||
import com.ljsd.jieling.logic.activity.IEventHandler;
|
||||
import com.ljsd.jieling.logic.dao.ExpeditionManager;
|
||||
import com.ljsd.jieling.logic.dao.ExpeditionNodeInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Description: 远征 猎妖之路
|
||||
* Author: zsx
|
||||
* CreateDate: 2020/1/7 11:46
|
||||
*/
|
||||
public class ExpeditionLogic {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ExpeditionLogic.class);
|
||||
|
||||
private ExpeditionLogic(){
|
||||
}
|
||||
|
||||
public static class Instance {
|
||||
public final static ExpeditionLogic instance = new ExpeditionLogic();
|
||||
}
|
||||
|
||||
public static ExpeditionLogic getInstance() {
|
||||
return ExpeditionLogic.Instance.instance;
|
||||
}
|
||||
|
||||
//每日重置
|
||||
public void flushUserdataEveryDay(User user){
|
||||
Map<Integer, ExpeditionNodeInfo> expeditionNodeInfoMap = new HashMap<>();
|
||||
|
||||
//TODO
|
||||
ExpeditionManager manager = new ExpeditionManager();
|
||||
manager.setExpeditionNodeInfos(expeditionNodeInfoMap);
|
||||
manager.setLay(1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private void openLay(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue