Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
06d665e02c
|
@ -1,4 +1,5 @@
|
|||
Id OpenRule MapTime ReviveTime
|
||||
int mut,int#int,2 int mut,int#int,1
|
||||
100 0#0 600 0#0#0#10
|
||||
101 0#0 600 0#0#0#10
|
||||
102 0#0 600 0#0#0#10
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
Id MissionNum Reward
|
||||
int int int
|
||||
1 3 2000
|
||||
2 5 2001
|
||||
3 4 2024
|
||||
4 3 2002
|
||||
5 6 2025
|
||||
6 3 2003
|
||||
7 5 2004
|
||||
8 3 2005
|
||||
9 2 2006
|
||||
10 2 2007
|
||||
11 1 2008
|
||||
12 2 2009
|
||||
101 4 2002
|
||||
102 3 2002
|
||||
103 1 2002
|
||||
104 8 2002
|
||||
0 0 0
|
|
@ -0,0 +1,19 @@
|
|||
Id MissionNum Reward
|
||||
int int int
|
||||
1 3 2000
|
||||
2 5 2001
|
||||
3 4 2024
|
||||
4 3 2002
|
||||
5 6 2025
|
||||
6 3 2003
|
||||
7 5 2004
|
||||
8 3 2005
|
||||
9 2 2006
|
||||
10 2 2007
|
||||
11 1 2008
|
||||
12 2 2009
|
||||
101 4 2002
|
||||
102 3 2002
|
||||
103 1 2002
|
||||
104 8 2002
|
||||
0 0 0
|
|
@ -0,0 +1,12 @@
|
|||
Id Name SimpleLevel NormalLevel DifficultyLevel
|
||||
int string mut,float#float,1 mut,float#float,1 mut,float#float,1
|
||||
1 无名之森 1011#1021#1031#1041#1051 1012#1022#1032#1042#1052 1013#1023#1033#1043#1053
|
||||
2 河口平原 2011#2021#2031#2041#2051 2012#2022#2032#2042#2052 2013#2023#2033#2043#2053
|
||||
3 御水之都 3011#3021#3031#3041#3051 3012#3022#3032#3042#3052 3013#3023#3033#3043#3053
|
||||
4 御水废墟 4011#4021#4031#4041#4051 4012#4022#4032#4042#4052 4013#4023#4033#4043#4053
|
||||
5 血色沼泽 5011#5021#5031#5041#5051 5012#5022#5032#5042#5052 5013#5023#5033#5043#5053
|
||||
6 血色沼泽 6011#6021#6031#6041#6051 6012#6022#6032#6042#6052 6013#6023#6033#6043#6053
|
||||
7 血色沼泽 7011#7021#7031#7041#7051 7012#7022#7032#7042#7052 7013#7023#7033#7043#7053
|
||||
8 血色沼泽 8011#8021#8031#8041#8051 8012#8022#8032#8042#8052 8013#8023#8033#8043#8053
|
||||
9 血色沼泽 9011#9021#9031#9041#9051 9012#9022#9032#9042#9052 9013#9023#9033#9043#9053
|
||||
10 血色沼泽 10011#10021#10031#10041#10051 10012#10022#10032#10042#10052 10013#10023#10033#10043#10053
|
|
@ -1,6 +1,6 @@
|
|||
Id Contents Rewardgroup
|
||||
int mut,int#int,2 mut,int#int,1
|
||||
10001 5001#5002 10001
|
||||
10001 50001#50002 10001
|
||||
10101 1#2#3 10101#20101
|
||||
10102 4#5#6 10102#20102
|
||||
10103 7#8#9 10103#20103
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.ljsd.jieling.logic.Table;
|
|||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="MissionEventsConfig")
|
||||
@Table(name ="ChallengeMissionConfig")
|
||||
public class SMissionEventsConfig implements BaseConfig {
|
||||
|
||||
public static Map<Integer, SMissionEventsConfig> sMissionEventsConfigMap;
|
||||
|
|
|
@ -94,6 +94,17 @@ public class MapLogic {
|
|||
return;
|
||||
}
|
||||
SChallengeMapConfig scMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId);
|
||||
if (scMapConfig == null) {
|
||||
LOGGER.info("enterMap() uid=>{} sChallengeConfig == null =>{} ", uid, mapId);
|
||||
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "该地图不存在");
|
||||
return;
|
||||
}
|
||||
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapId);
|
||||
if (sChallengeConfig == null) {
|
||||
LOGGER.info("enterMap() uid=>{} sChallengeConfig == null =>{} ", uid, mapId);
|
||||
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "该地图不存在");
|
||||
return;
|
||||
}
|
||||
// if (scMapConfig == null || scMapConfig.getOpenRule() == null || scMapConfig.getOpenRule().length == 0) {
|
||||
// LOGGER.info("enterMap() uid=>{} mapId=>{}, scMapConfig.getOpenRule()=>{}", uid, mapId, scMapConfig == null ? "" : scMapConfig.getOpenRule());
|
||||
// MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "");
|
||||
|
@ -134,6 +145,7 @@ public class MapLogic {
|
|||
cellToProto(cells, entry);
|
||||
}
|
||||
MapInfoProto.MapEnterResponse.Builder mapEnterResponse = MapInfoProto.MapEnterResponse.newBuilder();
|
||||
mapEnterResponse.setLeftTime(getLeftTime(user));
|
||||
for (Map.Entry<Integer, Integer> buffEntry : mapManager.getFoodBufferMap().entrySet()) {
|
||||
if (buffEntry.getValue() <= 0) {
|
||||
continue;
|
||||
|
@ -141,14 +153,15 @@ public class MapLogic {
|
|||
CommonProto.FoodBuffer foodBuffer = CBean2Proto.getFoodBuffer(buffEntry.getKey(), buffEntry.getValue());
|
||||
mapEnterResponse.addFoodBuffers(foodBuffer);
|
||||
}
|
||||
mapEnterResponse.setMissions(getMission(mapManager.getMission()));
|
||||
if (mapManager.getMission() != null) {
|
||||
mapEnterResponse.setMissions(getMission(mapManager.getMission()));
|
||||
}
|
||||
mapEnterResponse.addAllMapList(cells);
|
||||
mapEnterResponse.setCurXY(mapManager.getCurXY());
|
||||
mapEnterResponse.addAllWakeCells(mapManager.getWalkCells() == null ? new ArrayList<>() : mapManager.getWalkCells());
|
||||
if (mapManager.getTemporaryItems() != null) {
|
||||
mapEnterResponse.setTemporaryItems(CBean2Proto.getDrop(mapManager.getTemporaryItems()));
|
||||
}
|
||||
mapEnterResponse.setLeftTime(getLeftTime(user));
|
||||
MessageUtil.sendMessage(iSession, 1, messageType.getNumber(), mapEnterResponse.build(), true);
|
||||
}
|
||||
|
||||
|
@ -282,6 +295,11 @@ public class MapLogic {
|
|||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||
return;
|
||||
}
|
||||
if (mapManager.getStartExporeTime() == 0) {
|
||||
LOGGER.info("mapManager.getStartExporeTime() == 0");
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "未开始探索");
|
||||
return;
|
||||
}
|
||||
if (getLeftTime(user) <= 0) {
|
||||
LOGGER.info("updateMap() uid=>{}, no step=>{}", uid, getLeftTime(user));
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||
|
@ -327,6 +345,11 @@ public class MapLogic {
|
|||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||
return;
|
||||
}
|
||||
if (mapManager.getStartExporeTime() == 0) {
|
||||
LOGGER.info("mapManager.getStartExporeTime() == 0");
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "未开始探索");
|
||||
return;
|
||||
}
|
||||
Cell cell = mapManager.getMapInfo().get(mapManager.getTriggerXY());
|
||||
if (cell == null) {
|
||||
LOGGER.info("cell == null xy is wrong =>{} triggerXY=>{}", mapManager.getCurXY(), mapManager.getTriggerXY());
|
||||
|
@ -485,7 +508,7 @@ public class MapLogic {
|
|||
}
|
||||
// LOGGER.info("updateEvent =====>success<====== xy=>{}, getPointId=>{} eventId={}, mission=>{}, nextEventId=>{}, eventBehaviorCommon=>{} {} sOptionConfig.getReward()=>{}", mapManager.getCurXY(), cell == null ? 0 : cell.getPointId(),
|
||||
// cell == null ? 0 : cell.getEventId(), eventUpdateResponse.getMissionList(), nextEventId, eventBehaviorCommon,eventUpdateResponse.getDrop(), sOptionConfig.getReward());
|
||||
LOGGER.info("updatEvent() uid=>{},nextEventId={},eventId={}", uid, nextEventId, cell == null ? 0 : cell.getEventId());
|
||||
LOGGER.info("updatEvent() uid=>{},nextEventId={},eventId={},mission=>{}", uid, nextEventId, cell == null ? 0 : cell.getEventId(), eventUpdateResponse.getMission());
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), eventUpdateResponse.build(), true);
|
||||
}
|
||||
|
||||
|
@ -666,6 +689,7 @@ public class MapLogic {
|
|||
mapManager.setTriggerXY(0);
|
||||
mapManager.setFoodBufferMap(new HashMap<>());
|
||||
TemporaryItems temporaryItems = mapManager.getTemporaryItems();
|
||||
mapManager.setMission(null);
|
||||
if (temporaryItems != null) {
|
||||
ItemUtil.addTemporaryItemToBag(user, temporaryItems, needTemporaryItem);
|
||||
mapManager.setTemporaryItems(null);
|
||||
|
@ -820,7 +844,7 @@ public class MapLogic {
|
|||
if (missionId != 0) {
|
||||
MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse = MapInfoProto.EventUpdateResponse.newBuilder();
|
||||
BehaviorUtil.updateMission(user, missionId, eventUpdateResponse);
|
||||
fightEndResponse.addAllMission(eventUpdateResponse.getMissionList());
|
||||
fightEndResponse.setMission(eventUpdateResponse.getMission());
|
||||
}
|
||||
if (destoryId != 0) {
|
||||
BehaviorUtil.destoryPoint(user, user.getMapManager().getCurMapId(), destoryId);
|
||||
|
@ -1034,7 +1058,7 @@ public class MapLogic {
|
|||
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(user.getMapManager().getCurMapId());
|
||||
long startExporeTime = user.getMapManager().getStartExporeTime();
|
||||
if (startExporeTime == 0) {
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
int useTime = (int) ((TimeUtils.now() - startExporeTime) / 1000);
|
||||
if (useTime >= sChallengeConfig.getMapTime()) {
|
||||
|
@ -1059,7 +1083,7 @@ public class MapLogic {
|
|||
} else {
|
||||
user.getMapManager().setMission(mission);
|
||||
}
|
||||
checkMissionReturn.missions.add(mission);
|
||||
checkMissionReturn.mission = mission;
|
||||
return checkMissionReturn;
|
||||
}
|
||||
|
||||
|
@ -1073,8 +1097,13 @@ public class MapLogic {
|
|||
User user = UserManager.getUser(uid);
|
||||
MapManager mapManager = user.getMapManager();
|
||||
if (mapManager.getMapInfo() == null) {
|
||||
LOGGER.info("mapManager.getMapInfo() == null");
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||
LOGGER.info("startExplorte mapManager.getMapInfo() == null");
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "未进入地图");
|
||||
return;
|
||||
}
|
||||
if (mapManager.getStartExporeTime() > 0) {
|
||||
LOGGER.info("startExplorte mapManager.getStartExporeTime() > 0 =>{}", mapManager.getStartExporeTime());
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "已开始探索");
|
||||
return;
|
||||
}
|
||||
mapManager.setStartExporeTime(TimeUtils.now());
|
||||
|
|
|
@ -44,7 +44,7 @@ public class MapManager extends MongoBase {
|
|||
|
||||
private long startExporeTime;
|
||||
|
||||
private boolean missionIsFinish;
|
||||
private int userTime;
|
||||
|
||||
private Mission mission;
|
||||
|
||||
|
@ -249,13 +249,13 @@ public class MapManager extends MongoBase {
|
|||
this.startExporeTime = startExporeTime;
|
||||
}
|
||||
|
||||
public boolean isMissionIsFinish() {
|
||||
return missionIsFinish;
|
||||
public int getUserTime() {
|
||||
return userTime;
|
||||
}
|
||||
|
||||
public void setMissionIsFinish(boolean missionIsFinish) {
|
||||
updateString("missionIsFinish", missionIsFinish);
|
||||
this.missionIsFinish = missionIsFinish;
|
||||
public void setUserTime(int userTime) {
|
||||
updateString("userTime", userTime);
|
||||
this.userTime = userTime;
|
||||
}
|
||||
|
||||
public Mission getMission() {
|
||||
|
|
|
@ -121,7 +121,6 @@ public class BehaviorUtil {
|
|||
.setTeamSkillList(HeroLogic.getInstance().getPokenmonSkills(user,teamId))
|
||||
.build();
|
||||
fightData.setHeroFightInfos(fightTeamInfo);
|
||||
|
||||
//monster
|
||||
List<CommonProto.FightUnitInfo> monsterByGroup = MonsterUtil.getMonsterByGroup(groupId);
|
||||
String monsterTeamSkill = MonsterUtil.getMonsterTeamSkillByGroup(groupId);
|
||||
|
@ -162,16 +161,14 @@ public class BehaviorUtil {
|
|||
/**
|
||||
* 更新任务
|
||||
*/
|
||||
public static boolean updateMission(User user, int missionId, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception{
|
||||
public static boolean updateMission(User user, int missionId, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
||||
Mission mission = user.getMapManager().getMission();
|
||||
if (mission == null) {
|
||||
return false;
|
||||
}
|
||||
CheckMissionReturn checkMissionReturn = MapLogic.getInstance().checkMission(mission, user);
|
||||
for (Mission missions : checkMissionReturn.missions) {
|
||||
CommonProto.Mission missionProto = MapLogic.getInstance().getMission(missions);
|
||||
eventUpdateResponse.addMission(missionProto);
|
||||
}
|
||||
CommonProto.Mission missionProto = MapLogic.getInstance().getMission(checkMissionReturn.mission);
|
||||
eventUpdateResponse.setMission(missionProto);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,6 @@ import com.ljsd.jieling.protocols.CommonProto;
|
|||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class DestroyMissionBehavior extends BaseBehavior {
|
||||
@Override
|
||||
|
@ -26,10 +24,8 @@ public class DestroyMissionBehavior extends BaseBehavior {
|
|||
}
|
||||
CheckMissionReturn checkMissionReturn = MapLogic.getInstance().checkMission(mission, user);
|
||||
BehaviorUtil.destoryCurPoint(user);
|
||||
for (Mission cmission : checkMissionReturn.missions){
|
||||
CommonProto.Mission missionProto = MapLogic.getInstance().getMission(cmission);
|
||||
eventUpdateResponse.addMission(missionProto);
|
||||
}
|
||||
CommonProto.Mission missionProto = MapLogic.getInstance().getMission(checkMissionReturn.mission);
|
||||
eventUpdateResponse.setMission(missionProto);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,6 @@ import java.util.List;
|
|||
|
||||
public class CheckMissionReturn {
|
||||
public String newEventId;
|
||||
public List<Mission> missions = new ArrayList<>();
|
||||
public Mission mission;
|
||||
public CommonProto.Drop.Builder drop;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue