fix map sweep
parent
2252704adf
commit
bd763bcb1c
|
@ -141,16 +141,15 @@ public class MapLogic {
|
|||
return;
|
||||
}
|
||||
int type = sChallengeConfig.getType();
|
||||
Map<Integer, CrossInfo> crossInfoMap = mapManager.getCrossInfoMap();
|
||||
if (type == 1) {
|
||||
if (crossInfoMap.containsKey(mapId)) {
|
||||
if (crossInfoMap.get(mapId).getStars().contains(STAR_1)) {
|
||||
boolean enough = ItemUtil.itemCost(user, new int[][]{{Global.GENERALSTORY_TICKET, 1}}, BIReason.MAP_ENTER_CONSUME, mapId);
|
||||
if (!enough) {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "no ticket");
|
||||
return;
|
||||
}
|
||||
if (mapManager.getPlayGenMaps().contains(mapId)) {
|
||||
boolean enough = ItemUtil.itemCost(user, new int[][]{{Global.GENERALSTORY_TICKET, 1}}, BIReason.MAP_ENTER_CONSUME, mapId);
|
||||
if (!enough) {
|
||||
MessageUtil.sendErrorResponse(iSession, 0, messageType.getNumber(), "no ticket");
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
mapManager.updatePlayGenMaps(mapId);
|
||||
}
|
||||
}else if(type == 3){
|
||||
boolean enough = ItemUtil.itemCost(user, new int[][]{{Global.HEROSTORY_TICKET, 1}},BIReason.MAP_ENTER_CONSUME,mapId);
|
||||
|
@ -1494,23 +1493,22 @@ public class MapLogic {
|
|||
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "");
|
||||
return;
|
||||
}
|
||||
//todo vip
|
||||
/* SChallengeSetting sChallengeSetting = SChallengeSetting.challengeSetting;
|
||||
int dailyLimitPrivilege = sChallengeSetting.getDailyLimitPrivilege();
|
||||
VipPrivilegeType.
|
||||
if (mapManager.getDayFightCount() + count > sChallengeSetting.getLimit() + mapManager.getBuyFightCount()) {
|
||||
LOGGER.info("sweep over max count: {}", (mapManager.getDayFightCount() + count));
|
||||
MessageUtil.sendErrorResponse(session,0, messageType.getNumber(), "");
|
||||
return;
|
||||
}*/
|
||||
SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId);
|
||||
MapInfoProto.MapSweepResponse.Builder mapSweepResponse = MapInfoProto.MapSweepResponse.newBuilder();
|
||||
for (int i = 0; i < count; i++) {
|
||||
CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, sChallengeMapConfig.getSweepingAward(), 1, 0, BIReason.MAP_SWEEP_REWARD);
|
||||
mapSweepResponse.addDrop(dropBuilder);
|
||||
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapId);
|
||||
int type = sChallengeConfig.getType();
|
||||
if(type==3 || type==1){
|
||||
SChallengeMapConfig sChallengeMapConfig = SChallengeMapConfig.integerSChallengeMapConfigMap.get(mapId);
|
||||
MapInfoProto.MapSweepResponse.Builder mapSweepResponse = MapInfoProto.MapSweepResponse.newBuilder();
|
||||
for (int i = 0; i < count; i++) {
|
||||
CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, sChallengeMapConfig.getSweepingAward(), 1, 0, BIReason.MAP_SWEEP_REWARD);
|
||||
mapSweepResponse.addDrop(dropBuilder);
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.STORY_FIGHT, mapId,1,count);
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), mapSweepResponse.build(), true);
|
||||
}else{
|
||||
LOGGER.info("uid={},type={}",uid,type);
|
||||
MessageUtil.sendErrorResponse(session, 0, messageType.getNumber(), "now sweep");
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.STORY_FIGHT, mapId,1,count);
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), mapSweepResponse.build(), true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -1578,6 +1576,7 @@ public class MapLogic {
|
|||
.setTowerUseTime((int)(mapManager.getCurrTowerTime()/1000))
|
||||
.build();
|
||||
builder.setTowerCopyInfo(towerCopyInfo);
|
||||
builder.addAllPlayedGenMapId(mapManager.getPlayGenMaps());
|
||||
LOGGER.info("关卡信息{}",towerCopyInfo.toString());
|
||||
MessageUtil.sendMessage(iSession, 1, msgId, builder.build(), true);
|
||||
}
|
||||
|
|
|
@ -74,6 +74,10 @@ public class MapManager extends MongoBase {
|
|||
// 副本星级奖励领取进度 challengeStarBox id
|
||||
private int starReward;
|
||||
|
||||
//已玩普通副本地图
|
||||
private Set<Integer> playGenMaps = new HashSet<>();
|
||||
|
||||
|
||||
// 爬塔副本当前层数
|
||||
private int tower = 1;
|
||||
// 爬塔副本战斗次数
|
||||
|
@ -581,4 +585,13 @@ public class MapManager extends MongoBase {
|
|||
this.setBossXY(0);
|
||||
this.setBossType(0);
|
||||
}
|
||||
|
||||
public Set<Integer> getPlayGenMaps() {
|
||||
return playGenMaps;
|
||||
}
|
||||
|
||||
public void updatePlayGenMaps(int mapId) {
|
||||
playGenMaps.add(mapId);
|
||||
updateString("playGenMaps",playGenMaps);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue