back_recharge
parent
168e51c45f
commit
627b376b37
|
@ -62,7 +62,7 @@ public class GameApplication {
|
|||
|
||||
RedisUtil.getInstence().init(configurableApplicationContext);
|
||||
|
||||
// STableManager.initialize("com.ljsd.jieling.config");
|
||||
STableManager.initialize("com.ljsd.jieling.config");
|
||||
|
||||
UserManager.init(configurableApplicationContext);
|
||||
|
||||
|
|
|
@ -64,7 +64,6 @@ public class MapLogic {
|
|||
user.setMapManager(mapManager);
|
||||
}
|
||||
}
|
||||
|
||||
List<CommonProto.Cell> cells = new ArrayList<>(mapManager.getMapInfo().size());
|
||||
for (Map.Entry<Integer, Cell> entry : mapManager.getMapInfo().entrySet()) {
|
||||
List<CommonProto.CellEvent> cellEvents = new ArrayList<>();
|
||||
|
@ -120,14 +119,50 @@ public class MapLogic {
|
|||
mapManager.setTypeEight(spicelMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 战斗开始
|
||||
*/
|
||||
public void fightStart(ISession session, int bigEventId){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 战斗结束
|
||||
*/
|
||||
public void fightEnd(ISession session, int bigEventId){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用物品(包括侦察和吃buff)
|
||||
*/
|
||||
public void useItem(ISession session, int bigEventId){
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 离开
|
||||
*/
|
||||
public void leave(ISession session, int bigEventId){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 更新事件点
|
||||
*
|
||||
* @param uid
|
||||
* @param session
|
||||
* @param xy
|
||||
*/
|
||||
public void updateEvent(int uid, int xy, int bigEventId, int smallEventId, int choice) throws Exception {
|
||||
public void updateEvent(ISession session, int xy, int bigEventId, int choice, List<Integer> cells) throws Exception {
|
||||
Set<Integer> cellSet = new HashSet<>(cells);
|
||||
if (cells.size() != cellSet.size()) {
|
||||
LOGGER.info("cells has repeated");
|
||||
return;
|
||||
}
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
MapManager mapManager = user.getMapManager();
|
||||
Cell cell = mapManager.getMapInfo().get(xy);
|
||||
|
@ -146,14 +181,14 @@ public class MapLogic {
|
|||
return;
|
||||
}
|
||||
int schedule = eventIds.get(bigEventId);
|
||||
if (schedule == -1 || schedule >= smallEventId) {
|
||||
LOGGER.info("event is finished,bigEventId=>{} smallEventId=>{}", bigEventId, smallEventId);
|
||||
if (schedule == -1) {
|
||||
LOGGER.info("event is finished,bigEventId=>{} smallEventId=>{}", bigEventId, -1);
|
||||
return;
|
||||
}
|
||||
SCMapEventsConfig scMapEvent = SCMapEventsConfig.scMapEventMap.get(bigEventId);
|
||||
SCMapEventsItemConfig scMapEventsItemConfig = SCMapEventsItemConfig.scMapEventsItemConfigs.get(bigEventId).get(smallEventId);
|
||||
SCMapEventsItemConfig scMapEventsItemConfig = SCMapEventsItemConfig.scMapEventsItemConfigs.get(bigEventId).get(schedule);
|
||||
if (scMapEventsItemConfig == null) {
|
||||
LOGGER.info("no scMapEventsItemConfig bigEventId=>{} smallEventId=>{}", bigEventId, smallEventId);
|
||||
LOGGER.info("no scMapEventsItemConfig bigEventId=>{} smallEventId=>{}", bigEventId, schedule);
|
||||
return;
|
||||
}
|
||||
String[] contents = scMapEventsItemConfig.getContents().split("\\|");
|
||||
|
@ -162,49 +197,41 @@ public class MapLogic {
|
|||
return;
|
||||
}
|
||||
String[] eventArr = contents[choice].split("#");
|
||||
switch (scMapEvent.getStyle()) {
|
||||
case EventType.monster: {
|
||||
switch (Integer.parseInt(eventArr[0])) {
|
||||
case EventType.fight: {
|
||||
fightStart(session, bigEventId);
|
||||
break;
|
||||
}
|
||||
case EventType.continuity: {
|
||||
switch (Integer.parseInt(eventArr[0])) {
|
||||
case EventType.fight: {
|
||||
case EventType.attribute: {
|
||||
|
||||
break;
|
||||
}
|
||||
case EventType.attribute: {
|
||||
|
||||
break;
|
||||
}
|
||||
case EventType.useItem:
|
||||
case EventType.scout: {
|
||||
|
||||
break;
|
||||
}
|
||||
case EventType.leave: {
|
||||
|
||||
break;
|
||||
}
|
||||
case EventType.dialogue: {
|
||||
|
||||
break;
|
||||
}
|
||||
case EventType.jump: {
|
||||
|
||||
break;
|
||||
}
|
||||
case EventType.eatBuff: {
|
||||
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
return;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EventType.useItem:
|
||||
case EventType.scout: {
|
||||
|
||||
break;
|
||||
}
|
||||
case EventType.leave: {
|
||||
|
||||
break;
|
||||
}
|
||||
case EventType.dialogue: {
|
||||
|
||||
break;
|
||||
}
|
||||
case EventType.jump: {
|
||||
|
||||
break;
|
||||
}
|
||||
case EventType.eatBuff: {
|
||||
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (smallEventId + 1 >= contents.length - 1) {
|
||||
if (schedule + 1 >= contents.length - 1) {
|
||||
cell.getEventIds().put(bigEventId, -1);
|
||||
} else {
|
||||
cell.getEventIds().put(bigEventId, schedule + 1);
|
||||
|
|
|
@ -217,6 +217,7 @@ public class ProtocolsManager implements ProtocolsAbstract {
|
|||
return;
|
||||
} else {
|
||||
try {
|
||||
LOGGER.info("request uid=>{} commond=>{} msgId=>{}: " + packetNetData.getUserId(), baseHandler.getMessageCode(), packetNetData.getMsgId());
|
||||
baseHandler.execute(session, packetNetData);
|
||||
} catch (Exception e) {
|
||||
//TODO
|
||||
|
|
Loading…
Reference in New Issue