Merge branch 'master' of 60.1.1.230:backend/jieling_server

# Conflicts:
#	serverlogic/src/main/java/com/ljsd/GameApplication.java
back_recharge
wangyuan 2019-09-10 10:07:55 +08:00
commit 2a286218e6
11 changed files with 105 additions and 40 deletions

View File

@ -12,6 +12,7 @@ import com.ljsd.jieling.handler.map.MapLogic;
import com.ljsd.jieling.logic.GlobalDataManaager;
import com.ljsd.jieling.logic.STableManager;
import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.logic.dao.GuilidManager;
import com.ljsd.jieling.logic.dao.MailingSystemManager;
import com.ljsd.jieling.logic.fight.CheckFight;
import com.ljsd.jieling.logic.hero.HeroLogic;
@ -88,6 +89,8 @@ public class GameApplication {
// HttpPool.init();
//todo 设置开服时间
setRegisterTime();
GuilidManager.init();
STableManager.initialize("com.ljsd.jieling.config");
//mongo异步数据处理线程
MongoDataHandlerTask.init(configurableApplicationContext);

View File

@ -28,47 +28,57 @@ public class UpSoulEquipQuiickHandler extends BaseHandler<HeroInfoProto.UpQuickS
User user = UserManager.getUser(iSession.getUid());
SoulEquip soulEquip = user.getEquipManager().getSoulEquipMap().get(upQuickSoulEquipRequest.getEquipId());
if (null == soulEquip) {
throw new Exception("装备不存在");
throw new Exception("升级的装备不存在");
}
int addleve = 1;
SEquipSign sEcfg = SEquipSign.getsEquipSignMap().get(soulEquip.getCfgId());
if (null == sEcfg ) {
throw new Exception("装备配置不存在" + soulEquip.getCfgId());
if (null == sEcfg) {
throw new Exception("升级的装备配置不存在" + soulEquip.getCfgId());
}
SEquipSign nextEcfg = SEquipSign.getsEquipSignMap().get(soulEquip.getCfgId()+addleve);
if ( null == nextEcfg) {
SEquipSign nextEcfg = SEquipSign.getsEquipSignMap().get(soulEquip.getCfgId() + addleve);
if (null == nextEcfg) {
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.UP_SOUL_EQUIP_RESPONSE_VALUE, "最高等级");
return;
}
List<String> consumIds = new LinkedList<>();
int nextNeedExp = SEquipSign.getEquipExpMap().get(sEcfg.getId());
int sumExp = soulEquip.getExp();
int leve = soulEquip.getLevel();
boolean full = false;
for (String equipId : upQuickSoulEquipRequest.getSoulEquipIdsList()) {
if (full) {
break;
}
SoulEquip equip = user.getEquipManager().getSoulEquipMap().get(equipId);
if (null == equip) {
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.UP_SOUL_EQUIP_RESPONSE_VALUE, "");
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.UP_SOUL_EQUIP_RESPONSE_VALUE, "消耗的装备不存在");
return;
}
SEquipSign sEquipSign1 = SEquipSign.getsEquipSignMap().get(equip.getCfgId());
if (null == sEquipSign1) {
throw new Exception("装备配置不存在" + equip.getCfgId());
throw new Exception("消耗的装备配置不存在" + equip.getCfgId());
}
if (upQuickSoulEquipRequest.getEquipId() == equipId) {
throw new Exception("消耗正在升级的装备" + equip.getCfgId());
}
sumExp += sEquipSign1.getResolve();
consumIds.add(equipId);
if (sumExp >= nextNeedExp) {
leve+=1;
addleve+=1;
SEquipSign nextEcfg1 = SEquipSign.getsEquipSignMap().get(equip.getCfgId()+addleve);
while (sumExp >= nextNeedExp) {
SEquipSign nextEcfg1 = SEquipSign.getsEquipSignMap().get(soulEquip.getCfgId()+addleve);
if (null == nextEcfg1) {
full = true;
break;
}
addleve += 1;
leve += 1;
nextNeedExp = SEquipSign.getEquipExpMap().get(nextEcfg1.getId());
}
if (full) {
break;
}
}
consumIds.forEach(id->user.getEquipManager().removeSoulEquip(id));
consumIds.forEach(id -> user.getEquipManager().removeSoulEquip(id));
soulEquip.setExp(sumExp);
soulEquip.setLevel(leve);
HeroInfoProto.UpSoulEquipResponse.Builder builder = HeroInfoProto.UpSoulEquipResponse.newBuilder();
@ -76,7 +86,7 @@ public class UpSoulEquipQuiickHandler extends BaseHandler<HeroInfoProto.UpQuickS
builder.setLeve(leve);
builder.addAllSoulEquipIds(consumIds);
builder.setEquipId(upQuickSoulEquipRequest.getEquipId());
MessageUtil.sendMessage(iSession,1, MessageTypeProto.MessageType.UP_SOUL_EQUIP_RESPONSE_VALUE,builder.build(),true);
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.UP_SOUL_EQUIP_RESPONSE_VALUE, builder.build(), true);
}
}

View File

@ -1282,10 +1282,13 @@ public class MapLogic {
}
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(teamId);
for (TeamPosHeroInfo teamPosHeroInfo : team) {
if(mapManager.getHeroAllAttributeMap().get(teamPosHeroInfo.getHeroId()).get(HeroAttributeEnum.Hp.getPropertyId())<checkResult[teamPosHeroInfo.getPosition()+1]){
continue;
Map<Integer, Integer> heroAttr = mapManager.getHeroAllAttributeMap().get(teamPosHeroInfo.getHeroId());
if(heroAttr!=null){
if(heroAttr.get(HeroAttributeEnum.Hp.getPropertyId())<checkResult[teamPosHeroInfo.getPosition()+1]){
continue;
}
mapManager.updateHeroOneAttribute(teamPosHeroInfo.getHeroId(), HeroAttributeEnum.CurHP.getPropertyId(), checkResult[teamPosHeroInfo.getPosition()+1]);
}
mapManager.updateHeroOneAttribute(teamPosHeroInfo.getHeroId(), HeroAttributeEnum.CurHP.getPropertyId(), checkResult[teamPosHeroInfo.getPosition()+1]);
}
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4&&teamId==401){
for (int i = 0 ; i <team.size();i++) {
@ -1293,7 +1296,11 @@ public class MapLogic {
Map<Integer, Integer> heroAllAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero,false,teamId);
int per = (int)(checkResult[i+2] / (double) heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())*10000);
mapManager.updateEndlessHeroHp(team.get(i).getHeroId(),per);
if(mapManager.getHeroAllAttributeMap().get(hero.getId()).get(HeroAttributeEnum.CurHP.getPropertyId())==0){
Map<Integer, Integer> currAttrMap = mapManager.getHeroAllAttributeMap().get(hero.getId());
if(currAttrMap==null){
continue;
}
if(currAttrMap.get(HeroAttributeEnum.CurHP.getPropertyId())==0){
mapManager.removeOneHeroAttribute(hero.getId());
}else{
mapManager.updateHeroOneAttribute(team.get(i).getHeroId(), HeroAttributeEnum.CurHP.getPropertyId(), checkResult[i+2]);
@ -1543,7 +1550,11 @@ public class MapLogic {
Map<Integer, Integer> heroAllAttribute = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero,false,teamId);
int per =(int) (checkResult[i+2] / (double) heroAllAttribute.get(HeroAttributeEnum.Hp.getPropertyId())*10000);
mapManager.updateEndlessHeroHp(team.get(i).getHeroId(),per);
if(mapManager.getHeroAllAttributeMap().get(hero.getId()).get(HeroAttributeEnum.CurHP.getPropertyId())==0){
Map<Integer, Integer> currAttrMap = mapManager.getHeroAllAttributeMap().get(hero.getId());
if(currAttrMap==null){
continue;
}
if(currAttrMap.get(HeroAttributeEnum.CurHP.getPropertyId())==0){
mapManager.removeOneHeroAttribute(hero.getId());
}else{
mapManager.updateHeroOneAttribute(team.get(i).getHeroId(), HeroAttributeEnum.CurHP.getPropertyId(), checkResult[i+2]);

View File

@ -40,7 +40,7 @@ public class GetQuestionRequestHandler extends BaseHandler<PlayerInfoProto.GetQu
}
List<CommonProto.QuestionOptions> list = new ArrayList<>();
question.getcQuestionOptionBeans().forEach(cQuestionOptionBean -> {
list.add(CommonProto.QuestionOptions.newBuilder().setContent(cQuestionOptionBean.getContent()).setType(cQuestionOptionBean.getType()).addAllOptions(Arrays.asList(cQuestionOptionBean.getOptions())).build());
list.add(CommonProto.QuestionOptions.newBuilder().setContent(cQuestionOptionBean.getContent()).setAnswerType(cQuestionOptionBean.getAnswerType()).setType(cQuestionOptionBean.getType()).addAllOptions(Arrays.asList(cQuestionOptionBean.getOptions())).build());
});
GlobalSystemControl.save(globalSystemControl);

View File

@ -39,11 +39,11 @@ public class UpdateQuestionRequestHandler extends BaseHandler<PlayerInfoProto.up
MessageUtil.sendErrorResponse(iSession, 0, MessageTypeProto.MessageType.UPDATE_QUESTION_RESPONSE_VALUE, "");
return;
}
if (proto.getOptionsCount() != question.getcQuestionOptionBeans().size()) {
PlayerInfoProto.upDataQuestionResponse.Builder builder = PlayerInfoProto.upDataQuestionResponse.newBuilder();
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.UPDATE_QUESTION_RESPONSE_VALUE, builder.setResult(-1).build(), true);
return;
}
// if (proto.getOptionsCount() != question.getcQuestionOptionBeans().size()) {
// PlayerInfoProto.upDataQuestionResponse.Builder builder = PlayerInfoProto.upDataQuestionResponse.newBuilder();
// MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.UPDATE_QUESTION_RESPONSE_VALUE, builder.setResult(-1).build(), true);
// return;
// }
user.getQuestionManager().addQuestion(question.getId(),proto.getOptionsList());
//移除过剩问卷答案

View File

@ -209,7 +209,6 @@ public class GlobalDataManaager {
DataManagerDistributor.init();
initServerIsLanEnviornment(configurableApplicationContext);
StoreLogic.checkGlobalStore(true);
GuilidManager.init();
new RPCServerTask(configurableApplicationContext).start();
new RPCGmServerTask(configurableApplicationContext).start();
} catch (Exception e) {

View File

@ -58,8 +58,9 @@ public class BloodLogic {
HeroManager heroManager = user.getHeroManager();
TeamPosManager teamPosManager = user.getTeamPosManager();
List<TeamPosHeroInfo> teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(teamId);
if(teamPosHeroInfos==null){
if(teamPosHeroInfos==null||teamPosHeroInfos.size()<1){
teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(1);
teamId = 1;
}
Iterator<TeamPosHeroInfo> it = teamPosHeroInfos.iterator();
Map<String, FamilyHeroInfo> heroAllAttribute = new HashMap<>();

View File

@ -123,8 +123,8 @@ public class EquipManager extends MongoBase {
if(especialEquip ==null){
return;
}
updateString("especialEquipMap."+equipId+".star",especialEquip.getStar()+1);
especialEquip.setStar(especialEquip.getStar()+1);
especialEquipMap.put(equipId,especialEquip);
updateString("especialEquipMap."+equipId+".star",especialEquip.getStar()+1);
}
}

View File

@ -483,7 +483,7 @@ public class GuildFightLogic {
public static void getFamilyFightRoundInfo(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
RedisUtil redisUtil = RedisUtil.getInstence();
int enemyFamily = getEnemyFamily(UserManager.getUser(session.getUid()).getPlayerInfoManager().getGuildId());
Integer attackCount = redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_ATTACK_COUNT,"",session.getId(),Integer.class);
Integer attackCount = redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_ATTACK_COUNT,"",String.valueOf(session.getUid()),Integer.class);
if(attackCount==null){
attackCount = 0;
}
@ -663,7 +663,7 @@ public class GuildFightLogic {
//战绩结算
int getExp = 0;
Double rank = redisUtil.getZSetScore(RedisKey.FAMILY_FIGHT_RANK, "", str);
// rank+=7000;
rank+=7000;
for(Map.Entry<Integer, SGuildScoreConfig> entry:sGuildScoreConfigMap.entrySet()){
if(rank<entry.getValue().getScoreMin()||rank>entry.getValue().getScoreMax()){
continue;
@ -848,24 +848,37 @@ public class GuildFightLogic {
timeRound = sGuildSetting.getPrepareTime();
if(status==0){
LOGGER.info("阶段变为布防");
Map<Integer, GuildInfo> guildInfoMap = GuilidManager.guildInfoMap;
if(guildInfoMap!=null&&guildInfoMap.size()>0){
for(Map.Entry<Integer, GuildInfo> entry:guildInfoMap.entrySet()){
int build = 0;
Map<Integer, Set<Integer>> members = entry.getValue().getMembers();
for(Map.Entry<Integer, Set<Integer>> member:members.entrySet()){
for(Integer uid:member.getValue()){
entry.getValue().updateDefendInfo(uid,build%3+1);
build=build%3+1;
}
}
}
}
status = 1;
}
}else if(flagTimeRound(sGuildSetting.getMatchTime(),hour,minute)){
timeRound = sGuildSetting.getMatchTime();
if(status==1){
if(status!=2){
status = 2;
LOGGER.info("阶段变为匹配");
startMatching = true;
}
startMatching = true;
}else if(flagTimeRound(sGuildSetting.getBattleTime(),hour,minute)){
timeRound = sGuildSetting.getBattleTime();
if(status == 2){
if(status != 3){
status = 3;
LOGGER.info("阶段变为进攻");
}
}else if(flagTimeRound(sGuildSetting.getSettleTime(),hour,minute)){
timeRound = sGuildSetting.getSettleTime();
if(status==3){
if(status!=4){
accountFamilyFightResult();
MongoUtil.getLjsdMongoTemplate().lastUpdate();
status = 4;

View File

@ -374,6 +374,11 @@ public class HeroLogic {
for(Map.Entry<Integer, List<TeamPosHeroInfo>> item :teamPosForHero.entrySet()){
int teamId = item.getKey();
List<TeamPosHeroInfo> teamPosHeroInfoList = item.getValue();
if(teamId==501){
if(teamPosHeroInfoList==null|teamPosHeroInfoList.size()<1){
teamPosHeroInfoList = teamPosForHero.get(1);
}
}
List<TeamPosForPokenInfo> teamPosForPokenInfos = teamPosForPoken.get(teamId);
if(null == teamPosForPokenInfos){
teamPosForPokenInfos = new ArrayList<>(1);
@ -1368,9 +1373,16 @@ public class HeroLogic {
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE.getNumber(),"法宝智能穿戴一个");
}else{
int[] equipTalismanaUnlock = SGameSetting.getGameSetting().getEquipTalismanaUnlock();
if(user.getPlayerInfoManager().getLevel()<equipTalismanaUnlock[0]||hero.getLevel()<equipTalismanaUnlock[1]){
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE.getNumber(),"玩家等级或妖灵师等级不够,无法装备!");
return;
if(equipTalismanaUnlock[0]==1){
if(user.getPlayerInfoManager().getLevel()<equipTalismanaUnlock[0]){
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE.getNumber(),"玩家等级不够,无法装备!");
return;
}
}else{
if(hero.getStar()<equipTalismanaUnlock[1]){
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.EQUIP_WEAR_RESPONSE.getNumber(),"妖灵师等级不够,无法装备!");
return;
}
}
hero.updateEspecial(equipIds.get(0));
}
@ -1444,6 +1456,13 @@ public class HeroLogic {
}
for (HeroInfoProto.SoulEquipPos soulEquipPos : equipIds) {
if(hero.getSoulEquipByPositionMap().containsKey(soulEquipPos.getPosition())){
String id = hero.getSoulEquipByPositionMap().get(soulEquipPos.getPosition());
SoulEquip oldEquip = user.getEquipManager().getSoulEquipMap().get(id);
if(null!=oldEquip){
oldEquip.setHeroId("");
}
}
hero.updateSoulEquipPositionMap(soulEquipPos.getPosition(),soulEquipPos.getEquipId());
}
@ -1488,7 +1507,7 @@ public class HeroLogic {
if(null == soulEquip || StringUtil.isEmpty(soulEquip.getHeroId())){
//未装备
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.SOUL_EQUIP_UNLOAD_OPT_RESPONSE_VALUE,"");
return;
continue;
}
soulEquip.setHeroId("");
positions.add(soulEquipPos.getPosition());

View File

@ -3,6 +3,7 @@ package com.ljsd.jieling.logic.question;
public class CQuestionOptionBean {
private String content = "";
private int answerType;
private int type;
private String[] options ;
@ -35,5 +36,13 @@ public class CQuestionOptionBean {
public void setOptions(String[] options) {
this.options = options;
}
public int getAnswerType() {
return answerType;
}
public void setAnswerType(int answerType) {
this.answerType = answerType;
}
}