fix
parent
5bcd5583c9
commit
e9b57014bf
|
@ -0,0 +1,59 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="AccomplishmentBox")
|
||||
public class SAccomplishmentBox implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int total;
|
||||
|
||||
private int[][] box;
|
||||
|
||||
private Map<Integer,Integer> boxMap;
|
||||
private static Map<Integer, SAccomplishmentBox> sAccomplishmentBoxMap;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SAccomplishmentBox> config = STableManager.getConfig(SAccomplishmentBox.class);
|
||||
for(SAccomplishmentBox sAccomplishmentBox : config.values()){
|
||||
int[][] box = sAccomplishmentBox.getBox();
|
||||
Map<Integer,Integer> boxMapTmp = new HashMap<>();
|
||||
for(int [] boxItem : box){
|
||||
boxMapTmp.put(boxItem[0],boxItem[1]);
|
||||
}
|
||||
sAccomplishmentBox.setBoxMap(boxMapTmp);
|
||||
}
|
||||
sAccomplishmentBoxMap = config;
|
||||
}
|
||||
|
||||
public static SAccomplishmentBox getsAccomplishmentBoxByMapId( int mapId ) {
|
||||
return sAccomplishmentBoxMap.get(mapId);
|
||||
}
|
||||
|
||||
public int getid() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public int[][] getBox() {
|
||||
return box;
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getBoxMap() {
|
||||
return boxMap;
|
||||
}
|
||||
|
||||
public void setBoxMap(Map<Integer, Integer> boxMap) {
|
||||
this.boxMap = boxMap;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.ljsd.jieling.config;
|
||||
|
||||
import com.ljsd.jieling.logic.STableManager;
|
||||
import com.ljsd.jieling.logic.Table;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="AccomplishmentConfig")
|
||||
public class SAccomplishmentConfig implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int mapId;
|
||||
|
||||
private int logic;
|
||||
|
||||
private int[] values;
|
||||
|
||||
private int score;
|
||||
|
||||
private static Map<Integer, List<SAccomplishmentConfig>> sAccomplishmentConfigByMapIdMap;
|
||||
|
||||
private static Map<Integer, SAccomplishmentConfig> sAccomplishmentConfigByIdMap;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SAccomplishmentConfig> config = STableManager.getConfig(SAccomplishmentConfig.class);
|
||||
Map<Integer, List<SAccomplishmentConfig>> sAccomplishmentConfigByMapIdMapTmp = new HashMap<>();
|
||||
for(SAccomplishmentConfig sAccomplishmentConfig : config.values()){
|
||||
int mapId = sAccomplishmentConfig.getMapId();
|
||||
if(!sAccomplishmentConfigByMapIdMapTmp.containsKey(mapId)){
|
||||
sAccomplishmentConfigByMapIdMapTmp.put(mapId,new ArrayList<>());
|
||||
}
|
||||
sAccomplishmentConfigByMapIdMapTmp.get(mapId).add(sAccomplishmentConfig);
|
||||
}
|
||||
sAccomplishmentConfigByMapIdMap = sAccomplishmentConfigByMapIdMapTmp;
|
||||
sAccomplishmentConfigByIdMap = config;
|
||||
}
|
||||
|
||||
public static List<SAccomplishmentConfig> getsAccomplishmentConfigByMapId(int mapId) {
|
||||
return sAccomplishmentConfigByMapIdMap.get(mapId);
|
||||
}
|
||||
|
||||
public static SAccomplishmentConfig getsAccomplishmentConfigByIdMap(int id) {
|
||||
return sAccomplishmentConfigByIdMap.get(id);
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getMapId() {
|
||||
return mapId;
|
||||
}
|
||||
|
||||
public int getLogic() {
|
||||
return logic;
|
||||
}
|
||||
|
||||
public int[] getValues() {
|
||||
return values;
|
||||
}
|
||||
|
||||
public int getScore() {
|
||||
return score;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -925,7 +925,7 @@ public class MapLogic {
|
|||
MapManager mapManager = user.getMapManager();
|
||||
Map<Integer, MapMission> allMapMissionProgress = mapManager.getAllMissionProgress();
|
||||
if(allMapMissionProgress == null || allMapMissionProgress.isEmpty()){
|
||||
MessageUtil.sendErrorResponse(session,0, MessageTypeProto.MessageType.GET_ALL_MAP_ACCOMPLISH_RESPONSE_VALUE,"");
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_ALL_MAP_ACCOMPLISH_RESPONSE_VALUE,null,true);
|
||||
return;
|
||||
}
|
||||
List<CommonProto.MapAccomplishInfo> mapAccomplishInfos = new ArrayList<>(allMapMissionProgress.size());
|
||||
|
|
Loading…
Reference in New Issue