我要变强
parent
b782ee0a8a
commit
3caea6d9d2
|
@ -2,20 +2,21 @@ package com.ljsd.jieling.handler.activity;
|
||||||
|
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
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.network.session.ISession;
|
||||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
import com.ljsd.jieling.protocols.PlayerInfoProto;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class ToBeStrongerHandler extends BaseHandler<PlayerInfoProto.GetToBeStrongerRequest>{
|
public class ToBeStrongerHandler extends BaseHandler{
|
||||||
@Override
|
@Override
|
||||||
public MessageTypeProto.MessageType getMessageCode() {
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
return MessageTypeProto.MessageType.TO_BE_STRONGER_REQUEST;
|
return MessageTypeProto.MessageType.TO_BE_STRONGER_REQUEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processWithProto(ISession iSession, PlayerInfoProto.GetToBeStrongerRequest proto){
|
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||||
ActivityLogic.getInstance().toBeStronger(iSession,proto.getTempId(),MessageTypeProto.MessageType.TO_BE_STRONGER_RESPONSE);
|
ActivityLogic.getInstance().toBeStronger(iSession,MessageTypeProto.MessageType.TO_BE_STRONGER_RESPONSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1053,12 +1053,14 @@ public class ActivityLogic {
|
||||||
* @param session
|
* @param session
|
||||||
* @param messageType
|
* @param messageType
|
||||||
*/
|
*/
|
||||||
public void toBeStronger(ISession session, int tempId,MessageTypeProto.MessageType messageType){
|
public void toBeStronger(ISession session,MessageTypeProto.MessageType messageType) throws Exception {
|
||||||
PlayerInfoProto.GetToBeStrongerResponse.Builder response = PlayerInfoProto.GetToBeStrongerResponse.newBuilder();
|
User user = UserManager.getUser(session.getUid());
|
||||||
for(int i = 0 ; i <6;i++){
|
user.getUserMissionManager().onGameEvent(user,GameEvent.TO_BE_STRONGER);
|
||||||
CommonProto.StrongerInfo.Builder info = CommonProto.StrongerInfo.newBuilder().setCurScore(1000).setMaxScore(6000);
|
// PlayerInfoProto.GetToBeStrongerResponse.Builder response = PlayerInfoProto.GetToBeStrongerResponse.newBuilder();
|
||||||
response.addInfos(info.build());
|
// for(int i = 0 ; i <6;i++){
|
||||||
}
|
// CommonProto.StrongerInfo.Builder info = CommonProto.StrongerInfo.newBuilder().setCurScore(1000).setMaxScore(6000);
|
||||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
// response.addInfos(info.build());
|
||||||
|
// }
|
||||||
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,7 @@ public class CumulationData {
|
||||||
public int takeSenvenLoinRewardTimes;// 领取七日登录奖励次数达到
|
public int takeSenvenLoinRewardTimes;// 领取七日登录奖励次数达到
|
||||||
public int takeDailyBoxTimes;// 领取日常任务宝箱奖励次数达到
|
public int takeDailyBoxTimes;// 领取日常任务宝箱奖励次数达到
|
||||||
public int wearEquipTimes;// 妖灵师穿戴装备件数达到
|
public int wearEquipTimes;// 妖灵师穿戴装备件数达到
|
||||||
|
public int toBeStronger;
|
||||||
public Map<Integer,Integer> synthesisHeroStarTimesMap = new HashMap<>();// 碎片合成%s星妖灵师次数达到
|
public Map<Integer,Integer> synthesisHeroStarTimesMap = new HashMap<>();// 碎片合成%s星妖灵师次数达到
|
||||||
|
|
||||||
public Map<Integer,Integer> heroUpStarTimesMap = new HashMap<>();//将妖灵师%s进阶次数达到
|
public Map<Integer,Integer> heroUpStarTimesMap = new HashMap<>();//将妖灵师%s进阶次数达到
|
||||||
|
@ -156,6 +157,7 @@ public class CumulationData {
|
||||||
givePresents=0;
|
givePresents=0;
|
||||||
friendNums=0;
|
friendNums=0;
|
||||||
monsterAttackTimes = 0;
|
monsterAttackTimes = 0;
|
||||||
|
toBeStronger = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearArray(int[] source){
|
private void clearArray(int[] source){
|
||||||
|
|
|
@ -52,4 +52,6 @@ public enum GameEvent {
|
||||||
MONSTER_ATTACK_PLAY,//参与兽潮来袭
|
MONSTER_ATTACK_PLAY,//参与兽潮来袭
|
||||||
MONSTER_ATTACK_LEVEL, // 兽潮来袭到达层
|
MONSTER_ATTACK_LEVEL, // 兽潮来袭到达层
|
||||||
|
|
||||||
|
TO_BE_STRONGER,//我要变强
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -584,6 +584,9 @@ public class MissionLoigc {
|
||||||
case MONSTER_ATTACK_LEVEL:
|
case MONSTER_ATTACK_LEVEL:
|
||||||
count = user.getMapManager().getLastMonsterAttack() - 1;
|
count = user.getMapManager().getLastMonsterAttack() - 1;
|
||||||
break;
|
break;
|
||||||
|
case TO_BE_STRONGER:
|
||||||
|
count = cumulationData.toBeStronger;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
count = 0;
|
count = 0;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -76,7 +76,7 @@ public enum MissionType {
|
||||||
|
|
||||||
JOIN_MONSTER_ATTACK_TIMES(56),//参与兽潮来袭的次数
|
JOIN_MONSTER_ATTACK_TIMES(56),//参与兽潮来袭的次数
|
||||||
MONSTER_ATTACK_LEVEL(57),//兽潮来袭到达x层
|
MONSTER_ATTACK_LEVEL(57),//兽潮来袭到达x层
|
||||||
|
TO_BE_STRONGER(58)
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -206,6 +206,8 @@ public enum MissionType {
|
||||||
return JOIN_MONSTER_ATTACK_TIMES;//参与兽潮来袭的次数
|
return JOIN_MONSTER_ATTACK_TIMES;//参与兽潮来袭的次数
|
||||||
case 57:
|
case 57:
|
||||||
return MONSTER_ATTACK_LEVEL;//兽潮来袭到达x层
|
return MONSTER_ATTACK_LEVEL;//兽潮来袭到达x层
|
||||||
|
case 58:
|
||||||
|
return TO_BE_STRONGER;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,6 +97,7 @@ public class DataManagerDistributor {
|
||||||
|
|
||||||
judges.put(MissionType.JOIN_MONSTER_ATTACK_TIMES,new JoinMonsterAttackManager());
|
judges.put(MissionType.JOIN_MONSTER_ATTACK_TIMES,new JoinMonsterAttackManager());
|
||||||
judges.put(MissionType.MONSTER_ATTACK_LEVEL,new DefaultDataManager());
|
judges.put(MissionType.MONSTER_ATTACK_LEVEL,new DefaultDataManager());
|
||||||
|
judges.put(MissionType.TO_BE_STRONGER,new StrongerManager());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -241,6 +241,11 @@ public class MissionEventDistributor {
|
||||||
eventEnumListMap.put(GameEvent.MONSTER_ATTACK_LEVEL,typeList);
|
eventEnumListMap.put(GameEvent.MONSTER_ATTACK_LEVEL,typeList);
|
||||||
eventProcessor.put(GameEvent.MONSTER_ATTACK_LEVEL,new CumulationDataEventProcessor());
|
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 =
|
private static final ThreadLocal<Map<GameMisionType, List<MissionStateChangeInfo>>> threadMissionChangeList =
|
||||||
|
|
Loading…
Reference in New Issue