代码回滚,关卡改回主线关卡,不用小兵
parent
28ac06a311
commit
82f2280585
|
@ -1746,15 +1746,18 @@ public class MapLogic {
|
||||||
* 主线胜利处理
|
* 主线胜利处理
|
||||||
*/
|
*/
|
||||||
public CommonProto.Drop.Builder mainFightWinHandler(ISession session, int fightId) throws Exception {
|
public CommonProto.Drop.Builder mainFightWinHandler(ISession session, int fightId) throws Exception {
|
||||||
|
SMainLevelConfig sMainLevelConfig = SMainLevelConfig.config.get(fightId);
|
||||||
User user = UserManager.getUser(session.getUid());
|
User user = UserManager.getUser(session.getUid());
|
||||||
// 关卡信息
|
// 关卡信息
|
||||||
openNextMainLevel(session, user, fightId);
|
openNextMainLevel(session, user, fightId);
|
||||||
|
// 排行榜
|
||||||
|
AbstractRank rank = RankContext.getRankEnum(RankEnum.MAIN_LEVEL_RANK.getType());
|
||||||
|
rank.addRank(user.getId(), "", sMainLevelConfig.getVirtureId(), user.getPlayerInfoManager().getMaxForce());
|
||||||
// 推送
|
// 推送
|
||||||
MainLevelManager mainLevelManager = user.getMainLevelManager();
|
MainLevelManager mainLevelManager = user.getMainLevelManager();
|
||||||
FightInfoProto.MainLevelFightUpdateIndication build = FightInfoProto.MainLevelFightUpdateIndication.newBuilder().setState(mainLevelManager.getState()).setFightId(mainLevelManager.getFightId()).build();
|
FightInfoProto.MainLevelFightUpdateIndication build = FightInfoProto.MainLevelFightUpdateIndication.newBuilder().setState(mainLevelManager.getState()).setFightId(mainLevelManager.getFightId()).build();
|
||||||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.MAIN_LEVEL_FIGHT_UPDATE_INDICATION_VALUE, build, true);
|
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.MAIN_LEVEL_FIGHT_UPDATE_INDICATION_VALUE, build, true);
|
||||||
// 打点,现在不用
|
// 打点,现在不用
|
||||||
SMainLevelConfig sMainLevelConfig = SMainLevelConfig.config.get(fightId);
|
|
||||||
// ReportUtil.onReportEvent(user, ReportEventEnum.PASS_STAGE.getType(), String.valueOf(fightId), "", sMainLevelConfig.getReward(), new Date());
|
// ReportUtil.onReportEvent(user, ReportEventEnum.PASS_STAGE.getType(), String.valueOf(fightId), "", sMainLevelConfig.getReward(), new Date());
|
||||||
// 奖励道具
|
// 奖励道具
|
||||||
return ItemUtil.dropToPrivilege(user, sMainLevelConfig.getReward(), BIReason.LEVELDIFFICULTY_FIGHT_REWARD);
|
return ItemUtil.dropToPrivilege(user, sMainLevelConfig.getReward(), BIReason.LEVELDIFFICULTY_FIGHT_REWARD);
|
||||||
|
|
|
@ -6,16 +6,16 @@ import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.jbean.ActivityMission;
|
import com.ljsd.jieling.jbean.ActivityMission;
|
||||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||||
|
import com.ljsd.jieling.logic.activity.event.FightMainEvent;
|
||||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
import com.ljsd.jieling.logic.activity.event.SoldierMainEvent;
|
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import com.ljsd.jieling.util.ItemUtil;
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
import com.ljsd.jieling.util.MessageUtil;
|
import com.ljsd.jieling.util.MessageUtil;
|
||||||
import config.SActivityRewardConfig;
|
import config.SActivityRewardConfig;
|
||||||
import config.SSoldierStageConfig;
|
import config.SMainLevelConfig;
|
||||||
import rpc.protocols.CommonProto;
|
import rpc.protocols.CommonProto;
|
||||||
import rpc.protocols.PlayerInfoProto;
|
import rpc.protocols.PlayerInfoProto;
|
||||||
import util.TimeUtils;
|
import util.TimeUtils;
|
||||||
|
@ -34,15 +34,18 @@ public class GiveEndlessDrawActivity extends AbstractActivity {
|
||||||
|
|
||||||
GiveEndlessDrawActivity(int id) {
|
GiveEndlessDrawActivity(int id) {
|
||||||
super(id);
|
super(id);
|
||||||
Poster.getPoster().listenEvent(this, SoldierMainEvent.class);
|
Poster.getPoster().listenEvent(this, FightMainEvent.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(IEvent event) throws Exception {
|
public void onEvent(IEvent event) throws Exception {
|
||||||
if (!(event instanceof SoldierMainEvent)) {
|
if (!(event instanceof FightMainEvent)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
FightMainEvent event1 = (FightMainEvent) event;
|
||||||
|
if (event1.getSort() != 1){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SoldierMainEvent event1 = (SoldierMainEvent) event;
|
|
||||||
ISession session = OnlineUserManager.sessionMap.get(event1.getUid());
|
ISession session = OnlineUserManager.sessionMap.get(event1.getUid());
|
||||||
// 状态推送
|
// 状态推送
|
||||||
sendActivityProgress(session, null);
|
sendActivityProgress(session, null);
|
||||||
|
@ -92,7 +95,7 @@ public class GiveEndlessDrawActivity extends AbstractActivity {
|
||||||
*/
|
*/
|
||||||
private int getState(User user, SActivityRewardConfig reward, ActivityProgressInfo progress){
|
private int getState(User user, SActivityRewardConfig reward, ActivityProgressInfo progress){
|
||||||
// 当前关卡id
|
// 当前关卡id
|
||||||
int soldierLayerId = user.getMainLevelManager().getSoldierLayerId();
|
int mainLvId = user.getMainLevelManager().getFightId();
|
||||||
// 任务类型,0:一次性奖励,1:每日奖励
|
// 任务类型,0:一次性奖励,1:每日奖励
|
||||||
int type = reward.getValues()[0][0];
|
int type = reward.getValues()[0][0];
|
||||||
// 任务条件(关卡id)
|
// 任务条件(关卡id)
|
||||||
|
@ -111,11 +114,11 @@ public class GiveEndlessDrawActivity extends AbstractActivity {
|
||||||
}
|
}
|
||||||
// 首次领取
|
// 首次领取
|
||||||
else {
|
else {
|
||||||
SSoldierStageConfig value = SSoldierStageConfig.idMap.get(valueId);
|
SMainLevelConfig value = SMainLevelConfig.config.get(valueId);
|
||||||
SSoldierStageConfig layer = SSoldierStageConfig.idMap.get(soldierLayerId);
|
SMainLevelConfig mainLv = SMainLevelConfig.config.get(mainLvId);
|
||||||
if (value != null && layer != null){
|
if (value != null && mainLv != null){
|
||||||
//关卡满足
|
//关卡满足
|
||||||
if (layer.getId() >= value.getId()){
|
if (mainLv.getVirtureId() > value.getVirtureId()){
|
||||||
state = 1;
|
state = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -357,11 +357,15 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
|
||||||
// 获取邮件内容格式
|
// 获取邮件内容格式
|
||||||
int mailText = SChongRankInfo.getMap().get(id).get(rankType).getMailText();
|
int mailText = SChongRankInfo.getMap().get(id).get(rankType).getMailText();
|
||||||
String key = SErrorCodeEerverConfig.errorMap.get(mailText).getkey();
|
String key = SErrorCodeEerverConfig.errorMap.get(mailText).getkey();
|
||||||
|
// 分值
|
||||||
|
String scoreStr = String.valueOf(score);
|
||||||
// 类型3主线编队排行榜的分数需要特殊处理
|
// 类型3主线编队排行榜的分数需要特殊处理
|
||||||
if (rankType == 3){
|
if (rankType == 3){
|
||||||
return SErrorCodeEerverConfig.getFormatMessage(key, new Object[]{rank});
|
int id = Long.valueOf(score).intValue();
|
||||||
|
SMainLevelConfig config = SMainLevelConfig.getVirtualMap().get(id);
|
||||||
|
scoreStr = config.getName();
|
||||||
}
|
}
|
||||||
return SErrorCodeEerverConfig.getFormatMessage(key, new Object[]{score,rank});
|
return SErrorCodeEerverConfig.getFormatMessage(key, new Object[]{scoreStr,rank});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@ import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.handler.map.MapLogic;
|
import com.ljsd.jieling.handler.map.MapLogic;
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
import com.ljsd.jieling.logic.activity.event.SaveHeroForceEvent;
|
import com.ljsd.jieling.logic.activity.event.SaveHeroForceEvent;
|
||||||
import com.ljsd.jieling.logic.activity.event.SoldierMainEvent;
|
|
||||||
import com.ljsd.jieling.logic.dao.MainLevelManager;
|
import com.ljsd.jieling.logic.dao.MainLevelManager;
|
||||||
import com.ljsd.jieling.logic.dao.Soldier;
|
import com.ljsd.jieling.logic.dao.Soldier;
|
||||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||||
|
@ -16,9 +15,6 @@ import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||||
import com.ljsd.jieling.logic.mission.MissionType;
|
import com.ljsd.jieling.logic.mission.MissionType;
|
||||||
import com.ljsd.jieling.logic.rank.RankContext;
|
|
||||||
import com.ljsd.jieling.logic.rank.RankEnum;
|
|
||||||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
import com.ljsd.jieling.util.CBean2Proto;
|
import com.ljsd.jieling.util.CBean2Proto;
|
||||||
import com.ljsd.jieling.util.ItemUtil;
|
import com.ljsd.jieling.util.ItemUtil;
|
||||||
|
@ -407,9 +403,9 @@ public class SoldierLogic {
|
||||||
}
|
}
|
||||||
builder.setResult(1);
|
builder.setResult(1);
|
||||||
// 排行榜
|
// 排行榜
|
||||||
AbstractRank rank = RankContext.getRankEnum(RankEnum.MAIN_LEVEL_RANK.getType());
|
// AbstractRank rank = RankContext.getRankEnum(RankEnum.MAIN_LEVEL_RANK.getType());
|
||||||
rank.addRank(user.getId(), "", stageConfig.getId(), user.getPlayerInfoManager().getMaxForce());
|
// rank.addRank(user.getId(), "", stageConfig.getId(), user.getPlayerInfoManager().getMaxForce());
|
||||||
Poster.getPoster().dispatchEvent(new SoldierMainEvent(user.getId()));
|
// Poster.getPoster().dispatchEvent(new SoldierMainEvent(user.getId()));
|
||||||
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME, MissionType.SOLDIER_LAYER, 1);
|
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME, MissionType.SOLDIER_LAYER, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue