代码修复
parent
5f5562938b
commit
29bf5b17be
|
|
@ -6,6 +6,7 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.ExpeditionNodeInfo;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.PropertyItem;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||
|
|
@ -93,20 +94,30 @@ public class HeroNodeGetInfoRequestHandler extends BaseHandler<Expedition.HeroNo
|
|||
|
||||
heroMapTemp.forEach((s, hero) -> {
|
||||
CommonProto.ViewHeroInfo.Builder inner = CommonProto.ViewHeroInfo.newBuilder();
|
||||
|
||||
// 英雄属性
|
||||
Map<Integer, Integer> heroNotBufferAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero, true, 0);
|
||||
for(Map.Entry<Integer,Integer> item : heroNotBufferAttribute.entrySet()){
|
||||
inner.addSpecialEffects(CommonProto.SpecialEffects.newBuilder().setPropertyId(item.getKey()).setPropertyValue(item.getValue()).build());
|
||||
}
|
||||
for(Integer equipId : hero.getEquipByPositionMap().values()){
|
||||
// 装备
|
||||
for(Integer equipId : hero.getEquipByPositionMap().values()){
|
||||
inner.addEquip(CBean2Proto.getEquipProto(equipId));
|
||||
}
|
||||
// 大闹天宫装备信息
|
||||
Map<String, PropertyItem> equipMap = user.getExpeditionManager().getEquipMap();
|
||||
// 魂宝,灵宝
|
||||
for(String equipId : hero.getJewelInfo()){
|
||||
inner.addEquip(CBean2Proto.getEquipProto(equipMap.get(equipId)));
|
||||
}
|
||||
// 英雄战力
|
||||
inner.setForce(HeroLogic.getInstance().calForce(heroNotBufferAttribute));
|
||||
// 英雄
|
||||
inner.setHero(CBean2Proto.getHero(hero));
|
||||
builder.addViewHeroInfo(inner);
|
||||
user.getExpeditionManager().getGHeroSet().add(hero.getTemplateId());
|
||||
});
|
||||
|
||||
// nodeInfo.setState(ExpeditionLogic.NODESTATE_HERO);
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -204,23 +204,23 @@ public class ExpeditionManager extends MongoBase {
|
|||
}
|
||||
|
||||
|
||||
public void addEquip(User user, PropertyItem equip) throws Exception {
|
||||
public void addEquip(PropertyItem equip){
|
||||
equip.init(this.getRootId(),getMongoKey() + ".equipMap." + equip.getId());
|
||||
updateString("equipMap." + equip.getId(), equip);
|
||||
equipMap.put(equip.getId(),equip);
|
||||
}
|
||||
|
||||
public void clearEquip() throws Exception {
|
||||
updateString("equipMap", equipMap);
|
||||
public void clearEquip(){
|
||||
equipMap.clear();
|
||||
updateString("equipMap", equipMap);
|
||||
}
|
||||
|
||||
public void clearEquipToTemp() throws Exception {
|
||||
updateString("equipMapTemp" , equipMapTemp);
|
||||
public void clearEquipToTemp(){
|
||||
equipMapTemp.clear();
|
||||
updateString("equipMapTemp" , equipMapTemp);
|
||||
}
|
||||
|
||||
public void addEquipToTemp(User user, PropertyItem equip) throws Exception {
|
||||
public void addEquipToTemp(PropertyItem equip){
|
||||
equip.init(this.getRootId(),getMongoKey() + ".equipMapTemp." + equip.getId());
|
||||
updateString("equipMapTemp." + equip.getId(), equip);
|
||||
equipMapTemp.put(equip.getId(),equip);
|
||||
|
|
|
|||
|
|
@ -30,6 +30,15 @@ public class Jewel extends PropertyItem {
|
|||
this.setJewelType(STableManager.getConfig(SJewelConfig.class).get(jewelId).getLocation());
|
||||
}
|
||||
|
||||
public Jewel(int uid,int jewelId,Jewel jewel){
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
super.setId(KeyGenUtils.produceIdByModule(UUIDEnum.JEWEL, uid));
|
||||
this.setEquipId(jewelId);
|
||||
this.setJewelType(STableManager.getConfig(SJewelConfig.class).get(jewelId).getLocation());
|
||||
this.setBuildLevel(jewel.getBuildLevel());
|
||||
this.setLevel(jewel.getLevel());
|
||||
}
|
||||
|
||||
public int getBuildLevel() {
|
||||
return buildLevel;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ public class ExpeditionLogic {
|
|||
* @param newHero
|
||||
* @param type
|
||||
*/
|
||||
private static void addExpeditionJewel(User user,Hero newHero,int type) throws Exception {
|
||||
private static void addExpeditionJewel(User user,Hero newHero,int type){
|
||||
Set<String> jewelInfo = newHero.getJewelInfo();
|
||||
if (jewelInfo == null || jewelInfo.size() <= 0){
|
||||
// 没有魂宝灵宝
|
||||
|
|
@ -642,15 +642,13 @@ public class ExpeditionLogic {
|
|||
continue;
|
||||
}
|
||||
// 修改装备id为表里类型,1:魂宝,2:灵宝
|
||||
if (jewel.getJewelType() == 1){
|
||||
jewel.setEquipId(equip[0]);
|
||||
}else {
|
||||
jewel.setEquipId(equip[1]);
|
||||
}
|
||||
int jewelId = jewel.getJewelType() == 1?equip[0]:equip[1];
|
||||
|
||||
Jewel jews = new Jewel(user.getId(), jewelId,jewel);
|
||||
// 添加到大闹天宫装备背包,此操作会更新唯一id
|
||||
user.getExpeditionManager().addEquip(user,jewel);
|
||||
user.getExpeditionManager().addEquip(jews);
|
||||
// 新的装备id
|
||||
set.add(jewel.getId());
|
||||
set.add(jews.getId());
|
||||
}
|
||||
newHero.setJewelInfo(set);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
|||
import com.ljsd.jieling.network.server.GlobalidHelper;
|
||||
import com.ljsd.jieling.network.server.WorldHelper;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import config.SExpeditionSetting;
|
||||
import manager.STableManager;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
|
@ -28,8 +30,10 @@ import util.MathUtils;
|
|||
import util.TimeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
|
|
@ -132,6 +136,7 @@ public class RankLogic {
|
|||
* @throws Exception
|
||||
*/
|
||||
public List<List<Integer>> getRandomUserByRank(User user,int counts) throws Exception {
|
||||
List<List<Integer>> result = new ArrayList<>();
|
||||
// 获取排行信息
|
||||
PlayerInfoProto.RankResponse rankResponse = getRankInfo(user,1,50);
|
||||
// 计时器
|
||||
|
|
@ -139,10 +144,12 @@ public class RankLogic {
|
|||
|
||||
int rankSize = rankResponse.getRanksCount();
|
||||
if (rankSize <= 0){
|
||||
throw new ErrorCodeException(ErrorCode.SYS_ERROR_CODE,"战力排行榜暂无数据,没有人上榜");
|
||||
// 排行榜没有玩家,走默认表配置
|
||||
int[] defaults = STableManager.getConfig(SExpeditionSetting.class).get(1).getDefaultLineup();
|
||||
List<Integer> collect = Arrays.stream(defaults).boxed().collect(Collectors.toList());
|
||||
result.add(collect);
|
||||
return result;
|
||||
}
|
||||
|
||||
List<List<Integer>> result = new ArrayList<>();
|
||||
// 计数器
|
||||
int count = 0;
|
||||
do {
|
||||
|
|
|
|||
|
|
@ -5,97 +5,99 @@ import manager.Table;
|
|||
@Table(name ="ExpeditionSetting")
|
||||
public class SExpeditionSetting implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
private int id;
|
||||
|
||||
private int reviveRefresh;
|
||||
private int reviveRefresh;
|
||||
|
||||
private int[] revive;
|
||||
private int[] revive;
|
||||
|
||||
private int holyCount;
|
||||
private int holyCount;
|
||||
|
||||
private int regeneratePercent;
|
||||
private int regeneratePercent;
|
||||
|
||||
private int[][] matchForce;
|
||||
private int[][] matchForce;
|
||||
|
||||
private int[] matchForceRange;
|
||||
private int[] matchForceRange;
|
||||
|
||||
private int[][] powerfulForce;
|
||||
private int[][] powerfulForce;
|
||||
|
||||
private int fightTime;
|
||||
private int fightTime;
|
||||
|
||||
private int[][] treasureTime;
|
||||
private int[][] treasureTime;
|
||||
|
||||
private int[] openRules;
|
||||
private int[] openRules;
|
||||
|
||||
private int[] levelForce;
|
||||
private int[] levelForce;
|
||||
|
||||
private int[][] fourthOpenRule;
|
||||
private int[][] fourthOpenRule;
|
||||
|
||||
private int recruitTime;
|
||||
private int recruitTime;
|
||||
|
||||
private int[][] playerLevelfix;
|
||||
private int[][] playerLevelfix;
|
||||
|
||||
private int specialReward;
|
||||
|
||||
@Override
|
||||
private int specialReward;
|
||||
|
||||
private int[] defaultLineup;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getReviveRefresh() {
|
||||
public int getReviveRefresh() {
|
||||
return reviveRefresh;
|
||||
}
|
||||
|
||||
public int[] getRevive() {
|
||||
public int[] getRevive() {
|
||||
return revive;
|
||||
}
|
||||
|
||||
public int getHolyCount() {
|
||||
public int getHolyCount() {
|
||||
return holyCount;
|
||||
}
|
||||
|
||||
public int getRegeneratePercent() {
|
||||
public int getRegeneratePercent() {
|
||||
return regeneratePercent;
|
||||
}
|
||||
|
||||
public int[][] getMatchForce() {
|
||||
public int[][] getMatchForce() {
|
||||
return matchForce;
|
||||
}
|
||||
|
||||
public int[] getMatchForceRange() {
|
||||
public int[] getMatchForceRange() {
|
||||
return matchForceRange;
|
||||
}
|
||||
|
||||
public int[][] getPowerfulForce() {
|
||||
public int[][] getPowerfulForce() {
|
||||
return powerfulForce;
|
||||
}
|
||||
|
||||
public int getFightTime() {
|
||||
public int getFightTime() {
|
||||
return fightTime;
|
||||
}
|
||||
|
||||
public int[][] getTreasureTime() {
|
||||
public int[][] getTreasureTime() {
|
||||
return treasureTime;
|
||||
}
|
||||
|
||||
public int[] getOpenRules() {
|
||||
public int[] getOpenRules() {
|
||||
return openRules;
|
||||
}
|
||||
|
||||
public int[] getLevelForce() {
|
||||
public int[] getLevelForce() {
|
||||
return levelForce;
|
||||
}
|
||||
|
||||
public int[][] getFourthOpenRule() {
|
||||
public int[][] getFourthOpenRule() {
|
||||
return fourthOpenRule;
|
||||
}
|
||||
|
||||
public int getRecruitTime() {
|
||||
public int getRecruitTime() {
|
||||
return recruitTime;
|
||||
}
|
||||
|
||||
|
|
@ -106,4 +108,8 @@ public class SExpeditionSetting implements BaseConfig {
|
|||
public int getSpecialReward() {
|
||||
return specialReward;
|
||||
}
|
||||
|
||||
public int[] getDefaultLineup() {
|
||||
return defaultLineup;
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,9 @@ public class ExcelUtils {
|
|||
|
||||
public static void main(String[] args) throws Exception {
|
||||
File oldfile = new File(path);
|
||||
if (!oldfile.exists()&&!oldfile.isDirectory()){
|
||||
oldfile.mkdir();
|
||||
}
|
||||
String[] list = oldfile.list();
|
||||
oldFileNames.addAll(Arrays.asList(list));
|
||||
readExcelData();
|
||||
|
|
@ -126,7 +129,7 @@ public class ExcelUtils {
|
|||
int nums = Integer.parseInt(typeInfos[1]);
|
||||
StringBuffer sb = new StringBuffer();
|
||||
if("string".equals(typeInfos[0])){
|
||||
sb.append("String");
|
||||
sb.append("String");
|
||||
}else{
|
||||
sb.append(typeInfos[0]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue