无尽开启地图
parent
89ffd40206
commit
4471d842e1
|
|
@ -2,6 +2,7 @@ package com.ljsd.jieling.handler.map;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
public class EndlessMapInfo {
|
public class EndlessMapInfo {
|
||||||
private int curMapId;
|
private int curMapId;
|
||||||
|
|
@ -16,6 +17,8 @@ public class EndlessMapInfo {
|
||||||
|
|
||||||
private int consumeExecution;
|
private int consumeExecution;
|
||||||
|
|
||||||
|
private Set<Integer> openMap;
|
||||||
|
|
||||||
public int getCurMapId() {
|
public int getCurMapId() {
|
||||||
return curMapId;
|
return curMapId;
|
||||||
}
|
}
|
||||||
|
|
@ -68,4 +71,12 @@ public class EndlessMapInfo {
|
||||||
public void setConsumeExecution(int consumeExecution) {
|
public void setConsumeExecution(int consumeExecution) {
|
||||||
this.consumeExecution = consumeExecution;
|
this.consumeExecution = consumeExecution;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<Integer> getOpenMap() {
|
||||||
|
return openMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpenMap(Set<Integer> openMap) {
|
||||||
|
this.openMap = openMap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,7 @@ public class EventType {
|
||||||
public static final int fourtyFour = 44;
|
public static final int fourtyFour = 44;
|
||||||
public static final int fourtyfive = 45;
|
public static final int fourtyfive = 45;
|
||||||
public static final int fourtySix = 46;
|
public static final int fourtySix = 46;
|
||||||
|
public static final int fourtySeven = 47;
|
||||||
|
|
||||||
|
|
||||||
public static final int updatePonintEvent = 1;
|
public static final int updatePonintEvent = 1;
|
||||||
|
|
|
||||||
|
|
@ -2832,6 +2832,19 @@ public class MapLogic {
|
||||||
}
|
}
|
||||||
Map<String, EndlessHero> endlessHeroInfo = endlessMapInfo.getEndlessHeroInfo();
|
Map<String, EndlessHero> endlessHeroInfo = endlessMapInfo.getEndlessHeroInfo();
|
||||||
MapInfoProto.GetEndlessHeroResponse.Builder response = MapInfoProto.GetEndlessHeroResponse.newBuilder();
|
MapInfoProto.GetEndlessHeroResponse.Builder response = MapInfoProto.GetEndlessHeroResponse.newBuilder();
|
||||||
|
//已开启地图处理
|
||||||
|
Map<Integer, SEndlessMapConfig> sEndlessMapConfigMap = SEndlessMapConfig.sEndlessMapConfigMap;
|
||||||
|
if(endlessMapInfo.getOpenMap()==null||endlessMapInfo.getOpenMap().size()<1){
|
||||||
|
Set<Integer> openMap = new HashSet<>();
|
||||||
|
for(Map.Entry<Integer, SEndlessMapConfig> entry :sEndlessMapConfigMap.entrySet()){
|
||||||
|
openMap.add(entry.getKey());
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
mapManager.updateEndlessOpenedMap(openMap);
|
||||||
|
}
|
||||||
|
for(Integer map:mapManager.getEndlessMapInfo().getOpenMap()){
|
||||||
|
response.addOpenMapId(map);
|
||||||
|
}
|
||||||
for(Map.Entry<String,Hero> heroEntry : heroManager.getHeroMap().entrySet()) {
|
for(Map.Entry<String,Hero> heroEntry : heroManager.getHeroMap().entrySet()) {
|
||||||
if(heroEntry.getValue().getLevel()<20){
|
if(heroEntry.getValue().getLevel()<20){
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -2880,6 +2893,7 @@ public class MapLogic {
|
||||||
|
|
||||||
user.getTeamPosManager().updateTeamPosByTeamId(401,team);
|
user.getTeamPosManager().updateTeamPosByTeamId(401,team);
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,11 +2,9 @@ package com.ljsd.jieling.handler.map;
|
||||||
|
|
||||||
|
|
||||||
import com.ljsd.common.mogodb.MongoBase;
|
import com.ljsd.common.mogodb.MongoBase;
|
||||||
import com.ljsd.jieling.config.SChallengeSetting;
|
|
||||||
import com.ljsd.jieling.config.SGameSetting;
|
import com.ljsd.jieling.config.SGameSetting;
|
||||||
import com.ljsd.jieling.config.SVipLevelConfig;
|
import com.ljsd.jieling.config.SVipLevelConfig;
|
||||||
import com.ljsd.jieling.core.GlobalsDef;
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
import com.ljsd.jieling.handler.mission.Mission;
|
import com.ljsd.jieling.handler.mission.Mission;
|
||||||
|
|
@ -15,10 +13,13 @@ import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||||
import com.ljsd.jieling.logic.dao.Item;
|
import com.ljsd.jieling.logic.dao.Item;
|
||||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.util.*;
|
import com.ljsd.jieling.util.MathUtils;
|
||||||
|
import com.ljsd.jieling.util.TimeUtils;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.HashMap;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
public class MapManager extends MongoBase {
|
public class MapManager extends MongoBase {
|
||||||
|
|
@ -738,6 +739,10 @@ public class MapManager extends MongoBase {
|
||||||
updateString("endlessMapInfo.consumeExecution",endlessMapInfo.getConsumeExecution());
|
updateString("endlessMapInfo.consumeExecution",endlessMapInfo.getConsumeExecution());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateEndlessOpenedMap(Set<Integer> mapIds){
|
||||||
|
endlessMapInfo.setOpenMap(mapIds);
|
||||||
|
updateString("endlessMapInfo.openMap",mapIds);
|
||||||
|
}
|
||||||
public int getLastXY() {
|
public int getLastXY() {
|
||||||
return lastXY;
|
return lastXY;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.ljsd.jieling.handler.map.behavior;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.handler.map.EventType;
|
||||||
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class FourtySevenBehavior extends BaseBehavior {
|
||||||
|
@Override
|
||||||
|
public int getBehaviorType() {
|
||||||
|
return EventType.fourtySeven;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean process(int optionId, User user, int[][] behaviorTypeValues, MapInfoProto.EventUpdateResponse.Builder eventUpdateResponse) throws Exception {
|
||||||
|
int targetMapId = behaviorTypeValues[0][0];
|
||||||
|
Set<Integer> openMap = user.getMapManager().getEndlessMapInfo().getOpenMap();
|
||||||
|
if(openMap.contains(targetMapId)){
|
||||||
|
return true;
|
||||||
|
}else{
|
||||||
|
openMap.add(targetMapId);
|
||||||
|
user.getMapManager().updateEndlessOpenedMap(openMap);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue