Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
30c154d407
|
@ -637,19 +637,23 @@ public class MapLogic {
|
||||||
* @param messageType
|
* @param messageType
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public void outMap(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
public void outMap(ISession session,int mapId,MessageTypeProto.MessageType messageType) throws Exception {
|
||||||
int uid = session.getUid();
|
int uid = session.getUid();
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
MapManager mapManager = user.getMapManager();
|
MapManager mapManager = user.getMapManager();
|
||||||
MapMission mapMission = mapManager.getAllMissionProgress().get(mapManager.getCurMapId());
|
|
||||||
if (mapManager.getMapInfo() == null) {
|
if (mapManager.getMapInfo() == null) {
|
||||||
LOGGER.info("mapManager.getMapInfo() == null");
|
LOGGER.info("mapManager.getMapInfo() == null");
|
||||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MapInfoProto.MapOutResponse build = MapInfoProto.MapOutResponse.newBuilder().setMapAccomplishInfo(CBean2Proto.getMapAccomplishInfo(mapManager.getAllMissionProgress().get(mapManager.getCurMapId()))).build();
|
|
||||||
resetMapInfo(user, true);
|
resetMapInfo(user, true);
|
||||||
|
MapMission mapMission = mapManager.getAllMissionProgress().get(mapId);
|
||||||
|
if(mapMission!=null){
|
||||||
|
MapInfoProto.MapOutResponse build = MapInfoProto.MapOutResponse.newBuilder().setMapAccomplishInfo(CBean2Proto.getMapAccomplishInfo(mapManager.getAllMissionProgress().get(mapManager.getCurMapId()))).build();
|
||||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), build, true);
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), build, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetMapInfo(User user, boolean needTemporaryItem) throws Exception {
|
public void resetMapInfo(User user, boolean needTemporaryItem) throws Exception {
|
||||||
|
@ -840,6 +844,9 @@ public class MapLogic {
|
||||||
|
|
||||||
public void updateMapMission(MapManager mapManager,int eventType,int eventId,int bossIdOrItemId){
|
public void updateMapMission(MapManager mapManager,int eventType,int eventId,int bossIdOrItemId){
|
||||||
int mapId = mapManager.getCurMapId();
|
int mapId = mapManager.getCurMapId();
|
||||||
|
if(mapId==0){
|
||||||
|
return;
|
||||||
|
}
|
||||||
MapMission mapMission = mapManager.getAllMissionProgress().get(mapId);
|
MapMission mapMission = mapManager.getAllMissionProgress().get(mapId);
|
||||||
int addScore=0;
|
int addScore=0;
|
||||||
Map<Integer, Integer> allMissionProgress = mapMission.getAllMissionProgress();
|
Map<Integer, Integer> allMissionProgress = mapMission.getAllMissionProgress();
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.ljsd.jieling.handler.map;
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@ -15,6 +16,9 @@ public class MapOutRequestHandler extends BaseHandler{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||||
MapLogic.getInstance().outMap(iSession, MessageTypeProto.MessageType.MAP_OUT_RESPONSE);
|
byte[] bytes = netData.parseClientProtoNetData();
|
||||||
|
MapInfoProto.MapOutRequest mapOutRequest = MapInfoProto.MapOutRequest.parseFrom(bytes);
|
||||||
|
int mapId = mapOutRequest.getMapId();
|
||||||
|
MapLogic.getInstance().outMap(iSession, mapId,MessageTypeProto.MessageType.MAP_OUT_RESPONSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue