地图 gm
parent
215fa27996
commit
de37dcd698
|
@ -12,6 +12,7 @@ import com.ljsd.jieling.handler.BaseHandler;
|
||||||
import com.ljsd.jieling.handler.map.MapLogic;
|
import com.ljsd.jieling.handler.map.MapLogic;
|
||||||
import com.ljsd.jieling.handler.map.MapManager;
|
import com.ljsd.jieling.handler.map.MapManager;
|
||||||
import com.ljsd.jieling.handler.map.MapMission;
|
import com.ljsd.jieling.handler.map.MapMission;
|
||||||
|
import com.ljsd.jieling.handler.mission.Mission;
|
||||||
import com.ljsd.jieling.logic.dao.Hero;
|
import com.ljsd.jieling.logic.dao.Hero;
|
||||||
import com.ljsd.jieling.logic.dao.Mail;
|
import com.ljsd.jieling.logic.dao.Mail;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
@ -90,19 +91,30 @@ public class GMRequestHandler extends BaseHandler{
|
||||||
SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(100 + prarm1);
|
SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(100 + prarm1);
|
||||||
Set<Integer> missionIds = new HashSet<>();
|
Set<Integer> missionIds = new HashSet<>();
|
||||||
MapManager mapManager = cUser.getMapManager();
|
MapManager mapManager = cUser.getMapManager();
|
||||||
Map<Integer, MapMission> allMissionProgress = mapManager.getAllMissionProgress();
|
|
||||||
int curMapId = mapManager.getCurMapId();
|
|
||||||
if (scMapConfig != null) {
|
if (scMapConfig != null) {
|
||||||
for (int i = 1; i <= prarm1; i++) {
|
for (int i = 1; i <= prarm1; i++) {
|
||||||
int mapId = 100 + i;
|
int mapId = 100 + i;
|
||||||
SCMapConfig crossMap = SCMapConfig.getsCMapSize().get(mapId);
|
SCMapConfig crossMap = SCMapConfig.getsCMapSize().get(mapId);
|
||||||
cUser.getPlayerInfoManager().setMapId(mapId);
|
|
||||||
if (crossMap.getOpenRule() != null && crossMap.getOpenRule().length > 0) {
|
if (crossMap.getOpenRule() != null && crossMap.getOpenRule().length > 0) {
|
||||||
missionIds.add(crossMap.getOpenRule()[0]);
|
missionIds.add(crossMap.getOpenRule()[0]);
|
||||||
}
|
}
|
||||||
initFininshMapMission(mapManager,mapId);
|
initFininshMapMission(mapManager,mapId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cUser.getPlayerInfoManager().setMapId(scMapConfig.getId());
|
||||||
|
SCMapConfig crossMap = SCMapConfig.getsCMapSize().get(scMapConfig.getId() + 1);
|
||||||
|
if (crossMap == null || crossMap.getOpenRule().length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Map<Integer, Mission> doingMissions = cUser.getMissionManager().getDoingMissions();
|
||||||
|
for (Integer key : doingMissions.keySet()) {
|
||||||
|
cUser.getMissionManager().removeDoingMissions(key);
|
||||||
|
}
|
||||||
|
Mission mission = new Mission();
|
||||||
|
mission.setMissionId(crossMap.getOpenRule()[0]);
|
||||||
|
mission.setMissionStep(0);
|
||||||
|
mission.setOpen(false);
|
||||||
|
cUser.getMissionManager().updateOneDoingMissions(crossMap.getOpenRule()[0], mission);
|
||||||
cUser.getMissionManager().updateFinishMissions(missionIds);
|
cUser.getMissionManager().updateFinishMissions(missionIds);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class MapLogic {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(mapId);
|
SCMapConfig scMapConfig = SCMapConfig.getsCMapSize().get(mapId);
|
||||||
if (scMapConfig == null || scMapConfig.getOpenRule() == null) {
|
if (scMapConfig == null || scMapConfig.getOpenRule() == null || scMapConfig.getOpenRule().length == 0) {
|
||||||
LOGGER.info("enterMap() uid=>{} mapId=>{}, scMapConfig.getOpenRule()=>{}", uid, mapId, scMapConfig == null ? "" : scMapConfig.getOpenRule());
|
LOGGER.info("enterMap() uid=>{} mapId=>{}, scMapConfig.getOpenRule()=>{}", uid, mapId, scMapConfig == null ? "" : scMapConfig.getOpenRule());
|
||||||
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "");
|
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue