Merge branch 'master' of http://60.1.1.230/backend/jieling_server
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/config/SRechargeCommodityConfig.java # serverlogic/src/main/java/com/ljsd/jieling/config/SSpecialConfig.java # serverlogic/src/main/java/com/ljsd/jieling/config/STreasureTaskConfig.java # serverlogic/src/main/java/com/ljsd/jieling/logic/activity/UserLevelEventHandler.java # serverlogic/src/main/java/com/ljsd/jieling/logic/dao/UserMissionManager.java # serverlogic/src/main/java/com/ljsd/jieling/logic/mission/event/MissionEventDistributor.javaback_recharge
commit
fb33d6bdb6
|
@ -39,8 +39,11 @@ public class TaskStaticConfig extends AbstractClassStaticConfig {
|
|||
if(!treasureTaskConfigByActivityMap.containsKey(activityId)){
|
||||
treasureTaskConfigByActivityMap.put(activityId,new ArrayList<>());
|
||||
}
|
||||
|
||||
if(!sTreasureTaskConfigListByTypeMapTmp.containsKey(sTreasureTaskConfig.getTaskType())){
|
||||
sTreasureTaskConfigListByTypeMapTmp.put(sTreasureTaskConfig.getTaskType(),new ArrayList<>());
|
||||
}
|
||||
treasureTaskConfigByActivityMap.get(activityId).add(sTreasureTaskConfig);
|
||||
sTreasureTaskConfigListByTypeMapTmp.get(sTreasureTaskConfig.getTaskType()).add(sTreasureTaskConfig);
|
||||
if(sTreasureTaskConfig.getTaskType() == MissionType.SENVER_HAPPY.getMissionTypeValue()){
|
||||
sTreasureSevenTaskConfigByActivityMapTmp.put(sTreasureTaskConfig.getActivityId(),sTreasureTaskConfig);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,8 @@ public interface Global {
|
|||
int ELITEPROOF = 25; // 精英证明
|
||||
int HEARTFIRE = 26; // 心火明晶
|
||||
int CHANGENAME = 64; // 改名卡
|
||||
|
||||
int EXP = 17;//经验
|
||||
int TREASURE_SCORE = 68;//孙龙宝藏积分
|
||||
|
||||
int SEND_CARD_COUNT = 20; // 每页发送卡牌个数
|
||||
int SEND_ITEM_COUNT = 200; // 每页发送道具个数
|
||||
|
|
|
@ -21,4 +21,5 @@ public interface GlobalGm {
|
|||
int OUT_BLOODY_BATTLE = 17;//退出血战
|
||||
int MISSION_LEAD = 18;//任务指引
|
||||
int ESPECIAL_EQUIP = 19;//增加法宝,星级
|
||||
int TREASURE_FINISH = 20;//戒灵秘宝一键完成
|
||||
}
|
||||
|
|
|
@ -24,12 +24,10 @@ public interface GlobalItemType {
|
|||
int SOUL_MARK =13;// 魂印
|
||||
int ESPECIAL_EQUIP = 14;//法宝
|
||||
|
||||
int EXP = 17;//经验
|
||||
|
||||
//物品使用类型
|
||||
int NO_USE = 0 ; //不使用
|
||||
int RANDOM_USE = 1; // 随机使用
|
||||
|
||||
|
||||
//道具id
|
||||
int STAMINA = 2; // 精力
|
||||
}
|
||||
|
|
|
@ -277,7 +277,13 @@ public class GMRequestHandler extends BaseHandler{
|
|||
cUser.getEquipManager().addEspecialEquip(cUser,especialEquip);
|
||||
}
|
||||
break;
|
||||
|
||||
case GlobalGm.TREASURE_FINISH:
|
||||
Set<Integer> doingMissionIds = cUser.getUserMissionManager().getTreasureMissionIdsType().getDoingMissionIds();
|
||||
if(doingMissionIds.contains(prarm2)){
|
||||
doingMissionIds.remove(prarm2);
|
||||
cUser.getUserMissionManager().getTreasureMissionIdsType().addFinishMissionId(prarm2);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
}
|
||||
try {
|
||||
|
|
|
@ -2193,7 +2193,7 @@ public class MapLogic {
|
|||
|
||||
public void getMainLevelRankInfo(ISession session) throws Exception {
|
||||
int rankEndLine = SSpecialConfig.getIntegerValue(SSpecialConfig.Level_RankingShowNum);
|
||||
Set<ZSetOperations.TypedTuple<String>> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.MAINLEVEL_RANK, "", 0, rankEndLine);
|
||||
Set<ZSetOperations.TypedTuple<String>> arenaRankInfo = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.MAINLEVEL_RANK, "", 0, rankEndLine-1);
|
||||
int rank =1;
|
||||
FightInfoProto.MainLevelRankInfoResponse.Builder builder = FightInfoProto.MainLevelRankInfoResponse.newBuilder();
|
||||
List<CommonProto.MainLevelRankInfo.Builder> mainLevelRankInfoList = new ArrayList<>(rankEndLine);
|
||||
|
@ -2223,19 +2223,27 @@ public class MapLogic {
|
|||
o2.setRank(rank);
|
||||
}
|
||||
}
|
||||
return o2.getFightId()-o1.getFightId();
|
||||
return o1.getRank()-o2.getRank();
|
||||
}
|
||||
});
|
||||
for(CommonProto.MainLevelRankInfo.Builder builder1 : mainLevelRankInfoList){
|
||||
builder.addMainLevelRankInfo(builder1.build());
|
||||
}
|
||||
rank =1;
|
||||
int myRank =-1;
|
||||
int uid = session.getUid();
|
||||
for(CommonProto.MainLevelRankInfo.Builder builder1 : mainLevelRankInfoList){
|
||||
builder1.setRank(rank++);
|
||||
builder.addMainLevelRankInfo(builder1.build());
|
||||
if(builder1.getUid() == uid){
|
||||
myRank = builder1.getRank();
|
||||
}
|
||||
}
|
||||
|
||||
int score = RedisUtil.getInstence().getZSetScore(RedisKey.MAINLEVEL_RANK,"", Integer.toString(uid)).intValue();
|
||||
int myRank =-1;
|
||||
if(score == -1){
|
||||
score = 1011;
|
||||
}else{
|
||||
myRank= RedisUtil.getInstence().getZSetreverseRank(RedisKey.MAINLEVEL_RANK,"",Integer.toString(uid)).intValue();
|
||||
if(myRank==-1){
|
||||
myRank= RedisUtil.getInstence().getZSetreverseRank(RedisKey.MAINLEVEL_RANK,"",Integer.toString(uid)).intValue();
|
||||
}
|
||||
}
|
||||
User user = UserManager.getUser(uid);
|
||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
|
|
|
@ -296,6 +296,7 @@ public class GlobalDataManaager {
|
|||
PlayerLogic.getInstance().flushUserdataEvery(user,fBuilder);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.DAILY_REFRESH,0);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.TREASH_REFRESH,0);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.TREASH_WEEK_REFRESH,0);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.BLOODY_REFRESH,0);
|
||||
FriendLogic.getInstance().refreshState(session);
|
||||
|
||||
|
|
|
@ -32,11 +32,11 @@ public class FightMainEventHandler implements IEventHandler{
|
|||
if(sGlobalSystemConfigs == null){
|
||||
return;
|
||||
}
|
||||
int uid = fightMainEvent.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
for(SGlobalSystemConfig sGlobalSystemConfig : sGlobalSystemConfigs){
|
||||
int[][] openGifts = sGlobalSystemConfig.getOpenGifts();
|
||||
if(openGifts!=null && openGifts.length>0){
|
||||
int uid = fightMainEvent.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
ItemUtil.drop(user,openGifts, BIReason.SYSTERM_OPEN_REWARD);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ import com.ljsd.jieling.logic.dao.UserManager;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import config.SGlobalSystemConfig;
|
||||
import config.SMainLevelConfig;
|
||||
import manager.STableManager;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -24,15 +25,26 @@ public class UserLevelEventHandler implements IEventHandler{
|
|||
return;
|
||||
UserLevelEvent userLevelEvent = (UserLevelEvent) event;
|
||||
int level = userLevelEvent.getLevel();
|
||||
|
||||
List<SGlobalSystemConfig> sGlobalSystemConfigs = STableManager.getFigureConfig(CommonStaticConfig.class).getsGlobalSystemConfigMapByTypeAndConditionMap().get(2).get(level);
|
||||
|
||||
int uid = userLevelEvent.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
int state = user.getMainLevelManager().getState();
|
||||
if(state == -1 ){
|
||||
int fightId = user.getMainLevelManager().getFightId();
|
||||
SMainLevelConfig sMainLevelConfig = SMainLevelConfig.config.get(fightId);
|
||||
if(level>=sMainLevelConfig.getLevelLimit()){
|
||||
user.getMainLevelManager().setState(1);
|
||||
}
|
||||
|
||||
}
|
||||
if(sGlobalSystemConfigs == null){
|
||||
return;
|
||||
}
|
||||
for(SGlobalSystemConfig sGlobalSystemConfig : sGlobalSystemConfigs){
|
||||
int[][] openGifts = sGlobalSystemConfig.getOpenGifts();
|
||||
if(openGifts!=null && openGifts.length>0){
|
||||
int uid = userLevelEvent.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
ItemUtil.drop(user,openGifts, BIReason.SYSTERM_OPEN_REWARD);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,6 +186,9 @@ public class CumulationData {
|
|||
public int param;
|
||||
public Map<Integer, Map<Integer, Integer>> param2;
|
||||
public long value;
|
||||
public int missionTimeType;
|
||||
|
||||
|
||||
|
||||
public Result(MissionType subType) {
|
||||
this.subType = subType;
|
||||
|
@ -210,6 +213,14 @@ public class CumulationData {
|
|||
public void setValue(long value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public void setMissionTimeType(int missionTimeType) {
|
||||
this.missionTimeType = missionTimeType;
|
||||
}
|
||||
|
||||
public int getMissionTimeType() {
|
||||
return missionTimeType;
|
||||
}
|
||||
}
|
||||
|
||||
public void updateHeroUpStarTimes(int heroTid){
|
||||
|
|
|
@ -51,6 +51,11 @@ public class MainLevelManager extends MongoBase {
|
|||
|
||||
}
|
||||
|
||||
public void setState(int state){
|
||||
this.state = state;
|
||||
updateString("state",state);
|
||||
}
|
||||
|
||||
public void updateFight(int fightId,int state){
|
||||
if(fightId!=1011){
|
||||
updateStateInfo();
|
||||
|
|
|
@ -15,6 +15,7 @@ import util.MathUtils;
|
|||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -89,6 +90,7 @@ public class UserMissionManager extends MongoBase {
|
|||
break;
|
||||
case TREASH_WEEK_REFRESH:
|
||||
int[] dailyRefreshIds = resetTreasureTaskInfo(1,missionTypeEnumListMap,treasureCumulationData);
|
||||
|
||||
int[] weekRefreshIds = resetTreasureTaskInfo(2,missionTypeEnumListMap,treasureWeekCumulationData);
|
||||
CommonProto.RefreshTask.Builder task1 = treasureIndicationBuild(1, dailyRefreshIds);
|
||||
CommonProto.RefreshTask.Builder task2 = treasureIndicationBuild(2, weekRefreshIds);
|
||||
|
@ -234,18 +236,20 @@ public class UserMissionManager extends MongoBase {
|
|||
CumulationData.Result result = treasureCumulationData.updateData(missionType, parm);
|
||||
CumulationData.Result weekResult = treasureWeekCumulationData.updateData(missionType, parm);
|
||||
CumulationData.Result monthResult = treasureMonthCumulationData.updateData(missionType, parm);
|
||||
|
||||
if(result!=null){
|
||||
result.setMissionTimeType(1);
|
||||
treasureMissionIdsType.calCumulationDataResult(user,result,missionTypeEnumListMap.get(GameMisionType.TREASUREMISSION),treasureCumulationData);
|
||||
updateString("treasureCumulationData",treasureCumulationData);
|
||||
updateString("treasureMissionIdsType",treasureMissionIdsType);
|
||||
}
|
||||
if(weekResult!=null){
|
||||
weekResult.setMissionTimeType(2);
|
||||
treasureMissionIdsType.calCumulationDataResult(user,weekResult,missionTypeEnumListMap.get(GameMisionType.TREASUREMISSION),treasureWeekCumulationData);
|
||||
updateString("treasureWeekCumulationData",treasureWeekCumulationData);
|
||||
updateString("treasureMissionIdsType",treasureMissionIdsType);
|
||||
}
|
||||
if(monthResult!=null){
|
||||
monthResult.setMissionTimeType(3);
|
||||
treasureMissionIdsType.calCumulationDataResult(user,monthResult,missionTypeEnumListMap.get(GameMisionType.TREASUREMISSION),treasureMonthCumulationData);
|
||||
|
||||
updateString("treasureMonthCumulationData",treasureMonthCumulationData);
|
||||
|
@ -277,11 +281,21 @@ public class UserMissionManager extends MongoBase {
|
|||
|
||||
|
||||
private int[] resetTreasureTaskInfo(int type,Map<GameMisionType, List<MissionStateChangeInfo>> missionTypeEnumListMap,CumulationData treasureCumulationData){
|
||||
int[] typeMissionNum = SSpecialConfig.getOnceArrayValue(SSpecialConfig.SUNLONG_DAILYTASKS);
|
||||
List<Integer> taskTypeMap = STreasureSunlongTaskConfig.taskTypeMap.get(type);
|
||||
for(Integer treasure:taskTypeMap){
|
||||
if(treasureMissionIdsType.getDoingMissionIds().contains(treasure)){
|
||||
treasureMissionIdsType.getDoingMissionIds().remove(treasure);
|
||||
//周刷新检测
|
||||
if(type==3){
|
||||
treasureMissionIdsType.setWeekRefresh((int)(TimeUtils.now()/1000));
|
||||
}
|
||||
if(type==2){
|
||||
if(treasureMissionIdsType.getWeekRefresh()>= TimeUtils.getCurWeekdayStartTime(1,5)){
|
||||
return null;
|
||||
}
|
||||
treasureMissionIdsType.setWeekRefresh((int)TimeUtils.now()/1000);
|
||||
}
|
||||
int[] typeMissionNum = SSpecialConfig.getOnceArrayValue(SSpecialConfig.SUNLONG_DAILYTASKS);
|
||||
List<Integer> taskTypeMap = STreasureSunlongTaskConfig.taskTypeMap.get(type);
|
||||
for(Integer treasure:taskTypeMap){
|
||||
if(treasureMissionIdsType.getDoingMissionIds().contains(treasure)){
|
||||
treasureMissionIdsType.getDoingMissionIds().remove(treasure);
|
||||
}
|
||||
if(treasureMissionIdsType.getFinishMissionIds().contains(treasure)){
|
||||
treasureMissionIdsType.getFinishMissionIds().remove(treasure);
|
||||
|
@ -297,7 +311,7 @@ public class UserMissionManager extends MongoBase {
|
|||
temp[1] = STreasureSunlongTaskConfig.treasureTaskConfig.get(taskTypeMap.get(i)).getWeight();
|
||||
randomTask[i] = temp;
|
||||
}
|
||||
int[] tasks= MathUtils.randomFromWeightWithTaking(randomTask,5);// typeMissionNum[type-1]
|
||||
int[] tasks= MathUtils.randomFromWeightWithTaking(randomTask,typeMissionNum[type-1]);// typeMissionNum[type-1]
|
||||
List<MissionStateChangeInfo> missionStateChangeInfos = missionTypeEnumListMap.get(GameMisionType.TREASUREMISSION);
|
||||
for(Integer task:tasks){
|
||||
treasureMissionIdsType.getDoingMissionIds().add(task);
|
||||
|
|
|
@ -246,6 +246,9 @@ public class GuildFightLogic {
|
|||
Map<Integer, SGuildLevelConfig> configMap = STableManager.getConfig(SGuildLevelConfig.class);
|
||||
//匹配处理
|
||||
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(gid);
|
||||
if(guildInfo.getDefendInfo().size()<configMap.get(guildInfo.getLevel()).getDefendNum()){
|
||||
continue;
|
||||
}
|
||||
int totalForce = 0;
|
||||
for(Map.Entry<Integer, Set<Integer>> entry:guildInfo.getMembers().entrySet()){
|
||||
for(Integer uid:entry.getValue()){
|
||||
|
|
|
@ -447,10 +447,18 @@ public class ItemLogic {
|
|||
public void especialEquipUpStar(ISession session, String equipId, List<HeroInfoProto.ConsumeMaterial> materials) throws Exception {
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
EspecialEquip especialEquip = user.getEquipManager().getEspecialEquipMap().get(equipId);
|
||||
if(especialEquip == null){
|
||||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,"not exists");
|
||||
return;
|
||||
}
|
||||
SEquipTalismana sEquipTalismana = SEquipTalismana.equipTalismanaStarMap.get(especialEquip.getEquipId()).get(especialEquip.getStar());
|
||||
Map<Integer, SEquipTalismanaRankup> equipTalismanaRankupMap = STableManager.getConfig(SEquipTalismanaRankup.class);
|
||||
boolean success = true;
|
||||
//按槽位遍历所需材料
|
||||
if(sEquipTalismana.getRankupConsumeMaterial().length != materials.size()){
|
||||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,"卡槽数量不对");
|
||||
return;
|
||||
}
|
||||
for(int i = 0 ; i <sEquipTalismana.getRankupConsumeMaterial().length;i++){
|
||||
//遍历前端传进材料
|
||||
for(HeroInfoProto.ConsumeMaterial material:materials){
|
||||
|
@ -460,6 +468,10 @@ public class ItemLogic {
|
|||
}
|
||||
SEquipTalismanaRankup sEquipTalismanaRankup = equipTalismanaRankupMap.get(sEquipTalismana.getRankupConsumeMaterial()[i][1]);
|
||||
for(String materEquip:material.getHeroIdsList()){
|
||||
if(equipId.equals(materEquip)){
|
||||
MessageUtil.sendErrorResponse(session,0,MessageTypeProto.MessageType.UP_HERO_STAR_RESPONSE_VALUE,"不能吞自己");
|
||||
return;
|
||||
}
|
||||
EspecialEquip especialEquip1 = user.getEquipManager().getEspecialEquipMap().get(materEquip);
|
||||
//材料种类判断
|
||||
if(sEquipTalismanaRankup.getIssame()==1){
|
||||
|
|
|
@ -354,16 +354,10 @@ public class MissionLoigc {
|
|||
missionStateChangeInfos = gameMisionTypeListMap.get(GameMisionType.TREASUREMISSION);
|
||||
if(missionStateChangeInfos!=null && !missionStateChangeInfos.isEmpty()){
|
||||
|
||||
// ItemUtil.drop(user,STreasureSunlongTaskConfig.treasureTaskConfig.get(missionId).getIntegral(),BIReason.TREASURE_SCORE);
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserTaskEvent,type,missionId);
|
||||
Repot37EventUtil.onKtEvent(user, Repot37EventUtil.Report37EventType.TASK_FINISH_EVEMT,missionId,"");
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, missionStateChangeInfos.get(0).getRewwardGroups(), BIReason.TAKE_MISSION_REWARD);
|
||||
|
||||
STreasureSunlongConfig levelConfig = STreasureSunlongConfig.levelTreasureConfigMap.get(user.getPlayerInfoManager().getTreasureLevel());
|
||||
while(ItemUtil.itemCost(user,levelConfig.getIntegral(), BIReason.TREASURE_LEVEL_UP_CONCUME,1)){
|
||||
user.getPlayerInfoManager().addTreasureLevel();
|
||||
levelConfig = STreasureSunlongConfig.levelTreasureConfigMap.get(user.getPlayerInfoManager().getTreasureLevel());
|
||||
}
|
||||
ItemUtil.treasureLevelUp(user);
|
||||
PlayerInfoProto.TakeMissionRewardResponse build = PlayerInfoProto.TakeMissionRewardResponse.newBuilder().setDrop(drop).setTreasureScore(user.getPlayerInfoManager().getTreasureLevel()).build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.TAKE_MISSION_REWARD_RESPONSE_VALUE,build,true);
|
||||
return;
|
||||
|
|
|
@ -8,9 +8,10 @@ import java.util.Map;
|
|||
public class HeroLevelUpManager implements BaseDataManager{
|
||||
@Override
|
||||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
int oldLevle = (int)parm[0]+1;
|
||||
int newLevle = (int)parm[1];
|
||||
if(missionType == MissionType.HERO_LEVLE_COUNT){
|
||||
int oldLevle = (int)parm[0]+1;
|
||||
int newLevle = (int)parm[1];
|
||||
|
||||
Map<Integer, Integer> heroLevleCountMap = data.getHeroLevleCountMap();
|
||||
for(;oldLevle<=newLevle;oldLevle++){
|
||||
Integer count = heroLevleCountMap.get(oldLevle);
|
||||
|
@ -21,7 +22,7 @@ public class HeroLevelUpManager implements BaseDataManager{
|
|||
|
||||
}
|
||||
}else if(missionType == MissionType.HERO_LEVLE_TIMES){
|
||||
data.heroLevleTimes++;
|
||||
data.heroLevleTimes+=newLevle-oldLevle+1;
|
||||
}
|
||||
return new CumulationData.Result(missionType);
|
||||
}
|
||||
|
|
|
@ -1,9 +1,6 @@
|
|||
package com.ljsd.jieling.logic.mission.event;
|
||||
|
||||
import config.SBeginnerTask;
|
||||
import config.SDailyTasksConfig;
|
||||
import config.STaskConfig;
|
||||
import config.STreasureTaskConfig;
|
||||
import config.*;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mission.*;
|
||||
|
@ -34,6 +31,9 @@ public class MissionEventDistributor {
|
|||
|
||||
eventProcessor.put(GameEvent.DAILY_REFRESH,new DailyRefreshEventProcess());
|
||||
eventProcessor.put(GameEvent.BLOODY_REFRESH,new DailyRefreshEventProcess());
|
||||
eventProcessor.put(GameEvent.TREASH_REFRESH,new TreasureRefreshEventProcess());
|
||||
eventProcessor.put(GameEvent.TREASH_WEEK_REFRESH,new TreasureRefreshEventProcess());
|
||||
|
||||
eventProcessor.put(GameEvent.TREASH_MONTH_REFRESH,new TreasureRefreshEventProcess());
|
||||
eventProcessor.put(GameEvent.SERVENHAPPY_REFRESH,new TreasureRefreshEventProcess());
|
||||
eventProcessor.put(GameEvent.BEGINNER,new BeginneRefreshEventProcessor());
|
||||
|
@ -361,6 +361,10 @@ public class MissionEventDistributor {
|
|||
SBeginnerTask sBeginnerTask = SBeginnerTask.sBeginnerTaskCongigMap.get(missionStateChangeInfo.getMissionId());
|
||||
progress= sBeginnerTask.getTaskValue()[1][0];
|
||||
}
|
||||
if(gameMisionType == GameMisionType.TREASUREMISSION){
|
||||
STreasureSunlongTaskConfig sunlongTaskConfig = STreasureSunlongTaskConfig.treasureTaskConfig.get(missionStateChangeInfo.getMissionId());
|
||||
progress= sunlongTaskConfig.getTaskValue()[1][0];
|
||||
}
|
||||
if(gameMisionType == GameMisionType.SEVENMISSION){
|
||||
STreasureTaskConfig sTreasureTaskConfig = STreasureTaskConfig.sTreasureTaskConfigMap.get(missionStateChangeInfo.getMissionId());
|
||||
if(sTreasureTaskConfig.getTaskType() != MissionType.SENVER_HAPPY.getMissionTypeValue()){
|
||||
|
|
|
@ -15,6 +15,17 @@ import java.util.Set;
|
|||
public class TreasureMissionType extends AbstractMissionType{
|
||||
|
||||
private Map<Integer,Integer> takeTimes = new HashMap<>();
|
||||
|
||||
private int weekRefresh;
|
||||
|
||||
public int getWeekRefresh() {
|
||||
return weekRefresh;
|
||||
}
|
||||
|
||||
public void setWeekRefresh(int weekRefresh) {
|
||||
this.weekRefresh = weekRefresh;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openMission(User user, int missionId, List<MissionStateChangeInfo> missionTypeEnumList) {
|
||||
|
||||
|
@ -47,6 +58,7 @@ public class TreasureMissionType extends AbstractMissionType{
|
|||
|
||||
@Override
|
||||
public void calCumulationDataResult(User user, CumulationData.Result result, List<MissionStateChangeInfo> missionStateChangeInfos, CumulationData cumulationData) {
|
||||
|
||||
Set<Integer> doingMissionIds = getDoingMissionIds();
|
||||
List<STreasureSunlongTaskConfig> sTreasureTaskConfigs = STreasureSunlongTaskConfig.sTreasureTaskConfigListByTypeMapTmp.get(result.subType.getMissionTypeValue());
|
||||
if(sTreasureTaskConfigs == null){
|
||||
|
@ -57,6 +69,9 @@ public class TreasureMissionType extends AbstractMissionType{
|
|||
if(!doingMissionIds.contains(sTreasureTaskConfig.getId())){
|
||||
continue;
|
||||
}
|
||||
if(sTreasureTaskConfig.getType()!=result.getMissionTimeType()){
|
||||
continue;
|
||||
}
|
||||
int doingProgress = MissionLoigc.getDoingProgress(user, cumulationData, sTreasureTaskConfig.getTaskType(), sTreasureTaskConfig.getTaskValue()[0]);
|
||||
//完成
|
||||
int finishParm = sTreasureTaskConfig.getTaskValue()[1][0];
|
||||
|
|
|
@ -385,6 +385,9 @@ public class PlayerLogic {
|
|||
if(days == 0){
|
||||
continue;
|
||||
}
|
||||
if(days == sRechargeCommodityConfig.getContiueDays()){
|
||||
days-=1;
|
||||
}
|
||||
remainDays = TimeUtils.differentDays(nowTime * 1000L, goodsInfo.getValue()*1000L)-1;
|
||||
}else{
|
||||
continue;
|
||||
|
@ -396,7 +399,7 @@ public class PlayerLogic {
|
|||
int[][] rewardTemplates = sRechargeCommodityConfig.getExtraReward()[0];
|
||||
int[][] rewards = new int[rewardTemplates.length][];
|
||||
for(int i=0;i<rewardTemplates.length;i++){
|
||||
int[] rewardTemplate = rewardTemplates[0];
|
||||
int[] rewardTemplate = rewardTemplates[i];
|
||||
int typeReward = rewardTemplate[0];
|
||||
rewards[i] = new int[2];
|
||||
rewards[i][0] = rewardTemplate[1];
|
||||
|
|
|
@ -74,12 +74,6 @@ public class BuyGoodsLogic {
|
|||
if(isDiscount!=0){
|
||||
price=(int)(sRechargeCommodityConfig.getPrice() * (10 + isDiscount)/10f);
|
||||
}
|
||||
/* if(!openId.equals("gm-test")&&price*100!=amount){
|
||||
resultRes.setResultCode(0);
|
||||
resultRes.setResultMsg("amount is wrong");
|
||||
LOGGER.info("the uid={},should pay={},amount={}",uid,price*100,amount);
|
||||
return resultRes;
|
||||
}*/
|
||||
buyCount=buyCount+1;
|
||||
int limit = sRechargeCommodityConfig.getLimit();
|
||||
int type = sRechargeCommodityConfig.getType();
|
||||
|
@ -213,12 +207,7 @@ public class BuyGoodsLogic {
|
|||
resultRes.setResultCode(1);
|
||||
KtEventUtils.onKtEvent(user, ParamEventBean.UserPayEvent,goodsId,orderId,resultRes.getResultCode(),price);
|
||||
notifyPaySuccessFul(uid,goodsId,amount != -999);
|
||||
|
||||
Class<? extends MongoUpdateCache> aClass = MongoUpdateCacheThreadLocal.getMongoUpdateCache().getClass();
|
||||
Field requestMap = aClass.getDeclaredField("requestMap");
|
||||
requestMap.setAccessible(true);
|
||||
requestMap.set(MongoUpdateCacheThreadLocal.getMongoUpdateCache(), new HashMap<>());
|
||||
MongoUtil.getLjsdMongoTemplate().save(user);
|
||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
return resultRes;
|
||||
|
||||
}
|
||||
|
@ -294,7 +283,7 @@ public class BuyGoodsLogic {
|
|||
if(buyTimes ==null){
|
||||
buyTimes=0;
|
||||
}
|
||||
if(limit!=0){
|
||||
if(sRechargeCommodityConfig.getLimitShow() == 0 && limit!=0){
|
||||
if(buyTimes>=limit){
|
||||
boolean isNew = rechargeInfo.addNewSendId(goodsId);
|
||||
if(!isNew){
|
||||
|
|
|
@ -275,6 +275,7 @@ public class ItemUtil {
|
|||
public static String getReward(Map<Integer, Integer> itemMap,Map<Integer, Integer> cardMap,Map<Integer, Integer> equipMap, Map<Integer,Integer> randomMap) {
|
||||
StringBuilder reward= new StringBuilder();
|
||||
for (Map.Entry<Integer, Integer> entry : itemMap.entrySet()){
|
||||
if(entry.getValue() == 0){continue;}
|
||||
if (reward.length() == 0){
|
||||
reward = new StringBuilder(entry.getKey() + "#" + entry.getValue());
|
||||
}else{
|
||||
|
@ -282,6 +283,7 @@ public class ItemUtil {
|
|||
}
|
||||
}
|
||||
for (Map.Entry<Integer, Integer> entry : cardMap.entrySet()){
|
||||
if(entry.getValue() == 0){continue;}
|
||||
if (reward.length() == 0){
|
||||
reward = new StringBuilder(entry.getKey() + "#" + entry.getValue());
|
||||
}else{
|
||||
|
@ -289,6 +291,7 @@ public class ItemUtil {
|
|||
}
|
||||
}
|
||||
for (Map.Entry<Integer, Integer> entry : equipMap.entrySet()){
|
||||
if(entry.getValue() == 0){continue;}
|
||||
if (reward.length() == 0){
|
||||
reward = new StringBuilder(entry.getKey() + "#" + entry.getValue());
|
||||
}else{
|
||||
|
@ -296,6 +299,7 @@ public class ItemUtil {
|
|||
}
|
||||
}
|
||||
for (Map.Entry<Integer, Integer> entry : randomMap.entrySet()){
|
||||
if(entry.getValue() == 0){continue;}
|
||||
if (reward.length() == 0){
|
||||
reward = new StringBuilder(entry.getKey() + "#" + entry.getValue());
|
||||
}else{
|
||||
|
@ -508,9 +512,12 @@ public class ItemUtil {
|
|||
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_differ_content", new Object[]{nickName,sDifferDemonsConfig.getName(),sItem.getName()});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,sItem.getId(),0,0,0,0,0);
|
||||
}
|
||||
if(sItem.getId() == GlobalItemType.EXP){
|
||||
if(sItem.getId() == Global.EXP){
|
||||
userLevelUp(user,itemNum);
|
||||
}
|
||||
if(sItem.getId() == Global.TREASURE_SCORE){
|
||||
treasureLevelUp(user);
|
||||
}
|
||||
sendToFront.add(CBean2Proto.getItem(item,-1));
|
||||
}
|
||||
if (dropBuilder != null) {
|
||||
|
@ -584,6 +591,19 @@ public class ItemUtil {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 孙龙宝藏升级
|
||||
* @param user
|
||||
*/
|
||||
public static void treasureLevelUp(User user) throws Exception {
|
||||
STreasureSunlongConfig levelConfig = STreasureSunlongConfig.levelTreasureConfigMap.get(user.getPlayerInfoManager().getTreasureLevel());
|
||||
while(ItemUtil.itemCost(user,levelConfig.getIntegral(), BIReason.TREASURE_LEVEL_UP_CONCUME,1)){
|
||||
user.getPlayerInfoManager().addTreasureLevel();
|
||||
levelConfig = STreasureSunlongConfig.levelTreasureConfigMap.get(user.getPlayerInfoManager().getTreasureLevel());
|
||||
}
|
||||
PlayerInfoProto.TreasureLevelUpIndication indication = PlayerInfoProto.TreasureLevelUpIndication.newBuilder().setLevel(user.getPlayerInfoManager().getTreasureLevel()).build();
|
||||
MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()),1,MessageTypeProto.MessageType.TREASURE_LEVELUP_INDICATION_VALUE,indication,true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加道具到临时背包
|
||||
|
@ -1319,7 +1339,7 @@ public class ItemUtil {
|
|||
SVipLevelConfig sVipLevelConfig = SVipLevelConfig.getsVipLevelConfigMap().get(vipLevel);
|
||||
Map<Integer, Integer> privilegeMap = sVipLevelConfig.getPrivilegeMap();
|
||||
if(reason == BIReason.ADVENTURE_BASE_REWARD){
|
||||
if(itemType == GlobalItemType.EXP){
|
||||
if(itemType == Global.EXP){
|
||||
sourceNum = parseTheValueByPrivilegeMap(privilegeMap,sourceNum,VipPrivilegeType.ADVENTURE_EXP_REWARD);
|
||||
return sourceNum;
|
||||
}
|
||||
|
|
|
@ -10,54 +10,55 @@ import java.util.Map;
|
|||
|
||||
@Table(name ="RechargeCommodityConfig")
|
||||
public class SRechargeCommodityConfig implements BaseConfig {
|
||||
private int id;
|
||||
|
||||
private int id;
|
||||
private String name;
|
||||
|
||||
private String name;
|
||||
private int type;
|
||||
|
||||
private int type;
|
||||
private int price;
|
||||
|
||||
private int price;
|
||||
private int[][] firstMultiple;
|
||||
|
||||
private int[][] firstMultiple;
|
||||
private int[][] baseReward;
|
||||
|
||||
private int[][] baseReward;
|
||||
private int[][][] extraReward;
|
||||
|
||||
private int[][][] extraReward;
|
||||
private int limit;
|
||||
|
||||
private int limit;
|
||||
private int firstInvest;
|
||||
|
||||
private int firstInvest;
|
||||
private int isDiscount;
|
||||
|
||||
private int isDiscount;
|
||||
private int[] discountType;
|
||||
|
||||
private int[] discountType;
|
||||
private int order;
|
||||
|
||||
private int order;
|
||||
private int accumulativeRecharge;
|
||||
|
||||
private int accumulativeRecharge;
|
||||
private int[][] playerLevel;
|
||||
|
||||
private int[][] playerLevel;
|
||||
private int[] openPrivilege;
|
||||
|
||||
private int[] openPrivilege;
|
||||
|
||||
private int contiueDays;
|
||||
private int contiueDays;
|
||||
|
||||
|
||||
|
||||
private int time;
|
||||
private String startTime;
|
||||
private String endtime;
|
||||
private int time;
|
||||
private String startTime;
|
||||
private String endtime;
|
||||
|
||||
|
||||
private long startTimeLong;
|
||||
private long endTimeLong;
|
||||
|
||||
public static Map<Integer, SRechargeCommodityConfig> rechargeCommodityConfigMap;
|
||||
public static Map<Integer, SRechargeCommodityConfig> rechargeLevelMap;
|
||||
private int limitShow;
|
||||
|
||||
|
||||
@Override
|
||||
public static Map<Integer, SRechargeCommodityConfig> rechargeCommodityConfigMap;
|
||||
public static Map<Integer, SRechargeCommodityConfig> rechargeLevelMap;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SRechargeCommodityConfig> config = STableManager.getConfig(SRechargeCommodityConfig.class);
|
||||
Map<Integer, SRechargeCommodityConfig> rechargeLevelMapTmp = new HashMap<>();
|
||||
|
@ -95,47 +96,47 @@ public class SRechargeCommodityConfig implements BaseConfig {
|
|||
|
||||
|
||||
|
||||
public int getId() {
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getPrice() {
|
||||
public int getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public int[][] getFirstMultiple() {
|
||||
public int[][] getFirstMultiple() {
|
||||
return firstMultiple;
|
||||
}
|
||||
|
||||
public int[][] getBaseReward() {
|
||||
public int[][] getBaseReward() {
|
||||
return baseReward;
|
||||
}
|
||||
|
||||
public int[][][] getExtraReward() {
|
||||
public int[][][] getExtraReward() {
|
||||
return extraReward;
|
||||
}
|
||||
|
||||
public int getLimit() {
|
||||
public int getLimit() {
|
||||
return limit;
|
||||
}
|
||||
|
||||
public int getFirstInvest() {
|
||||
public int getFirstInvest() {
|
||||
return firstInvest;
|
||||
}
|
||||
|
||||
public int getIsDiscount() {
|
||||
public int getIsDiscount() {
|
||||
return isDiscount;
|
||||
}
|
||||
|
||||
public int[] getDiscountType() {
|
||||
public int[] getDiscountType() {
|
||||
return discountType;
|
||||
}
|
||||
|
||||
public int getOrder() {
|
||||
public int getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
|
@ -186,4 +187,7 @@ public class SRechargeCommodityConfig implements BaseConfig {
|
|||
public long getEndTimeLong() {
|
||||
return endTimeLong;
|
||||
}
|
||||
public int getLimitShow() {
|
||||
return limitShow;
|
||||
}
|
||||
}
|
|
@ -9,7 +9,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
|
||||
@Table(name = "SpecialConfig")
|
||||
public class SSpecialConfig implements BaseConfig {
|
||||
|
||||
private static Map<String, String> enumers;
|
||||
private int id;
|
||||
|
||||
|
@ -36,7 +35,7 @@ public class SSpecialConfig implements BaseConfig {
|
|||
public static final String lamp_lottery_content_parm = "lamp_lottery_content_parm";//资质13及以上——系统消息
|
||||
public static final String lamp_rankup_hero_content_parm = "lamp_rankup_hero_content_parm";//10星及以上——系统消息
|
||||
public static final String lamp_lottery_differ_content_parm = "lamp_lottery_differ_content_parm";//5及以上——系统消息
|
||||
// public static final String lamp_activate_differ_content_parm = "lamp_activate_differ_content_parm";//5及以上——系统消息
|
||||
// public static final String lamp_activate_differ_content_parm = "lamp_activate_differ_content_parm";//5及以上——系统消息
|
||||
public static final String lamp_rankup_differ_content_parm = "lamp_rankup_differ_content_parm";//10阶以上——系统消息
|
||||
public static final String lamp_lottery_equip_content_parm = "lamp_lottery_equip_content_parm";//5及以上——系统消息
|
||||
public static final String lamp_lottery_equipsign_content_parm = "lamp_lottery_equipsign_content_parm";//5及以上——系统消息
|
||||
|
@ -45,8 +44,9 @@ public class SSpecialConfig implements BaseConfig {
|
|||
public static final String lamp_rankup_equiptalisman_content_parm = "lamp_rankup_equiptalisman_content_parm";//8星及以上——系统消息
|
||||
public static final String SUNLONG_DAILYTASKS = "Sunlong_DailyTasks";//孙龙的宝藏每日、每周、每月任务个数
|
||||
public static final String SUNLONG_COST = "Sunlong_Cost";//孙龙的宝藏购买等级
|
||||
public static final String SUNLONG_INTEGRAL ="Sunlong_Integral";//孙龙的宝藏每日积分礼包
|
||||
public static final String SUNLONG_INTEGRAL = "Sunlong_Integral";//孙龙的宝藏每日积分礼包
|
||||
public static final String SUNLONG_REWARD = "Sunlong_Reward";//孙龙的宝藏礼包
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
@ -72,26 +72,28 @@ public class SSpecialConfig implements BaseConfig {
|
|||
}
|
||||
return Integer.valueOf(value);
|
||||
}
|
||||
public static int[] getOnceArrayValue(String key){
|
||||
|
||||
public static int[] getOnceArrayValue(String key) {
|
||||
String value = enumers.get(key);
|
||||
String[] array = value.split("\\#");
|
||||
int[] arrayNum = new int[array.length];
|
||||
for (int i = 0 ; i < array.length;i++) {
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
arrayNum[i] = Integer.parseInt(array[i]);
|
||||
}
|
||||
return arrayNum;
|
||||
}
|
||||
public static int[][] getTwiceArrayValue(String key){
|
||||
|
||||
public static int[][] getTwiceArrayValue(String key) {
|
||||
String value = enumers.get(key);
|
||||
String[] array = value.split("\\|");
|
||||
int[][] arrayNum = new int[array.length][];
|
||||
for (int i = 0 ; i < array.length;i++) {
|
||||
String[] temp = array[i].split("\\#");
|
||||
for (int i = 0; i < array.length; i++) {
|
||||
String[] temp = array[i].split("#");
|
||||
int[] tempNum = new int[temp.length];
|
||||
for (int j = 0 ; j < tempNum.length;j++) {
|
||||
for (int j = 0; j < tempNum.length; j++) {
|
||||
tempNum[j] = Integer.parseInt(temp[j]);
|
||||
}
|
||||
arrayNum[i] = tempNum;
|
||||
arrayNum[i] = tempNum;
|
||||
}
|
||||
return arrayNum;
|
||||
}
|
||||
|
@ -113,5 +115,4 @@ public class SSpecialConfig implements BaseConfig {
|
|||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue