Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn

back_recharge
jiahuiwen 2021-10-20 13:17:41 +08:00
commit d410b576a0
6 changed files with 89 additions and 33 deletions

View File

@ -48,10 +48,7 @@ import rpc.protocols.CommonProto;
import rpc.protocols.MessageTypeProto; import rpc.protocols.MessageTypeProto;
import util.TimeUtils; import util.TimeUtils;
import java.util.Arrays; import java.util.*;
import java.util.Calendar;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.CrossYuXuLunDaoChallengeRequest> { public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.CrossYuXuLunDaoChallengeRequest> {
@ -326,7 +323,7 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
arenaRecord.setServerName(defServerName); arenaRecord.setServerName(defServerName);
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
//编队为空 判输赢 //编队为空 判输赢
if (!updateResult(myUser,i, myteamId, defTeamId, result)) { if (!updateResult(myUser,i, myteamId, defTeamId, result,csPlayer,crossArenaManager,arenaRecord)) {
continue; continue;
} }
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(myUser, myteamId[i], null, null); CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(myUser, myteamId[i], null, null);
@ -359,7 +356,7 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
return result; return result;
} }
public static boolean updateResult(User user,int i, int[] myteamId, int[] defTeamId, int[] result) { public static boolean updateResult(User user,int i, int[] myteamId, int[] defTeamId, int[] result,CSPlayer csPlayer,CrossArenaManager crossArenaManager, ArenaRecord arenaRecord) throws Exception{
/*if (myteamId[i] == 0 || defTeamId[i] == 0) { /*if (myteamId[i] == 0 || defTeamId[i] == 0) {
if (myteamId[i] == 0 && defTeamId[i] == 0) { if (myteamId[i] == 0 && defTeamId[i] == 0) {
result[i] = 0; result[i] = 0;
@ -372,6 +369,24 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
} }
return false; return false;
}*/ }*/
//没有队伍时候 直接断定对方赢
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero();
if(!teamPosForHero.containsKey(myteamId[i]) || teamPosForHero.get(myteamId[i]).size() == 0){
result[i] = 0;
if (GameApplication.serverId == csPlayer.getServerId()) {
User defuser = UserManager.getUser(csPlayer.getUserId());
int addforce = HeroLogic.getInstance().calTeamTotalForce(defuser, myteamId[i], false);
arenaRecord.getYxldDefForce().add(addforce);
}else{
List<com.ljsd.jieling.thrift.idl.TeamPosHeroInfo> teamPosHeroInfos = crossArenaManager.getTeams().getOrDefault(myteamId[i], new ArrayList<>());
int addforcerpc = crossArenaManager.getTotalForceByTeam().get(myteamId[i]);
arenaRecord.getYxldDefForce().add(addforcerpc);
}
return false;
}
return true;
}
public static boolean updateResult(User user,int i, int[] myteamId, int[] defTeamId, int[] result){
//没有队伍时候 直接断定对方赢 //没有队伍时候 直接断定对方赢
Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero(); Map<Integer, List<TeamPosHeroInfo>> teamPosForHero = user.getTeamPosManager().getTeamPosForHero();
if(!teamPosForHero.containsKey(myteamId[i]) || teamPosForHero.get(myteamId[i]).size() == 0){ if(!teamPosForHero.containsKey(myteamId[i]) || teamPosForHero.get(myteamId[i]).size() == 0){
@ -380,7 +395,6 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
} }
return true; return true;
} }
public int[] getFightResultByPersonToRobot(User myUser, int defUserUid, int[] myteamId, int[] defTeamId, ArenaInfoProto.CrossYuXuLunDaoChallengeResponse.Builder builder) throws Exception { public int[] getFightResultByPersonToRobot(User myUser, int defUserUid, int[] myteamId, int[] defTeamId, ArenaInfoProto.CrossYuXuLunDaoChallengeResponse.Builder builder) throws Exception {
int[] result = new int[3];//1赢 0输 int[] result = new int[3];//1赢 0输
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {

View File

@ -46,27 +46,50 @@ public class NewWelfareActivity extends AbstractActivity {
boolean isUpdate = false; boolean isUpdate = false;
for(SActivityRewardConfig sActivityRewardConfig : sActivityRewardConfigs){ for(SActivityRewardConfig sActivityRewardConfig : sActivityRewardConfigs){
ActivityProgressInfo activityProgressInfo = activityProgressInfoMap.get(sActivityRewardConfig.getId()); ActivityProgressInfo activityProgressInfo = activityProgressInfoMap.get(sActivityRewardConfig.getId());
if(activityProgressInfo.getState() == 1){ if(sActivityRewardConfig.getSort()==1){
continue; if(activityProgressInfo.getState() == 1){
} continue;
if(sActivityRewardConfig.getValues()[0][0] == newWelfareEvent.getType() ){
int parm = newWelfareEvent.getParm();
if( newWelfareEvent.getType() == NewWelfareTypeEnum.LOGIN_TIMES.getType()){
activityProgressInfo.setProgrss(activityProgressInfo.getProgrss()+1);
parm=activityProgressInfo.getProgrss();
} }
if(parm ==sActivityRewardConfig.getValues()[1][0]){ if(sActivityRewardConfig.getValues()[0][0] == newWelfareEvent.getType() ){
if(newWelfareEvent.getType() == NewWelfareTypeEnum.RECHARGE_BUY.getType()){ int parm = newWelfareEvent.getParm();
//可领取奖励 if( newWelfareEvent.getType() == NewWelfareTypeEnum.LOGIN_TIMES.getType()){
activityProgressInfo.setState(3); activityProgressInfo.setProgrss(activityProgressInfo.getProgrss()+1);
}else{ parm=activityProgressInfo.getProgrss();
activityProgressInfo.setState(1); }
if(parm ==sActivityRewardConfig.getValues()[1][0]){
if(newWelfareEvent.getType() == NewWelfareTypeEnum.RECHARGE_BUY.getType()){
//可领取奖励
activityProgressInfo.setState(3);
}else{
activityProgressInfo.setState(1);
}
activityMission.getActivityMissionMap().put(sActivityRewardConfig.getId(), activityProgressInfo);
isUpdate = true;
}
}
}else{
//新增任务
if(activityProgressInfo.getState()!= 0){
continue;
}
if(sActivityRewardConfig.getValues()[0][0] == newWelfareEvent.getType() ){
int parm = newWelfareEvent.getParm();
if (newWelfareEvent.getType() == NewWelfareTypeEnum.ALL_MISSION_FIN.getType()||newWelfareEvent.getType() == NewWelfareTypeEnum.EXPLORE.getType()){
activityProgressInfo.setProgrss(activityProgressInfo.getProgrss()+1);
parm=activityProgressInfo.getProgrss();
}
if(parm ==sActivityRewardConfig.getValues()[1][0]){
activityProgressInfo.setState(3);
activityMission.getActivityMissionMap().put(sActivityRewardConfig.getId(), activityProgressInfo);
isUpdate = true;
if (sActivityRewardConfig.getSort()==2){
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user,NewWelfareTypeEnum.ALL_MISSION_FIN.getType(),1));
}
} }
activityMission.getActivityMissionMap().put(sActivityRewardConfig.getId(), activityProgressInfo);
isUpdate = true;
} }
} }
} }
if(isUpdate){ if(isUpdate){
//更新进度 //更新进度
ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId()); ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId());
@ -86,17 +109,22 @@ public class NewWelfareActivity extends AbstractActivity {
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap(); Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
//0是领取最后奖励 //0是领取最后奖励
if(missionId==0){ if(missionId==0){
for(ActivityProgressInfo activityProgressInfo : activityProgressInfoMap.values()){ for (Map.Entry<Integer, ActivityProgressInfo> inter : activityProgressInfoMap.entrySet()) {
if(activityProgressInfo.getState() != 1){ ActivityProgressInfo activityProgressInfo=inter.getValue();
int activityMissionId=inter.getKey();
SActivityRewardConfig missonConfig= SActivityRewardConfig.getsActivityRewardConfigByMissionId(activityMissionId);
if(activityProgressInfo.getState() != 1&&missonConfig.getSort()==1){
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE); throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
} }
} }
for(Map.Entry<Integer,ActivityProgressInfo> item: activityProgressInfoMap.entrySet()){ for(Map.Entry<Integer,ActivityProgressInfo> item: activityProgressInfoMap.entrySet()){
item.getValue().setState(2); SActivityRewardConfig missonConfig= SActivityRewardConfig.getsActivityRewardConfigByMissionId(item.getKey());
activityMission.getActivityMissionMap().put(item.getKey(),item.getValue()); if (missonConfig.getSort()==1){
item.getValue().setState(2);
activityMission.getActivityMissionMap().put(item.getKey(),item.getValue());
}
} }
sendActivityProgress(session, activityMission, null); sendActivityProgress(session, activityMission, null);
List<SActivityRewardConfig> sActivityRewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id); List<SActivityRewardConfig> sActivityRewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sActivityRewardConfigs.get(0).getReward(), BIReason.TAKE_ACTIVITY_REWARD); CommonProto.Drop.Builder drop = ItemUtil.drop(user, sActivityRewardConfigs.get(0).getReward(), BIReason.TAKE_ACTIVITY_REWARD);

View File

@ -3,7 +3,10 @@ package com.ljsd.jieling.logic.activity.event;
public enum NewWelfareTypeEnum { public enum NewWelfareTypeEnum {
LEVEL_FIGHT(1), LEVEL_FIGHT(1),
LOGIN_TIMES(2), LOGIN_TIMES(2),
RECHARGE_BUY(3) RECHARGE_BUY(3),
EXPLORE(4),//极速探索n次
UPSTAR(5),//指定英雄升级至x星
ALL_MISSION_FIN(6)//sort为2所有任务完成
; ;
private int type; private int type;

View File

@ -367,17 +367,23 @@ public class CrossYuxulundaoLogic {
public static CommonProto.crossYxldPlayerRecordInfo getCrossYxldPlayerRecordInfo(int uid,ArenaRecord arenaRecord,boolean isSend) throws Exception { public static CommonProto.crossYxldPlayerRecordInfo getCrossYxldPlayerRecordInfo(int uid,ArenaRecord arenaRecord,boolean isSend) throws Exception {
CommonProto.FightData fightDataProto1 = null; CommonProto.FightData fightDataProto1 ;
CommonProto.FightData fightDataProto2 = null; CommonProto.FightData fightDataProto2 ;
CommonProto.FightData fightDataProto3 = null; CommonProto.FightData fightDataProto3;
if(arenaRecord.getYxldFightData1() != null){ if(arenaRecord.getYxldFightData1() != null){
fightDataProto1 = CommonProto.FightData.parseFrom(arenaRecord.getYxldFightData1()); fightDataProto1 = CommonProto.FightData.parseFrom(arenaRecord.getYxldFightData1());
}else{
fightDataProto1 = CommonProto.FightData.newBuilder().build();
} }
if(arenaRecord.getYxldFightData2() != null){ if(arenaRecord.getYxldFightData2() != null){
fightDataProto2 = CommonProto.FightData.parseFrom(arenaRecord.getYxldFightData2()); fightDataProto2 = CommonProto.FightData.parseFrom(arenaRecord.getYxldFightData2());
}else{
fightDataProto2 = CommonProto.FightData.newBuilder().build();
} }
if(arenaRecord.getYxldFightData3() != null){ if(arenaRecord.getYxldFightData3() != null){
fightDataProto3 = CommonProto.FightData.parseFrom(arenaRecord.getYxldFightData3()); fightDataProto3 = CommonProto.FightData.parseFrom(arenaRecord.getYxldFightData3());
}else{
fightDataProto3 = CommonProto.FightData.newBuilder().build();
} }
List<Integer> result = null;// List<Integer> result = null;//
if (arenaRecord.getYxldResult() == null) { if (arenaRecord.getYxldResult() == null) {
@ -389,6 +395,7 @@ public class CrossYuxulundaoLogic {
result = Arrays.stream(arenaRecord.getYxldResult()).boxed().collect(Collectors.toList()); result = Arrays.stream(arenaRecord.getYxldResult()).boxed().collect(Collectors.toList());
} }
if(isSend){ if(isSend){
CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(uid); CSPlayer csPlayer = CrossServiceLogic.getPlayerByRedis(uid);
CSPlayer defPlayer = CrossServiceLogic.getPlayerByRedis(arenaRecord.getDefUid()); CSPlayer defPlayer = CrossServiceLogic.getPlayerByRedis(arenaRecord.getDefUid());
String myServerName = CrossDeathPathLogic.getInstance().getServerNameByDeathPath(csPlayer.getServerId()); String myServerName = CrossDeathPathLogic.getInstance().getServerNameByDeathPath(csPlayer.getServerId());

View File

@ -19,6 +19,8 @@ import com.ljsd.jieling.ktbeans.KTGameType;
import com.ljsd.jieling.ktbeans.KtEventUtils; import com.ljsd.jieling.ktbeans.KtEventUtils;
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean; import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
import com.ljsd.jieling.logic.OnlineUserManager; import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.activity.event.NewWelfareEvent;
import com.ljsd.jieling.logic.activity.event.NewWelfareTypeEnum;
import com.ljsd.jieling.logic.activity.event.Poster; import com.ljsd.jieling.logic.activity.event.Poster;
import com.ljsd.jieling.logic.activity.event.SecretEvent; import com.ljsd.jieling.logic.activity.event.SecretEvent;
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic; import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
@ -234,7 +236,9 @@ public class CombatLogic {
user.getUserMissionManager().onGameEvent(user,GameEvent.PlAY_STORY,9999,1); user.getUserMissionManager().onGameEvent(user,GameEvent.PlAY_STORY,9999,1);
Poster.getPoster().dispatchEvent(new SecretEvent(user.getId())); Poster.getPoster().dispatchEvent(new SecretEvent(user.getId()));
user.getUserMissionManager().onGameEvent(user, GameEvent.TAKE_ADVENTURE_REWARD_COUNT,1); user.getUserMissionManager().onGameEvent(user, GameEvent.TAKE_ADVENTURE_REWARD_COUNT,1);
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.EXPLORE.getType(),1));
} }
FightInfoProto.TakeAventureRewardResponse build = FightInfoProto.TakeAventureRewardResponse.newBuilder().setDrop(adventureFastReward.get(1)).setRandomDrop(adventureFastReward.get(2)).build(); FightInfoProto.TakeAventureRewardResponse build = FightInfoProto.TakeAventureRewardResponse.newBuilder().setDrop(adventureFastReward.get(1)).setRandomDrop(adventureFastReward.get(2)).build();
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ADVENTURE_REWARD_RESPONSE_VALUE,build,true); MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ADVENTURE_REWARD_RESPONSE_VALUE,build,true);
KtEventUtils.onKtEvent(user,ParamEventBean.UserGameType,KTGameType.TAKE_SECURE_REWARD.getIndex(),type*10); KtEventUtils.onKtEvent(user,ParamEventBean.UserGameType,KTGameType.TAKE_SECURE_REWARD.getIndex(),type*10);

View File

@ -1541,7 +1541,7 @@ public class HeroLogic{
rankUpHeroExecute(targetHero); rankUpHeroExecute(targetHero);
user.getHeroManager().addHeroStar(targetHero.getTemplateId(),targetHero.getStar()); user.getHeroManager().addHeroStar(targetHero.getTemplateId(),targetHero.getStar());
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),targetHero.getTemplateId(),targetHero.getStar())); Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),targetHero.getTemplateId(),targetHero.getStar()));
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user,NewWelfareTypeEnum.UPSTAR.getType(),targetHero.getTemplateId()));
targetHero.setStarBreakId(scHeroRankUpConfig.getId()); targetHero.setStarBreakId(scHeroRankUpConfig.getId());
user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_UP,2,targetHero.getTemplateId(),targetHero.getStar()); user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_UP,2,targetHero.getTemplateId(),targetHero.getStar());
user.getUserMissionManager().onGameEvent(user,GameEvent.GET_HERO,targetHero.getTemplateId(),targetHero.getStar()); user.getUserMissionManager().onGameEvent(user,GameEvent.GET_HERO,targetHero.getTemplateId(),targetHero.getStar());