add log
commit
a47395fcea
|
|
@ -0,0 +1,108 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 爬塔
|
||||
*/
|
||||
@Table(name = "TrialConfig")
|
||||
public class STrialConfig implements BaseConfig {
|
||||
|
||||
public static Map<Integer, STrialConfig> sTrialConfigMap;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sTrialConfigMap = STableManager.getConfig(STrialConfig.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 层数
|
||||
*/
|
||||
private int id;
|
||||
/**
|
||||
* 地图id
|
||||
*/
|
||||
private int mapId;
|
||||
/**
|
||||
* 是否是记录层
|
||||
*/
|
||||
private int isSaveFloor;
|
||||
/**
|
||||
* 扫荡奖励
|
||||
*/
|
||||
private int[] reward;
|
||||
/**
|
||||
* "类型#怪物组id
|
||||
* 1普通
|
||||
* 2精英"
|
||||
*/
|
||||
private int[][] randomMonsterType;
|
||||
/**
|
||||
* 怪物数量
|
||||
*/
|
||||
private int[] monsterCount;
|
||||
/**
|
||||
* "类型#权重
|
||||
* 1boss
|
||||
* 2福利怪
|
||||
* 3补给点
|
||||
* 4商店"
|
||||
*/
|
||||
private int[][] randomBossType;
|
||||
/**
|
||||
* 对应MapPointid
|
||||
*/
|
||||
private int[] randomMapPointId;
|
||||
/**
|
||||
* 击败普通怪获得能量
|
||||
*/
|
||||
private int normalEnergy;
|
||||
/**
|
||||
* 击败精英怪获得能量
|
||||
*/
|
||||
private int eliteEnergy;
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getMapId() {
|
||||
return mapId;
|
||||
}
|
||||
|
||||
public int getIsSaveFloor() {
|
||||
return isSaveFloor;
|
||||
}
|
||||
|
||||
public int[] getReward() {
|
||||
return reward;
|
||||
}
|
||||
|
||||
public int[][] getRandomMonsterType() {
|
||||
return randomMonsterType;
|
||||
}
|
||||
|
||||
public int[] getMonsterCount() {
|
||||
return monsterCount;
|
||||
}
|
||||
|
||||
public int[][] getRandomBossType() {
|
||||
return randomBossType;
|
||||
}
|
||||
|
||||
public int getNormalEnergy() {
|
||||
return normalEnergy;
|
||||
}
|
||||
|
||||
public int getEliteEnergy() {
|
||||
return eliteEnergy;
|
||||
}
|
||||
|
||||
public int[] getRandomMapPointId() {
|
||||
return randomMapPointId;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
@Table(name = "TrialSetting")
|
||||
public class STrialSetting implements BaseConfig{
|
||||
|
||||
public static STrialSetting sTrialSetting;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
sTrialSetting = STableManager.getConfig(STrialSetting.class).get(1);
|
||||
}
|
||||
|
||||
private int id;
|
||||
/**
|
||||
* 副本每日重置次数
|
||||
*/
|
||||
private int dailyReset;
|
||||
/**
|
||||
* 复活次数
|
||||
*/
|
||||
private int rebornTimes;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getDailyReset() {
|
||||
return dailyReset;
|
||||
}
|
||||
|
||||
public int getRebornTimes() {
|
||||
return rebornTimes;
|
||||
}
|
||||
}
|
||||
|
|
@ -105,6 +105,6 @@ public class EventType {
|
|||
public static final int fightEvent = 2;
|
||||
public static final int shopEvent = 3;
|
||||
public static final int updateOptionalEvent = 4;
|
||||
public static final int passMap = 4;
|
||||
public static final int passMap = 5;
|
||||
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -41,9 +41,7 @@ public class MapManager extends MongoBase {
|
|||
private Map<Integer,Integer> foodBufferMap = new HashMap<>();
|
||||
private Map<String,Map<Integer, Integer>> heroAllAttributeMap = new HashMap<>(5);
|
||||
|
||||
private MapMission mapMissionProgres;
|
||||
|
||||
private MapMission copyMissionProgres=new MapMission(); //副本累计
|
||||
private Map<Integer,MapMission> copyMissionProgresMap=new HashMap<>(); //副本累计
|
||||
|
||||
private Set<Integer> takeCopyMisionRewards =new HashSet<>();//副本奖励
|
||||
|
||||
|
|
@ -82,6 +80,12 @@ public class MapManager extends MongoBase {
|
|||
private int fightCount;
|
||||
// 爬塔副本重置次数
|
||||
private int resetCount;
|
||||
// 爬塔副本试炼精气
|
||||
private int essenceValue;
|
||||
// 爬塔副本历史最高层
|
||||
private int highestTower;
|
||||
// 爬塔副本商店
|
||||
private Map<Integer, Integer> towerShopInfos;
|
||||
|
||||
|
||||
public MapManager() {
|
||||
|
|
@ -331,15 +335,6 @@ public class MapManager extends MongoBase {
|
|||
this.canMoveTime = canMoveTime;
|
||||
}
|
||||
|
||||
public MapMission getMapMissionProgres() {
|
||||
return mapMissionProgres;
|
||||
}
|
||||
|
||||
public void setMapMissionProgres(MapMission mapMissionProgres) {
|
||||
this.mapMissionProgres = mapMissionProgres;
|
||||
updateString("mapMissionProgres", mapMissionProgres);
|
||||
}
|
||||
|
||||
public Map<Integer, CrossInfo> getCrossInfoMap() {
|
||||
return crossInfoMap;
|
||||
}
|
||||
|
|
@ -408,8 +403,8 @@ public class MapManager extends MongoBase {
|
|||
}
|
||||
}
|
||||
|
||||
public MapMission getCopyMissionProgres() {
|
||||
return copyMissionProgres;
|
||||
public MapMission getCopyMissionProgresById(int copyId) {
|
||||
return copyMissionProgresMap.get(copyId);
|
||||
}
|
||||
|
||||
public int getFindSuddenlyBossMapId() {
|
||||
|
|
@ -462,7 +457,44 @@ public class MapManager extends MongoBase {
|
|||
}
|
||||
|
||||
public void setCopyMissionProgres(MapMission copyMissionProgres) {
|
||||
updateString("copyMissionProgres" , copyMissionProgres);
|
||||
this.copyMissionProgres = copyMissionProgres;
|
||||
updateString("copyMissionProgresMap." + copyMissionProgres.getMapId() , copyMissionProgres);
|
||||
this.copyMissionProgresMap.put(copyMissionProgres.getMapId(),copyMissionProgres);
|
||||
}
|
||||
|
||||
public void clearCopyMission(int copyId){
|
||||
removeString(getMongoKey() + ".copyMissionProgresMap." + copyId);
|
||||
this.copyMissionProgresMap.remove(copyId);
|
||||
}
|
||||
|
||||
public int getEssenceValue() {
|
||||
return essenceValue;
|
||||
}
|
||||
|
||||
public void setEssenceValue(int essenceValue) {
|
||||
updateString("essenceValue" , essenceValue);
|
||||
this.essenceValue = essenceValue;
|
||||
}
|
||||
|
||||
public int getHighestTower() {
|
||||
return highestTower;
|
||||
}
|
||||
|
||||
public void setHighestTower(int highestTower) {
|
||||
updateString("highestTower" , highestTower);
|
||||
this.highestTower = highestTower;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getTowerShopInfos() {
|
||||
return towerShopInfos;
|
||||
}
|
||||
|
||||
public void setTowerShopInfos(Map<Integer, Integer> towerShopInfos) {
|
||||
updateString("towerShopInfos" , towerShopInfos);
|
||||
this.towerShopInfos = towerShopInfos;
|
||||
}
|
||||
|
||||
public void addOrUpdatetowerShopInfos(int key, int value) {
|
||||
updateString("towerShopInfos." + key, value);
|
||||
this.towerShopInfos.put(key, value);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,10 +32,19 @@ public class MapMissionManager {
|
|||
missionTypes.add(MapMissionType.KILL_BOSS);
|
||||
typeByEventTypeMap.put(EventType.fightEvent,missionTypes);
|
||||
|
||||
missionTypes = new ArrayList<>(1);
|
||||
missionTypes = new ArrayList<>(2);
|
||||
missionTypes.add(MapMissionType.DIGGER_EVENT);
|
||||
missionTypes.add(MapMissionType.OPEN_BOX);
|
||||
typeByEventTypeMap.put(EventType.updatePonintEvent,missionTypes);
|
||||
|
||||
|
||||
missionTypes = new ArrayList<>(5);
|
||||
missionTypes.add(MapMissionType.PASS_FINISH_DIFFICULT_MAP);
|
||||
missionTypes.add(MapMissionType.PASS_INTIME_MAP);
|
||||
missionTypes.add(MapMissionType.PASS_DEATH_MAP_EVENT);
|
||||
missionTypes.add(MapMissionType.PASS_TEAM_FORCE_EVENT);
|
||||
missionTypes.add(MapMissionType.PASS_TEAM_NOT_PROFESSION_EVENT);
|
||||
typeByEventTypeMap.put(EventType.passMap,missionTypes);
|
||||
}
|
||||
|
||||
public static int updateMapMission(MapManager mapManager, int eventType, int eventId, int bossIdOrItemId){
|
||||
|
|
@ -44,12 +53,11 @@ public class MapMissionManager {
|
|||
if(mapId==0){
|
||||
return 0;
|
||||
}
|
||||
MapMission mapMission = mapManager.getMapMissionProgres();
|
||||
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapId);
|
||||
mapId=sChallengeConfig.getMapId();
|
||||
MapMission mapMission = mapManager.getCopyMissionProgresById(mapId);
|
||||
boolean copyMissionUpdate = false;
|
||||
if(sChallengeConfig.getType()==2){
|
||||
mapMission = mapManager.getCopyMissionProgres();
|
||||
if(sChallengeConfig.getType()==3){
|
||||
copyMissionUpdate= true;
|
||||
}
|
||||
if(mapMission == null ){
|
||||
|
|
@ -82,6 +90,7 @@ public class MapMissionManager {
|
|||
if(isHit && !updateProgress){
|
||||
continue;
|
||||
}
|
||||
boolean isNeedReset = false;
|
||||
for(SAccomplishmentConfig sAccomplishmentConfig : sAccomplishmentConfigs){
|
||||
int missionId = sAccomplishmentConfig.getId();
|
||||
Integer missionValue = allMissionProgress.get(missionId);
|
||||
|
|
@ -95,6 +104,7 @@ public class MapMissionManager {
|
|||
for(int targetEventIdTmp : values[0]){
|
||||
if(targetEventIdTmp == eventId){
|
||||
updateProgress = true;
|
||||
isNeedReset =true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -111,6 +121,9 @@ public class MapMissionManager {
|
|||
readySendCopyMission(missionStateChangeInfo);
|
||||
}
|
||||
}
|
||||
if(isNeedReset){
|
||||
updateProgress = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -131,20 +144,17 @@ public class MapMissionManager {
|
|||
}
|
||||
}
|
||||
if(needUpdate){
|
||||
if(copyMissionUpdate){
|
||||
mapManager.setCopyMissionProgres(mapMission);
|
||||
}else{
|
||||
mapManager.setMapMissionProgres(mapMission);
|
||||
}
|
||||
mapManager.setCopyMissionProgres(mapMission);
|
||||
}
|
||||
return mapMission.getTotalWeight();
|
||||
}
|
||||
|
||||
public static void processPassMapEvent(User user,int passTime){
|
||||
MapManager mapManager = user.getMapManager();
|
||||
MapMission copyMissionProgres = mapManager.getCopyMissionProgres();
|
||||
|
||||
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId());
|
||||
int mapId = sChallengeConfig.getId();
|
||||
MapMission copyMissionProgres = mapManager.getCopyMissionProgresById(mapId);
|
||||
int difficultType = sChallengeConfig.getDifficultType();
|
||||
HeroLogic.getInstance().calTeamTotalForce(user,mapManager.getTeamId(),false);
|
||||
Map<Integer, Integer> allMissionProgress = copyMissionProgres.getAllMissionProgress();
|
||||
|
|
@ -217,7 +227,7 @@ public class MapMissionManager {
|
|||
}
|
||||
}
|
||||
if(needUpdate){
|
||||
user.getMapManager().setCopyMissionProgres(user.getMapManager().getCopyMissionProgres());
|
||||
user.getMapManager().setCopyMissionProgres(copyMissionProgres);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.FightInfoProto;
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
|
|
@ -22,5 +23,8 @@ public class MapEnterRequestHandler extends BaseHandler{
|
|||
MapInfoProto.MapEnterRequest mapEnterRequest = MapInfoProto.MapEnterRequest.parseFrom(message);
|
||||
int teamId = mapEnterRequest.getTeamId();
|
||||
MapLogic.getInstance().enterMap(iSession, mapEnterRequest.getMapId(), teamId, MessageTypeProto.MessageType.MAP_ENTER_RESPONSE);
|
||||
|
||||
MapLogic.getInstance().enterTowerCopy(iSession, 1, MessageTypeProto.MessageType.MAP_ENTER_RESPONSE );
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class MapTowerCallChiefRequest extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.MAP_TOWER_CALL_CHIEF_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
MapLogic.getInstance().callChief(iSession, MessageTypeProto.MessageType.MAP_TOWER_CALL_CHIEF_RESPONSE);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
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;
|
||||
|
||||
@Component
|
||||
public class MapTowerEnterRequestHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.MAP_TOWER_ENTER_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
byte[] message = netData.parseClientProtoNetData();
|
||||
MapInfoProto.MapTowerEnterRequest mapTowerEnterRequest = MapInfoProto.MapTowerEnterRequest.parseFrom(message);
|
||||
int teamId = mapTowerEnterRequest.getTeamId();
|
||||
MapLogic.getInstance().enterTowerCopy(iSession, teamId, MessageTypeProto.MessageType.MAP_TOWER_ENTER_RESPONSE);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
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.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class MapTowerOutRequest extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.MAP_TOWER_OUT_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
public class MapTowerResetRequestHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.MAP_TOWER_RESET_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
MapLogic.getInstance().outTowerCopy(iSession, MessageTypeProto.MessageType.MAP_TOWER_RESET_RESPONSE);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.handler.map;
|
||||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.SweepLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.protocols.FightInfoProto;
|
||||
|
|
@ -66,15 +66,19 @@ public class MissionLoigc {
|
|||
|
||||
|
||||
public static void getCopyMission(User user,List<CommonProto.UserMissionInfo> missionList){
|
||||
MapMission copyMissionProgres = user.getMapManager().getCopyMissionProgres();
|
||||
Map<Integer, Integer> allMissionProgress =new HashMap<>();
|
||||
Set<Integer> takeCopyMisionRewards = user.getMapManager().getTakeCopyMisionRewards();
|
||||
if(copyMissionProgres!=null){
|
||||
allMissionProgress = copyMissionProgres.getAllMissionProgress();
|
||||
}
|
||||
|
||||
int missionType = GameMisionType.COPYMISSION.getType();
|
||||
boolean needUpdate = false;
|
||||
|
||||
for(Integer copyId: SChallengeConfig.copyIds){
|
||||
boolean needUpdate = false;
|
||||
MapMission copyMissionProgres = user.getMapManager().getCopyMissionProgresById(copyId);
|
||||
Map<Integer, Integer> allMissionProgress =new HashMap<>();
|
||||
Set<Integer> takeCopyMisionRewards = user.getMapManager().getTakeCopyMisionRewards();
|
||||
if(copyMissionProgres==null){
|
||||
copyMissionProgres = new MapMission();
|
||||
copyMissionProgres.setMapId(copyId);
|
||||
copyMissionProgres.setAllMissionProgress(allMissionProgress);
|
||||
}
|
||||
List<SAccomplishmentConfig> sAccomplishmentConfigs = SAccomplishmentConfig.getsAccomplishmentConfigByMapId(copyId);
|
||||
for(SAccomplishmentConfig sAccomplishmentConfig : sAccomplishmentConfigs){
|
||||
Integer missionId = sAccomplishmentConfig.getId();
|
||||
|
|
@ -100,10 +104,11 @@ public class MissionLoigc {
|
|||
}
|
||||
missionList.add(CommonProto.UserMissionInfo.newBuilder().setMissionId(missionId).setState(state).setType(missionType).setProgress(mineProgess).build());
|
||||
}
|
||||
if(needUpdate){
|
||||
user.getMapManager().setCopyMissionProgres(copyMissionProgres);
|
||||
}
|
||||
}
|
||||
if(needUpdate){
|
||||
user.getMapManager().setCopyMissionProgres(user.getMapManager().getCopyMissionProgres());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void getVipMission(User user,List<CommonProto.UserMissionInfo> missionList){
|
||||
|
|
@ -146,9 +151,12 @@ public class MissionLoigc {
|
|||
if(type == GameMisionType.COPYMISSION.getType()){ //副本 任务
|
||||
Set<Integer> takeCopyMisionRewards = user.getMapManager().getTakeCopyMisionRewards();
|
||||
if(takeCopyMisionRewards.contains(missionId)){
|
||||
MessageUtil.sendErrorResponse(session,0, MessageTypeProto.MessageType.TAKE_MISSION_REWARD_RESPONSE_VALUE,"had taked reward");
|
||||
return;
|
||||
}
|
||||
Map<Integer, Integer> allMissionProgress = user.getMapManager().getCopyMissionProgres().getAllMissionProgress();
|
||||
SAccomplishmentConfig sAccomplishmentConfig = SAccomplishmentConfig.getsAccomplishmentConfigByIdMap(missionId);
|
||||
int mapId = sAccomplishmentConfig.getMapId();
|
||||
Map<Integer, Integer> allMissionProgress = user.getMapManager().getCopyMissionProgresById(mapId).getAllMissionProgress();
|
||||
int finsihProgress = SAccomplishmentConfig.getsAccomplishmentConfigByIdMap(missionId).getValues()[1][0];
|
||||
if(!allMissionProgress.containsKey(missionId) || allMissionProgress.get(missionId) <finsihProgress){
|
||||
MessageUtil.sendErrorResponse(session,0, MessageTypeProto.MessageType.TAKE_MISSION_REWARD_RESPONSE_VALUE,"mission can not get reward");
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.ljsd.jieling.logic.dao.*;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.protocols.ChatProto;
|
||||
import com.ljsd.jieling.protocols.CommonProto;
|
||||
import com.ljsd.jieling.protocols.MapInfoProto;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
|
@ -301,4 +302,19 @@ public class CBean2Proto {
|
|||
return result;
|
||||
|
||||
}
|
||||
|
||||
public static List<MapInfoProto.TowerShopInfo> getTowerShopInfo(Map<Integer, Integer> towerShopInfos) {
|
||||
List<MapInfoProto.TowerShopInfo> towerShopInfosProto = new ArrayList<>();
|
||||
if (towerShopInfos != null) {
|
||||
for (Map.Entry<Integer, Integer> entry : towerShopInfos.entrySet()) {
|
||||
MapInfoProto.TowerShopInfo towerShopInfo = MapInfoProto.TowerShopInfo
|
||||
.newBuilder()
|
||||
.setGoodsId(entry.getKey())
|
||||
.setBuyCount(entry.getValue())
|
||||
.build();
|
||||
towerShopInfosProto.add(towerShopInfo);
|
||||
}
|
||||
}
|
||||
return towerShopInfosProto;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue