无尽副本部分修改

back_recharge
lvxinran 2019-08-27 21:03:46 +08:00
parent 43883d4722
commit eca20927e6
9 changed files with 161 additions and 7 deletions

View File

@ -52,6 +52,8 @@ public class MapPointConfig implements BaseConfig{
private int[][] randomProbability;
private int isShowFightAbility;
@Override
public void init() throws Exception {
scMapEventMap = STableManager.getConfig(MapPointConfig.class);
@ -92,4 +94,8 @@ public class MapPointConfig implements BaseConfig{
public int[][] getRandomProbability() {
return randomProbability;
}
public int getIsShowFightAbility() {
return isShowFightAbility;
}
}

View File

@ -78,6 +78,7 @@ public class HandlerLogicThread extends Thread{
//日后删除
whiteMsg.add(MessageTypeProto.MessageType.GET_CHAT_MESSAGE_REQUEST_VALUE);
whiteMsg.add(MessageTypeProto.MessageType.BLESS_INFO_REQUEST_VALUE);
whiteMsg.add(MessageTypeProto.MessageType.SERVER_FIVE_REQEUST_VALUE);
whiteMsg.add(MessageTypeProto.MessageType.SERVER_ZERO_REQUEST_VALUE);
whiteMsg.add(MessageTypeProto.MessageType.FAMILY_FIGHT_ROUND_INFO_REQUEST_VALUE);
@ -85,7 +86,6 @@ public class HandlerLogicThread extends Thread{
whiteMsg.add(MessageTypeProto.MessageType.FAMILY_GET_MEMBER_REQUEST_VALUE);
whiteMsg.add(MessageTypeProto.MessageType.FAMILY_GET_APPLY_REQUEST_VALUE);
whiteMsg.add(MessageTypeProto.MessageType.ADVENTURE_BOSSHURT_REQEUST_VALUE);

View File

@ -9,6 +9,8 @@ public class Cell {
private int eventId;
private int force;
public Cell() {
}
@ -37,4 +39,12 @@ public class Cell {
public void setEventId(int eventId) throws Exception {
this.eventId = eventId;
}
public int getForce() {
return force;
}
public void setForce(int force) {
this.force = force;
}
}

View File

@ -1,6 +1,7 @@
package com.ljsd.jieling.handler.map;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
@ -19,6 +20,12 @@ public class EndlessMapInfo {
private Set<Integer> openMap;
private Map<Integer,Integer> cellRefreshTime;
private Set<Integer> walkCell = new HashSet<>();
private Map<Integer, Cell> mapInfo = new HashMap<>();
public int getCurMapId() {
return curMapId;
}
@ -79,4 +86,32 @@ public class EndlessMapInfo {
public void setOpenMap(Set<Integer> openMap) {
this.openMap = openMap;
}
public void putRefreshTime(int cellId,int time){
cellRefreshTime.put(cellId,time);
}
public Map<Integer, Integer> getCellRefreshTime() {
return cellRefreshTime;
}
public void setCellRefreshTime(Map<Integer, Integer> cellRefreshTime) {
this.cellRefreshTime = cellRefreshTime;
}
public Set<Integer> getWalkCell() {
return walkCell;
}
public void setWalkCell(Set<Integer> walkCell) {
this.walkCell = walkCell;
}
public void setMapInfo(Map<Integer, Cell> mapInfo) {
this.mapInfo = mapInfo;
}
public Map<Integer, Cell> getMapInfo() {
return mapInfo;
}
}

View File

@ -109,6 +109,7 @@ public class EventType {
public static final int fourtyfive = 45;
public static final int fourtySix = 46;
public static final int fourtySeven = 47;
public static final int fourtyEight = 48;
public static final int updatePonintEvent = 1;

View File

@ -215,8 +215,14 @@ public class MapLogic {
}
}
Map<Integer, Cell> endlessMapCellInfo = mapManager.getEndlessMapInfo().getMapInfo();
if(endlessMapCellInfo !=null&&endlessMapCellInfo.size()>0){
mapManager.setMapInfo(endlessMapCellInfo);
}
Set<Integer> walkCell = mapManager.getEndlessMapInfo().getWalkCell();
if(walkCell!=null&&walkCell.size()>0){
mapManager.setWalkCells(walkCell);
}
mapManager.updateEndlessMapId(mapId);
EndlessMapInfo endlessMapInfo = mapManager.getEndlessMapInfo();
for(Map.Entry<Integer,Map<Integer,String>> entry :endlessMapInfo.getMapSign().entrySet()){
@ -230,6 +236,15 @@ public class MapLogic {
mapEnterResponse.addSigns(sign);
}
}
Map<Integer, Integer> cellRefreshTime = endlessMapInfo.getCellRefreshTime();
if(cellRefreshTime!=null&&cellRefreshTime.size()>0){
for(Map.Entry<Integer, Integer> time:cellRefreshTime.entrySet()){
CommonProto.EndlessRefreshInfo.Builder info = CommonProto.EndlessRefreshInfo.newBuilder();
info.setCellId(time.getKey());
info.setTime(time.getValue());
mapEnterResponse.addRefreshInfo(info);
}
}
}
List<CommonProto.Cell> cells = new ArrayList<>(mapManager.getMapInfo().size());
for (Map.Entry<Integer, Cell> entry : mapManager.getMapInfo().entrySet()) {
@ -347,12 +362,12 @@ public class MapLogic {
if (cell.getEventId() == -1) {
return;
}
CommonProto.Cell cellProto = CommonProto.Cell
CommonProto.Cell.Builder cellProto = CommonProto.Cell
.newBuilder()
.setCellId(entry.getKey())
.setPointId(cell.getPointId())
.build();
cells.add(cellProto);
.setMonsterForce(cell.getForce());
cells.add(cellProto.build());
}
@ -402,6 +417,12 @@ public class MapLogic {
continue;
}
Cell cellValue = new Cell(xy, mapPointConfig.getInitialEventId(), mapPointConfig.getId());
if(xy>1000){
cellValue.setForce(123456);
}
if(mapPointConfig.getIsShowFightAbility()==1){
cellValue.setForce(123456);
}
newMap.put(xy, cellValue);
}
if (user.getPlayerInfoManager().getMapId() == 100) {
@ -756,7 +777,7 @@ public class MapLogic {
// 3 条件跳转 1001#1002|00或1为和#条件id#条件id
case 3:
case 8:
case 10: {
case 10: {
SOptionAddCondition sOptionAddConditions = SOptionAddCondition.sOptionAddConditionMap.get(jumpTypeValues[1][1]);
if (sOptionAddConditions == null) {
LOGGER.info("sOptionAddConditions == null jumpTypeValues[1][1]=>{}", jumpTypeValues[1][1]);
@ -911,6 +932,16 @@ public class MapLogic {
}
return jumpTypeValues[0][1];
}
case 10:{
Map<Integer, Integer> cellRefreshTime = user.getMapManager().getEndlessMapInfo().getCellRefreshTime();
Integer time = cellRefreshTime.get(mapManager.getCurMapId());
if(time!=null&&time>TimeUtils.now()/1000){
nextEventId=jumpTypeValues[0][0];
}else{
nextEventId=jumpTypeValues[0][1];
}
break;
}
default: {
nextEventId = jumpTypeValues[0][1];
break;
@ -943,6 +974,10 @@ public class MapLogic {
User user = UserManager.getUser(uid);
MapManager mapManager = user.getMapManager();
SChallengeConfig challengeConfig = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId());
if(mapManager.getCurMapId()==0){
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
return;
}
MapInfoProto.MapOutResponse.Builder builder = MapInfoProto.MapOutResponse.newBuilder();
//无尽副本
@ -971,6 +1006,9 @@ public class MapLogic {
mapManager.updateEndlessConsumeExecution(0);
mapManager.updateEndlessFightCount(0);
}
//无尽副本信息保存
mapManager.endlessWalkCellSave();
mapManager.endlessMapInfoSave();
}
if(outType == 0||mapManager.getTower()-1==STrialConfig.getHighestTower()){
if(mapManager.getTowerUnusedBuffer()!=null){
@ -1541,6 +1579,7 @@ public class MapLogic {
int useTime = (int) ((TimeUtils.now() - startExporeTime) / 1000);
if (needResetMap && useTime >= sChallengeConfig.getMapTime()) {
resetMapInfo(user, false);
MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()),1, MessageTypeProto.MessageType.MAP_OUT_INDICATION_VALUE,null,true);
return 0;
} else {
return sChallengeConfig.getMapTime() - useTime;

View File

@ -762,6 +762,21 @@ public class MapManager extends MongoBase {
this.lastMonsterAttack = lastMonsterAttack;
updateString("lastMonsterAttack",lastMonsterAttack);
}
public void updateEndlessCellTime(int cellId,int time){
if(endlessMapInfo.getCellRefreshTime()==null){
endlessMapInfo.setCellRefreshTime(new HashMap<>());
}
endlessMapInfo.putRefreshTime(cellId,time);
updateString("endlessMapInfo.cellRefreshTime."+cellId,time);
}
public void endlessWalkCellSave(){
endlessMapInfo.setWalkCell(walkCells);
updateString("endlessMapInfo.walkCells",walkCells);
}
public void endlessMapInfoSave(){
endlessMapInfo.setMapInfo(mapInfo);
updateString("endlessMapInfo.mapInfo",mapInfo);
}
}

View File

@ -0,0 +1,47 @@
package com.ljsd.jieling.handler.map.behavior;
import com.ljsd.jieling.handler.map.EventType;
import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.protocols.CommonProto;
import com.ljsd.jieling.protocols.FightInfoProto;
import com.ljsd.jieling.protocols.MapInfoProto;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.util.MessageUtil;
import com.ljsd.jieling.util.TimeUtils;
import org.springframework.stereotype.Component;
import java.util.Map;
@Component
public class FourtyEightBehavior extends BaseBehavior{
@Override
public int getBehaviorType() {
return EventType.fourtyEight;
}
@Override
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
String readyInfo = behaviorTypeValues[0][0] + "#" + Integer.toString(optionId);
BehaviorUtil.fightReady(user.getId(), readyInfo);
return true;
}
@Override
public boolean isFightBehavior() {
return true;
}
@Override
public boolean afterFight(User user, int[][] behaviorTypeValues, FightInfoProto.FightEndResponse.Builder fightEndResponse){
user.getMapManager().updateEndlessCellTime(user.getMapManager().getCurXY(), (int)(TimeUtils.now()/1000)+behaviorTypeValues[0][1]);
Map<Integer, Integer> cellRefreshTime = user.getMapManager().getEndlessMapInfo().getCellRefreshTime();
MapInfoProto.EndlessTimeIndication.Builder indication = MapInfoProto.EndlessTimeIndication.newBuilder();
for(Map.Entry<Integer, Integer> entry:cellRefreshTime.entrySet()){
CommonProto.EndlessRefreshInfo info = CommonProto.EndlessRefreshInfo.newBuilder().setCellId(entry.getKey()).setTime(entry.getValue()).build();
indication.addInfos(info);
}
MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()),1, MessageTypeProto.MessageType.ENDLESS_REFRESH_INDICAITON_VALUE,indication.build(),true);
return true;
}
}

View File

@ -165,6 +165,7 @@ public class GuildInfo extends MongoBase {
return icon;
}
public void updateIcon(int icon){
this.icon = icon;
updateString("icon",icon);
}
public int getResult(int type){