修行2.0
parent
b51cd010a3
commit
23d1b68080
|
@ -287,7 +287,7 @@ public class EndExpeditionBattleRequest extends BaseHandler<Expedition.EndExpedi
|
|||
throw new ErrorCodeException("试炼节点英雄掉落失败");
|
||||
}
|
||||
Hero hero1 = ExpeditionLogic.createRandomHero(user,hero,heroTid,level,-1,2);
|
||||
drop.addHero(CBean2Proto.getHero(hero1));
|
||||
drop.addHero(CBean2Proto.getHero(user,hero1));
|
||||
for(Integer equipId : hero1.getEquipByPositionMap().values()){
|
||||
drop.addEquipId(CBean2Proto.getEquipProto(equipId));
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public class GetExpeditionRequestHandler extends BaseHandler<Expedition.GetExped
|
|||
List<CommonProto.Hero> heroList = new ArrayList<>();
|
||||
Map<String, Hero> heroMap = user.getExpeditionManager().getHeroMap();
|
||||
for(Hero hero : heroMap.values()){
|
||||
heroList.add(CBean2Proto.getHero(hero));
|
||||
heroList.add(CBean2Proto.getHero(user,hero));
|
||||
}
|
||||
builder.addAllHeroList(heroList);
|
||||
Map<String, PropertyItem> equipMap = user.getExpeditionManager().getEquipMap();
|
||||
|
|
|
@ -110,7 +110,7 @@ public class HeroNodeGetInfoRequestHandler extends BaseHandler<Expedition.HeroNo
|
|||
// 英雄战力
|
||||
inner.setForce(HeroLogic.getInstance().calForce(heroNotBufferAttribute));
|
||||
// 英雄
|
||||
inner.setHero(CBean2Proto.getHero(hero));
|
||||
inner.setHero(CBean2Proto.getHero(user,hero));
|
||||
builder.addViewHeroInfo(inner);
|
||||
user.getExpeditionManager().getGHeroSet().add(hero.getTemplateId());
|
||||
});
|
||||
|
|
|
@ -100,7 +100,7 @@ public class HeroNodeRequestHandler extends BaseHandler<Expedition.HeroNodeReque
|
|||
}
|
||||
|
||||
|
||||
drop.addHero(CBean2Proto.getHero(hero));
|
||||
drop.addHero(CBean2Proto.getHero(user,hero));
|
||||
|
||||
//clear temp
|
||||
// user.getExpeditionManager().clearEquipToTemp();
|
||||
|
|
|
@ -164,7 +164,7 @@ public class GMRequestHandler extends BaseHandler{
|
|||
}
|
||||
hero.setBreakId(breakId);
|
||||
}
|
||||
CommonProto.Hero finalHeroProto = CBean2Proto.getHero(hero);
|
||||
CommonProto.Hero finalHeroProto = CBean2Proto.getHero(cUser,hero);
|
||||
gmBuilder.setDrop(CommonProto.Drop.newBuilder().addHero(finalHeroProto).build());
|
||||
|
||||
break;
|
||||
|
@ -366,7 +366,7 @@ public class GMRequestHandler extends BaseHandler{
|
|||
heroTmp.setBreakId(scHeroRankUpConfigBreak.getId());
|
||||
}
|
||||
}
|
||||
gmBuilder.setDrop(CommonProto.Drop.newBuilder().addHero(CBean2Proto.getHero(heroTmp)).build());
|
||||
gmBuilder.setDrop(CommonProto.Drop.newBuilder().addHero(CBean2Proto.getHero(cUser,heroTmp)).build());
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public class GetAllHerosHandler extends BaseHandler{
|
|||
}
|
||||
}
|
||||
}
|
||||
heroList.add(CBean2Proto.getHero(hero));
|
||||
heroList.add(CBean2Proto.getHero(user,hero));
|
||||
}
|
||||
boolean isSendFinish = false;
|
||||
int endIndex = startIndex + Global.SEND_CARD_COUNT;
|
||||
|
|
|
@ -70,7 +70,7 @@ public class DoHeroChangeRequestHandler extends BaseHandler<HeroInfoProto.DoHer
|
|||
newHero.setEquipByPositionMap(hero.getEquipByPositionMap());
|
||||
newHero.setJewelInfo(hero.getJewelInfo());
|
||||
user.getHeroManager().addHero(newHero);
|
||||
drop.addHero(CBean2Proto.getHero(newHero));
|
||||
drop.addHero(CBean2Proto.getHero(user,newHero));
|
||||
//新头像
|
||||
SItem sItem = SItem.getsItemMap().get(hero.getChangeId());
|
||||
if(sItem != null){
|
||||
|
|
|
@ -8,13 +8,20 @@ import com.ljsd.jieling.handler.BaseHandler;
|
|||
import com.ljsd.jieling.logic.dao.PurpleMansionSeal;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.CBean2Proto;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SXiuXian;
|
||||
import config.SXiuXianSkill;
|
||||
import manager.STableManager;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author hj
|
||||
* @Description 修行玩法,升级
|
||||
|
@ -31,9 +38,9 @@ public class UpPracticeLevelHandler extends BaseHandler<HeroInfoProto.UpPractice
|
|||
}
|
||||
|
||||
@Override
|
||||
public GeneratedMessage processWithProto(int uid, HeroInfoProto.UpPracticeLevelRequest proto) throws Exception {
|
||||
public void processWithProto(ISession iSession, HeroInfoProto.UpPracticeLevelRequest proto) throws Exception {
|
||||
// 用户信息
|
||||
User user = UserManager.getUser(uid);
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
if (user == null) {
|
||||
throw new ErrorCodeException(ErrorCode.UNKNOWN);
|
||||
}
|
||||
|
@ -73,9 +80,16 @@ public class UpPracticeLevelHandler extends BaseHandler<HeroInfoProto.UpPractice
|
|||
PurpleMansionSeal purpleMansionSeal = new PurpleMansionSeal(seal, xianSkill.getType(),"",0);
|
||||
user.getHeroManager().putPurpleMansionSeal(purpleMansionSeal);
|
||||
}
|
||||
|
||||
// 推送神印信息
|
||||
List<CommonProto.PurpleMansionSeal> sealInfo = CBean2Proto.getPurpleMansionSealInfo(user);
|
||||
HeroInfoProto.PurpleMansionSealIndication build2 = HeroInfoProto.PurpleMansionSealIndication.newBuilder().addAllSealList(sealInfo).build();
|
||||
MessageUtil.sendIndicationMessage(iSession,1, MessageTypeProto.MessageType.PurpleMansionSealIndication_VALUE,build2,true);
|
||||
}
|
||||
|
||||
return HeroInfoProto.UpPracticeLevelResponse.newBuilder().setPracticeLevel(xiuXian2.getId()).build();
|
||||
// 升级返回
|
||||
HeroInfoProto.UpPracticeLevelResponse build = HeroInfoProto.UpPracticeLevelResponse.newBuilder().setPracticeLevel(xiuXian2.getId()).build();
|
||||
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.UpPracticeLevelResponse_VALUE,build,true);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1497,6 +1497,9 @@ public class HeroLogic{
|
|||
SXiuXianSkill xianSkill = STableManager.getConfig(SXiuXianSkill.class).get(sealId);
|
||||
// 技能数组转list
|
||||
int skillId = xianSkill.getSkillId();
|
||||
if (skillId <= 0){
|
||||
return;
|
||||
}
|
||||
// 适用范围
|
||||
int[] fitList = xianSkill.getFitList();
|
||||
switch (fitList[0]){
|
||||
|
@ -1930,11 +1933,11 @@ public class HeroLogic{
|
|||
// 修行等级属性加成
|
||||
Map<Integer, SXiuXian> xiuXianMap = STableManager.getConfig(SXiuXian.class);
|
||||
int practiceLevel = user.getHeroManager().getPracticeLevel();
|
||||
xiuXianMap.values().forEach(v->{
|
||||
if (v.getId() >= practiceLevel && v.getTotalPros() != null){
|
||||
for (SXiuXian v : xiuXianMap.values()) {
|
||||
if (practiceLevel >= v.getId() && v.getTotalPros() != null){
|
||||
combinedAttribute(v.getTotalPros(),heroAllAttribute);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// //皮肤、称号加成 -- 前端未实现,暂时注释
|
||||
// int decoration = user.getPlayerInfoManager().getDecoration();
|
||||
|
|
|
@ -625,7 +625,7 @@ public class PlayerLogic {
|
|||
builder.addEquip(CBean2Proto.getEquipProto(equipId));
|
||||
}
|
||||
builder.setForce(HeroLogic.getInstance().calForce(heroNotBufferAttribute));
|
||||
builder.setHero(CBean2Proto.getHero(hero));
|
||||
builder.setHero(CBean2Proto.getHero(userInMem,hero));
|
||||
Map<Integer, Integer> guildSkill = userInMem.getGuildMyInfo().getGuildSkill();
|
||||
int profession = SCHero.getsCHero().get(hero.getTemplateId()).getProfession();
|
||||
Integer skill = guildSkill.getOrDefault(profession, 0);
|
||||
|
|
|
@ -24,6 +24,7 @@ import util.StringUtil;
|
|||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class CBean2Proto {
|
||||
|
||||
|
@ -205,7 +206,7 @@ public class CBean2Proto {
|
|||
return userMountLists;
|
||||
}
|
||||
|
||||
public static CommonProto.Hero getHero(Hero hero){
|
||||
public static CommonProto.Hero getHero(User user, Hero hero){
|
||||
List<CommonProto.SoulPos> soulPoss = new ArrayList<>();
|
||||
Map<Integer, Integer> soulEquipMap = hero.getSoulEquipByPositionMap();
|
||||
if(soulEquipMap!=null&&!soulEquipMap.isEmpty()){
|
||||
|
@ -216,6 +217,7 @@ public class CBean2Proto {
|
|||
soulPoss.add(builder.build());
|
||||
}
|
||||
}
|
||||
|
||||
return CommonProto.Hero
|
||||
.newBuilder()
|
||||
.setId(hero.getId())
|
||||
|
@ -233,6 +235,7 @@ public class CBean2Proto {
|
|||
.setCreatetype(hero.getCreateType())
|
||||
.setChangeId(hero.getChangeId())
|
||||
.setSkinId(hero.getSkin())
|
||||
.addAllSealIdList(getSealIdListByHero(user,hero))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -723,4 +726,24 @@ public class CBean2Proto {
|
|||
});
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取英雄身上的神印id列表
|
||||
* @param user
|
||||
* @param hero
|
||||
* @return
|
||||
*/
|
||||
private static List<Integer> getSealIdListByHero(User user, Hero hero){
|
||||
ArrayList<Integer> list = new ArrayList<>();
|
||||
Collection<PurpleMansionSeal> values = user.getHeroManager().getPurpleMansionSeal().values();
|
||||
for (PurpleMansionSeal v : values) {
|
||||
if (v.getState() == 1){
|
||||
if (v.getType() == 1 && !v.getSubId().equals(hero.getId())){
|
||||
continue;
|
||||
}
|
||||
list.add(v.getSealId());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1276,7 +1276,7 @@ public class ItemUtil {
|
|||
heroManager.addHero(hero);
|
||||
// 鸿蒙阵推送
|
||||
HeroLogic.getInstance().addOrUpdateHongmeng(OnlineUserManager.getSessionByUid(user.getId()));
|
||||
heroList.add(CBean2Proto.getHero(hero));
|
||||
heroList.add(CBean2Proto.getHero(user,hero));
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
if (scHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级
|
||||
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert("lamp_lottery_content", new Object[]{playerInfoManager.getNickName(), scHero.getStar(), scHero.getReadingName()},new int[]{0,0,1});
|
||||
|
|
Loading…
Reference in New Issue