我要变强

back_recharge
lvxinran 2019-09-03 20:49:14 +08:00
parent b782ee0a8a
commit 3caea6d9d2
9 changed files with 41 additions and 11 deletions

View File

@ -2,20 +2,21 @@ package com.ljsd.jieling.handler.activity;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.activity.ActivityLogic;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.MessageTypeProto;
import com.ljsd.jieling.protocols.PlayerInfoProto;
import org.springframework.stereotype.Component;
@Component
public class ToBeStrongerHandler extends BaseHandler<PlayerInfoProto.GetToBeStrongerRequest>{
public class ToBeStrongerHandler extends BaseHandler{
@Override
public MessageTypeProto.MessageType getMessageCode() {
return MessageTypeProto.MessageType.TO_BE_STRONGER_REQUEST;
}
@Override
public void processWithProto(ISession iSession, PlayerInfoProto.GetToBeStrongerRequest proto){
ActivityLogic.getInstance().toBeStronger(iSession,proto.getTempId(),MessageTypeProto.MessageType.TO_BE_STRONGER_RESPONSE);
public void process(ISession iSession, PacketNetData netData) throws Exception {
ActivityLogic.getInstance().toBeStronger(iSession,MessageTypeProto.MessageType.TO_BE_STRONGER_RESPONSE);
}
}

View File

@ -1053,12 +1053,14 @@ public class ActivityLogic {
* @param session
* @param messageType
*/
public void toBeStronger(ISession session, int tempId,MessageTypeProto.MessageType messageType){
PlayerInfoProto.GetToBeStrongerResponse.Builder response = PlayerInfoProto.GetToBeStrongerResponse.newBuilder();
for(int i = 0 ; i <6;i++){
CommonProto.StrongerInfo.Builder info = CommonProto.StrongerInfo.newBuilder().setCurScore(1000).setMaxScore(6000);
response.addInfos(info.build());
}
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
public void toBeStronger(ISession session,MessageTypeProto.MessageType messageType) throws Exception {
User user = UserManager.getUser(session.getUid());
user.getUserMissionManager().onGameEvent(user,GameEvent.TO_BE_STRONGER);
// PlayerInfoProto.GetToBeStrongerResponse.Builder response = PlayerInfoProto.GetToBeStrongerResponse.newBuilder();
// for(int i = 0 ; i <6;i++){
// CommonProto.StrongerInfo.Builder info = CommonProto.StrongerInfo.newBuilder().setCurScore(1000).setMaxScore(6000);
// response.addInfos(info.build());
// }
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
}
}

View File

@ -90,6 +90,7 @@ public class CumulationData {
public int takeSenvenLoinRewardTimes;// 领取七日登录奖励次数达到
public int takeDailyBoxTimes;// 领取日常任务宝箱奖励次数达到
public int wearEquipTimes;// 妖灵师穿戴装备件数达到
public int toBeStronger;
public Map<Integer,Integer> synthesisHeroStarTimesMap = new HashMap<>();// 碎片合成%s星妖灵师次数达到
public Map<Integer,Integer> heroUpStarTimesMap = new HashMap<>();//将妖灵师%s进阶次数达到
@ -156,6 +157,7 @@ public class CumulationData {
givePresents=0;
friendNums=0;
monsterAttackTimes = 0;
toBeStronger = 0;
}
private void clearArray(int[] source){

View File

@ -52,4 +52,6 @@ public enum GameEvent {
MONSTER_ATTACK_PLAY,//参与兽潮来袭
MONSTER_ATTACK_LEVEL, // 兽潮来袭到达层
TO_BE_STRONGER,//我要变强
}

View File

@ -584,6 +584,9 @@ public class MissionLoigc {
case MONSTER_ATTACK_LEVEL:
count = user.getMapManager().getLastMonsterAttack() - 1;
break;
case TO_BE_STRONGER:
count = cumulationData.toBeStronger;
break;
default:
count = 0;
break;

View File

@ -76,7 +76,7 @@ public enum MissionType {
JOIN_MONSTER_ATTACK_TIMES(56),//参与兽潮来袭的次数
MONSTER_ATTACK_LEVEL(57),//兽潮来袭到达x层
TO_BE_STRONGER(58)
;
@ -206,6 +206,8 @@ public enum MissionType {
return JOIN_MONSTER_ATTACK_TIMES;//参与兽潮来袭的次数
case 57:
return MONSTER_ATTACK_LEVEL;//兽潮来袭到达x层
case 58:
return TO_BE_STRONGER;
default:
return null;
}

View File

@ -97,6 +97,7 @@ public class DataManagerDistributor {
judges.put(MissionType.JOIN_MONSTER_ATTACK_TIMES,new JoinMonsterAttackManager());
judges.put(MissionType.MONSTER_ATTACK_LEVEL,new DefaultDataManager());
judges.put(MissionType.TO_BE_STRONGER,new StrongerManager());
}

View File

@ -0,0 +1,12 @@
package com.ljsd.jieling.logic.mission.data;
import com.ljsd.jieling.logic.dao.CumulationData;
import com.ljsd.jieling.logic.mission.MissionType;
public class StrongerManager implements BaseDataManager {
@Override
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
data.toBeStronger++;
return new CumulationData.Result(missionType);
}
}

View File

@ -241,6 +241,11 @@ public class MissionEventDistributor {
eventEnumListMap.put(GameEvent.MONSTER_ATTACK_LEVEL,typeList);
eventProcessor.put(GameEvent.MONSTER_ATTACK_LEVEL,new CumulationDataEventProcessor());
typeList = new ArrayList<>();
typeList.add(MissionType.TO_BE_STRONGER);
eventEnumListMap.put(GameEvent.TO_BE_STRONGER,typeList);
eventProcessor.put(GameEvent.TO_BE_STRONGER,new CumulationDataEventProcessor());
}
private static final ThreadLocal<Map<GameMisionType, List<MissionStateChangeInfo>>> threadMissionChangeList =