Merge branch 'master_otnew' into master_dev
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/db/mongo/MongoPropertyConverter.javamaster_otnew
commit
fd70aadc15
|
@ -16,7 +16,7 @@ public class MongoPropertyConverter implements Converter<BasicDBObject, Property
|
|||
// private static final JsonWriterSettings jsonWriterSettings = new JsonWriterSettings();
|
||||
@Override
|
||||
public PropertyItem convert(BasicDBObject source) {
|
||||
if (StringUtil.isEmpty(source.toString()) || !source.containsField("equipId") || !source.containsField("id")) {
|
||||
if (StringUtil.isEmpty(source.toString()) || !source.containsField("equipId") || !source.containsField("_id")) {
|
||||
return null;
|
||||
}
|
||||
SItem item = SItem.getsItemMap().get(source.getInt("equipId"));
|
||||
|
|
|
@ -3,12 +3,17 @@ package com.ljsd.jieling.logic.dao;
|
|||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.globals.GlobalItemType;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||
import config.SItem;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class EquipManager extends MongoBase {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(EquipManager.class);
|
||||
|
||||
private Map<String,PropertyItem> equipMap = new HashMap<>();// 属性装备列表
|
||||
private Set<Integer> equipBookEnabled = new HashSet<>();// 装备图鉴
|
||||
private Set<Integer> soulGealList = new HashSet<>();// 魂印列表
|
||||
|
@ -64,13 +69,21 @@ public class EquipManager extends MongoBase {
|
|||
}
|
||||
|
||||
public Map<String, PropertyItem> getEquipMap() {
|
||||
Iterator<Map.Entry<String, PropertyItem>> iterator = equipMap.entrySet().iterator();
|
||||
while (iterator.hasNext()){
|
||||
Map.Entry<String, PropertyItem> next = iterator.next();
|
||||
if (next.getValue() == null){
|
||||
LOGGER.error("属性装备数据出现异常,删除道具:{}",next.getKey());
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
return equipMap;
|
||||
}
|
||||
|
||||
public List<PropertyItem> getFaxiangList(){
|
||||
ArrayList<PropertyItem> list = new ArrayList<>();
|
||||
Map<Integer, SItem> itemMap = SItem.getsItemMap();
|
||||
for (PropertyItem item : equipMap.values()) {
|
||||
for (PropertyItem item : getEquipMap().values()) {
|
||||
SItem sItem = itemMap.get(item.getEquipId());
|
||||
if (sItem == null || sItem.getItemType() != GlobalItemType.FAXIANG_EQUIP){
|
||||
continue;
|
||||
|
@ -83,7 +96,7 @@ public class EquipManager extends MongoBase {
|
|||
public List<PropertyItem> getJewelList(){
|
||||
ArrayList<PropertyItem> list = new ArrayList<>();
|
||||
Map<Integer, SItem> itemMap = SItem.getsItemMap();
|
||||
for (PropertyItem item : equipMap.values()) {
|
||||
for (PropertyItem item : getEquipMap().values()) {
|
||||
SItem sItem = itemMap.get(item.getEquipId());
|
||||
if (sItem == null || sItem.getItemType() != GlobalItemType.JEWEL){
|
||||
continue;
|
||||
|
@ -95,7 +108,7 @@ public class EquipManager extends MongoBase {
|
|||
|
||||
public List<Baubles> getBaublesList(){
|
||||
ArrayList<Baubles> list = new ArrayList<>();
|
||||
for (PropertyItem item : equipMap.values()) {
|
||||
for (PropertyItem item : getEquipMap().values()) {
|
||||
if (item instanceof Baubles){
|
||||
list.add((Baubles) item);
|
||||
}
|
||||
|
@ -104,11 +117,11 @@ public class EquipManager extends MongoBase {
|
|||
}
|
||||
|
||||
public PropertyItem getEquip(String equipId) {
|
||||
return equipMap.get(equipId);
|
||||
return getEquipMap().get(equipId);
|
||||
}
|
||||
|
||||
public Baubles getBaubles(String equipId) {
|
||||
PropertyItem item = equipMap.get(equipId);
|
||||
PropertyItem item = getEquipMap().get(equipId);
|
||||
if (item instanceof Baubles){
|
||||
return (Baubles) item;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue