主线任务
parent
ae84d45e79
commit
4116399900
|
@ -1,11 +0,0 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
@Table(name = "MissionEventsConfig")
|
||||
public class SCMissionEventsConfig implements BaseConfig {
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="MissionEventsConfig")
|
||||
public class SMissionEventsConfig implements BaseConfig {
|
||||
|
||||
public static Map<Integer, SMissionEventsConfig> sMissionEventsConfigMap;
|
||||
|
||||
private int id;
|
||||
|
||||
private int type;
|
||||
|
||||
private int missionNum;
|
||||
|
||||
private int reward;
|
||||
|
||||
private int[] openRules;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sMissionEventsConfigMap = STableManager.getConfig(SMissionEventsConfig.class);
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getMissionNum() {
|
||||
return missionNum;
|
||||
}
|
||||
|
||||
public int getReward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
public int[] getOpenRules() {
|
||||
return openRules;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -17,21 +17,41 @@ public class EventType {
|
|||
|
||||
/**
|
||||
* 小事件类型
|
||||
* 1战斗
|
||||
* 2消耗物品
|
||||
* 3侦察
|
||||
* 4离开
|
||||
* 5行动到某张地图某坐标点
|
||||
* 6进度条
|
||||
* 7生成新的地图点
|
||||
* 8吃buff
|
||||
* 9确认
|
||||
* 1 战斗
|
||||
* 行为参数:怪物组id
|
||||
* 2 消耗物品
|
||||
* 行为参数:物品id#物品数量
|
||||
* 3 侦察
|
||||
* 行为参数:照妖镜id#数量
|
||||
* 5 行动到某张地图某坐标点
|
||||
* 行为参数:0代表为主城 地图id#坐标(x,y)
|
||||
* 6 进度条
|
||||
* 行为参数:读条时间
|
||||
* 7 讨债类型(先从所有事件点里面随机三个,然后事件点位置空白区域随机出)
|
||||
* 行为参数:任务id#事件点id#事件点id#事件点id
|
||||
* 8 吃buff
|
||||
* 行为参数:buff id
|
||||
* 9 完成任务往下推一步并销毁当前事件点
|
||||
* 行为参数:任务id
|
||||
* 10 监听打怪数量
|
||||
* 行为参数:怪物id#num#任务id#当前步骤
|
||||
* 11 完成任务往下推一步并开启新的事件点(未开启前不显示)
|
||||
* 行为参数:任务id#地图id#坐标id#事件点id#地图id#坐标id#事件点id
|
||||
* 13 完成任务往下推一步不销毁事件点
|
||||
* 行为参数:任务id
|
||||
* 14 完成任务往下推一步并消耗物品,不摧毁事件点
|
||||
* 行为参数:物品id#物品数量#任务id
|
||||
*/
|
||||
public static final int fight = 1;
|
||||
public static final int useItem = 2;
|
||||
public static final int scout = 3;
|
||||
public static final int leave = 4;
|
||||
public static final int jump = 5;
|
||||
public static final int dialogue = 7;
|
||||
public static final int dun = 7;
|
||||
public static final int eatBuff = 8;
|
||||
public static final int destroyMission = 9;
|
||||
public static final int monitorMission = 10;
|
||||
public static final int openMission = 11;
|
||||
public static final int finishMission = 13;
|
||||
public static final int useItemMission = 14;
|
||||
}
|
||||
|
|
|
@ -4,10 +4,9 @@ import com.ljsd.jieling.config.*;
|
|||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.MapManager;
|
||||
import com.ljsd.jieling.logic.dao.User;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.handler.mission.Mission;
|
||||
import com.ljsd.jieling.handler.mission.MissionLogic;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
|
@ -283,6 +282,7 @@ public class MapLogic {
|
|||
boolean isSuccess = false;
|
||||
int behaviorType = sOptionConfig.getBehaviorType();
|
||||
int[][] behaviorTypeValues = sOptionConfig.getBehaviorTypeValues();
|
||||
CommonProto.Mission openMission = null;
|
||||
switch (behaviorType) {
|
||||
case EventType.fight: {
|
||||
// heroFightInfos = fightStart(uid, bigEventId, user);
|
||||
|
@ -305,8 +305,55 @@ public class MapLogic {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case EventType.dialogue: {
|
||||
|
||||
case EventType.dun: {
|
||||
boolean hasMission = MissionLogic.getInstance().hasMission(user, behaviorTypeValues[0][0]);
|
||||
if (hasMission) {
|
||||
break;
|
||||
}
|
||||
SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(mapManager.getCurMapId());
|
||||
int[] mapSize = scMapConfig.getSize();
|
||||
Map<Integer, Cell> newDunEvents = new HashMap<>();
|
||||
Map<Integer, MapPointConfig> newDunEventIds = new HashMap<>();
|
||||
int i = 0;
|
||||
Random random = new Random();
|
||||
while (newDunEventIds.size() < 3) {
|
||||
int newDunEventId = behaviorTypeValues[0][random.nextInt(behaviorTypeValues[0].length - 1) + 1];
|
||||
MapPointConfig mapPointConfig = MapPointConfig.scMapEventMap.get(newDunEventId);
|
||||
newDunEventIds.put(newDunEventIds.size(), mapPointConfig);
|
||||
i++;
|
||||
if (i >= 1000) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (newDunEventIds.size() < 3) {
|
||||
break;
|
||||
}
|
||||
i = 0;
|
||||
while (newDunEvents.size() < 3) {
|
||||
int x = random.nextInt(mapSize[0]);
|
||||
int y = random.nextInt(mapSize[1]);
|
||||
int xy = CellUtil.xy2Pos(x, y);
|
||||
if (mapManager.getMapInfo().containsKey(xy)) {
|
||||
continue;
|
||||
}
|
||||
MapPointConfig mapPointConfig = newDunEventIds.get(newDunEvents.size());
|
||||
Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId());
|
||||
newDunEvents.put(xy, cellValue);
|
||||
i++;
|
||||
if (i >= 1000) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
mapManager.getMapInfo().putAll(newDunEvents);
|
||||
Mission mission = new Mission();
|
||||
mission.setMissionId(behaviorTypeValues[0][0]);
|
||||
mission.setMissionStep(0);
|
||||
mission.setMissionStep(0);
|
||||
mission.getMissionInfos().putAll(newDunEvents);
|
||||
Map<Integer, Mission> doingMissions = user.getMissionManager().getDoingMissions();
|
||||
doingMissions.put(behaviorTypeValues[0][0], mission);
|
||||
user.getMissionManager().updateDoingMissions(doingMissions);
|
||||
openMission = getMission(newDunEvents, mission);
|
||||
break;
|
||||
}
|
||||
case EventType.jump: {
|
||||
|
@ -317,6 +364,71 @@ public class MapLogic {
|
|||
}
|
||||
break;
|
||||
}
|
||||
case EventType.destroyMission: {
|
||||
isSuccess = true;
|
||||
Map<Integer, Mission> doingMissions = user.getMissionManager().getDoingMissions();
|
||||
Mission mission = doingMissions.get(behaviorTypeValues[0][0]);
|
||||
if (mission == null) {
|
||||
break;
|
||||
}
|
||||
MissionLogic.getInstance().checkMission(mission, user);
|
||||
Map<Integer, Cell> mapInfo = mapManager.getMapInfo();
|
||||
mapInfo.remove(mapManager.getCurXY());
|
||||
mapManager.setMapInfo(mapInfo);
|
||||
openMission = getMission(null, mission);
|
||||
break;
|
||||
}
|
||||
case EventType.monitorMission: {
|
||||
isSuccess = true;
|
||||
Map<Integer, Mission> doingMissions = user.getMissionManager().getDoingMissions();
|
||||
Mission mission = doingMissions.get(behaviorTypeValues[0][0]);
|
||||
if (mission == null) {
|
||||
break;
|
||||
}
|
||||
MissionLogic.getInstance().checkMission(mission, user);
|
||||
openMission = getMission(null, mission);
|
||||
break;
|
||||
}
|
||||
case EventType.openMission: {
|
||||
isSuccess = true;
|
||||
Map<Integer, Mission> doingMissions = user.getMissionManager().getDoingMissions();
|
||||
Mission mission = doingMissions.get(behaviorTypeValues[0][0]);
|
||||
if (mission == null) {
|
||||
break;
|
||||
}
|
||||
MissionLogic.getInstance().checkMission(mission, user);
|
||||
openMission = getMission(null, mission);
|
||||
// TODO 还要开新事件
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
case EventType.finishMission: {
|
||||
isSuccess = true;
|
||||
Map<Integer, Mission> doingMissions = user.getMissionManager().getDoingMissions();
|
||||
Mission mission = doingMissions.get(behaviorTypeValues[0][0]);
|
||||
if (mission == null) {
|
||||
break;
|
||||
}
|
||||
MissionLogic.getInstance().checkMission(mission, user);
|
||||
openMission = getMission(null, mission);
|
||||
break;
|
||||
}
|
||||
case EventType.useItemMission: {
|
||||
isSuccess = true;
|
||||
Map<Integer, Mission> doingMissions = user.getMissionManager().getDoingMissions();
|
||||
Mission mission = doingMissions.get(behaviorTypeValues[0][0]);
|
||||
if (mission == null) {
|
||||
break;
|
||||
}
|
||||
boolean checkCost = ItemUtil.itemCost(user, behaviorTypeValues);
|
||||
if (!checkCost) {
|
||||
break;
|
||||
}
|
||||
MissionLogic.getInstance().checkMission(mission, user);
|
||||
openMission = getMission(null, mission);
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
break;
|
||||
}
|
||||
|
@ -422,10 +534,33 @@ public class MapLogic {
|
|||
if (dropBuilder != null) {
|
||||
eventUpdateResponse.setDrop(dropBuilder);
|
||||
}
|
||||
if (openMission != null) {
|
||||
eventUpdateResponse.setMission(openMission);
|
||||
}
|
||||
LOGGER.info("updateEvent =====>success<====== xy=>{}, getPointId=>{} eventId={}", mapManager.getCurXY(), cell.getPointId(), cell.getEventId());
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), eventUpdateResponse.build(), true);
|
||||
}
|
||||
|
||||
private CommonProto.Mission getMission(Map<Integer, Cell> newDunEvents, Mission mission) {
|
||||
CommonProto.Mission openMission;
|
||||
StringBuilder state = null;
|
||||
if (newDunEvents != null) {
|
||||
state = new StringBuilder();
|
||||
for (Map.Entry<Integer, Cell> cellEntry : newDunEvents.entrySet()) {
|
||||
state.append(cellEntry.getKey());
|
||||
state.append("#");
|
||||
state.append(cellEntry.getValue().getEventId());
|
||||
state.append("|");
|
||||
}
|
||||
}
|
||||
openMission = CommonProto.Mission.newBuilder()
|
||||
.setItemId(mission.getMissionId())
|
||||
.setMissionStep(mission.getMissionStep())
|
||||
.setState(state == null ? "" : state.toString())
|
||||
.build();
|
||||
return openMission;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退出地图
|
||||
* @param session
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package com.ljsd.jieling.handler.mission;
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.handler.map.Cell;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class Mission extends MongoBase {
|
||||
|
||||
private int missionId;
|
||||
|
||||
private int missionStep;
|
||||
|
||||
private Map<Integer, Cell> missionInfos = new ConcurrentHashMap<>();
|
||||
|
||||
public int getMissionId() {
|
||||
return missionId;
|
||||
}
|
||||
|
||||
public void setMissionId(int missionId) {
|
||||
this.missionId = missionId;
|
||||
}
|
||||
|
||||
public int getMissionStep() {
|
||||
return missionStep;
|
||||
}
|
||||
|
||||
public void setMissionStep(int missionStep) {
|
||||
this.missionStep = missionStep;
|
||||
}
|
||||
|
||||
public Map<Integer, Cell> getMissionInfos() {
|
||||
return missionInfos;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.ljsd.jieling.handler.mission;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
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;
|
||||
|
||||
@Component
|
||||
public class MissionGetAllRequestHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.MISSION_GET_ALL_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
MissionLogic.getInstance().getAllMissions(iSession, MessageTypeProto.MessageType.MISSION_GET_ALL_RESPONSE);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,126 @@
|
|||
package com.ljsd.jieling.handler.mission;
|
||||
|
||||
import com.ljsd.jieling.config.SMissionEventsConfig;
|
||||
import com.ljsd.jieling.handler.map.Cell;
|
||||
import com.ljsd.jieling.logic.dao.User;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.MissionInfoProto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class MissionLogic {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(MissionLogic.class);
|
||||
|
||||
private MissionLogic() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取单例
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static MissionLogic getInstance() {
|
||||
return MissionLogic.Instance.instance;
|
||||
}
|
||||
|
||||
public static class Instance {
|
||||
public final static MissionLogic instance = new MissionLogic();
|
||||
}
|
||||
|
||||
public void getAllMissions(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
MissionManager missionManager = user.getMissionManager();
|
||||
Map<Integer, Mission> doingMissions = missionManager.getDoingMissions();
|
||||
Set<Integer> finishMissions = missionManager.getFinishMissions();
|
||||
MissionInfoProto.MissionGetAllResponse.Builder missionGetAllResponse = MissionInfoProto.MissionGetAllResponse.newBuilder();
|
||||
for (Mission doingMission : doingMissions.values()) {
|
||||
StringBuilder state = new StringBuilder();
|
||||
if (!doingMission.getMissionInfos().isEmpty()) {
|
||||
for (Map.Entry<Integer, Cell> cellEntry : doingMission.getMissionInfos().entrySet()) {
|
||||
state.append(cellEntry.getKey());
|
||||
state.append("#");
|
||||
state.append(cellEntry.getValue().getEventId());
|
||||
state.append("|");
|
||||
}
|
||||
}
|
||||
CommonProto.Mission mission = CommonProto.Mission
|
||||
.newBuilder()
|
||||
.setMissionStep(doingMission.getMissionStep())
|
||||
.setItemId(doingMission.getMissionId())
|
||||
.setState(state.toString())
|
||||
.build();
|
||||
missionGetAllResponse.addMissions(mission);
|
||||
}
|
||||
for (int finishMission : finishMissions) {
|
||||
SMissionEventsConfig sMissionEventsConfig = SMissionEventsConfig.sMissionEventsConfigMap.get(finishMission);
|
||||
CommonProto.Mission mission = CommonProto.Mission
|
||||
.newBuilder()
|
||||
.setMissionStep(sMissionEventsConfig.getMissionNum())
|
||||
.setItemId(finishMission)
|
||||
.setState("")
|
||||
.build();
|
||||
missionGetAllResponse.addMissions(mission);
|
||||
}
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), missionGetAllResponse.build(), true);
|
||||
}
|
||||
|
||||
public boolean hasMission(User user, int missionId) {
|
||||
MissionManager missionManager = user.getMissionManager();
|
||||
if (missionManager.getTakeRewardMissions().contains(missionId)){
|
||||
return true;
|
||||
}
|
||||
if (missionManager.getDoingMissions().containsKey(missionId)) {
|
||||
return true;
|
||||
}
|
||||
if (missionManager.getTakeRewardMissions().contains(missionId)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int checkMission(Mission mission, User user) throws Exception {
|
||||
SMissionEventsConfig sMissionEventsConfig = SMissionEventsConfig.sMissionEventsConfigMap.get(mission.getMissionId());
|
||||
mission.setMissionStep(mission.getMissionStep() + 1);
|
||||
if (mission.getMissionStep() >= sMissionEventsConfig.getMissionNum()) {
|
||||
Map<Integer, Mission> doingMissions = user.getMissionManager().getDoingMissions();
|
||||
doingMissions.remove(mission.getMissionId());
|
||||
user.getMissionManager().updateDoingMissions(doingMissions);
|
||||
Set<Integer> finishMissions = user.getMissionManager().getFinishMissions();
|
||||
finishMissions.add(mission.getMissionId());
|
||||
user.getMissionManager().updateFinishMissions(finishMissions);
|
||||
return mission.getMissionId();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
public void takeMissionReward(ISession session, int missionId, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
Set<Integer> finishMissions = user.getMissionManager().getFinishMissions();
|
||||
if (!finishMissions.contains(missionId)) {
|
||||
return;
|
||||
}
|
||||
finishMissions.remove(missionId);
|
||||
user.getMissionManager().updateFinishMissions(finishMissions);
|
||||
user.getMissionManager().addTakeRewardMissions(missionId);
|
||||
SMissionEventsConfig sMissionEventsConfig = SMissionEventsConfig.sMissionEventsConfigMap.get(missionId);
|
||||
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder();//ItemUtil.drop(user, new int[][]);
|
||||
MissionInfoProto.TakeMissionResponse takeMissionResponse =
|
||||
MissionInfoProto.TakeMissionResponse
|
||||
.newBuilder()
|
||||
.setDrop(drop)
|
||||
.build();
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), takeMissionResponse, true);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.ljsd.jieling.handler.mission;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class MissionManager extends MongoBase {
|
||||
|
||||
private Map<Integer, Mission> doingMissions = new ConcurrentHashMap<>();
|
||||
|
||||
private Set<Integer> finishMissions = Sets.newConcurrentHashSet();
|
||||
|
||||
private Set<Integer> takeRewardMissions = Sets.newConcurrentHashSet();
|
||||
|
||||
public Map<Integer, Mission> getDoingMissions() {
|
||||
return doingMissions;
|
||||
}
|
||||
|
||||
public Set<Integer> getFinishMissions() {
|
||||
return finishMissions;
|
||||
}
|
||||
|
||||
public Set<Integer> getTakeRewardMissions() {
|
||||
return takeRewardMissions;
|
||||
}
|
||||
|
||||
public void updateDoingMissions(Map<Integer, Mission> doingMissions) throws Exception {
|
||||
this.doingMissions = doingMissions;
|
||||
updateString( "doingMissions", doingMissions);
|
||||
}
|
||||
|
||||
public void updateFinishMissions(Set<Integer> finishMissions) throws Exception {
|
||||
this.finishMissions = finishMissions;
|
||||
updateString( "finishMissions", finishMissions);
|
||||
}
|
||||
|
||||
public void addTakeRewardMissions(int missionId) throws Exception {
|
||||
takeRewardMissions.add(missionId);
|
||||
updateString( "takeRewardMissions", takeRewardMissions);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.ljsd.jieling.handler.mission;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.protocols.MissionInfoProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class MissionTakeRewardRequestHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.MISSION_TAKE_REWARD_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
byte[] message = netData.parseClientProtoNetData();
|
||||
MissionInfoProto.TakeMissionRewardRequest takeMissionRewardRequest = MissionInfoProto.TakeMissionRewardRequest.parseFrom(message);
|
||||
int missionId = takeMissionRewardRequest.getMissionId();
|
||||
MissionLogic.getInstance().takeMissionReward(iSession, missionId, MessageTypeProto.MessageType.MISSION_TAKE_REWARD_RESPONSE);
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.logic.dao;
|
|||
|
||||
import com.ljsd.common.mogodb.LjsdMongoTemplate;
|
||||
import com.ljsd.common.mogodb.MongoRoot;
|
||||
import com.ljsd.jieling.handler.mission.MissionManager;
|
||||
|
||||
public class User extends MongoRoot {
|
||||
public static final String _COLLECTION_NAME = "user";
|
||||
|
@ -15,6 +16,8 @@ public class User extends MongoRoot {
|
|||
|
||||
private MapManager mapManager;
|
||||
|
||||
private MissionManager missionManager;
|
||||
|
||||
private TeamPosManager teamPosManager;
|
||||
|
||||
private MailManager mailManager;
|
||||
|
@ -35,6 +38,7 @@ public class User extends MongoRoot {
|
|||
this.itemManager = itemManager;
|
||||
this.heroManager = heroManager;
|
||||
this.mapManager = mapManager;
|
||||
this.missionManager = new MissionManager();
|
||||
this.teamPosManager = new TeamPosManager();
|
||||
this.mailManager = new MailManager();
|
||||
this.equipManager = new EquipManager();
|
||||
|
@ -46,6 +50,7 @@ public class User extends MongoRoot {
|
|||
this.itemManager.init(this, "itemManager", false);
|
||||
this.heroManager.init(this, "heroManager", false);
|
||||
this.mapManager.init(this, "mapManager", false);
|
||||
this.missionManager.init(this, "missionManager", false);
|
||||
this.teamPosManager.init(this,"teamPosManager",false);
|
||||
this.mailManager.init(this,"mailManager",false);
|
||||
this.equipManager.init(this,"equipManager",false);
|
||||
|
@ -59,6 +64,7 @@ public class User extends MongoRoot {
|
|||
this.itemManager = new ItemManager();
|
||||
this.heroManager = new HeroManager();
|
||||
this.mapManager = new MapManager();
|
||||
this.missionManager = new MissionManager();
|
||||
this.equipManager = new EquipManager();
|
||||
this.adventureManager = new AdventureManager();
|
||||
this.pokemonManager = new PokemonManager();
|
||||
|
@ -68,6 +74,7 @@ public class User extends MongoRoot {
|
|||
heroManager.init(this, "heroManager", false);
|
||||
mapManager.init(this, "mapManager", false);
|
||||
equipManager.init(this,"equipManager",false);
|
||||
missionManager.init(this, "missionManager", false);
|
||||
adventureManager.init(this,"adventureManager",false);
|
||||
adventureManager.init(this,"pokemonManager",false);
|
||||
}
|
||||
|
@ -144,4 +151,8 @@ public class User extends MongoRoot {
|
|||
public PokemonManager getPokemonManager() {
|
||||
return pokemonManager;
|
||||
}
|
||||
|
||||
public MissionManager getMissionManager() {
|
||||
return missionManager;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue