整理包路径
parent
32155b1435
commit
a173e7c0d1
|
@ -1,4 +1,4 @@
|
|||
package com.ljsd.jieling.logic.map;
|
||||
package com.ljsd.jieling.handler.map;
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.ljsd.jieling.logic.map;
|
||||
package com.ljsd.jieling.handler.map;
|
||||
|
||||
public class EventType {
|
||||
// 事件点类型 1怪物 2怪物群 3矿 4入口 5出口 6一次性事件 7重复事件 8npc 9地图boss
|
|
@ -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,8 @@ public class MapEnterRequestHandler extends BaseHandler{
|
|||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
|
||||
byte[] message = netData.parseClientProtoNetData();
|
||||
MapInfoProto.MapInfo.MapEnterRequest mapEnterRequest = MapInfoProto.MapInfo.MapEnterRequest.parseFrom(message);
|
||||
MapLogic.getInstance().enterMap(iSession, mapEnterRequest.getMapId(), MessageTypeProto.MessageType.MAP_ENTER_RESPONSE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package com.ljsd.jieling.logic.map;
|
||||
package com.ljsd.jieling.handler.map;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.MapManager;
|
||||
import com.ljsd.jieling.logic.dao.User;
|
||||
|
@ -44,8 +44,8 @@ public class MapLogic {
|
|||
int uid = iSession.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
MapManager mapManager = user.getMapManager();
|
||||
if (mapManager == null) {
|
||||
mapManager = initMap(uid, 1);
|
||||
if (mapManager.getCurMapId() == 0) {
|
||||
mapManager = initMap( 1);
|
||||
user.setMapManager(mapManager);
|
||||
}
|
||||
MapInfoProto.MapInfo.MapEnterResponse mapEnterResponse = MapInfoProto.MapInfo.MapEnterResponse
|
||||
|
@ -55,7 +55,7 @@ public class MapLogic {
|
|||
}
|
||||
|
||||
|
||||
private MapManager initMap(int uid, int mapId) throws Exception {
|
||||
private MapManager initMap(int mapId) throws Exception {
|
||||
if (mapId == 0) {
|
||||
mapId = 1;
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ public class MapLogic {
|
|||
crossMapInfos.get(cMap.getCurMapId()).addAll(cell.getEventIds());
|
||||
}
|
||||
if (scMapEvent.getStyle() == EventType.exit) {
|
||||
initMap(uid, cMap.getCurMapId() + 1);
|
||||
initMap(cMap.getCurMapId() + 1);
|
||||
return;
|
||||
}
|
||||
cell.setFinish(true);
|
|
@ -3,7 +3,7 @@ package com.ljsd.jieling.logic.dao;
|
|||
|
||||
|
||||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.logic.map.Cell;
|
||||
import com.ljsd.jieling.handler.map.Cell;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
Loading…
Reference in New Issue