Merge branch 'master_test_hw' into master_test_hw_i18n
commit
202943d84f
|
@ -17,7 +17,7 @@ jar {
|
||||||
baseName = 'globalserver'
|
baseName = 'globalserver'
|
||||||
version = '1.0.0'
|
version = '1.0.0'
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'Main-Class': 'com.global.GlobalServerApplivation'
|
attributes 'Main-Class': 'com.global.GlobalServerApplication'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
@ -145,6 +145,9 @@ public class RedisUtil {
|
||||||
String oldName = key[i];
|
String oldName = key[i];
|
||||||
// 新名字
|
// 新名字
|
||||||
String newName = oldName+"BACK:"+System.currentTimeMillis();
|
String newName = oldName+"BACK:"+System.currentTimeMillis();
|
||||||
|
// key是否存在
|
||||||
|
boolean aBoolean = hasKey(oldName);
|
||||||
|
if (aBoolean){
|
||||||
// 重命名
|
// 重命名
|
||||||
redisTemplate.rename(oldName,newName);
|
redisTemplate.rename(oldName,newName);
|
||||||
// 设置过期时间
|
// 设置过期时间
|
||||||
|
@ -152,6 +155,7 @@ public class RedisUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ============================String=============================
|
// ============================String=============================
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -167,6 +167,8 @@ public enum ErrorCode implements IErrorCode {
|
||||||
|
|
||||||
BAG_FULL(135,"背包内存储空间不足,无法领取附件"),
|
BAG_FULL(135,"背包内存储空间不足,无法领取附件"),
|
||||||
|
|
||||||
|
LOCK_FILL(138,"锁定数量已满,无法刷新"),
|
||||||
|
|
||||||
;
|
;
|
||||||
private static final Set<Integer> CodeSet = new HashSet<>();
|
private static final Set<Integer> CodeSet = new HashSet<>();
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,8 @@ import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||||
|
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||||
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
|
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
|
||||||
import com.ljsd.jieling.logic.activity.event.CommitSheJiEvent;
|
import com.ljsd.jieling.logic.activity.event.CommitSheJiEvent;
|
||||||
|
@ -14,6 +16,9 @@ import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
import com.ljsd.jieling.logic.dao.root.GuildInfo;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.logic.rank.RankContext;
|
||||||
|
import com.ljsd.jieling.logic.rank.RankEnum;
|
||||||
|
import com.ljsd.jieling.logic.rank.RankLogic;
|
||||||
import rpc.protocols.ActivityProto;
|
import rpc.protocols.ActivityProto;
|
||||||
import rpc.protocols.CommonProto;
|
import rpc.protocols.CommonProto;
|
||||||
import rpc.protocols.MessageTypeProto;
|
import rpc.protocols.MessageTypeProto;
|
||||||
|
@ -99,7 +104,7 @@ public class CommitShejiActivityItemRequestHandler extends BaseHandler<ActivityP
|
||||||
_result[0][1]= sGodSacrificeSetting.getRewardItemChangRate()[index+3]*proto.getItemNum();
|
_result[0][1]= sGodSacrificeSetting.getRewardItemChangRate()[index+3]*proto.getItemNum();
|
||||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, _result, BIReason.SHEJI_ACTIVITY);
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user, _result, BIReason.SHEJI_ACTIVITY);
|
||||||
guildInfo.setGuildSheJiScore(score+guildInfo.getGuildSheJiScore());
|
guildInfo.setGuildSheJiScore(score+guildInfo.getGuildSheJiScore());
|
||||||
Poster.getPoster().dispatchEvent(new CommitSheJiEvent(guildId,uid,score));
|
Poster.getPoster().dispatchEvent(new CommitSheJiEvent(guildId,uid,score,proto.getItemId(),proto.getItemNum()));
|
||||||
return ActivityProto.CommitShejiActivityItemResponse.newBuilder().setDrop(drop).build();
|
return ActivityProto.CommitShejiActivityItemResponse.newBuilder().setDrop(drop).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ import com.ljsd.jieling.exception.ErrorCode;
|
||||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||||
import com.ljsd.jieling.globals.BIReason;
|
import com.ljsd.jieling.globals.BIReason;
|
||||||
import com.ljsd.jieling.handler.BaseHandler;
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||||
|
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
import com.ljsd.jieling.logic.dao.UserManager;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.fight.*;
|
import com.ljsd.jieling.logic.fight.*;
|
||||||
|
@ -24,6 +26,7 @@ import rpc.protocols.MessageTypeProto;
|
||||||
|
|
||||||
import java.text.NumberFormat;
|
import java.text.NumberFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/***
|
/***
|
||||||
* @author hj
|
* @author hj
|
||||||
|
@ -56,7 +59,7 @@ public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGenera
|
||||||
|
|
||||||
// 读表
|
// 读表
|
||||||
int monsterGroupId = newHeroConfig.getMonsterGroup(); //怪物id
|
int monsterGroupId = newHeroConfig.getMonsterGroup(); //怪物id
|
||||||
long bossBlood = 0; //怪物血量
|
double bossBlood = 0.0; //怪物血量
|
||||||
int[][] hurtList = newHeroConfig.getDropCell(); //伤害奖励表
|
int[][] hurtList = newHeroConfig.getDropCell(); //伤害奖励表
|
||||||
|
|
||||||
SMonsterGroup sMonsterGroup = SMonsterGroup.getsMonsterGroupMap().get(monsterGroupId);
|
SMonsterGroup sMonsterGroup = SMonsterGroup.getsMonsterGroupMap().get(monsterGroupId);
|
||||||
|
@ -98,22 +101,25 @@ public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGenera
|
||||||
// 战斗结果,第二位是伤害
|
// 战斗结果,第二位是伤害
|
||||||
int[] checkResult = fightResult.getCheckResult();
|
int[] checkResult = fightResult.getCheckResult();
|
||||||
|
|
||||||
// 设置小数点后4位
|
double lessBlood = 0.0;
|
||||||
NumberFormat numberFormat = NumberFormat.getInstance();
|
int hurtResult = 0;
|
||||||
numberFormat.setMaximumFractionDigits(4);
|
|
||||||
long lessBlood = 0;
|
|
||||||
// checkResult第一位输赢,1赢,其他输
|
// checkResult第一位输赢,1赢,其他输
|
||||||
if (checkResult[0] == 1){
|
if (checkResult[0] == 1){
|
||||||
lessBlood = bossBlood;
|
lessBlood = bossBlood;
|
||||||
|
hurtResult = checkResult[1];
|
||||||
}else {
|
}else {
|
||||||
// checkResult第三位开始为血量,下标0开始
|
// checkResult第三位开始为血量,下标0开始
|
||||||
for (int i = 2; i < checkResult.length; i++) {
|
for (int i = 2; i < checkResult.length; i++) {
|
||||||
lessBlood+=checkResult[i];
|
lessBlood+=checkResult[i];
|
||||||
}
|
}
|
||||||
|
lessBlood = bossBlood - lessBlood;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 伤害/血量 ,用float表示
|
// 伤害/血量 ,用float表示
|
||||||
String blood = numberFormat.format((float)lessBlood/(float)bossBlood);
|
// 设置小数点后4位
|
||||||
|
NumberFormat nf = NumberFormat.getInstance();
|
||||||
|
nf.setMaximumFractionDigits(4);
|
||||||
|
String blood = nf.format(lessBlood/bossBlood);
|
||||||
// 表里面配置的伤害是万分比,所以这里的概率乘以10000
|
// 表里面配置的伤害是万分比,所以这里的概率乘以10000
|
||||||
float b = Float.parseFloat(blood)*10000;
|
float b = Float.parseFloat(blood)*10000;
|
||||||
|
|
||||||
|
@ -122,17 +128,22 @@ public class NewGeneralAttackHandler extends BaseHandler<ActivityProto.NewGenera
|
||||||
|
|
||||||
// 道具逻辑,封装好的
|
// 道具逻辑,封装好的
|
||||||
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder();
|
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder();
|
||||||
|
// 战报返回
|
||||||
|
List<String> dropResult = new ArrayList<>();
|
||||||
|
|
||||||
for (int i = 0; i < hurtList.length; i++) {
|
for (int i = 0; i < hurtList.length; i++) {
|
||||||
// 当前类型奖励次数
|
// 当前类型奖励次数
|
||||||
float v = b / hurtList[i][0];
|
float v = b / hurtList[i][0];
|
||||||
dropList[0] = hurtList[i][1];
|
dropList[0] = hurtList[i][1];
|
||||||
ItemUtil.drop(user, dropList,drop,v,0, BIReason.NEW_GENERAL_ATTACK);
|
ItemUtil.drop(user, dropList,drop,v,0, BIReason.NEW_GENERAL_ATTACK);
|
||||||
System.out.println();
|
dropResult.add(dropList[0] + "#" + v);
|
||||||
}
|
}
|
||||||
// 消耗道具
|
// 消耗道具
|
||||||
PlayerLogic.getInstance().checkAndUpdate(user, proto.getPrivilageTypeId(),1);
|
PlayerLogic.getInstance().checkAndUpdate(user, proto.getPrivilageTypeId(),1);
|
||||||
|
|
||||||
|
// 埋点
|
||||||
|
ReportUtil.onReportEvent(user, ReportEventEnum.VANQUISH_BOSS.getType(), monsterGroupId,checkResult[0],hurtResult,dropResult);
|
||||||
|
|
||||||
return ActivityProto.NewGeneralAttackResponse.newBuilder().setFightData(fightData).setDrop(drop).build();
|
return ActivityProto.NewGeneralAttackResponse.newBuilder().setFightData(fightData).setDrop(drop).build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,11 +14,8 @@ import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||||
import com.ljsd.jieling.logic.activity.event.ArenaChallengeEvent;
|
import com.ljsd.jieling.logic.activity.event.ArenaChallengeEvent;
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
import com.ljsd.jieling.logic.arena.ArenaLogic;
|
||||||
import com.ljsd.jieling.logic.dao.ArenaEnemy;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.ArenaManager;
|
|
||||||
import com.ljsd.fight.ArenaRecord;
|
import com.ljsd.fight.ArenaRecord;
|
||||||
import com.ljsd.jieling.logic.dao.Item;
|
|
||||||
import com.ljsd.jieling.logic.dao.UserManager;
|
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||||
import com.ljsd.jieling.logic.rank.RankContext;
|
import com.ljsd.jieling.logic.rank.RankContext;
|
||||||
|
@ -34,6 +31,7 @@ import config.SArenaSetting;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
|
@ -151,6 +149,67 @@ public class ArenaChallengeHandler extends BaseHandler<ArenaInfoProto.ArenaChall
|
||||||
}
|
}
|
||||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ARENA_CHALLENGE_RESPONSE_VALUE,build,true);
|
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.ARENA_CHALLENGE_RESPONSE_VALUE,build,true);
|
||||||
// KtEventUtils.onKtEvent(user, ParamEventBean.UserGameType, KTGameType.ARENA.getIndex(),challengeUid);
|
// KtEventUtils.onKtEvent(user, ParamEventBean.UserGameType, KTGameType.ARENA.getIndex(),challengeUid);
|
||||||
ReportUtil.onReportEvent(user,ReportEventEnum.ARENA_CHALLENGE.getType(),fightResult==0?"失败":"成功",myscoreChange,dropBuilder.toString());
|
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||||
|
String[] heroes = new String[]{"","","","","",""};
|
||||||
|
|
||||||
|
|
||||||
|
for(TeamPosHeroInfo info:teamPosHeroInfos){
|
||||||
|
StringBuilder builderHero = new StringBuilder();
|
||||||
|
String heroId = info.getHeroId();
|
||||||
|
int position = info.getPosition();
|
||||||
|
|
||||||
|
Hero hero = user.getHeroManager().getHero(heroId);
|
||||||
|
builderHero.append(hero.getTemplateId()).append("-").append(hero.getStar()).append("-").append(hero.getLevel());
|
||||||
|
heroes[position-1] = builderHero.toString();
|
||||||
|
}
|
||||||
|
PokemonManager pokemonManager = user.getPokemonManager();
|
||||||
|
Map<Integer, String> pokemonTeamMap = pokemonManager.getPokemonTeamMap();
|
||||||
|
StringBuilder builderPokemon = new StringBuilder();
|
||||||
|
for(Map.Entry<Integer,String> entry:pokemonTeamMap.entrySet()){
|
||||||
|
if(builderPokemon.length()!=0){
|
||||||
|
builderPokemon.append(",");
|
||||||
|
}
|
||||||
|
String value = entry.getValue();
|
||||||
|
Pokemon pokemon = pokemonManager.getPokemonMap().get(value);
|
||||||
|
if(pokemon==null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
builderPokemon.append(pokemon.getTmpId()).append("-").append(pokemon.getLevel()).append("-").append(pokemon.getStar());
|
||||||
|
}
|
||||||
|
String[] defHeroes = new String[]{"","","","","",""};
|
||||||
|
StringBuilder defBuilderPokemon = new StringBuilder();
|
||||||
|
|
||||||
|
if(defUser!=null){
|
||||||
|
List<TeamPosHeroInfo> defteamPosHeroInfos = defUser.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||||
|
for(TeamPosHeroInfo info:defteamPosHeroInfos){
|
||||||
|
StringBuilder builderHero = new StringBuilder();
|
||||||
|
String heroId = info.getHeroId();
|
||||||
|
int position = info.getPosition();
|
||||||
|
|
||||||
|
Hero hero = defUser.getHeroManager().getHero(heroId);
|
||||||
|
builderHero.append(hero.getTemplateId()).append("-").append(hero.getStar()).append("-").append(hero.getLevel());
|
||||||
|
defHeroes[position-1] = builderHero.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<Integer, String> defPokemonTeamMap = defUser.getPokemonManager().getPokemonTeamMap();
|
||||||
|
for(Map.Entry<Integer,String> entry:defPokemonTeamMap.entrySet()){
|
||||||
|
if(defBuilderPokemon.length()!=0){
|
||||||
|
defBuilderPokemon.append(",");
|
||||||
|
}
|
||||||
|
String value = entry.getValue();
|
||||||
|
Pokemon pokemon = defUser.getPokemonManager().getPokemonMap().get(value);
|
||||||
|
if(pokemon==null){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
defBuilderPokemon.append(pokemon.getTmpId()).append("-").append(pokemon.getLevel()).append("-").append(pokemon.getStar());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(enemyType==GlobalsDef.ARENA_ROBOT_TYPE){
|
||||||
|
ReportUtil.onReportEvent(user,ReportEventEnum.ARENA_CHALLENGE.getType(),fightResult==0?"失败":"成功",myscoreChange,dropBuilder.toString(),myscore+myscoreChange,rank.getRankIndexByKey(String.valueOf(curSeason),uid),challengeUid,defScoreChange,defScore-myscoreChange,rank.getRankIndexByKey(String.valueOf(curSeason),challengeUid),heroes[0],heroes[1],heroes[2],heroes[3],heroes[4],heroes[5],builderPokemon.toString());
|
||||||
|
}else{
|
||||||
|
ReportUtil.onReportEvent(user,ReportEventEnum.ARENA_CHALLENGE.getType(),fightResult==0?"失败":"成功",myscoreChange,dropBuilder.toString(),myscore+myscoreChange,rank.getRankIndexByKey(String.valueOf(curSeason),uid),challengeUid,defScoreChange,defScore-myscoreChange,rank.getRankIndexByKey(String.valueOf(curSeason),challengeUid),heroes[0],heroes[1],heroes[2],heroes[3],heroes[4],heroes[5],builderPokemon.toString(),defHeroes[0],defHeroes[1],defHeroes[2],defHeroes[3],defHeroes[4],defHeroes[5],defBuilderPokemon.toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,6 @@ public class GuildSkillLevelUpHandler extends BaseHandler<Family.GuildSkillLevel
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void processWithProto(ISession iSession, Family.GuildSkillLevelUpRequest proto) throws Exception {
|
public void processWithProto(ISession iSession, Family.GuildSkillLevelUpRequest proto) throws Exception {
|
||||||
GuildLogic.guildSkillLevelUp(iSession,proto.getType(), MessageTypeProto.MessageType.GUILD_SKILL_LEVEL_UP_RESPONSE);
|
GuildLogic.guildSkillLevelUp(iSession,proto.getType(),proto.getBeforeLevel(),proto.getAfterLevel(), MessageTypeProto.MessageType.GUILD_SKILL_LEVEL_UP_RESPONSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2810,6 +2810,30 @@ public class MapLogic {
|
||||||
this.endlessSeason = season;
|
this.endlessSeason = season;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 清理无尽副本道具
|
||||||
|
* @param session
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void clearEndLessDrop(int uid) throws Exception {
|
||||||
|
User user = UserManager.getUser(uid);
|
||||||
|
// 根据功能类型获取需要清理的道具列表
|
||||||
|
List<SItem> itemList = SItem.getItemMapByRecycle().get(FunctionIdEnum.Endless.getFunctionType());
|
||||||
|
if (itemList == null || itemList.isEmpty()){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (SItem item:itemList){
|
||||||
|
// 获取玩家背包道具并消耗
|
||||||
|
Item item1 = user.getItemManager().getItem(item.getId());
|
||||||
|
if(item1!=null){
|
||||||
|
int[][] cost= new int[1][];
|
||||||
|
cost[0] = new int[]{item1.getItemId(),item1.getItemNum()};
|
||||||
|
ItemUtil.itemCost(user,cost,BIReason.ENDLESS_REASON_CHANGE,0);
|
||||||
|
System.out.println("======================清理无尽副本道具,玩家:{ " + uid + " },道具id:{ " + item1.getItemId() + " }");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 无尽副本设置当前mapId
|
* 无尽副本设置当前mapId
|
||||||
* @param endlessMapId
|
* @param endlessMapId
|
||||||
|
@ -2908,6 +2932,8 @@ public class MapLogic {
|
||||||
|
|
||||||
for(Map.Entry<Integer, ISession> entry:onlineUserMap.entrySet()){
|
for(Map.Entry<Integer, ISession> entry:onlineUserMap.entrySet()){
|
||||||
endLessClear(entry.getValue());
|
endLessClear(entry.getValue());
|
||||||
|
// 清理无尽副本道具
|
||||||
|
clearEndLessDrop(entry.getValue().getUid());
|
||||||
}
|
}
|
||||||
updateEndlessSeason(0);
|
updateEndlessSeason(0);
|
||||||
}
|
}
|
||||||
|
@ -3201,8 +3227,26 @@ public class MapLogic {
|
||||||
trailHero.setSkinTime(skinTime);
|
trailHero.setSkinTime(skinTime);
|
||||||
heroInfo.put(id,trailHero);
|
heroInfo.put(id,trailHero);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MapInfoProto.TrialHeroInfoSaveResponse.Builder response = MapInfoProto.TrialHeroInfoSaveResponse.newBuilder();
|
||||||
|
for(Map.Entry<String,TrailHero> entry:heroInfo.entrySet()){
|
||||||
|
TrailHero trailHero = entry.getValue();
|
||||||
|
int remainHp = trailHero.getProperty().get(HeroAttributeEnum.CurHP.getPropertyId());
|
||||||
|
int maxHp = trailHero.getProperty().get(HeroAttributeEnum.Hp.getPropertyId());
|
||||||
|
//判断血量万分比,如果小于0.01%返回0.01%
|
||||||
|
int calHp = remainHp>0? (int) (remainHp * 10000D / maxHp > 0 ? remainHp * 10000D / maxHp : 1) :0;
|
||||||
|
MapInfoProto.TrialHeroInfo info = MapInfoProto.TrialHeroInfo.newBuilder().setHeroId(entry.getKey())
|
||||||
|
.setTmpId(trailHero.getTmpId())
|
||||||
|
.setHeroHp(calHp)
|
||||||
|
.setStar(trailHero.getStar())
|
||||||
|
.setLevel(trailHero.getLevel())
|
||||||
|
.setSkinId(trailHero.getSkinId())
|
||||||
|
.build();
|
||||||
|
response.addHeroes(info);
|
||||||
|
}
|
||||||
|
|
||||||
mapManager.updateTrailHeroInfo(heroInfo);
|
mapManager.updateTrailHeroInfo(heroInfo);
|
||||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -65,6 +65,7 @@ public class EndlessMap extends AbstractMap{
|
||||||
}
|
}
|
||||||
EndlessMapInfo endlessMapInfo = mapManager.getEndlessMapInfo();
|
EndlessMapInfo endlessMapInfo = mapManager.getEndlessMapInfo();
|
||||||
//是否是新的周期
|
//是否是新的周期
|
||||||
|
LOGGER.info("======================无尽副本,周期验证;用户:{ },,内存:{ }",endlessMapInfo.getSeason() , MapLogic.endlessSeason);
|
||||||
if(endlessMapInfo.getSeason()!=MapLogic.endlessSeason){
|
if(endlessMapInfo.getSeason()!=MapLogic.endlessSeason){
|
||||||
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Endless);
|
TimeControllerOfFunction openTimeOfFuntionCacheByType = GlobalDataManaager.getInstance().getOpenTimeOfFuntionCacheByType(FunctionIdEnum.Endless);
|
||||||
// StoreLogic.initOnsStoereWithTime(user, SEndlessMapConfig.sEndlessMapConfigMap.get(4001).getMapStoreId(),openTimeOfFuntionCacheByType.getStartTime(),openTimeOfFuntionCacheByType.getEndTime());
|
// StoreLogic.initOnsStoereWithTime(user, SEndlessMapConfig.sEndlessMapConfigMap.get(4001).getMapStoreId(),openTimeOfFuntionCacheByType.getStartTime(),openTimeOfFuntionCacheByType.getEndTime());
|
||||||
|
@ -73,7 +74,8 @@ public class EndlessMap extends AbstractMap{
|
||||||
mapManager.endlessWalkCellSave(new HashSet<>());
|
mapManager.endlessWalkCellSave(new HashSet<>());
|
||||||
mapManager.endlessMapInfoSave(new HashMap<>());
|
mapManager.endlessMapInfoSave(new HashMap<>());
|
||||||
//清除当前副本信息
|
//清除当前副本信息
|
||||||
|
// 清理无尽副本道具
|
||||||
|
MapLogic.getInstance().clearEndLessDrop(uid);
|
||||||
//新创建地图
|
//新创建地图
|
||||||
mapManager.setCurMapType(type);
|
mapManager.setCurMapType(type);
|
||||||
// enterNewMap(user,4001,GlobalsDef.ENDLESS_TEAM,mapEnterResponse);
|
// enterNewMap(user,4001,GlobalsDef.ENDLESS_TEAM,mapEnterResponse);
|
||||||
|
@ -443,9 +445,9 @@ public class EndlessMap extends AbstractMap{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// SChallengeMapConfig challengeMapConfig = STableManager.getConfig(SChallengeMapConfig.class).get(mapId);
|
SChallengeMapConfig challengeMapConfig = STableManager.getConfig(SChallengeMapConfig.class).get(mapId);
|
||||||
// int xy = CellUtil.xy2Pos(challengeMapConfig.getPosition()[0], challengeMapConfig.getPosition()[1]);
|
int xy = CellUtil.xy2Pos(challengeMapConfig.getPosition()[0], challengeMapConfig.getPosition()[1]);
|
||||||
// mapManager.setCurXY(xy);
|
mapManager.setCurXY(xy);
|
||||||
mapManager.setCurMapId(mapId);
|
mapManager.setCurMapId(mapId);
|
||||||
initMapMission(user,newMap);
|
initMapMission(user,newMap);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.ljsd.jieling.handler.missingRoom;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
import com.ljsd.jieling.logic.mission.MissionLoigc;
|
||||||
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import rpc.protocols.MessageTypeProto;
|
||||||
|
import rpc.protocols.PlayerInfoProto;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 天宫探险上锁
|
||||||
|
* @author hj
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class MissingRoomLockHandler extends BaseHandler<PlayerInfoProto.MissingRoomLockRequest> {
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return MessageTypeProto.MessageType.MISSING_ROOM_LOCK_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processWithProto(ISession iSession, PlayerInfoProto.MissingRoomLockRequest proto) throws Exception {
|
||||||
|
MissionLoigc.missiongRoomLock(iSession,proto.getMissionId(),proto.getLock(),MessageTypeProto.MessageType.MISSING_ROOM_LOCK_RESPONSE);
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,6 +17,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 天宫寻宝刷新
|
||||||
* @author lvxinran
|
* @author lvxinran
|
||||||
* @date 2019/12/12
|
* @date 2019/12/12
|
||||||
* @discribe
|
* @discribe
|
||||||
|
|
|
@ -8,8 +8,9 @@ import rpc.protocols.PlayerInfoProto;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 天宫寻宝探险
|
||||||
* @author lvxinran
|
* @author lvxinran
|
||||||
* @date 2019/12/12
|
* @date 2019/12/12MISSING_ROOM_HERO_SEND_REQUEST
|
||||||
* @discribe
|
* @discribe
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
|
|
|
@ -41,7 +41,6 @@ public class HotfixUtil implements IEventHandler {
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(IEvent event) throws Exception {
|
public void onEvent(IEvent event) throws Exception {
|
||||||
doWork(SysUtil.getPath("conf/hotfix.json"));
|
doWork(SysUtil.getPath("conf/hotfix.json"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doWork(String pathName){
|
private void doWork(String pathName){
|
||||||
|
|
|
@ -15,85 +15,87 @@ public enum ReportEventEnum {
|
||||||
CREATE_ACCOUNT(1,"create_account", new CreateRoleEventHandler(),new String[]{""}),
|
CREATE_ACCOUNT(1,"create_account", new CreateRoleEventHandler(),new String[]{""}),
|
||||||
APP_LOGIN(2,"app_login", new LoginEventHandler(),new String[]{""}),
|
APP_LOGIN(2,"app_login", new LoginEventHandler(),new String[]{""}),
|
||||||
CREATE_ROLE(3,"create_role", new CreateRoleEventHandler(),new String[]{"role_name"}),
|
CREATE_ROLE(3,"create_role", new CreateRoleEventHandler(),new String[]{"role_name"}),
|
||||||
// GUIDE(4,"guide", new CommonEventHandler(),new String[]{"step_id"}),
|
// GUIDE(4,"guide", CommonEventHandler.getInstance(),new String[]{"step_id"}),
|
||||||
LEVEL_UP(5,"level_up", new UserLevelUpEventHandler(),new String[]{"level","promotion_level","improved_level"}),
|
LEVEL_UP(5,"level_up", new UserLevelUpEventHandler(),new String[]{"level","promotion_level","improved_level"}),
|
||||||
MISSION_START(6,"mission_start", new CommonEventHandler(),new String[]{"mission_id","mission_name"}),
|
MISSION_START(6,"mission_start", CommonEventHandler.getInstance(),new String[]{"mission_id","mission_name"}),
|
||||||
MISSION_COMPLETE(7,"mission_complete", new CommonEventHandler(),new String[]{"mission_id","mission_name","reward_list","mission_start_time"}),
|
MISSION_COMPLETE(7,"mission_complete", CommonEventHandler.getInstance(),new String[]{"mission_id","mission_name","reward_list","mission_start_time"}),
|
||||||
JOIN_ACTIVITY(8,"join_activity", new CommonEventHandler(),new String[]{"activity_id","activity_name"}),
|
JOIN_ACTIVITY(8,"join_activity", CommonEventHandler.getInstance(),new String[]{"activity_id","activity_name"}),
|
||||||
COMPLETE_ACTIVITY(9,"complete_activity", new CommonEventHandler(),new String[]{"activity_id","mission_id","rewards_id_list","rewards_num_list","take_time"}),
|
COMPLETE_ACTIVITY(9,"complete_activity", CommonEventHandler.getInstance(),new String[]{"activity_id","mission_id","rewards_id_list","rewards_num_list","take_time"}),
|
||||||
ENTER_STAGE(10,"enter_stage", new CommonEventHandler(),new String[]{"stage_id","stage_name"}),
|
ENTER_STAGE(10,"enter_stage", CommonEventHandler.getInstance(),new String[]{"stage_id","stage_name"}),
|
||||||
PASS_STAGE(11,"pass_stage", new PassStageEventHandler(),new String[]{"stage_id","stage_name"}),
|
PASS_STAGE(11,"pass_stage", new PassStageEventHandler(),new String[]{"stage_id","stage_name"}),
|
||||||
GET_HERO(12,"get_hero", new CommonEventHandler(),new String[]{"hero_id","quality","get_type"}),
|
GET_HERO(12,"get_hero", CommonEventHandler.getInstance(),new String[]{"hero_id","quality","get_type"}),
|
||||||
HERO_STRENGTHEN(13,"hero_strengthen", new CommonEventHandler(),new String[]{"hero_id","old_quality","new_quality","strengthen_type","cost_item_list","cost_hero_list"}),
|
HERO_STRENGTHEN(13,"hero_strengthen", CommonEventHandler.getInstance(),new String[]{"hero_id","old_quality","new_quality","strengthen_type","cost_item_list","cost_hero_list"}),
|
||||||
GET_EQUIP(14,"get_equip", new CommonEventHandler(),new String[]{"equip_id","quality","get_type"}),
|
GET_EQUIP(14,"get_equip", CommonEventHandler.getInstance(),new String[]{"equip_id","quality","get_type"}),
|
||||||
EQUIP_STRENGTHEN(15,"equip_strengthen", new CommonEventHandler(),new String[]{"equip_id","old_quality","new_quality","strengthen_type","cost_item_list"}),
|
EQUIP_STRENGTHEN(15,"equip_strengthen", CommonEventHandler.getInstance(),new String[]{"equip_id","old_quality","new_quality","strengthen_type","cost_item_list"}),
|
||||||
GET_ITEM(16,"get_item", new CommonEventHandler(),new String[]{"get_amount","get_entrance","item_id","item_name","price"}),
|
GET_ITEM(16,"get_item", CommonEventHandler.getInstance(),new String[]{"get_amount","get_entrance","item_id","item_name","price"}),
|
||||||
COST_ITEM(17,"cost_item", new CommonEventHandler(),new String[]{"cost_amount","cost_entrance","item_id","item_name"}),
|
COST_ITEM(17,"cost_item", CommonEventHandler.getInstance(),new String[]{"cost_amount","cost_entrance","item_id","item_name"}),
|
||||||
GET_COINS(18,"get_coins", new CommonEventHandler(),new String[]{"get_amount","get_entrance","price"}),
|
GET_COINS(18,"get_coins", CommonEventHandler.getInstance(),new String[]{"get_amount","get_entrance","price"}),
|
||||||
COST_COINS(19,"cost_coins", new CommonEventHandler(),new String[]{"cost_amount","cost_entrance"}),
|
COST_COINS(19,"cost_coins", CommonEventHandler.getInstance(),new String[]{"cost_amount","cost_entrance"}),
|
||||||
GET_AMULET(20,"get_amulet", new CommonEventHandler(),new String[]{"get_amount","get_entrance","price"}),
|
GET_AMULET(20,"get_amulet", CommonEventHandler.getInstance(),new String[]{"get_amount","get_entrance","price"}),
|
||||||
COST_AMULET(21,"cost_amulet", new CommonEventHandler(),new String[]{"cost_amount","cost_entrance"}),
|
COST_AMULET(21,"cost_amulet", CommonEventHandler.getInstance(),new String[]{"cost_amount","cost_entrance"}),
|
||||||
GET_DIAMOND(22,"get_diamond", new CommonEventHandler(),new String[]{"get_amount","get_entrance","price"}),
|
GET_DIAMOND(22,"get_diamond", CommonEventHandler.getInstance(),new String[]{"get_amount","get_entrance","price"}),
|
||||||
COST_DIAMOND(23,"cost_diamond", new CommonEventHandler(),new String[]{"cost_amount","cost_entrance"}),
|
COST_DIAMOND(23,"cost_diamond", CommonEventHandler.getInstance(),new String[]{"cost_amount","cost_entrance"}),
|
||||||
CREATE_GUILD(24,"create_guild", new CommonEventHandler(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity"}),
|
CREATE_GUILD(24,"create_guild", CommonEventHandler.getInstance(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity"}),
|
||||||
JOIN_GUILD(25,"join_guild", new CommonEventHandler(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity","guild_create_time"}),
|
JOIN_GUILD(25,"join_guild", CommonEventHandler.getInstance(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity","guild_create_time"}),
|
||||||
QUIT_GUILD(26,"quit_guild", new CommonEventHandler(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity","guild_create_time"}),
|
QUIT_GUILD(26,"quit_guild", CommonEventHandler.getInstance(),new String[]{"guild_id","guild_name","guild_level","guild_people_num","guild_fighting_capacity","guild_create_time"}),
|
||||||
CREATE_ORDER(27,"create_order", new CommonEventHandler(),new String[]{"order_id","order_money_amount","Bundle_id","entrance","item_id","item_name","goods_id","item_list"}),
|
CREATE_ORDER(27,"create_order", CommonEventHandler.getInstance(),new String[]{"order_id","order_money_amount","Bundle_id","entrance","item_id","item_name","goods_id","item_list"}),
|
||||||
ORDER_COMPLETE(28,"order_complete", new ChargeAmountEventHandler(),new String[]{"order_id","order_money_amount","Bundle_id","channel_id","server_id","goods_id","goods_name","rewards_id_list","rewards_num_list","charge_time","device_id"}),
|
ORDER_COMPLETE(28,"order_complete", new ChargeAmountEventHandler(),new String[]{"order_id","order_money_amount","Bundle_id","channel_id","server_id","goods_id","goods_name","rewards_id_list","rewards_num_list","charge_time","device_id"}),
|
||||||
CHECK_RANKING(29,"check_ranking", new CommonEventHandler(),new String[]{"ranking_type"}),
|
CHECK_RANKING(29,"check_ranking", CommonEventHandler.getInstance(),new String[]{"ranking_type"}),
|
||||||
ASK_FOR_BEING_FRIENDS(30,"ask_for_being_friends", new CommonEventHandler(),new String[]{"target_id","target_name","target_level","entrance"}),
|
ASK_FOR_BEING_FRIENDS(30,"ask_for_being_friends", CommonEventHandler.getInstance(),new String[]{"target_id","target_name","target_level","entrance"}),
|
||||||
ALLOW_FRIENDS_ASK(31,"allow_friends_ask", new CommonEventHandler(),new String[]{"target_id","target_name","target_level","entrance"}),
|
ALLOW_FRIENDS_ASK(31,"allow_friends_ask", CommonEventHandler.getInstance(),new String[]{"target_id","target_name","target_level","entrance"}),
|
||||||
SEND_MESSAGE(32,"send_message", new CommonEventHandler(),new String[]{"message_type","message_content","send_time"}),
|
SEND_MESSAGE(32,"send_message", CommonEventHandler.getInstance(),new String[]{"message_type","message_content","send_time"}),
|
||||||
OPEN_MAIL(33,"open_mail", new CommonEventHandler(),new String[]{""}),
|
OPEN_MAIL(33,"open_mail", CommonEventHandler.getInstance(),new String[]{""}),
|
||||||
//-------新一期
|
//-------新一期
|
||||||
COMPLETE_DAILY_DUNGEON(35,"complete_daily_dungeon", new CommonEventHandler(),new String[]{"stage_id","stage_type","enemy_id","enemy_capacity","start_time","enemy_hero_list","left_challenge_nums","rewards_id_list","rewards_num_list","pass_type","Combat_results"}),
|
COMPLETE_DAILY_DUNGEON(35,"complete_daily_dungeon", CommonEventHandler.getInstance(),new String[]{"stage_id","stage_type","enemy_id","enemy_capacity","start_time","enemy_hero_list","left_challenge_nums","rewards_id_list","rewards_num_list","pass_type","Combat_results"}),
|
||||||
|
|
||||||
COMPLETE_XINMO(37,"complete_xinmo", new CommonEventHandler(),new String[]{"stage_id","enemy_id","enemy_capacity","start_time","enemy_hero_list","rewards_id_list","rewards_num_list","Combat_results"}),
|
COMPLETE_XINMO(37,"complete_xinmo", CommonEventHandler.getInstance(),new String[]{"stage_id","enemy_id","enemy_capacity","start_time","enemy_hero_list","rewards_id_list","rewards_num_list","Combat_results"}),
|
||||||
|
|
||||||
COMPLETE_CHECHI(39,"start_chechi", new CommonEventHandler(),new String[]{"stage_id","stage_type","Integral_entrance","Integral"}),
|
COMPLETE_CHECHI(39,"start_chechi", CommonEventHandler.getInstance(),new String[]{"stage_id","stage_type","Integral_entrance","Integral"}),
|
||||||
|
|
||||||
START_PANOPTIC_MIRROR(40,"start_panoptic_mirror",new CommonEventHandler(),new String[]{"Panoptic_Mirror_id"}),
|
START_PANOPTIC_MIRROR(40,"start_panoptic_mirror",CommonEventHandler.getInstance(),new String[]{"Panoptic_Mirror_id"}),
|
||||||
|
|
||||||
CHALLENGE_PANOPTIC_MIRROR_ENEMY(41,"challenge_panoptic_mirror_enemy", new CommonEventHandler(),new String[]{"Panoptic_Mirror_id","battle_result","hero_id"}),
|
CHALLENGE_PANOPTIC_MIRROR_ENEMY(41,"challenge_panoptic_mirror_enemy", CommonEventHandler.getInstance(),new String[]{"Panoptic_Mirror_id","battle_result","hero_id"}),
|
||||||
|
|
||||||
COMPLETE_PANOPTIC_MIRROR(42,"complete_panoptic_mirror", new CommonEventHandler(),new String[]{"Panoptic_Mirror_id"}),
|
COMPLETE_PANOPTIC_MIRROR(42,"complete_panoptic_mirror", CommonEventHandler.getInstance(),new String[]{"Panoptic_Mirror_id"}),
|
||||||
|
|
||||||
EQUIP_SYNTHESIS(43,"equip_synthesis", new CommonEventHandler(),new String[]{"item_id_num","cost_item_id","cost_items_amount"}),
|
EQUIP_SYNTHESIS(43,"equip_synthesis", CommonEventHandler.getInstance(),new String[]{"item_id_num","cost_item_id","cost_items_amount"}),
|
||||||
|
|
||||||
TREASURE_SYNTHESIS(44,"treasure_synthesis", new CommonEventHandler(),new String[]{"item_id_num","cost_item_id","cost_items_amount"}),
|
TREASURE_SYNTHESIS(44,"treasure_synthesis", CommonEventHandler.getInstance(),new String[]{"item_id_num","cost_item_id","cost_items_amount"}),
|
||||||
|
|
||||||
FATALITY_SYNTHESIS(45,"fatality_synthesis", new CommonEventHandler(),new String[]{"item_id","item_name","cost_item_id"}),
|
FATALITY_SYNTHESIS(45,"fatality_synthesis", CommonEventHandler.getInstance(),new String[]{"item_id","item_name","cost_item_id"}),
|
||||||
NORMAL_SUMMON(46,"Normal_summon", new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
NORMAL_SUMMON(46,"Normal_summon", CommonEventHandler.getInstance(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||||
|
|
||||||
FRIENDSHIP_SUMMON(47,"friendship_summon", new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
FRIENDSHIP_SUMMON(47,"friendship_summon", CommonEventHandler.getInstance(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||||
|
|
||||||
GODS_SUMMON(48,"gods_summon", new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
GODS_SUMMON(48,"gods_summon", CommonEventHandler.getInstance(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||||
|
|
||||||
SUMMON_HERO(49,"summon_hero", new CommonEventHandler(),new String[]{"item_id","hero_group","get_amount"}),//四元阵
|
SUMMON_HERO(49,"summon_hero", CommonEventHandler.getInstance(),new String[]{"item_id","hero_group","get_amount"}),//四元阵
|
||||||
|
|
||||||
HERO_COMPOSITION(50,"hero_composition", new CommonEventHandler(),new String[]{"hero_id","hero_level","hero_quality","reward_list","reward_nums_list"}),
|
HERO_COMPOSITION(50,"hero_composition", CommonEventHandler.getInstance(),new String[]{"hero_id","hero_level","hero_quality","reward_list","reward_nums_list"}),
|
||||||
|
|
||||||
SEND_HERO(51,"send_hero", new CommonEventHandler(),new String[]{"hero_id","hero_level_list","hero_quality_list","reward_list","reward_nums_list"}),
|
SEND_HERO(51,"send_hero", CommonEventHandler.getInstance(),new String[]{"hero_id","hero_level_list","hero_quality_list","reward_list","reward_nums_list"}),
|
||||||
TREASURE_DECOMPOSITION(52,"treasure_decomposition", new CommonEventHandler(),new String[]{"cost_item_list","reward_list","reward_nums_list"}),
|
TREASURE_DECOMPOSITION(52,"treasure_decomposition", CommonEventHandler.getInstance(),new String[]{"cost_item_list","reward_list","reward_nums_list"}),
|
||||||
|
|
||||||
START_TIANGONG(53,"start_tiangong",new CommonEventHandler(),new String[]{"stage_level","stage_id","stage_type","Combat_results","rewards_id_list","rewards_num_list"}),
|
START_TIANGONG(53,"start_tiangong",CommonEventHandler.getInstance(),new String[]{"stage_level","stage_id","stage_type","Combat_results","rewards_id_list","rewards_num_list"}),
|
||||||
TREASURE_COMPOSITION(54,"treasure_composition",new CommonEventHandler(),new String[]{"hero_id","item_level","reward_list","reward_nums_list"}),
|
TREASURE_COMPOSITION(54,"treasure_composition",CommonEventHandler.getInstance(),new String[]{"hero_id","item_level","reward_list","reward_nums_list"}),
|
||||||
|
|
||||||
LEAVE_PANOPTIC_MIRROR(55,"leave_panoptic_mirror",new CommonEventHandler(),new String[]{"Panoptic_Mirror_id"}),
|
LEAVE_PANOPTIC_MIRROR(55,"leave_panoptic_mirror",CommonEventHandler.getInstance(),new String[]{"Panoptic_Mirror_id"}),
|
||||||
TIME_SUMMON(56,"Time_summon",new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
TIME_SUMMON(56,"Time_summon",CommonEventHandler.getInstance(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||||
FATALITY_SUMMON(57,"fatality_summon",new CommonEventHandler(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
FATALITY_SUMMON(57,"fatality_summon",CommonEventHandler.getInstance(),new String[]{"hero_id","summon_type","cost_item_id","cost_amount","hero_id_quality_list"}),
|
||||||
GET_BEAST(58,"get_beast",new CommonEventHandler(),new String[]{"beast_id","quality","get_type"}),
|
GET_BEAST(58,"get_beast",CommonEventHandler.getInstance(),new String[]{"beast_id","quality","get_type"}),
|
||||||
BEAST_LEVEL(59,"beast_level",new CommonEventHandler(),new String[]{"beast_id","old_level","new_level","cost_item_list_info"}),
|
BEAST_LEVEL(59,"beast_level",CommonEventHandler.getInstance(),new String[]{"beast_id","old_level","new_level","cost_item_list_info"}),
|
||||||
BEAST_STAR(60,"beast_star",new CommonEventHandler(),new String[]{"beast_id","old_star","new_star","cost_item_list","cost_beast_list"}),
|
BEAST_STAR(60,"beast_star",CommonEventHandler.getInstance(),new String[]{"beast_id","old_star","new_star","cost_item_list","cost_beast_list"}),
|
||||||
BEAST_SUMMON(61,"beast_summon",new CommonEventHandler(),new String[]{"beast_id","summon_type","cost_item_id","cost_amount","reward_nums_list"}),
|
BEAST_SUMMON(61,"beast_summon",CommonEventHandler.getInstance(),new String[]{"beast_id","summon_type","cost_item_id","cost_amount","reward_nums_list"}),
|
||||||
BEAST_CABINET(62,"beast_cabinet",new CommonEventHandler(),new String[]{"beast_id","summon_type","cost_item_id","cost_amount","reward_nums_list"}),
|
BEAST_CABINET(62,"beast_cabinet",CommonEventHandler.getInstance(),new String[]{"beast_id","summon_type","cost_item_id","cost_amount","reward_nums_list"}),
|
||||||
GUESSING(63,"guessing",new CommonEventHandler(),new String[]{"season_id","guessing_type","stake_type","stake_num"}),
|
GUESSING(63,"guessing",CommonEventHandler.getInstance(),new String[]{"season_id","guessing_type","stake_type","stake_num"}),
|
||||||
|
|
||||||
GUESS_OVER(64,"guess_over",new CommonEventHandler(),new String[]{"season_id","guessing_type","stake_type","rewards_num"}),
|
GUESS_OVER(64,"guess_over",CommonEventHandler.getInstance(),new String[]{"season_id","guessing_type","stake_type","rewards_num"}),
|
||||||
|
|
||||||
GET_TREASURE(65,"get_treasure",new CommonEventHandler(),new String[]{"treasure_id","get_entrance"}),
|
|
||||||
ARENA_CHALLENGE(66,"arena_challenge",new CommonEventHandler(),new String[]{"battle_result","own_integral_num","rewards_num","own_new_integral_num","own_ranking","role_id","enemy_integral_num","new_enemy_integral_num","enemy_ranking","hero1","hero2","hero3","hero4","hero5","hero6","attack_pokemon,","defend_hero1","defend_hero2","defend_hero3","defend_hero4","defend_hero5","defend_hero6","defend_pokemon"}),
|
|
||||||
|
|
||||||
|
GET_TREASURE(65,"get_treasure",CommonEventHandler.getInstance(),new String[]{"treasure_id","get_entrance"}),
|
||||||
|
ARENA_CHALLENGE(66,"arena_challenge",CommonEventHandler.getInstance(),new String[]{"battle_result","own_integral_num","rewards_num","own_new_integral_num","own_ranking","role_id","enemy_integral_num","new_enemy_integral_num","enemy_ranking","hero1","hero2","hero3","hero4","hero5","hero6","attack_pokemon","defend_hero1","defend_hero2","defend_hero3","defend_hero4","defend_hero5","defend_hero6","defend_pokemon"}),
|
||||||
|
CEREMONY(67,"ceremony",CommonEventHandler.getInstance(),new String[]{"cost_item_id","integral_num","new_integral_num","own_ranking","guild_ranking"}),
|
||||||
|
TREASURE_SUMMON(68,"treasure_summon",CommonEventHandler.getInstance(),new String[]{"beast_id","summon_type","cost_item_id","cost_amount","reward_nums_list"}),// 降妖夺宝
|
||||||
|
VANQUISH_BOSS(69,"vanquish_boss",CommonEventHandler.getInstance(),new String[]{"boss_id","battle_result","damage_num","reward_nums_list"}),// 新将来袭
|
||||||
VIP_LEVEL_UP(100,"", new VipLevelUpEventHandler(),new String[]{""});
|
VIP_LEVEL_UP(100,"", new VipLevelUpEventHandler(),new String[]{""});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,17 @@ import java.util.Map;
|
||||||
* @discribe
|
* @discribe
|
||||||
*/
|
*/
|
||||||
public class CommonEventHandler implements IReportEvent {
|
public class CommonEventHandler implements IReportEvent {
|
||||||
|
|
||||||
|
public CommonEventHandler() {
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CommonEventHandler getInstance() {
|
||||||
|
return Instance.instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Instance {
|
||||||
|
public final static CommonEventHandler instance = new CommonEventHandler();
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> getEventProperties(ReportEventEnum eventEnum, Object... param) {
|
public Map<String, Object> getEventProperties(ReportEventEnum eventEnum, Object... param) {
|
||||||
Map<String, Object> resultMap = new HashMap<>();
|
Map<String, Object> resultMap = new HashMap<>();
|
||||||
|
|
|
@ -127,6 +127,7 @@ public class ActivityLogic implements IEventHandler{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkActiviyStatus() throws Exception {
|
public void checkActiviyStatus() throws Exception {
|
||||||
|
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
Map<Integer, SGlobalActivity> sGlobalActivityMap = SGlobalActivity.getsGlobalActivityMap();
|
Map<Integer, SGlobalActivity> sGlobalActivityMap = SGlobalActivity.getsGlobalActivityMap();
|
||||||
|
|
||||||
|
@ -181,7 +182,6 @@ public class ActivityLogic implements IEventHandler{
|
||||||
abstractActivity.onActivityStart();
|
abstractActivity.onActivityStart();
|
||||||
openActivityIds.add(sGlobalActivity.getId());
|
openActivityIds.add(sGlobalActivity.getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
//活动数据处理分发到角色线程
|
//活动数据处理分发到角色线程
|
||||||
InnerMessageUtil.broadcastWithRandom(user1 -> {
|
InnerMessageUtil.broadcastWithRandom(user1 -> {
|
||||||
if(user1==null){
|
if(user1==null){
|
||||||
|
@ -221,7 +221,6 @@ public class ActivityLogic implements IEventHandler{
|
||||||
}, new LinkedList<>(OnlineUserManager.sessionMap.keySet()),5);
|
}, new LinkedList<>(OnlineUserManager.sessionMap.keySet()),5);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void newPlayerOpenActivityMission(User user) throws Exception {
|
public void newPlayerOpenActivityMission(User user) throws Exception {
|
||||||
checkActivityOfUser(user, null);
|
checkActivityOfUser(user, null);
|
||||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||||
|
|
|
@ -6,6 +6,8 @@ import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||||
import com.ljsd.jieling.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
import com.ljsd.jieling.jbean.ActivityMission;
|
import com.ljsd.jieling.jbean.ActivityMission;
|
||||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||||
|
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||||
|
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||||
import com.ljsd.jieling.logic.activity.event.CommitSheJiEvent;
|
import com.ljsd.jieling.logic.activity.event.CommitSheJiEvent;
|
||||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
|
@ -96,7 +98,8 @@ class SheJiActivity extends AbstractActivity {
|
||||||
if(!ActivityLogic.getInstance().checkGlobleActivityOpen(id)){
|
if(!ActivityLogic.getInstance().checkGlobleActivityOpen(id)){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int guildId = ((CommitSheJiEvent) event).getGuild();
|
CommitSheJiEvent commitSheJiEvent = (CommitSheJiEvent) event;
|
||||||
|
int guildId = commitSheJiEvent.getGuild();
|
||||||
if (guildId == 0) {
|
if (guildId == 0) {
|
||||||
LOGGER.error("Exception guild id=>{} not exit", guildId);
|
LOGGER.error("Exception guild id=>{} not exit", guildId);
|
||||||
}
|
}
|
||||||
|
@ -122,8 +125,13 @@ class SheJiActivity extends AbstractActivity {
|
||||||
if(guildInfo.getGuildSheJiScore()>=sGodSacrificeSetting.getL1Score()){
|
if(guildInfo.getGuildSheJiScore()>=sGodSacrificeSetting.getL1Score()){
|
||||||
guildRank.addRank(guildId,String.valueOf(id),guildInfo.getGuildSheJiScore());
|
guildRank.addRank(guildId,String.valueOf(id),guildInfo.getGuildSheJiScore());
|
||||||
}
|
}
|
||||||
if( ((CommitSheJiEvent) event).getScore()!=0){
|
if( commitSheJiEvent.getScore()!=0){
|
||||||
RankContext.getRankEnum(RankEnum.EXPERT_RANK.getType()).incrementRankScoreOnly(((CommitSheJiEvent) event).getCommitUid(), String.valueOf(id), ((CommitSheJiEvent) event).getScore());
|
RankContext.getRankEnum(RankEnum.EXPERT_RANK.getType()).incrementRankScoreOnly(commitSheJiEvent.getCommitUid(), String.valueOf(id), commitSheJiEvent.getScore());
|
||||||
|
}
|
||||||
|
if(commitSheJiEvent.getItemId()!=0){
|
||||||
|
AbstractRank personRank = RankContext.getRankEnum(RankEnum.EXPERT_RANK.getType());
|
||||||
|
double score = RankContext.getRankEnum(RankEnum.GUILD_SHEJI_SCORE_RANK.getType()).getScoreById(commitSheJiEvent.getCommitUid(), String.valueOf(id));
|
||||||
|
ReportUtil.onReportEvent(UserManager.getUser(commitSheJiEvent.getCommitUid()),ReportEventEnum.CEREMONY.getType(),commitSheJiEvent.getItemId()+"#"+commitSheJiEvent.getItemNum(),commitSheJiEvent.getScore(),(int)score,personRank.getRankIndexByKey(String.valueOf(id),commitSheJiEvent.getCommitUid()),guildRank.getRankIndexByKey("",guildId)==-1?0:guildRank.getRankIndexByKey("",guildId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@ public class CommitSheJiEvent implements IEvent{
|
||||||
private int guild;
|
private int guild;
|
||||||
private int commitUid;
|
private int commitUid;
|
||||||
private int score;
|
private int score;
|
||||||
|
private int itemId;
|
||||||
|
private int itemNum;
|
||||||
|
|
||||||
public CommitSheJiEvent(int guild, int commitUid, int score) {
|
public CommitSheJiEvent(int guild, int commitUid, int score) {
|
||||||
this.guild = guild;
|
this.guild = guild;
|
||||||
|
@ -15,6 +17,14 @@ public class CommitSheJiEvent implements IEvent{
|
||||||
this.score = score;
|
this.score = score;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public CommitSheJiEvent(int guild, int commitUid, int score, int itemId, int itemNum) {
|
||||||
|
this.guild = guild;
|
||||||
|
this.commitUid = commitUid;
|
||||||
|
this.score = score;
|
||||||
|
this.itemId = itemId;
|
||||||
|
this.itemNum = itemNum;
|
||||||
|
}
|
||||||
|
|
||||||
public int getGuild() {
|
public int getGuild() {
|
||||||
return guild;
|
return guild;
|
||||||
}
|
}
|
||||||
|
@ -38,4 +48,20 @@ public class CommitSheJiEvent implements IEvent{
|
||||||
public void setScore(int score) {
|
public void setScore(int score) {
|
||||||
this.score = score;
|
this.score = score;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getItemId() {
|
||||||
|
return itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemId(int itemId) {
|
||||||
|
this.itemId = itemId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getItemNum() {
|
||||||
|
return itemNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setItemNum(int itemNum) {
|
||||||
|
this.itemNum = itemNum;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ public class Poster {
|
||||||
try {
|
try {
|
||||||
eh.onEvent(e);
|
eh.onEvent(e);
|
||||||
}catch (Exception e1){
|
}catch (Exception e1){
|
||||||
|
e1.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,9 +190,9 @@ public class GuildMyInfo extends MongoBase {
|
||||||
return guildSkill;
|
return guildSkill;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addGuildSkillByType(int type){
|
|
||||||
guildSkill.putIfAbsent(type, 0);
|
public void setGuildSkillByType(int type,int level){
|
||||||
guildSkill.put(type,guildSkill.get(type)+1);
|
guildSkill.put(type,level);
|
||||||
updateString("guildSkill",guildSkill);
|
updateString("guildSkill",guildSkill);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -399,7 +399,12 @@ public class PlayerManager extends MongoBase {
|
||||||
}else {
|
}else {
|
||||||
maxTime = TimeUtils.now()/1000+config.getContinueTime()[0];
|
maxTime = TimeUtils.now()/1000+config.getContinueTime()[0];
|
||||||
}
|
}
|
||||||
|
//todo 记得删掉
|
||||||
|
if(privilageId==4013){
|
||||||
|
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,5,0,true)/1000);
|
||||||
|
}else{
|
||||||
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,0,0,true)/1000);
|
maxTime = (int)(TimeUtils.getLastOrUnderHour(maxTime*1000,0,0,true)/1000);
|
||||||
|
}
|
||||||
newVipInfo.setEffectTime((int)maxTime);
|
newVipInfo.setEffectTime((int)maxTime);
|
||||||
}
|
}
|
||||||
this.vipInfo.put(privilageId,newVipInfo);
|
this.vipInfo.put(privilageId,newVipInfo);
|
||||||
|
|
|
@ -196,16 +196,24 @@ public class UserMissionManager extends MongoBase {
|
||||||
updateString("achievementMap",achievementMap);
|
updateString("achievementMap",achievementMap);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case MISSING_ROOM_REFRESH:
|
case MISSING_ROOM_REFRESH://天宫寻宝
|
||||||
Map<Integer,Integer> mustAppear = new HashMap<>();
|
Map<Integer,Integer> mustAppear = new HashMap<>();
|
||||||
List<Integer> mustMissions = new ArrayList<>();
|
List<Integer> mustMissions = new ArrayList<>();
|
||||||
|
List<Integer> lockMissions = new ArrayList<>();
|
||||||
if((int)parm[0]==1){
|
if((int)parm[0]==1){
|
||||||
//删除已经领取奖励的
|
//删除已经领取奖励的
|
||||||
missingRoomMissionType.getFinishMissionIds().removeIf(value->missingRoomMissionType.getAllMissingTime().get(value)==-1);
|
missingRoomMissionType.getFinishMissionIds().removeIf(value->missingRoomMissionType.getAllMissingTime().get(value)==-1);
|
||||||
missingRoomMissionType.getAllMissingTime().values().removeIf(value->value==-1);
|
missingRoomMissionType.getAllMissingTime().values().removeIf(value->value==-1);
|
||||||
boolean result;
|
|
||||||
|
// 任务全部锁定
|
||||||
|
Set<Integer> lockMissionIds = missingRoomMissionType.getLockMissionIds();
|
||||||
|
if (lockMissionIds.size() >= 6){
|
||||||
|
throw new ErrorCodeException(ErrorCode.LOCK_FILL);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 读表
|
||||||
SMazeTreasureSetting sMazeTreasureSetting = SMazeTreasureSetting.sMazeTreasureSetting;
|
SMazeTreasureSetting sMazeTreasureSetting = SMazeTreasureSetting.sMazeTreasureSetting;
|
||||||
result = ItemUtil.itemCost(user, new int[][]{sMazeTreasureSetting.getTakeOrder()}, BIReason.MISSING_ROOM_REFRESH_CONSUME, 1);
|
boolean result = ItemUtil.itemCost(user, new int[][]{sMazeTreasureSetting.getTakeOrder()}, BIReason.MISSING_ROOM_REFRESH_CONSUME, 1);
|
||||||
if(!result){
|
if(!result){
|
||||||
result = ItemUtil.itemCost(user, new int[][]{sMazeTreasureSetting.getRefreshItem()}, BIReason.MISSING_ROOM_REFRESH_CONSUME, 1);
|
result = ItemUtil.itemCost(user, new int[][]{sMazeTreasureSetting.getRefreshItem()}, BIReason.MISSING_ROOM_REFRESH_CONSUME, 1);
|
||||||
if(!result){
|
if(!result){
|
||||||
|
@ -222,22 +230,45 @@ public class UserMissionManager extends MongoBase {
|
||||||
missingRoomMissionType.privilegeRefresh(user,sMazeTreasureSetting.getHighDailyPrivilege(),mustAppear);
|
missingRoomMissionType.privilegeRefresh(user,sMazeTreasureSetting.getHighDailyPrivilege(),mustAppear);
|
||||||
//豪华特权
|
//豪华特权
|
||||||
missingRoomMissionType.privilegeRefresh(user,sMazeTreasureSetting.getLuxuryDailyPrivilege(),mustAppear);
|
missingRoomMissionType.privilegeRefresh(user,sMazeTreasureSetting.getLuxuryDailyPrivilege(),mustAppear);
|
||||||
int[][] refreshHighTypeNum = sMazeTreasureSetting.getRefreshHighTypeNum();
|
//非免费抽取次数必出
|
||||||
for(int[] refresh:refreshHighTypeNum){
|
missingRoomMissionType.notFreeRefreshMust(user,sMazeTreasureSetting.getRefreshHighTypeNum(),mustAppear);
|
||||||
if(missingRoomMissionType.getRefreshTotalCount()==0||missingRoomMissionType.getRefreshTotalCount()%refresh[0]!=0){
|
// 刷新次数+1
|
||||||
continue;
|
|
||||||
}else{
|
|
||||||
mustAppear.put(refresh[1],mustAppear.get(refresh[1])==null?1:(mustAppear.get(refresh[1])+1));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
missingRoomMissionType.setRefreshTotalCount(missingRoomMissionType.getRefreshTotalCount()+1);
|
missingRoomMissionType.setRefreshTotalCount(missingRoomMissionType.getRefreshTotalCount()+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Set<Integer> doingMissionIds = missingRoomMissionType.getDoingMissionIds();
|
||||||
|
doingMissionIds.forEach((doing)->{
|
||||||
|
if (lockMissionIds.contains(doing)){
|
||||||
|
lockMissions.add(doing);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
missingRoomMissionType.getDoingMissionIds().clear();
|
missingRoomMissionType.getDoingMissionIds().clear();
|
||||||
}else{
|
}else{
|
||||||
for(int firstTask:SMazeTreasureSetting.sMazeTreasureSetting.getFirstRefresh()){
|
for(int firstTask:SMazeTreasureSetting.sMazeTreasureSetting.getFirstRefresh()){
|
||||||
mustMissions.add(firstTask);
|
mustMissions.add(firstTask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新最大长度限制6条
|
||||||
|
if (lockMissions.size() + mustAppear.size() > 6){
|
||||||
|
// 锁定的不能动,获取特权任务数量
|
||||||
|
int num = 6 - lockMissions.size();
|
||||||
|
// 特权的key
|
||||||
|
Set<Integer> keys = mustAppear.keySet();
|
||||||
|
// 正序的set
|
||||||
|
Set<Integer> sortSet = new TreeSet<Integer>(Comparator.naturalOrder());
|
||||||
|
// 赋值
|
||||||
|
sortSet.addAll(keys);
|
||||||
|
// 遍历,如果数量满足,停止,不满足则删除等级小的任务
|
||||||
|
for (Integer ints:sortSet){
|
||||||
|
if (mustAppear.size() == num){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
mustAppear.remove(ints);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!mustAppear.isEmpty()){
|
if(!mustAppear.isEmpty()){
|
||||||
for(Map.Entry<Integer,Integer> entry:mustAppear.entrySet()){
|
for(Map.Entry<Integer,Integer> entry:mustAppear.entrySet()){
|
||||||
List<SMazeTreasure> sMazeTreasures = SMazeTreasure.mazeMapByTaskType.get(entry.getKey());
|
List<SMazeTreasure> sMazeTreasures = SMazeTreasure.mazeMapByTaskType.get(entry.getKey());
|
||||||
|
@ -265,7 +296,7 @@ public class UserMissionManager extends MongoBase {
|
||||||
// missingRoomMission.add(refreshWeight);
|
// missingRoomMission.add(refreshWeight);
|
||||||
// }
|
// }
|
||||||
//根据品质来随机
|
//根据品质来随机
|
||||||
int[] qualityArray = MathUtils.randomForWeight(qualityRate, 6 - mustMissions.size());
|
int[] qualityArray = MathUtils.randomForWeight(qualityRate, 6 - (mustMissions.size() + lockMissions.size()));
|
||||||
Map<Integer,Integer> qualityNum = new HashMap<>();
|
Map<Integer,Integer> qualityNum = new HashMap<>();
|
||||||
for(int quality:qualityArray){
|
for(int quality:qualityArray){
|
||||||
qualityNum.put(quality,qualityNum.getOrDefault(quality,0)+1);
|
qualityNum.put(quality,qualityNum.getOrDefault(quality,0)+1);
|
||||||
|
@ -285,9 +316,14 @@ public class UserMissionManager extends MongoBase {
|
||||||
missingRoomMissionType.addDoingMission(missingRoomMissionType.getMissionIndex()*10000+id);
|
missingRoomMissionType.addDoingMission(missingRoomMissionType.getMissionIndex()*10000+id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 必须任务
|
||||||
for(int mission:mustMissions){
|
for(int mission:mustMissions){
|
||||||
missingRoomMissionType.addDoingMission(missingRoomMissionType.getMissionIndex()*10000+mission);
|
missingRoomMissionType.addDoingMission(missingRoomMissionType.getMissionIndex()*10000+mission);
|
||||||
}
|
}
|
||||||
|
// 上锁任务
|
||||||
|
for(int mission:lockMissions){
|
||||||
|
missingRoomMissionType.addDoingMission(mission);
|
||||||
|
}
|
||||||
updateString("missingRoomMissionType",missingRoomMissionType);
|
updateString("missingRoomMissionType",missingRoomMissionType);
|
||||||
break;
|
break;
|
||||||
default:{
|
default:{
|
||||||
|
|
|
@ -143,6 +143,7 @@ public class GuildLogic {
|
||||||
|
|
||||||
for(Set<Integer> members : guildInfo.getMembers().values()){
|
for(Set<Integer> members : guildInfo.getMembers().values()){
|
||||||
for(int uidOfMember : members){
|
for(int uidOfMember : members){
|
||||||
|
LOGGER.info("errorMember:{}",uidOfMember);
|
||||||
User userMember = UserManager.getUser(uidOfMember);
|
User userMember = UserManager.getUser(uidOfMember);
|
||||||
builder.addFamilyWalkIndicaiton(CBean2Proto.getFamilyWalkIndicaiton(userMember));
|
builder.addFamilyWalkIndicaiton(CBean2Proto.getFamilyWalkIndicaiton(userMember));
|
||||||
}
|
}
|
||||||
|
@ -371,7 +372,7 @@ public class GuildLogic {
|
||||||
RedisUtil.getInstence().releaseDistributedLock(RedisKey.OPERATE_FAMILY,Integer.toString(guildId), Integer.toString(uid));
|
RedisUtil.getInstence().releaseDistributedLock(RedisKey.OPERATE_FAMILY,Integer.toString(guildId), Integer.toString(uid));
|
||||||
}
|
}
|
||||||
//社稷大典需要初始化分数
|
//社稷大典需要初始化分数
|
||||||
Poster.getPoster().dispatchEvent(new CommitSheJiEvent(guildId,uid,0));
|
Poster.getPoster().dispatchEvent(new CommitSheJiEvent(guildId,uid,0,0,0));
|
||||||
RedisUtil.getInstence().expire(RedisKey.getKey(RedisKey.FAMILY_JOIN,String.valueOf(uid),false), TimeUtils.DAY);
|
RedisUtil.getInstence().expire(RedisKey.getKey(RedisKey.FAMILY_JOIN,String.valueOf(uid),false), TimeUtils.DAY);
|
||||||
addGuildLog(guildInfo.getId(),GuildDef.Log.JOIN,user.getPlayerInfoManager().getNickName());
|
addGuildLog(guildInfo.getId(),GuildDef.Log.JOIN,user.getPlayerInfoManager().getNickName());
|
||||||
Family.FamilyJoinIndicaion build = Family.FamilyJoinIndicaion.newBuilder().setFamilyBaseInfo(CBean2Proto.getFamilyBaseInfo(guildInfo)).setFamilyUserInfo(CBean2Proto.getFamilyUserInfo(user, GlobalsDef.MEMBER)).build();
|
Family.FamilyJoinIndicaion build = Family.FamilyJoinIndicaion.newBuilder().setFamilyBaseInfo(CBean2Proto.getFamilyBaseInfo(guildInfo)).setFamilyUserInfo(CBean2Proto.getFamilyUserInfo(user, GlobalsDef.MEMBER)).build();
|
||||||
|
@ -1328,30 +1329,63 @@ public class GuildLogic {
|
||||||
* @param type
|
* @param type
|
||||||
* @param messageType
|
* @param messageType
|
||||||
*/
|
*/
|
||||||
public static void guildSkillLevelUp(ISession session, int type,MessageTypeProto.MessageType messageType) throws Exception {
|
public static void guildSkillLevelUp(ISession session, int type,int beforeLevel,int afterLevel,MessageTypeProto.MessageType messageType) throws Exception {
|
||||||
User user = UserManager.getUser(session.getUid());
|
User user = UserManager.getUser(session.getUid());
|
||||||
//todo 消耗校验
|
//todo 消耗校验
|
||||||
Map<Integer, Integer> skillInfo= user.getGuildMyInfo().getGuildSkill();
|
Map<Integer, Integer> skillInfo= user.getGuildMyInfo().getGuildSkill();
|
||||||
Map<Integer, Map<Integer, SGuildTechnology>> typeMap = SGuildTechnology.technologyMap.get(type);
|
|
||||||
int size = typeMap.size();
|
|
||||||
int[][] consume;
|
|
||||||
if(!skillInfo.containsKey(type)){
|
|
||||||
consume = typeMap.get(1).get(0).getConsume();
|
|
||||||
}else{
|
|
||||||
int level = skillInfo.get(type);
|
|
||||||
consume = typeMap.get(level%size+1).get(level/size).getConsume();
|
|
||||||
if(typeMap.get(level%size+1).get(level/size+1)==null){
|
|
||||||
throw new ErrorCodeException(ErrorCode.HERO_LEVE_MAX);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
boolean itemCost = ItemUtil.itemCost(user, consume, BIReason.GUILD_SKILL_LEVEL_UP_CONSUME, 1);
|
|
||||||
|
|
||||||
|
Map<Integer, Map<Integer, SGuildTechnology>> typeMap = SGuildTechnology.technologyMap.get(type);
|
||||||
|
if(skillInfo.getOrDefault(type, 0)!=beforeLevel||afterLevel>600)
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
|
int size = typeMap.size();
|
||||||
|
|
||||||
|
|
||||||
|
Map<Integer,Integer> consumeMap = new HashMap<>(2);
|
||||||
|
int baseLevel = beforeLevel / size;//100->16
|
||||||
|
int nextIndex = beforeLevel % size;//100->4
|
||||||
|
|
||||||
|
int afterBaseLevel =afterLevel / size;
|
||||||
|
int afterNextIndex = afterLevel % size;
|
||||||
|
// if(){
|
||||||
|
// }else{
|
||||||
|
// int level = skillInfo.get(type);
|
||||||
|
// consume = typeMap.get(level%size+1).get(level/size).getConsume();
|
||||||
|
// if(typeMap.get(level%size+1).get(level/size+1)==null){
|
||||||
|
// throw new ErrorCodeException(ErrorCode.HERO_LEVE_MAX);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
while(baseLevel<afterBaseLevel || nextIndex<afterNextIndex){
|
||||||
|
|
||||||
|
int[][] consume = typeMap.get(nextIndex+1).get(baseLevel).getConsume();
|
||||||
|
for(int[] consumeOnce:consume) {
|
||||||
|
consumeMap.put(consumeOnce[0],consumeMap.getOrDefault(consumeOnce[0],0)+consumeOnce[1]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!ItemUtil.checkCost(user, consumeMap)){
|
||||||
|
//把这一次的减回去
|
||||||
|
for(int[] consumeOnce:consume) {
|
||||||
|
consumeMap.put(consumeOnce[0],consumeMap.getOrDefault(consumeOnce[0],0)-consumeOnce[1]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(nextIndex+1==size){
|
||||||
|
nextIndex=0;
|
||||||
|
baseLevel++;
|
||||||
|
}else{
|
||||||
|
nextIndex++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
boolean itemCost = ItemUtil.itemCost(user, ItemUtil.mapToArray(consumeMap), BIReason.GUILD_SKILL_LEVEL_UP_CONSUME, 1);
|
||||||
if(!itemCost){
|
if(!itemCost){
|
||||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||||
}
|
}
|
||||||
user.getGuildMyInfo().addGuildSkillByType(type);
|
Family.GuildSkillLevelUpResponse response = Family.GuildSkillLevelUpResponse.newBuilder().setType(type).setCurlevel(baseLevel*size+nextIndex).build();
|
||||||
|
|
||||||
|
user.getGuildMyInfo().setGuildSkillByType(type,baseLevel*size+nextIndex);
|
||||||
|
// user.getGuildMyInfo().setGuildSkillByType(type,590);
|
||||||
|
|
||||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
|
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(session.getUid()));
|
||||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),response,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -698,6 +698,7 @@ public class FriendLogic {
|
||||||
friendManager.setHaveRewardMap(new HashMap<>());
|
friendManager.setHaveRewardMap(new HashMap<>());
|
||||||
for (Map.Entry<Integer,Integer> entry: giveMap.entrySet()){
|
for (Map.Entry<Integer,Integer> entry: giveMap.entrySet()){
|
||||||
Integer friendId = entry.getKey();
|
Integer friendId = entry.getKey();
|
||||||
|
LOGGER.info("FriendId:{}",friendId);
|
||||||
User friendUser = UserManager.getUser(friendId);
|
User friendUser = UserManager.getUser(friendId);
|
||||||
FriendManager friendManager1 = friendUser.getFriendManager();
|
FriendManager friendManager1 = friendUser.getFriendManager();
|
||||||
Map<Integer, Integer> haveRewardMap = friendManager1.getHaveRewardMap();
|
Map<Integer, Integer> haveRewardMap = friendManager1.getHaveRewardMap();
|
||||||
|
|
|
@ -416,6 +416,9 @@ public class HeroLogic{
|
||||||
eventEnum = ReportEventEnum.BEAST_CABINET;
|
eventEnum = ReportEventEnum.BEAST_CABINET;
|
||||||
activityId = sLotterySetting.getActivityId();
|
activityId = sLotterySetting.getActivityId();
|
||||||
break;
|
break;
|
||||||
|
case 11:
|
||||||
|
eventEnum = ReportEventEnum.TREASURE_SUMMON;
|
||||||
|
activityId = sLotterySetting.getActivityId();
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -333,15 +333,28 @@ public class MissionLoigc {
|
||||||
missionList.add(CommonProto.UserMissionInfo.newBuilder().setMissionId(missionId).setState(state).setType(vipmissionType).setProgress(progrss).build());
|
missionList.add(CommonProto.UserMissionInfo.newBuilder().setMissionId(missionId).setState(state).setType(vipmissionType).setProgress(progrss).build());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取天宫寻宝任务列表
|
||||||
|
* @param user
|
||||||
|
* @param missionList
|
||||||
|
*/
|
||||||
public static void getMissingRoomMission(User user ,List<CommonProto.UserMissionInfo> missionList){
|
public static void getMissingRoomMission(User user ,List<CommonProto.UserMissionInfo> missionList){
|
||||||
UserMissionManager userMissionManager = user.getUserMissionManager();
|
UserMissionManager userMissionManager = user.getUserMissionManager();
|
||||||
MissingRoomMissionType missingRoomMissionType = userMissionManager.getMissingRoomMissionType();
|
MissingRoomMissionType missingRoomMissionType = userMissionManager.getMissingRoomMissionType();
|
||||||
|
// 正在做任务
|
||||||
for(Integer missionId:missingRoomMissionType.getDoingMissionIds()){
|
for(Integer missionId:missingRoomMissionType.getDoingMissionIds()){
|
||||||
CommonProto.UserMissionInfo.Builder info = CommonProto.UserMissionInfo.newBuilder();
|
CommonProto.UserMissionInfo.Builder info = CommonProto.UserMissionInfo.newBuilder();
|
||||||
info.setMissionId(missionId).setState(0)
|
|
||||||
.setType(GameMisionType.MISSINGROOMMISSION.getType());
|
info.setMissionId(missionId).setState(0).setType(GameMisionType.MISSINGROOMMISSION.getType());
|
||||||
|
// 是否上锁
|
||||||
|
Set<Integer> lockMissionIds = missingRoomMissionType.getLockMissionIds();
|
||||||
|
if (lockMissionIds.contains(missionId)){
|
||||||
|
info.setLock(1);
|
||||||
|
}
|
||||||
missionList.add(info.build());
|
missionList.add(info.build());
|
||||||
}
|
}
|
||||||
|
// 完成的任务
|
||||||
for(Integer missionId:missingRoomMissionType.getFinishMissionIds()){
|
for(Integer missionId:missingRoomMissionType.getFinishMissionIds()){
|
||||||
CommonProto.UserMissionInfo.Builder info = CommonProto.UserMissionInfo.newBuilder();
|
CommonProto.UserMissionInfo.Builder info = CommonProto.UserMissionInfo.newBuilder();
|
||||||
int missingTime = missingRoomMissionType.getMissingTime(missionId);
|
int missingTime = missingRoomMissionType.getMissingTime(missionId);
|
||||||
|
@ -886,6 +899,44 @@ public class MissionLoigc {
|
||||||
user.getUserMissionManager().updateString("missingRoomMissionType",missingRoomMissionType);
|
user.getUserMissionManager().updateString("missingRoomMissionType",missingRoomMissionType);
|
||||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 天宫探险加锁
|
||||||
|
* @param session
|
||||||
|
* @param missionId
|
||||||
|
* @param operation
|
||||||
|
* @param messageType
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public static void missiongRoomLock(ISession session,int missionId,int operation, MessageTypeProto.MessageType messageType) throws Exception{
|
||||||
|
User user = UserManager.getUser(session.getUid());
|
||||||
|
// 获取天宫探险任务
|
||||||
|
MissingRoomMissionType missingRoomMissionType = user.getUserMissionManager().getMissingRoomMissionType();
|
||||||
|
// 不是待做任务,不能操作
|
||||||
|
Set<Integer> doingMissionIds = missingRoomMissionType.getDoingMissionIds();
|
||||||
|
if(!doingMissionIds.contains(missionId)){
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
|
}
|
||||||
|
|
||||||
|
Set<Integer> lockMissionIds = missingRoomMissionType.getLockMissionIds();
|
||||||
|
// 上锁
|
||||||
|
if (operation == 1){
|
||||||
|
if (lockMissionIds.contains(missionId)) {
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
|
}
|
||||||
|
missingRoomMissionType.addLockMissionId(missionId);
|
||||||
|
// 解锁
|
||||||
|
}else {
|
||||||
|
if (!lockMissionIds.contains(missionId)) {
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||||
|
}
|
||||||
|
missingRoomMissionType.getLockMissionIds().removeIf(value->value==missionId);
|
||||||
|
}
|
||||||
|
// 更新数据库
|
||||||
|
user.getUserMissionManager().updateString("missingRoomMissionType",missingRoomMissionType);
|
||||||
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean checkMainLevel(User user,int levelId){
|
public static boolean checkMainLevel(User user,int levelId){
|
||||||
if(!SMainLevelConfig.config.containsKey(levelId)){
|
if(!SMainLevelConfig.config.containsKey(levelId)){
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -16,6 +16,9 @@ public abstract class AbstractMissionType {
|
||||||
//可领取的任务,在可控范围内,使用map存储,利于查找
|
//可领取的任务,在可控范围内,使用map存储,利于查找
|
||||||
private Set<Integer> finishMissionIds = Sets.newConcurrentHashSet();
|
private Set<Integer> finishMissionIds = Sets.newConcurrentHashSet();
|
||||||
|
|
||||||
|
// 上锁的任务,不可刷新
|
||||||
|
private Set<Integer> lockMissionIds = Sets.newConcurrentHashSet();
|
||||||
|
|
||||||
//已领取的任务,在可控范围内,使用map存储,利于查找
|
//已领取的任务,在可控范围内,使用map存储,利于查找
|
||||||
private BitSet rewardedMissionIds = new BitSet(1024);
|
private BitSet rewardedMissionIds = new BitSet(1024);
|
||||||
|
|
||||||
|
@ -64,4 +67,16 @@ public abstract class AbstractMissionType {
|
||||||
public BitSet getRewardedMissionIds() {
|
public BitSet getRewardedMissionIds() {
|
||||||
return rewardedMissionIds;
|
return rewardedMissionIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Set<Integer> getLockMissionIds() {
|
||||||
|
return lockMissionIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLockMissionIds(Set<Integer> lockMissionIds) {
|
||||||
|
this.lockMissionIds = lockMissionIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addLockMissionId(int missionId) {
|
||||||
|
lockMissionIds.add(missionId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,14 +152,22 @@ public class MissingRoomMissionType extends AbstractMissionType{
|
||||||
if(!itemCost){
|
if(!itemCost){
|
||||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getLockMissionIds().removeIf(value->value==missionId);
|
||||||
getDoingMissionIds().remove(missionId);
|
getDoingMissionIds().remove(missionId);
|
||||||
getFinishMissionIds().add(missionId);
|
getFinishMissionIds().add(missionId);
|
||||||
missingTime.put(missionId, (int)(TimeUtils.now()/1000)+sMazeTreasure.getWasteTime());
|
missingTime.put(missionId, (int)(TimeUtils.now()/1000)+sMazeTreasure.getWasteTime());
|
||||||
heroesInfo.put(missionId,heroes);
|
heroesInfo.put(missionId,heroes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 特权刷新
|
||||||
|
* @param user 用户信息
|
||||||
|
* @param privilege 特权类型
|
||||||
|
* @param mustAppear 必出
|
||||||
|
*/
|
||||||
public void privilegeRefresh(User user,int[][] privilege,Map<Integer,Integer> mustAppear){
|
public void privilegeRefresh(User user,int[][] privilege,Map<Integer,Integer> mustAppear){
|
||||||
|
// 是否包含特权,包含奖励【1】
|
||||||
if(user.getPlayerInfoManager().checkFunctionIsAllowed(privilege[0][0])&&privilege.length>1){
|
if(user.getPlayerInfoManager().checkFunctionIsAllowed(privilege[0][0])&&privilege.length>1){
|
||||||
int especialCount = user.getPlayerInfoManager().getVipPrivilageValue(privilege[0][0]);
|
int especialCount = user.getPlayerInfoManager().getVipPrivilageValue(privilege[0][0]);
|
||||||
for(int i = 1; i< privilege.length; i++){
|
for(int i = 1; i< privilege.length; i++){
|
||||||
|
@ -169,8 +177,25 @@ public class MissingRoomMissionType extends AbstractMissionType{
|
||||||
}
|
}
|
||||||
user.getPlayerInfoManager().updateVipPrivilage(privilege[0][0],1);
|
user.getPlayerInfoManager().updateVipPrivilage(privilege[0][0],1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 非免费刷新必出
|
||||||
|
* @param user
|
||||||
|
* @param refreshHighTypeNum
|
||||||
|
* @param mustAppear
|
||||||
|
*/
|
||||||
|
public void notFreeRefreshMust(User user, int[][] refreshHighTypeNum,Map<Integer,Integer> mustAppear){
|
||||||
|
int refreshTotalCount = user.getUserMissionManager().getMissingRoomMissionType().getRefreshTotalCount();
|
||||||
|
for(int[] refresh:refreshHighTypeNum){
|
||||||
|
if(refreshTotalCount==0||refreshTotalCount%refresh[0]!=0){
|
||||||
|
continue;
|
||||||
|
}else{
|
||||||
|
mustAppear.put(refresh[1],mustAppear.get(refresh[1])==null?1:(mustAppear.get(refresh[1])+1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public Map<Integer,Integer> getAllMissingTime(){
|
public Map<Integer,Integer> getAllMissingTime(){
|
||||||
return missingTime;
|
return missingTime;
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,4 +205,8 @@ public abstract class AbstractRank implements IRank {
|
||||||
return RedisUtil.getInstence().getZSetScore(redisKey,rkey, String.valueOf(uid));
|
return RedisUtil.getInstence().getZSetScore(redisKey,rkey, String.valueOf(uid));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getRankIndexByKey(String rkey,int uid){
|
||||||
|
return RedisUtil.getInstence().getZSetreverseRank(redisKey,rkey,Integer.toString(uid)).intValue();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,7 @@ public class MinuteTask extends Thread {
|
||||||
STableManager.updateTablesWithTableNames(true);
|
STableManager.updateTablesWithTableNames(true);
|
||||||
ActivityLogic.getInstance().checkSecretBoxSeason();
|
ActivityLogic.getInstance().checkSecretBoxSeason();
|
||||||
StoreLogic.checkGlobalStore(false);
|
StoreLogic.checkGlobalStore(false);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
MapLogic.getInstance().minuteCheckAndRemoveMapRank();
|
MapLogic.getInstance().minuteCheckAndRemoveMapRank();
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
|
|
|
@ -335,6 +335,7 @@ public class FightDataUtil {
|
||||||
unitData.set("passivity", getPassivity(skillIds));
|
unitData.set("passivity", getPassivity(skillIds));
|
||||||
unitData.set("property", getProperty(property));
|
unitData.set("property", getProperty(property));
|
||||||
unitData.set("skinId",data.getSkinId());
|
unitData.set("skinId",data.getSkinId());
|
||||||
|
unitData.set("job",hero.getJob());
|
||||||
return unitData;
|
return unitData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -431018,7 +431018,7 @@ www.50spcombaidu1828adyou97sace.co.cc
|
||||||
领导还没下令,你怎么能去世呢
|
领导还没下令,你怎么能去世呢
|
||||||
李文亮|训诫
|
李文亮|训诫
|
||||||
李文亮|死不瞑目
|
李文亮|死不瞑目
|
||||||
|
竞技守卫
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -69,6 +69,8 @@ public class SCHero implements BaseConfig{
|
||||||
|
|
||||||
private static Map<Integer,SCHero> piecesMap;
|
private static Map<Integer,SCHero> piecesMap;
|
||||||
|
|
||||||
|
private int job;
|
||||||
|
|
||||||
|
|
||||||
public static class ConsumeMaterialInfo{
|
public static class ConsumeMaterialInfo{
|
||||||
private int groupID;
|
private int groupID;
|
||||||
|
@ -169,7 +171,7 @@ public class SCHero implements BaseConfig{
|
||||||
// 大于10星为 觉醒技能
|
// 大于10星为 觉醒技能
|
||||||
int[][] awakens = scHero.getAwaken();
|
int[][] awakens = scHero.getAwaken();
|
||||||
Map<Integer, TreeMap<Integer, List<Integer>>> awakSkillMapTmp = new HashMap<>();
|
Map<Integer, TreeMap<Integer, List<Integer>>> awakSkillMapTmp = new HashMap<>();
|
||||||
if (awakens != null && awakens.length > 0) {
|
if (awakens != null && awakens.length > 0&&awakens[0].length>0) {
|
||||||
awakSkillMapTmp.put(1, new TreeMap<>());
|
awakSkillMapTmp.put(1, new TreeMap<>());
|
||||||
awakSkillMapTmp.put(2, new TreeMap<>());
|
awakSkillMapTmp.put(2, new TreeMap<>());
|
||||||
for (int[] openSkillRule : awakens) {
|
for (int[] openSkillRule : awakens) {
|
||||||
|
@ -337,4 +339,8 @@ public class SCHero implements BaseConfig{
|
||||||
public int[][] getAwaken() {
|
public int[][] getAwaken() {
|
||||||
return awaken;
|
return awaken;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getJob() {
|
||||||
|
return job;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,15 @@ package config;
|
||||||
import manager.STableManager;
|
import manager.STableManager;
|
||||||
import manager.Table;
|
import manager.Table;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@Table(name = "ItemConfig")
|
@Table(name = "ItemConfig")
|
||||||
public class SItem implements BaseConfig {
|
public class SItem implements BaseConfig {
|
||||||
public static Map<Integer, SItem> sItemMap;
|
public static Map<Integer, SItem> sItemMap;
|
||||||
|
public static Map<Integer, List<SItem>> itemMapByRecycle;
|
||||||
private int id;
|
private int id;
|
||||||
private boolean backpackOrNot; //是否进背包
|
private boolean backpackOrNot; //是否进背包
|
||||||
private int itemType;
|
private int itemType;
|
||||||
|
@ -25,12 +29,18 @@ public class SItem implements BaseConfig {
|
||||||
private String resolveReward;
|
private String resolveReward;
|
||||||
private int itemNumlimit;
|
private int itemNumlimit;
|
||||||
private int[][] extraReward;
|
private int[][] extraReward;
|
||||||
|
private int recycle;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws Exception {
|
public void init() throws Exception {
|
||||||
sItemMap = STableManager.getConfig(SItem.class);
|
sItemMap = STableManager.getConfig(SItem.class);
|
||||||
|
Map<Integer, List<SItem>> map = new HashMap<>();
|
||||||
|
sItemMap.forEach((k,v)->{
|
||||||
|
map.computeIfAbsent(v.getRecycle(),n->new ArrayList<>()).add(v);
|
||||||
|
});
|
||||||
|
itemMapByRecycle = map;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getId() {
|
public int getId() {
|
||||||
|
@ -41,6 +51,10 @@ public class SItem implements BaseConfig {
|
||||||
return sItemMap;
|
return sItemMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Map<Integer, List<SItem>> getItemMapByRecycle() {
|
||||||
|
return itemMapByRecycle;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isBackpackOrNot() {
|
public boolean isBackpackOrNot() {
|
||||||
return backpackOrNot;
|
return backpackOrNot;
|
||||||
}
|
}
|
||||||
|
@ -104,4 +118,8 @@ public class SItem implements BaseConfig {
|
||||||
public int[][] getExtraReward() {
|
public int[][] getExtraReward() {
|
||||||
return extraReward;
|
return extraReward;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getRecycle() {
|
||||||
|
return recycle;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ jar {
|
||||||
baseName = 'worldserver'
|
baseName = 'worldserver'
|
||||||
version = '1.0.0'
|
version = '1.0.0'
|
||||||
manifest {
|
manifest {
|
||||||
attributes 'Main-Class': 'com.global.GlobalServerApplivation'
|
attributes 'Main-Class': 'com.WorldServerApplication'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
|
|
|
@ -19,14 +19,14 @@ public class WorldMongoConfig {
|
||||||
|
|
||||||
// 注入配置实体
|
// 注入配置实体
|
||||||
|
|
||||||
private MongoSettingsProperties mongoSettingsProperties;
|
// private MongoSettingsProperties mongoSettingsProperties;
|
||||||
@Bean
|
// @Bean
|
||||||
@ConfigurationProperties(
|
// @ConfigurationProperties(
|
||||||
prefix = "mongodb.options")
|
// prefix = "mongodb.options")
|
||||||
MongoSettingsProperties mongoSettingsProperties() {
|
// MongoSettingsProperties mongoSettingsProperties() {
|
||||||
mongoSettingsProperties =new MongoSettingsProperties();
|
// mongoSettingsProperties =new MongoSettingsProperties();
|
||||||
return mongoSettingsProperties;
|
// return mongoSettingsProperties;
|
||||||
}
|
// }
|
||||||
@Value("${spring.data.mongodbcore.uri}")
|
@Value("${spring.data.mongodbcore.uri}")
|
||||||
private String MONGO_CORE_URI;
|
private String MONGO_CORE_URI;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue