Merge branch 'master' of http://60.1.1.230/backend/jieling_server
commit
30c154d407
|
@ -637,19 +637,23 @@ public class MapLogic {
|
|||
* @param messageType
|
||||
* @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();
|
||||
User user = UserManager.getUser(uid);
|
||||
MapManager mapManager = user.getMapManager();
|
||||
MapMission mapMission = mapManager.getAllMissionProgress().get(mapManager.getCurMapId());
|
||||
if (mapManager.getMapInfo() == null) {
|
||||
LOGGER.info("mapManager.getMapInfo() == null");
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||
return;
|
||||
}
|
||||
MapInfoProto.MapOutResponse build = MapInfoProto.MapOutResponse.newBuilder().setMapAccomplishInfo(CBean2Proto.getMapAccomplishInfo(mapManager.getAllMissionProgress().get(mapManager.getCurMapId()))).build();
|
||||
resetMapInfo(user, true);
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), build, 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);
|
||||
return;
|
||||
}
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null, true);
|
||||
}
|
||||
|
||||
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){
|
||||
int mapId = mapManager.getCurMapId();
|
||||
if(mapId==0){
|
||||
return;
|
||||
}
|
||||
MapMission mapMission = mapManager.getAllMissionProgress().get(mapId);
|
||||
int addScore=0;
|
||||
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.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
@ -15,6 +16,9 @@ public class MapOutRequestHandler extends BaseHandler{
|
|||
|
||||
@Override
|
||||
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