Merge branch 'master_test_mcz_hardstage' into master_test_gn
# Conflicts: # tablemanager/src/main/java/config/SSpecialConfig.javaback_recharge
commit
98ee42fb6c
|
@ -21,6 +21,7 @@ import com.ljsd.jieling.logic.fight.FightUtil;
|
|||
import com.ljsd.jieling.logic.hardStage.HardStageChapter;
|
||||
import com.ljsd.jieling.logic.hardStage.HardStageLogic;
|
||||
import com.ljsd.jieling.logic.hardStage.HardStageNode;
|
||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.FightDataUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
|
@ -183,6 +184,9 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
fightStartResponse.setStars(node.getState());
|
||||
}
|
||||
}
|
||||
//成就任务
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.HARSTAGE_STARS,starSum);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.HARSTAGE_NODE,hardStageId);
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.HARD_STAGE_FIGHT_START_RESPONSE.getNumber(), fightStartResponse.build(), true);
|
||||
//更新消息
|
||||
HardStageLogic.sendHardStageIndication(user);
|
||||
|
|
|
@ -0,0 +1,80 @@
|
|||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.SweepLogic;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.family.GuildFightLogic;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import com.sun.deploy.util.ArrayUtil;
|
||||
import com.sun.tools.javac.util.ArrayUtils;
|
||||
import config.SFloodConfig;
|
||||
import config.SSpecialConfig;
|
||||
import manager.STableManager;
|
||||
import org.assertj.core.util.Lists;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.FightInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class SweepBattleRequestHandler extends BaseHandler<FightInfoProto.SweepDemonRequest>{
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.SWEEP_DEMON_REQUEST;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession iSession, FightInfoProto.SweepDemonRequest proto) throws Exception {
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
int id =proto.getId();
|
||||
SFloodConfig sFloodConfig = STableManager.getConfig(SFloodConfig.class).get(id);
|
||||
if(sFloodConfig == null){
|
||||
return;
|
||||
}
|
||||
List<Integer> dropList = Lists.newArrayList();
|
||||
boolean isOnekey= proto.getOnkeySweep();
|
||||
boolean isSuccess = false;
|
||||
CommonProto.Drop.Builder drop = null;
|
||||
//判断是否挑战过
|
||||
if(user.getMapManager().getLastMonsterAttack()<id){
|
||||
return;
|
||||
}
|
||||
int privilageType = SSpecialConfig.getIntegerValue(SSpecialConfig.SWEEP_ONEKEY);
|
||||
if(isOnekey){
|
||||
int times = PlayerLogic.getInstance().checkAndConsumeAllPrivilegeTimes(user,privilageType);
|
||||
if(times>0){
|
||||
int[][] reward = new int[times*sFloodConfig.getReward().length][2];
|
||||
for(int i =0;i<reward.length;){
|
||||
for (int [] a :sFloodConfig.getReward()) {
|
||||
reward[i] = a;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
drop = ItemUtil.drop(user, reward, BIReason.MONSTERATTACK_REWARD);
|
||||
}
|
||||
}else{
|
||||
//扫荡一次
|
||||
isSuccess = PlayerLogic.getInstance().checkAndUpdate(user,privilageType,1);
|
||||
if(isSuccess){
|
||||
drop = ItemUtil.drop(user, sFloodConfig.getReward(), BIReason.MONSTERATTACK_REWARD);
|
||||
}
|
||||
}
|
||||
if(drop == null){
|
||||
drop = CommonProto.Drop.newBuilder();
|
||||
}
|
||||
FightInfoProto.SweepDemonResponse.Builder res = FightInfoProto.SweepDemonResponse.newBuilder();
|
||||
res.setDrop(drop);
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.SWEEP_DEMON_RESPONSE.getNumber(), res.build(), true);
|
||||
}
|
||||
}
|
|
@ -24,9 +24,10 @@ public class VipLevelRewardHandler extends BaseHandler<PlayerInfoProto.VipLevelS
|
|||
User user = UserManager.getUser(iSession.getUid());
|
||||
PlayerInfoProto.VipLevelStateResponse.Builder response = PlayerInfoProto.VipLevelStateResponse.newBuilder();
|
||||
Map<Integer,Integer> vipRewardMap = user.getUserMissionManager().getVipMissionIdsType().getVipRewardMap();
|
||||
//针对已有特权等级玩家的兼容
|
||||
for(int i = user.getPlayerInfoManager().getVipLevel();i>=1;i--){
|
||||
if(!vipRewardMap.containsKey(i) && i!=0){
|
||||
vipRewardMap.put(i,0);
|
||||
vipRewardMap.put(i,1);
|
||||
}
|
||||
}
|
||||
user.getUserMissionManager().setVipMissionIdsType(user.getUserMissionManager().getVipMissionIdsType());
|
||||
|
|
|
@ -173,6 +173,11 @@ public class CumulationData {
|
|||
// 鸿蒙碑等级
|
||||
public int hongmeng_tablet_level;
|
||||
|
||||
//山河社稷星星数
|
||||
public int hardstage_stars;
|
||||
//山河社稷章节数
|
||||
public int hardstage_node;
|
||||
|
||||
public Result updateData(MissionType missionType, Object...parm) throws Exception {
|
||||
return DataManagerDistributor.updateData(this, missionType,parm);
|
||||
}
|
||||
|
@ -399,4 +404,20 @@ public class CumulationData {
|
|||
public void setHongmeng_tablet_level(int hongmeng_tablet_level) {
|
||||
this.hongmeng_tablet_level = hongmeng_tablet_level;
|
||||
}
|
||||
|
||||
public int getHardstage_stars() {
|
||||
return hardstage_stars;
|
||||
}
|
||||
|
||||
public void setHardstage_stars(int hardstage_stars) {
|
||||
this.hardstage_stars = hardstage_stars;
|
||||
}
|
||||
|
||||
public int getHardstage_node() {
|
||||
return hardstage_node;
|
||||
}
|
||||
|
||||
public void setHardstage_node(int hardstage_node) {
|
||||
this.hardstage_node = hardstage_node;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,4 +111,7 @@ public enum GameEvent {
|
|||
|
||||
COW_FLY_SKY_REFRESH,//牛气冲天刷新
|
||||
COW_FLY_SKY_REWEARD,//牛气冲天奖励
|
||||
|
||||
HARSTAGE_STARS,//山河社稷图星数
|
||||
HARSTAGE_NODE,//山河社稷图通关章节
|
||||
}
|
||||
|
|
|
@ -926,6 +926,12 @@ public class MissionLoigc {
|
|||
case EXPEDITION_FLOOR_TIMES:
|
||||
count = cumulationData.expedition_floor_times.get(missionSubType[0]);
|
||||
break;
|
||||
case HARSTAGE_STARS:
|
||||
count = cumulationData.hardstage_stars;
|
||||
break;
|
||||
case HARSTAGE_NODE:
|
||||
count = cumulationData.hardstage_node;
|
||||
break;
|
||||
//100以后类型继承 AbstractDataManager
|
||||
default:
|
||||
count = 0;
|
||||
|
|
|
@ -126,6 +126,9 @@ public enum MissionType {
|
|||
|
||||
HONGMENG_RESONANCE_LATTICE(119),//鸿蒙阵共鸣格子
|
||||
HONGMENG_TABLET_LEVEL(120),// 鸿蒙碑等级
|
||||
|
||||
HARSTAGE_STARS(121),//山河社稷图获得总星星数
|
||||
HARSTAGE_NODE(122),//山河社稷图通关章节
|
||||
;
|
||||
|
||||
private int missionType;
|
||||
|
|
|
@ -145,6 +145,12 @@ public class DataManagerDistributor {
|
|||
// 鸿蒙阵
|
||||
judges.put(MissionType.HONGMENG_RESONANCE_LATTICE, new HongMengResonanceDataManager());
|
||||
judges.put(MissionType.HONGMENG_TABLET_LEVEL, new HongMengLevelDataManager());
|
||||
|
||||
//山河社稷图
|
||||
judges.put(MissionType.HARSTAGE_STARS, new HardStageStarsDataManager());
|
||||
judges.put(MissionType.HARSTAGE_NODE, new HardStageNodeDataManager());
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static CumulationData.Result updateData(CumulationData data, MissionType missionType, Object...parm) throws Exception {
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
/**
|
||||
* 山河社稷章节数
|
||||
*/
|
||||
public class HardStageNodeDataManager implements BaseDataManager {
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int nums = (int)parm[0];
|
||||
data.setHardstage_node(nums);
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.ljsd.jieling.logic.mission.data;
|
||||
|
||||
import com.ljsd.jieling.logic.dao.CumulationData;
|
||||
import com.ljsd.jieling.logic.mission.MissionType;
|
||||
|
||||
/**
|
||||
* 山河社稷星数
|
||||
*/
|
||||
public class HardStageStarsDataManager implements BaseDataManager {
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int nums = (int)parm[0];
|
||||
data.setHardstage_stars(nums);
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
}
|
|
@ -428,6 +428,18 @@ public class MissionEventDistributor {
|
|||
eventEnumListMap.put(GameEvent.HONGMENG_TABLET_LEVEL, typeList);
|
||||
eventProcessor.put(GameEvent.HONGMENG_TABLET_LEVEL, new CumulationDataEventProcessor());
|
||||
|
||||
//山河社稷图
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.HARSTAGE_STARS);
|
||||
eventEnumListMap.put(GameEvent.HARSTAGE_STARS, typeList);
|
||||
eventProcessor.put(GameEvent.HARSTAGE_STARS, new CumulationDataEventProcessor());
|
||||
|
||||
typeList = new ArrayList<>();
|
||||
typeList.add(MissionType.HARSTAGE_NODE);
|
||||
eventEnumListMap.put(GameEvent.HARSTAGE_NODE, typeList);
|
||||
eventProcessor.put(GameEvent.HARSTAGE_NODE, new CumulationDataEventProcessor());
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static final ThreadLocal<Map<GameMisionType, List<MissionStateChangeInfo>>> threadMissionChangeList =
|
||||
|
|
|
@ -266,12 +266,20 @@ public class PlayerLogic {
|
|||
playerInfoManager.setVipLevel(vipLevel+1);
|
||||
//特权等级奖励
|
||||
Map<Integer, Integer>rewardMap = user.getUserMissionManager().getVipMissionIdsType().getVipRewardMap();
|
||||
if(!rewardMap.containsKey(playerInfoManager.getVipLevel())){
|
||||
|
||||
for(int i = user.getPlayerInfoManager().getVipLevel();i>=1;i--){
|
||||
if(!rewardMap.containsKey(i) && i!=0){
|
||||
rewardMap.put(i,1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*if(!rewardMap.containsKey(playerInfoManager.getVipLevel())){
|
||||
rewardMap.put(playerInfoManager.getVipLevel(),0);
|
||||
}
|
||||
if(rewardMap.get(playerInfoManager.getVipLevel())==0){
|
||||
rewardMap.put(playerInfoManager.getVipLevel(),1);
|
||||
}
|
||||
}*/
|
||||
user.getUserMissionManager().setVipMissionIdsType(user.getUserMissionManager().getVipMissionIdsType());
|
||||
|
||||
PlayerInfoProto.VipLevelStateResponse.Builder vipLevelStateResponse = PlayerInfoProto.VipLevelStateResponse.newBuilder();
|
||||
|
@ -838,6 +846,44 @@ public class PlayerLogic {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
//消耗完所有特权次数
|
||||
public int checkAndConsumeAllPrivilegeTimes(User user, int privilageTypeId){
|
||||
Map<Integer, VipInfo> vipInfo = user.getPlayerInfoManager().getVipInfo();
|
||||
if(privilageTypeId == 0){
|
||||
return 0;
|
||||
}
|
||||
List<SPrivilegeTypeConfig> sPrivilegeTypeConfigs = SPrivilegeTypeConfig.privilegeByType.get(privilageTypeId);
|
||||
List<Integer> typePrivileges = new ArrayList<>();
|
||||
for(SPrivilegeTypeConfig config:sPrivilegeTypeConfigs){
|
||||
if(!vipInfo.containsKey(config.getId())){
|
||||
continue;
|
||||
}
|
||||
typePrivileges.add(config.getId());
|
||||
}
|
||||
if(typePrivileges.isEmpty()){
|
||||
return 0;
|
||||
}
|
||||
int levelUpdateCount = 0;
|
||||
for(Integer privilageId:typePrivileges){
|
||||
VipInfo info = vipInfo.get(privilageId);
|
||||
if(info.getEffectTime()!=0&&TimeUtils.now()/1000>info.getEffectTime()){
|
||||
continue;
|
||||
}
|
||||
int mCount = getMaxCountByPrivilege(user,privilageId);
|
||||
if(mCount==-1){
|
||||
return 0;
|
||||
}
|
||||
if(info.getCount()>= mCount){
|
||||
continue;
|
||||
}
|
||||
if(info.getEffectTime()!=0&&TimeUtils.now()/1000>info.getEffectTime()){
|
||||
continue;
|
||||
}
|
||||
levelUpdateCount+=mCount-info.getCount();
|
||||
user.getPlayerInfoManager().updateVipPrivilage(privilageId, mCount-info.getCount());
|
||||
}
|
||||
return levelUpdateCount;
|
||||
}
|
||||
// private boolean priviliageCheck(User user, int privilageTypeId, int checkNum,boolean isUpdate){
|
||||
// Map<Integer, VipInfo> vipInfo = user.getPlayerInfoManager().getVipInfo();
|
||||
// if(privilageTypeId == 0){
|
||||
|
|
|
@ -514,6 +514,8 @@ public class StoreLogic implements IEventHandler {
|
|||
if(sStoreConfig.getOpenPrivilege()!=null){
|
||||
PlayerInfoProto.PrivilegeIndication.Builder indication = PlayerInfoProto.PrivilegeIndication.newBuilder();
|
||||
int[] openPrivilege = sStoreConfig.getOpenPrivilege();
|
||||
|
||||
for(int i=0;i<itemNum;i++){
|
||||
for(int privilege:openPrivilege){
|
||||
// int privilegeType = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(privilege).getPrivilegeType();
|
||||
// if(privilegeType== VipPrivilegeType.ADVENTURE_BASE_REWARD||privilegeType==VipPrivilegeType.FAST_MAP_LIMIT){
|
||||
|
@ -524,6 +526,8 @@ public class StoreLogic implements IEventHandler {
|
|||
// indication.addInfos(CommonProto.Privilege.newBuilder().setId(privilege).setUsedTimes(vipInfo.getCount()).setEffectTime(vipInfo.getEffectTime()).build());
|
||||
BuyGoodsNewLogic.addNewPrivilege(user,privilege,indication);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(uid);
|
||||
MessageUtil.sendIndicationMessage(sessionByUid,1, MessageTypeProto.MessageType.PRIVILLEGE_ADD_INDICATION_VALUE,indication.build(),true);
|
||||
|
|
|
@ -101,6 +101,7 @@ public class SSpecialConfig implements BaseConfig {
|
|||
public static final String FU_XING_STORE = "FuXingStore";//福星高照购买解锁奖励
|
||||
public static final String YIJIANGOUMAI = "YiJianGouMai";//一件购买
|
||||
public static final String WELFAREREDPACKET_LIMIT = "RedPackMaxGainNum";//每日领取红包数量上限
|
||||
public static final String SWEEP_ONEKEY = "floodprivilegeid";//一键扫荡
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
|
Loading…
Reference in New Issue