mission
parent
ac287305bb
commit
2105ba3e50
|
@ -3,9 +3,7 @@ package com.ljsd.jieling.logic.dao;
|
||||||
import com.ljsd.jieling.logic.mission.MissionType;
|
import com.ljsd.jieling.logic.mission.MissionType;
|
||||||
import com.ljsd.jieling.logic.mission.data.DataManagerDistributor;
|
import com.ljsd.jieling.logic.mission.data.DataManagerDistributor;
|
||||||
|
|
||||||
import java.util.BitSet;
|
import java.util.*;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class CumulationData {
|
public class CumulationData {
|
||||||
|
|
||||||
|
@ -94,8 +92,12 @@ public class CumulationData {
|
||||||
public int wearEquipTimes;// 妖灵师穿戴装备件数达到
|
public int wearEquipTimes;// 妖灵师穿戴装备件数达到
|
||||||
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 int consumerStamina; //消耗体力数量达到
|
public int consumerStamina; //消耗体力数量达到
|
||||||
|
|
||||||
|
public Set<Integer> differentHeros = new HashSet<>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//任务重置
|
//任务重置
|
||||||
|
@ -134,6 +136,8 @@ public class CumulationData {
|
||||||
clearArray(sEquipQualityCount);
|
clearArray(sEquipQualityCount);
|
||||||
clearArray(heroQualityCount);
|
clearArray(heroQualityCount);
|
||||||
consumerStamina=0;
|
consumerStamina=0;
|
||||||
|
differentHeros.clear();
|
||||||
|
heroUpStarTimesMap.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void clearArray(int[] source){
|
private void clearArray(int[] source){
|
||||||
|
@ -174,6 +178,14 @@ public class CumulationData {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateHeroUpStarTimes(int heroTid){
|
||||||
|
Integer count = heroUpStarTimesMap.get(heroTid);
|
||||||
|
if(count == null){
|
||||||
|
count = 0;
|
||||||
|
}
|
||||||
|
heroUpStarTimesMap.put(heroTid,count+1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public int getSecretRandomCount() {
|
public int getSecretRandomCount() {
|
||||||
return secretRandomCount;
|
return secretRandomCount;
|
||||||
|
|
|
@ -61,6 +61,10 @@ public class GuilidManager {
|
||||||
|
|
||||||
public static void addGuildLog(GuildLog guildLog) throws Exception {
|
public static void addGuildLog(GuildLog guildLog) throws Exception {
|
||||||
MongoUtil.getInstence().getMyMongoTemplate().save(guildLog);
|
MongoUtil.getInstence().getMyMongoTemplate().save(guildLog);
|
||||||
|
if(!guildLogInfoMap.containsKey(guildLog.getGuildId())){
|
||||||
|
guildLogInfoMap.put(guildLog.getGuildId(),new ArrayList<>());
|
||||||
|
}
|
||||||
|
guildLogInfoMap.get(guildLog.getGuildId()).add(guildLog);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void init() throws Exception {
|
public static void init() throws Exception {
|
||||||
|
|
|
@ -31,23 +31,6 @@ public class UserManager {
|
||||||
return userMap.containsKey(uid);
|
return userMap.containsKey(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
// public static User getUserForLogin(int uid) throws Exception {
|
|
||||||
// User user = userMap.get(uid);
|
|
||||||
// if (user != null) {
|
|
||||||
// user = MongoUtil.getInstence().getMyMongoTemplate().findById(User.getCollectionName(), Integer.toString(uid), User.class);
|
|
||||||
// }
|
|
||||||
// if (user == null) {
|
|
||||||
// user = registerUser(uid);
|
|
||||||
// }else{
|
|
||||||
// refreshUserLoginInfo(user);
|
|
||||||
// }
|
|
||||||
// return user;
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// private static void refreshUserLoginInfo(User user) {
|
|
||||||
// //TODO
|
|
||||||
// }
|
|
||||||
|
|
||||||
public static User userLogin(int uid,String openId) throws Exception {
|
public static User userLogin(int uid,String openId) throws Exception {
|
||||||
User user = null;
|
User user = null;
|
||||||
if (!UserManager.isUserExist(uid)){
|
if (!UserManager.isUserExist(uid)){
|
||||||
|
|
|
@ -5,5 +5,8 @@ public interface GuildDef {
|
||||||
int CREATE = 1;
|
int CREATE = 1;
|
||||||
int JOIN = 2;
|
int JOIN = 2;
|
||||||
int KICK = 3;
|
int KICK = 3;
|
||||||
|
int TRANSFER = 4; //转让
|
||||||
|
int APPOINTMENT = 5; //委任
|
||||||
|
int LEVEL = 6; //离开宗门
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,7 +229,7 @@ public class GuildLogic {
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
int msgId = MessageTypeProto.MessageType.FAMILY_GET_LOG_RESPOSNE_VALUE;
|
int msgId = MessageTypeProto.MessageType.FAMILY_GET_LOG_RESPOSNE_VALUE;
|
||||||
if(user.getPlayerInfoManager().getGuildId()==0){
|
if(user.getPlayerInfoManager().getGuildId()==0){
|
||||||
MessageUtil.sendErrorResponse(session,0,msgId,"已加入过公会");
|
MessageUtil.sendErrorResponse(session,0,msgId,"未加入公会");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Family.GetFamilyLogResponse.Builder builder = Family.GetFamilyLogResponse.newBuilder();
|
Family.GetFamilyLogResponse.Builder builder = Family.GetFamilyLogResponse.newBuilder();
|
||||||
|
@ -461,10 +461,14 @@ public class GuildLogic {
|
||||||
guildInfo.removeMember(targetType,targetUid);
|
guildInfo.removeMember(targetType,targetUid);
|
||||||
guildInfo.addMembers(position,targetUid);
|
guildInfo.addMembers(position,targetUid);
|
||||||
sendPositionChange(targetUid,position);
|
sendPositionChange(targetUid,position);
|
||||||
|
User targetUser = UserManager.getUser(targetUid);
|
||||||
if(position == GlobalsDef.CHAIRMAN){
|
if(position == GlobalsDef.CHAIRMAN){
|
||||||
guildInfo.removeMember(GlobalsDef.CHAIRMAN,uid);
|
guildInfo.removeMember(GlobalsDef.CHAIRMAN,uid);
|
||||||
guildInfo.addMembers(GlobalsDef.MEMBER,uid);
|
guildInfo.addMembers(GlobalsDef.MEMBER,uid);
|
||||||
sendPositionChange(uid,GlobalsDef.MEMBER);
|
sendPositionChange(uid,GlobalsDef.MEMBER);
|
||||||
|
addGuildLog(guildInfo.getId(),GuildDef.Log.TRANSFER,targetUser.getPlayerInfoManager().getNickName());
|
||||||
|
}else{
|
||||||
|
addGuildLog(guildInfo.getId(),GuildDef.Log.APPOINTMENT,targetUser.getPlayerInfoManager().getNickName());
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageUtil.sendMessage(session,1,msgId,null,true);
|
MessageUtil.sendMessage(session,1,msgId,null,true);
|
||||||
|
@ -627,6 +631,7 @@ public class GuildLogic {
|
||||||
}
|
}
|
||||||
guildInfo.removeMember(uidType,uid);
|
guildInfo.removeMember(uidType,uid);
|
||||||
user.getPlayerInfoManager().setGuildId(0);
|
user.getPlayerInfoManager().setGuildId(0);
|
||||||
|
addGuildLog(guildInfo.getId(),GuildDef.Log.LEVEL,user.getPlayerInfoManager().getNickName());
|
||||||
MessageUtil.sendMessage(session,1,msgId,null,true);
|
MessageUtil.sendMessage(session,1,msgId,null,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -674,54 +679,31 @@ public class GuildLogic {
|
||||||
}
|
}
|
||||||
case GuildDef.Log.JOIN: {
|
case GuildDef.Log.JOIN: {
|
||||||
// 加入宗门
|
// 加入宗门
|
||||||
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logCreate", new Object[]{name}));
|
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logJoin", new Object[]{name}));
|
||||||
GuilidManager.addGuildLog(cGuildLog);
|
GuilidManager.addGuildLog(cGuildLog);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 3: {
|
case GuildDef.Log.KICK: {
|
||||||
// 退出宗门
|
// 退出宗门
|
||||||
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logCreate", new Object[]{name}));
|
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logKick", new Object[]{name}));
|
||||||
GuilidManager.addGuildLog(cGuildLog);
|
GuilidManager.addGuildLog(cGuildLog);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4: {
|
case GuildDef.Log.TRANSFER: {
|
||||||
// 宗门任免
|
|
||||||
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logCreate", new Object[]{name}));
|
|
||||||
GuilidManager.addGuildLog(cGuildLog);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 5: {
|
|
||||||
// 宗门转让
|
// 宗门转让
|
||||||
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logCreate", new Object[]{name}));
|
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logTransfer", new Object[]{name}));
|
||||||
GuilidManager.addGuildLog(cGuildLog);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 6: {
|
|
||||||
// 宗门改名和改图腾
|
|
||||||
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logCreate", new Object[]{name}));
|
|
||||||
GuilidManager.addGuildLog(cGuildLog);
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 7: {
|
|
||||||
// 宗门公告
|
|
||||||
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logCreate", new Object[]{name}));
|
|
||||||
GuilidManager.addGuildLog(cGuildLog);
|
GuilidManager.addGuildLog(cGuildLog);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 8: {
|
case GuildDef.Log.APPOINTMENT: {
|
||||||
// 宗门宣言
|
// 宗门任免
|
||||||
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logCreate", new Object[]{name}));
|
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logAppointment", new Object[]{name}));
|
||||||
GuilidManager.addGuildLog(cGuildLog);
|
GuilidManager.addGuildLog(cGuildLog);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 9: {
|
case GuildDef.Log.LEVEL: {
|
||||||
// 15天转让
|
// 宗门退出
|
||||||
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logCreate", new Object[]{name}));
|
GuildLog cGuildLog = new GuildLog(guildId,name, SErrorCodeEerverConfig.getI18NMessage("guild.logLevel", new Object[]{name}));
|
||||||
GuilidManager.addGuildLog(cGuildLog);
|
GuilidManager.addGuildLog(cGuildLog);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,7 +232,7 @@ public class HeroLogic {
|
||||||
builder.setExtraBox(ItemUtil.drop(user, new int[]{lotterySecurityReward[1]},1F,0,BIReason.HERO_RANDOM));
|
builder.setExtraBox(ItemUtil.drop(user, new int[]{lotterySecurityReward[1]},1F,0,BIReason.HERO_RANDOM));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
user.getUserMissionManager().onGameEvent(user,GameEvent.RANDOM_HERO,sLotterySetting.getLotteryType(),perCount);
|
|
||||||
heroManager.updateRandCount(type,randCount);
|
heroManager.updateRandCount(type,randCount);
|
||||||
if(tenTimesMustGetItem!=null){
|
if(tenTimesMustGetItem!=null){
|
||||||
for(int i=0;i<tenTimesMustGetItem.length;i++){
|
for(int i=0;i<tenTimesMustGetItem.length;i++){
|
||||||
|
@ -629,7 +629,7 @@ public class HeroLogic {
|
||||||
recyleHeroBySystem(user,removeHeroIds);
|
recyleHeroBySystem(user,removeHeroIds);
|
||||||
targetHero.upStar( 1 );
|
targetHero.upStar( 1 );
|
||||||
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
||||||
user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_UP,2);
|
user.getUserMissionManager().onGameEvent(user,GameEvent.HERO_UP,2,heroId);
|
||||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,null,true);
|
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,null,true);
|
||||||
if(targetHero.getStar()>=7){
|
if(targetHero.getStar()>=7){
|
||||||
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_hero_content", new Object[]{user.getPlayerInfoManager().getNickName(), scHero.getReadingName(),targetHero.getStar()});
|
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_rankup_hero_content", new Object[]{user.getPlayerInfoManager().getNickName(), scHero.getReadingName(),targetHero.getStar()});
|
||||||
|
|
|
@ -496,9 +496,19 @@ public class MissionLoigc {
|
||||||
if(missionProgress!=null){
|
if(missionProgress!=null){
|
||||||
count = missionProgress;
|
count = missionProgress;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
case USER_CONSUMER_STAMINA:
|
case USER_CONSUMER_STAMINA:
|
||||||
count= cumulationData.consumerStamina;
|
count= cumulationData.consumerStamina;
|
||||||
break;
|
break;
|
||||||
|
case COLLECT_DIFFERENT_HEROS:
|
||||||
|
count= cumulationData.differentHeros.size();
|
||||||
|
break;
|
||||||
|
case ONE_HERO_UP_STAR_TIMES:
|
||||||
|
Integer num= cumulationData.heroUpStarTimesMap.get(missionSubType[0]);
|
||||||
|
if(num!=null){
|
||||||
|
count = num;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
count = 0;
|
count = 0;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -61,6 +61,8 @@ public enum MissionType {
|
||||||
HERO_WEAR_EQUIP_TIMES(46),//妖灵师穿戴装备件数达到
|
HERO_WEAR_EQUIP_TIMES(46),//妖灵师穿戴装备件数达到
|
||||||
SYNTHESIS_HERO_STAR_TIMES(47),//碎片合成%s星妖灵师次数达到
|
SYNTHESIS_HERO_STAR_TIMES(47),//碎片合成%s星妖灵师次数达到
|
||||||
USER_CONSUMER_STAMINA(48),//消耗体力数量达到
|
USER_CONSUMER_STAMINA(48),//消耗体力数量达到
|
||||||
|
COLLECT_DIFFERENT_HEROS(49), // 收集不同妖灵师数目达到
|
||||||
|
ONE_HERO_UP_STAR_TIMES(50), // 收集不同妖灵师数目达到
|
||||||
;
|
;
|
||||||
|
|
||||||
private int missionType;
|
private int missionType;
|
||||||
|
@ -171,6 +173,10 @@ public enum MissionType {
|
||||||
return SYNTHESIS_HERO_STAR_TIMES;
|
return SYNTHESIS_HERO_STAR_TIMES;
|
||||||
case 48:
|
case 48:
|
||||||
return USER_CONSUMER_STAMINA;
|
return USER_CONSUMER_STAMINA;
|
||||||
|
case 49:
|
||||||
|
return COLLECT_DIFFERENT_HEROS;
|
||||||
|
case 50:
|
||||||
|
return ONE_HERO_UP_STAR_TIMES;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ public class DataManagerDistributor {
|
||||||
judges.put(MissionType.RECRUITMENT_RANDOM_HEROES,new RandomHeroDataManager());
|
judges.put(MissionType.RECRUITMENT_RANDOM_HEROES,new RandomHeroDataManager());
|
||||||
judges.put(MissionType.ELEMENT_RANDOM_TIMES,new RandomHeroDataManager());
|
judges.put(MissionType.ELEMENT_RANDOM_TIMES,new RandomHeroDataManager());
|
||||||
judges.put(MissionType.COLLECT_QUALITY_HERO,new GetHeroManager());
|
judges.put(MissionType.COLLECT_QUALITY_HERO,new GetHeroManager());
|
||||||
|
judges.put(MissionType.COLLECT_DIFFERENT_HEROS,new GetHeroManager());
|
||||||
judges.put(MissionType.HERO_LEVLE_COUNT,new HeroLevelUpManager());
|
judges.put(MissionType.HERO_LEVLE_COUNT,new HeroLevelUpManager());
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,6 +72,7 @@ public class DataManagerDistributor {
|
||||||
|
|
||||||
judges.put(MissionType.HERO_BREAK_TIMES,new HeroUpDataManager());
|
judges.put(MissionType.HERO_BREAK_TIMES,new HeroUpDataManager());
|
||||||
judges.put(MissionType.HERO_UP_STAR_TIMES,new HeroUpDataManager());
|
judges.put(MissionType.HERO_UP_STAR_TIMES,new HeroUpDataManager());
|
||||||
|
judges.put(MissionType.ONE_HERO_UP_STAR_TIMES,new HeroUpDataManager());
|
||||||
|
|
||||||
judges.put(MissionType.TAKE_CHAPTER_REWARD_TIMES,new TakeActivityRewardHandler());
|
judges.put(MissionType.TAKE_CHAPTER_REWARD_TIMES,new TakeActivityRewardHandler());
|
||||||
judges.put(MissionType.TAKE_ONLINE_REWARD_TIMES,new TakeActivityRewardHandler());
|
judges.put(MissionType.TAKE_ONLINE_REWARD_TIMES,new TakeActivityRewardHandler());
|
||||||
|
|
|
@ -15,6 +15,12 @@ public class GetHeroManager implements BaseDataManager {
|
||||||
SCHero scHero = SCHero.getsCHero().get(heroTid);
|
SCHero scHero = SCHero.getsCHero().get(heroTid);
|
||||||
data.updateHeroQualityCount(scHero.getStar());
|
data.updateHeroQualityCount(scHero.getStar());
|
||||||
result = new CumulationData.Result(missionType);
|
result = new CumulationData.Result(missionType);
|
||||||
|
}else if(missionType == MissionType.COLLECT_DIFFERENT_HEROS){
|
||||||
|
if(!data.differentHeros.contains(heroTid)){
|
||||||
|
data.differentHeros.add(heroTid);
|
||||||
|
result = new CumulationData.Result(missionType);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,9 @@ public class HeroUpDataManager implements BaseDataManager {
|
||||||
data.heroBreakTimes++;
|
data.heroBreakTimes++;
|
||||||
}else if(missionType == MissionType.HERO_UP_STAR_TIMES && type == 2){
|
}else if(missionType == MissionType.HERO_UP_STAR_TIMES && type == 2){
|
||||||
data.heroUpStarTimes++;
|
data.heroUpStarTimes++;
|
||||||
|
}else if(missionType == MissionType.ONE_HERO_UP_STAR_TIMES && type == 2){
|
||||||
|
int heroTid = (int) parm[1];
|
||||||
|
data.updateHeroUpStarTimes(heroTid);
|
||||||
}else{
|
}else{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,7 @@ public class MissionEventDistributor {
|
||||||
|
|
||||||
typeList = new ArrayList<>();
|
typeList = new ArrayList<>();
|
||||||
typeList.add(MissionType.COLLECT_QUALITY_HERO);
|
typeList.add(MissionType.COLLECT_QUALITY_HERO);
|
||||||
|
typeList.add(MissionType.COLLECT_DIFFERENT_HEROS);
|
||||||
eventEnumListMap.put(GameEvent.GET_HERO,typeList);
|
eventEnumListMap.put(GameEvent.GET_HERO,typeList);
|
||||||
eventProcessor.put(GameEvent.GET_HERO,new CumulationDataEventProcessor());
|
eventProcessor.put(GameEvent.GET_HERO,new CumulationDataEventProcessor());
|
||||||
|
|
||||||
|
@ -186,6 +187,7 @@ public class MissionEventDistributor {
|
||||||
typeList = new ArrayList<>();
|
typeList = new ArrayList<>();
|
||||||
typeList.add(MissionType.HERO_BREAK_TIMES);
|
typeList.add(MissionType.HERO_BREAK_TIMES);
|
||||||
typeList.add(MissionType.HERO_UP_STAR_TIMES);
|
typeList.add(MissionType.HERO_UP_STAR_TIMES);
|
||||||
|
typeList.add(MissionType.ONE_HERO_UP_STAR_TIMES);
|
||||||
eventEnumListMap.put(GameEvent.HERO_UP,typeList);
|
eventEnumListMap.put(GameEvent.HERO_UP,typeList);
|
||||||
eventProcessor.put(GameEvent.HERO_UP,new CumulationDataEventProcessor());
|
eventProcessor.put(GameEvent.HERO_UP,new CumulationDataEventProcessor());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue