Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn
commit
aef4398c40
|
|
@ -9,6 +9,7 @@ public class FamilyHeroInfo {
|
|||
private int star;
|
||||
private Map<Integer,Long> attribute;
|
||||
private int position;
|
||||
private int godSoulLv;
|
||||
|
||||
public int getTempleteId() {
|
||||
return templeteId;
|
||||
|
|
@ -22,6 +23,10 @@ public class FamilyHeroInfo {
|
|||
return star;
|
||||
}
|
||||
|
||||
public int getGodSoulLv() {
|
||||
return godSoulLv;
|
||||
}
|
||||
|
||||
public Map<Integer, Long> getAttribute() {
|
||||
return attribute;
|
||||
}
|
||||
|
|
@ -47,12 +52,13 @@ public class FamilyHeroInfo {
|
|||
}
|
||||
|
||||
|
||||
public FamilyHeroInfo(int templeteId, int level, int star, Map<Integer, Long> attribute, int position) {
|
||||
public FamilyHeroInfo(int templeteId, int level, int star, Map<Integer, Long> attribute, int position,int godSoulLv) {
|
||||
this.templeteId = templeteId;
|
||||
this.level = level;
|
||||
this.star = star;
|
||||
this.attribute = attribute;
|
||||
this.position = position;
|
||||
this.godSoulLv=godSoulLv;
|
||||
}
|
||||
|
||||
public FamilyHeroInfo(int templeteId, int level, int star, Map<Integer, Long> attribute) {
|
||||
|
|
|
|||
|
|
@ -237,6 +237,7 @@ public class CoreService implements RPCRequestIFace.Iface {
|
|||
arenaOfHero.setCreateTime(hero.getCreateType());
|
||||
arenaOfHero.setChangeId(hero.getChangeId());
|
||||
arenaOfHero.setSkin(hero.getSkin());
|
||||
arenaOfHero.setGodSoulLv(hero.getGodSoulLv());
|
||||
for (Map.Entry<Integer, List<TeamPosHeroInfo>> entry : teamMap.entrySet()) {
|
||||
Integer teamId = entry.getKey();
|
||||
List<TeamPosHeroInfo> teamList = entry.getValue();
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ public enum FunctionIdEnum {
|
|||
CrossSevenWorld(112,new SevenWorldFunction()),//七界试炼
|
||||
FourQua(113,null),//四象心法
|
||||
Likable(114,null),//好感度
|
||||
GodSoul(116,null),//神魂
|
||||
WeekGood(9091,null),
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ package com.ljsd.jieling.core;
|
|||
|
||||
public interface GlobalsDef {
|
||||
String DEFAULT_NAME = "无名妖灵师";
|
||||
int VERSION_CODE=1;//后端兼容版本号
|
||||
int VERSION_CODE=2;//后端兼容版本号
|
||||
int MAP_MISSION_RETURN = -9999;
|
||||
int MAP_MISSION_FAILURE = -10000;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
package com.ljsd.jieling.db.redis;
|
||||
|
||||
import com.ljsd.jieling.db.mongo.AreaManager;
|
||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -356,7 +353,8 @@ public class RedisKey {
|
|||
|
||||
public static final String GUILD_LEADER_CACHE = "GUILD_LEADER_CACHE";
|
||||
|
||||
public static final String CROSS_RANK_UPDATE_VERSION = "CROSS_RANK_UPDATE_VERSION";
|
||||
public static final String CROSS_RANK_UPDATE = "CROSS_RANK_UPDATE";
|
||||
public static final String CROSS_RANK_DELETE = "CROSS_RANK_DELETE";
|
||||
|
||||
//玉虚论道
|
||||
public static final String CROSS_YUXULUNDAO_RANK = "CROSS_YUXULUNDAO_RANK";//排行榜信息 废弃
|
||||
|
|
|
|||
|
|
@ -1429,27 +1429,27 @@ public class RedisUtil {
|
|||
if (result == null){
|
||||
result = AreaManager.areaId + RedisKey.Delimiter_colon + type + RedisKey.Delimiter_colon + key;
|
||||
}
|
||||
deathPathKeyHandler(result);
|
||||
helpHeroKeyHandler(result);
|
||||
|
||||
// 保存需要清理的key
|
||||
saveRemoveKeyHandler(result);
|
||||
return result;}
|
||||
|
||||
/**
|
||||
* 十绝阵rediskey处理
|
||||
* 保存需要清理的key
|
||||
*/
|
||||
private void deathPathKeyHandler(String key){
|
||||
private void saveRemoveKeyHandler(String key){
|
||||
// 十绝阵相关
|
||||
if(key.contains("DEATH_PATH")){
|
||||
RedisUtil.getInstence().sSet(RedisKey.DEATH_PATH_DELETE,key);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 助战rediskey处理
|
||||
*/
|
||||
private void helpHeroKeyHandler(String key){
|
||||
// 助战相关
|
||||
if(key.contains("HELP_FIGHT")){
|
||||
RedisUtil.getInstence().sSet(RedisKey.HELP_FIGHT_DELETE,key);
|
||||
}
|
||||
// 跨服排行榜相关
|
||||
if(key.contains("CROSS_RANK_UPDATE")){
|
||||
RedisUtil.getInstence().sSet(RedisKey.CROSS_RANK_DELETE,key);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static final String LOCK_SUCCESS = "OK";
|
||||
|
|
|
|||
|
|
@ -176,11 +176,14 @@ public enum ErrorCode implements IErrorCode {
|
|||
CROSS_YXLD_OVER(145,"赛季结算中"),
|
||||
RIDING_SWARD_BET_TWO(146,"一轮比赛最多押注两次!"),
|
||||
PRACTICE_LEVE_DOWN(147,"修行等级不足"),
|
||||
GOD_SOUL_BIND(148,"选中英雄已被当前神魂绑定,操作失败"),
|
||||
HANDLE_FAILED(149,"操作失败"),
|
||||
SHOP_XIA_JIA(150,"商品已下架"),
|
||||
SHOP_COLSE(151,"商店已关闭"),
|
||||
SHOP_NO_ITEM(152,"商品不存在"),
|
||||
|
||||
GUILD_NOT_AUTHORITY(300,"账号因错误发言导致相关功能封禁中,操作失败"),
|
||||
|
||||
;
|
||||
private static final Set<Integer> CodeSet = new HashSet<>();
|
||||
|
||||
|
|
|
|||
|
|
@ -152,6 +152,7 @@ public class GMRequestHandler extends BaseHandler{
|
|||
Hero hero = cUser.getHeroManager().getHeroMap().get(heroId);
|
||||
if(prarm2-hero.getStar()>0){
|
||||
hero.upStar(prarm2-hero.getStar());
|
||||
cUser.getHeroManager().addHeroHandBook(hero.getTemplateId(),hero.getStar());
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,scHero.getStar());
|
||||
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByTypeTree = new TreeMap<>(scHeroRankUpConfigByType);
|
||||
|
|
@ -365,6 +366,7 @@ public class GMRequestHandler extends BaseHandler{
|
|||
maxStar = heroStarId+1>maxStar?heroStarId+1:maxStar;
|
||||
}
|
||||
heroTmp.upStar(maxStar-heroTmp.getStar());
|
||||
cUser.getHeroManager().addHeroHandBook(heroTmp.getTemplateId(),heroTmp.getStar());
|
||||
SCHeroRankUpConfig scHeroRankUpConfig = scHeroRankUpConfigByType.get(maxStar-1);
|
||||
cUser.getUserMissionManager().onGameEvent(cUser, GameEvent.HERO_LEVEL_UP,heroTmp.getOriginalLevel(),scHeroRankUpConfig.getOpenLevel());
|
||||
heroTmp.setLevel(scHeroRankUpConfig.getOpenLevel());
|
||||
|
|
|
|||
|
|
@ -160,8 +160,13 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
});
|
||||
}
|
||||
|
||||
if (playerInfoManager.getVersionCode()!= GlobalsDef.VERSION_CODE) {
|
||||
calPractiveSkillData(user);
|
||||
if (playerInfoManager.getVersionCode()< GlobalsDef.VERSION_CODE) {
|
||||
if (playerInfoManager.getVersionCode()<1){
|
||||
calPractiveSkillData(user);
|
||||
}
|
||||
if (playerInfoManager.getVersionCode()<2){
|
||||
calHeroHandBookData(user);
|
||||
}
|
||||
playerInfoManager.setVersionCode(GlobalsDef.VERSION_CODE);
|
||||
}
|
||||
// 处理玩家旧头像框,兼容,一个玩家只执行一次
|
||||
|
|
@ -352,6 +357,9 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
}
|
||||
//修行技能数据兼容
|
||||
private void calPractiveSkillData(User user) {
|
||||
if (!user.getHeroManager().getPracticeSkillMap().isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Map<Integer, SXiuXian> xiuxianConfigMap = STableManager.getConfig(SXiuXian.class);
|
||||
for (int i = 1; i <= user.getHeroManager().getPracticeLevel(); i++) {
|
||||
SXiuXian xiuxianConfig = xiuxianConfigMap.get(i);
|
||||
|
|
@ -361,5 +369,11 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
}
|
||||
}
|
||||
}
|
||||
///英雄图鉴数据兼容
|
||||
private void calHeroHandBookData(User user){
|
||||
for (Map.Entry<String, Hero> heroEntry : user.getHeroManager().getHeroMap().entrySet()) {
|
||||
user.getHeroManager().addHeroHandBook(heroEntry.getValue().getTemplateId(),heroEntry.getValue().getStar());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ public class TasuilingxiaoHandler extends BaseHandler<ActivityProto.Tasuilingxia
|
|||
Map<Integer, TaSuiHero> heroMap = new HashMap<>();
|
||||
for(TeamPosHeroInfo hero:teamPosForHero){
|
||||
Hero myHero = user.getHeroManager().getHero(hero.getHeroId());
|
||||
TaSuiHero taSuiHero = new TaSuiHero(myHero.getTemplateId(),myHero.getOriginalLevel(),myHero.getStar());
|
||||
TaSuiHero taSuiHero = new TaSuiHero(myHero.getTemplateId(),myHero.getOriginalLevel(),myHero.getStar(),myHero.getGodSoulLv());
|
||||
heroMap.put(hero.getPosition(),taSuiHero);
|
||||
}
|
||||
user.getHeroManager().setTaSuiHeroMap(heroMap);
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@ public class WeekCardHandler extends BaseHandler<ActivityProto.WeekCardRewardReq
|
|||
|
||||
@Override
|
||||
public void processWithProto(ISession session, ActivityProto.WeekCardRewardRequest proto) throws Exception{
|
||||
return;
|
||||
/*User user = UserManager.getUser(session.getUid());
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
int weekId = proto.getId();
|
||||
Map<Integer, WeekCardInfo> weekCard = user.getPlayerInfoManager().getWeekCard();
|
||||
ActivityProto.WeekCardRewardResponse.Builder res = ActivityProto.WeekCardRewardResponse.newBuilder();
|
||||
|
|
@ -71,6 +70,5 @@ public class WeekCardHandler extends BaseHandler<ActivityProto.WeekCardRewardReq
|
|||
singleWeekCard.setLeaveGetRewardDays(TimeUtils.getDayOfWeek());
|
||||
user.getPlayerInfoManager().setWeekCard(weekCard);
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.WeekCardRewardResponse.getNumber(), res.build(), true);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,10 +34,7 @@ public class WeekCardInfoHandler extends BaseHandler<ActivityProto.WeekCardInfo
|
|||
*/
|
||||
@Override
|
||||
public void processWithProto(ISession session, ActivityProto.WeekCardInfoRequest proto) throws Exception{
|
||||
ActivityProto.WeekCardInfoResponse.Builder res = ActivityProto.WeekCardInfoResponse.newBuilder();
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.WeekCardInfoResponse.getNumber(), res.build(), true);
|
||||
return;
|
||||
/*User user = UserManager.getUser(session.getUid());
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
int[] weekType = WeekCardLogic.getInstance().getWeekCardType(user);
|
||||
if(weekType == null){
|
||||
return;
|
||||
|
|
@ -45,6 +42,6 @@ public class WeekCardInfoHandler extends BaseHandler<ActivityProto.WeekCardInfo
|
|||
ActivityProto.WeekCardInfoResponse.Builder res = ActivityProto.WeekCardInfoResponse.newBuilder();
|
||||
List<CommonProto.WeekCard> weekCardList = WeekCardLogic.getInstance().initAllWeekCardInfo(user);
|
||||
res.addAllAllWeekCardInfo(weekCardList);
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.WeekCardInfoResponse.getNumber(), res.build(), true);*/
|
||||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.WeekCardInfoResponse.getNumber(), res.build(), true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ public class ChampinGetHandler extends BaseHandler {
|
|||
.setStar(familyHeroInfo.getStar())
|
||||
.setLevel(familyHeroInfo.getLevel())
|
||||
.setPosition(familyHeroInfo.getPosition())
|
||||
.setGodSoulLv(familyHeroInfo.getGodSoulLv())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
|
@ -201,6 +202,7 @@ public class ChampinGetHandler extends BaseHandler {
|
|||
.setStar(familyHeroInfo.getStar())
|
||||
.setLevel(familyHeroInfo.getLevel())
|
||||
.setPosition(familyHeroInfo.getPosition())
|
||||
.setGodSoulLv(familyHeroInfo.getGodSoulLv())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,6 +197,7 @@ public class ChampionBetInfoHandler extends BaseHandler<ArenaInfoProto.ChampionG
|
|||
.setStar(familyHeroInfo.getStar())
|
||||
.setLevel(familyHeroInfo.getLevel())
|
||||
.setPosition(familyHeroInfo.getPosition())
|
||||
.setGodSoulLv(familyHeroInfo.getGodSoulLv())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
|
@ -234,6 +235,7 @@ public class ChampionBetInfoHandler extends BaseHandler<ArenaInfoProto.ChampionG
|
|||
.setStar(familyHeroInfo.getStar())
|
||||
.setLevel(familyHeroInfo.getLevel())
|
||||
.setPosition(familyHeroInfo.getPosition())
|
||||
.setGodSoulLv(familyHeroInfo.getGodSoulLv())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,65 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.HeroManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SCHero;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@Component
|
||||
public class HeroGodSoulBindRequestHandler extends BaseHandler<HeroInfoProto.HeroGodSoulBindRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.HERO_GOD_SOUL_BIND_REQUEST;
|
||||
}
|
||||
|
||||
//神魂进阶绑定协议
|
||||
@Override
|
||||
public void processWithProto(ISession session, HeroInfoProto.HeroGodSoulBindRequest proto) throws Exception {
|
||||
String heroId=proto.getHeroId();
|
||||
int godSoulLv=proto.getGodSoulLv();
|
||||
List<String>bindHeroList= proto.getBindHerosList();
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
HeroManager heroManager= user.getHeroManager();
|
||||
Hero upHero=heroManager.getHero(heroId);
|
||||
SCHero heroConfig=SCHero.getsCHero().get(upHero.getTemplateId());
|
||||
if (heroConfig.getIsSoulOpen()==0||upHero.getStar()<=10){
|
||||
LOGGER.error("当前神将神魂不能被激活");
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
int index=0;
|
||||
for (int[] ints : heroConfig.getSoul()) {
|
||||
if (ints[0]==godSoulLv){
|
||||
boolean isCheckCondition=HeroLogic.getInstance().CheckHeroBindCondition(user,heroId,bindHeroList,ints[2],ints[3],index);
|
||||
if (!isCheckCondition){
|
||||
LOGGER.error("选中的英雄不满足激活神魂条件");
|
||||
throw new ErrorCodeException(ErrorCode.HANDLE_FAILED);
|
||||
}
|
||||
index+=ints[3];
|
||||
}
|
||||
}
|
||||
for (String _heroId : bindHeroList) {
|
||||
if (upHero.CheckGodSoulIsBind(godSoulLv,_heroId)) {
|
||||
LOGGER.error("选中的英雄已经被当前升级神魂英雄绑定");
|
||||
throw new ErrorCodeException(ErrorCode.GOD_SOUL_BIND);
|
||||
}
|
||||
}
|
||||
upHero.setGodSoulBindMap(1,godSoulLv,bindHeroList);
|
||||
for (String _bindHeroId : bindHeroList) {
|
||||
Hero bindHero=heroManager.getHero(_bindHeroId);
|
||||
bindHero.setGodSoulBeBindMap(1,heroId,godSoulLv);
|
||||
}
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.HERO_GOD_SOUL_BIND_RESPONSE_VALUE, null,true);
|
||||
}
|
||||
}
|
||||
|
|
@ -269,6 +269,7 @@ public class BehaviorUtil {
|
|||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(hero.getStar())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public class Cmd_addhero extends GmRoleAbstract{
|
|||
}else {
|
||||
hero.upStar(prarm2-hero.getStar());
|
||||
}
|
||||
|
||||
getUser().getHeroManager().addHeroHandBook(hero.getTemplateId(),hero.getStar());
|
||||
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByType = STableManager.getFigureConfig(HeroStaticConfig.class).getScHeroRankUpConfigByShow(GlobalsDef.UP_STAR_TYPE,scHero.getStar());
|
||||
Map<Integer, SCHeroRankUpConfig> scHeroRankUpConfigByTypeTree = new TreeMap<>(scHeroRankUpConfigByType);
|
||||
SCHeroRankUpConfig scHeroRankUpConfig = ((TreeMap<Integer, SCHeroRankUpConfig>) scHeroRankUpConfigByTypeTree).lowerEntry(hero.getStar()).getValue();
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ public class Cmd_role_gm extends GmRoleAbstract {
|
|||
int differDemonsLv = sArenaRobotConfig.getDifferDemonsLv();
|
||||
int robotLevel = sArenaRobotConfig.getRoleLv();
|
||||
Map<Integer, Long> robotHeroAttribute = HeroLogic.getInstance().calRobotHeroAttribute(scHero, robotLevel, 0, differDemonsId, differDemonsLv, false);
|
||||
heroAllAttribute.put(heroTid.toString(), new FamilyHeroInfo(heroTid, robotLevel, heroStar, robotHeroAttribute,inner++));
|
||||
heroAllAttribute.put(heroTid.toString(), new FamilyHeroInfo(heroTid, robotLevel, heroStar, robotHeroAttribute,inner++,0));
|
||||
// String property = HeroLogic.getInstance().getRobotHeroProperty(sArenaRobotConfig,scHero,propertySb,robotHeroAttribute).toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -407,8 +407,6 @@ public class GlobalDataManaager implements IManager {
|
|||
public static void checkNeedReFlush(ISession session,User user,PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder) throws Exception {
|
||||
// 需要隔天刷新的字段统一在这里处理
|
||||
if (TimeUtils.isOverTime(0,user.getPlayerInfoManager().getLoginTime())) {
|
||||
//周卡每日刷新
|
||||
//WeekCardLogic.getInstance().sendWeekCardInitInfo(session);
|
||||
//活动刷新
|
||||
ActivityLogic.getInstance().flushEveryDay(user,fBuilder);
|
||||
PlayerLogic.getInstance().vipflushEveryDay(user,fBuilder);
|
||||
|
|
@ -434,6 +432,10 @@ public class GlobalDataManaager implements IManager {
|
|||
SevenWorldLogic.getInstance().sevenWorldInfoIndication(session);
|
||||
// 御剑行
|
||||
RidingSwardLogic.getInstance().zeroClearRidingSwardByUser(user);
|
||||
//周卡邮件发放未领取奖励
|
||||
WeekCardLogic.getInstance().sendWeekCardRewardMail(session);
|
||||
//周卡每日刷新
|
||||
WeekCardLogic.getInstance().sendWeekCardInitInfo(session);
|
||||
|
||||
// GuildChallengeLogic.getInstance().resetBossDamage(user);
|
||||
if(TimeUtils.isSpanTime(user.getPlayerInfoManager().getLoginTime(),TimeUtils.now(),1,0)){
|
||||
|
|
|
|||
|
|
@ -243,8 +243,6 @@ public class GlobleSystemLogic implements IEventHandler {
|
|||
LOGGER.error("跨服分组,未获取到锁");
|
||||
return;
|
||||
}
|
||||
// 跨服排行榜处理
|
||||
CrossRankManager.getInstance().cleanCrossRank();
|
||||
|
||||
//这里为所有服务器的世界等级
|
||||
Map<String,Integer> worldLevelMap = redisUtil.getMapValues(RedisKey.SERVER_WORLDLEVE_INFO,"",String.class,Integer.class);
|
||||
|
|
@ -285,13 +283,20 @@ public class GlobleSystemLogic implements IEventHandler {
|
|||
redisUtil.del(RedisKey.CHAT_CROSS_MSG_ID+i);
|
||||
}
|
||||
|
||||
// 重新分组,需要删除旧排行榜数据,重新分组
|
||||
redisUtil.delVague(RedisKey.CROSS_RANK_DELETE,"CROSS_RANK_UPDATE:.*");
|
||||
|
||||
//释放分布式锁
|
||||
redisUtil.del("SERVER_SPLIT_REDIS_LOCK");
|
||||
|
||||
LOGGER.info("跨服分组结束");
|
||||
// splitInfo = RedisUtil.getInstence().getMapValues(RedisKey.SERVER_SPLIT_INFO,"",String.class,Integer.class);
|
||||
}
|
||||
//获取当前区服的跨服区组 -1为未在分组内
|
||||
|
||||
/**
|
||||
* 获取当前区服的跨服区组 -1为未在分组内
|
||||
* @return
|
||||
*/
|
||||
public int getCrossGroup(){
|
||||
//测试服不参与分组和跨服
|
||||
if(!GameApplication.serverProperties.isArenaCross()){
|
||||
|
|
@ -299,8 +304,23 @@ public class GlobleSystemLogic implements IEventHandler {
|
|||
}
|
||||
Integer group = RedisUtil.getInstence().getMapValue(RedisKey.SERVER_SPLIT_INFO, "", String.valueOf(GameApplication.serverId), Integer.class);
|
||||
crossGroup = group==null?-1:group;
|
||||
return crossGroup;
|
||||
}
|
||||
|
||||
return crossGroup;
|
||||
/**
|
||||
* 获取和当前分组同一分组的服务器id
|
||||
* @return
|
||||
*/
|
||||
public List<String> getCrossServersByGroup(){
|
||||
int group = getCrossGroup();
|
||||
Map<String, Integer> values = RedisUtil.getInstence().getMapValues(RedisKey.SERVER_SPLIT_INFO, "", String.class, Integer.class);
|
||||
ArrayList<String> list = new ArrayList<>();
|
||||
for (Map.Entry<String, Integer> entry : values.entrySet()) {
|
||||
if (entry.getValue() == group){
|
||||
list.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,25 @@
|
|||
package com.ljsd.jieling.logic.activity.activityLogic;
|
||||
|
||||
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.WeekCardInfo;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SErrorCodeEerverConfig;
|
||||
import config.SWeekcardConfig;
|
||||
import config.SWeekcardRotationConfig;
|
||||
import manager.STableManager;
|
||||
import rpc.protocols.ActivityProto;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import util.StringUtil;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class WeekCardLogic {
|
||||
|
||||
|
|
@ -25,7 +28,6 @@ public class WeekCardLogic {
|
|||
|
||||
public static class Instance {
|
||||
public final static WeekCardLogic instance = new WeekCardLogic();
|
||||
|
||||
}
|
||||
|
||||
public static WeekCardLogic getInstance() {
|
||||
|
|
@ -39,7 +41,56 @@ public class WeekCardLogic {
|
|||
res.addAllAllWeekCardInfo(weekCardList);
|
||||
//MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.WeekCardIndicationInfoResponse, res.build(), true);
|
||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.WeekCardIndicationInfoResponse_VALUE,res.build(),true);
|
||||
}
|
||||
|
||||
public void sendWeekCardRewardMail(ISession session)throws Exception{
|
||||
//发每周未领取的奖励
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
Map<Integer, WeekCardInfo> weekCard = user.getPlayerInfoManager().getWeekCard();
|
||||
Map<Integer,Integer>dropMap = new HashMap<>();
|
||||
boolean isSave = false;
|
||||
for(WeekCardInfo weekCardVal:weekCard.values()){
|
||||
Map<Integer, SWeekcardConfig> config = STableManager.getConfig(SWeekcardConfig.class);
|
||||
if(!config.containsKey(weekCardVal.getId())){
|
||||
continue;
|
||||
}
|
||||
if(!weekCardVal.isBuy()){
|
||||
continue;
|
||||
}
|
||||
if(TimeUtils.isSameWeek7(weekCardVal.getBugTime())){
|
||||
continue;
|
||||
}
|
||||
if(Calendar.DAY_OF_WEEK - weekCardVal.getLeaveGetRewardDays()>0){
|
||||
for(int i= (Calendar.DAY_OF_WEEK - weekCardVal.getLeaveGetRewardDays());i>0;i--){
|
||||
int [][]drop =config.get(weekCardVal.getId()).getBaseReward();
|
||||
for(int[] single:drop){
|
||||
if(dropMap.containsKey(single[0])){
|
||||
dropMap.put(single[0],dropMap.get(single[0])+single[1]);
|
||||
}else{
|
||||
dropMap.put(single[0],single[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
weekCardVal.setBuy(false);
|
||||
weekCardVal.setBugTime(0);
|
||||
isSave =true;
|
||||
}else{
|
||||
weekCardVal.setBuy(false);
|
||||
weekCardVal.setBugTime(0);
|
||||
isSave = true;
|
||||
}
|
||||
if(isSave){
|
||||
user.getPlayerInfoManager().setWeekCard(weekCard);
|
||||
}
|
||||
if(dropMap.size()>0){
|
||||
int [][] dropArray= dropMap.entrySet().stream().map(n->new int[]{n.getKey(),n.getValue()}).toArray(int[][]::new);
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("WeekcardReward_mail_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("WeekcardReward_mail_txt");
|
||||
// 排行奖励
|
||||
MailLogic.getInstance().sendMail(user.getId(), title, content,
|
||||
StringUtil.parseArrayToString(dropArray), TimeUtils.nowInt(), Global.MAIL_EFFECTIVE_TIME);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public List<CommonProto.WeekCard> initAllWeekCardInfo(User user) throws Exception{
|
||||
|
|
@ -53,8 +104,10 @@ public class WeekCardLogic {
|
|||
Map<Integer,SWeekcardRotationConfig> config = STableManager.getConfig(SWeekcardRotationConfig.class);
|
||||
boolean isSaveToDb =false;
|
||||
List<CommonProto.WeekCard> weekCardList=new ArrayList<>();
|
||||
if(weekCardType == null || weekCardType.length ==0){
|
||||
return weekCardList;
|
||||
}
|
||||
for(int i= 1;i<weekCardType.length;i++){
|
||||
//if(config.containsKey(weekCardType[i])){
|
||||
CommonProto.WeekCard.Builder weekCardProto = CommonProto.WeekCard.newBuilder();
|
||||
//周卡是否存在 判断是否过期
|
||||
if(!weekCard.containsKey(weekCardType[i])){
|
||||
|
|
@ -75,7 +128,6 @@ public class WeekCardLogic {
|
|||
weekCardProto.setIsBuy(singleWeekCard.isBuy());
|
||||
weekCardProto.setLeaveGetRewardDays(TimeUtils.getDayOfWeek()-singleWeekCard.getLeaveGetRewardDays());
|
||||
weekCardList.add(weekCardProto.build());
|
||||
//}
|
||||
}
|
||||
if(isSaveToDb){
|
||||
user.getPlayerInfoManager().setWeekCard(weekCard);
|
||||
|
|
@ -106,10 +158,14 @@ public class WeekCardLogic {
|
|||
if(level == 0){
|
||||
level = user.getPlayerInfoManager().getLevel();
|
||||
}
|
||||
if(level>=cardType[0][0]&&level<=cardType[1][0]){
|
||||
return cardType[0];
|
||||
if(cardType.length>1){
|
||||
if(level>=cardType[0][0]&&level<=cardType[1][0]){
|
||||
return cardType[0];
|
||||
}else {
|
||||
return cardType[1];
|
||||
}
|
||||
}else {
|
||||
return cardType[1];
|
||||
return cardType[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,11 +62,11 @@ public class CrossServiceLogic {
|
|||
try {
|
||||
MongoTemplate core = MongoUtil.getCoreMongoTemplate();
|
||||
List<CServerInfo> cServerInfos = core.findAll(CServerInfo.class);
|
||||
Map<Integer,CServerInfo> serverInfoMap = new HashMap<>(cServerInfos.size());
|
||||
cServerInfos.forEach(n->serverInfoMap.put(n.getServerId(),n));
|
||||
Map<Integer, CServerInfo> serverInfoMap = new HashMap<>(cServerInfos.size());
|
||||
cServerInfos.forEach(n -> serverInfoMap.put(n.getServerId(), n));
|
||||
cServerInfoMap = serverInfoMap;
|
||||
} catch (UnknownHostException e) {
|
||||
LOGGER.error("=========跨服服务器列表获取失败=======:{}",e.getMessage());
|
||||
LOGGER.error("=========跨服服务器列表获取失败=======:{}", e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public class BloodLogic {
|
|||
}
|
||||
}
|
||||
int position = heroInfo.getPosition();
|
||||
heroAllAttribute.put(heroInfo.getHeroId(), new FamilyHeroInfo(hero.getTemplateId(), hero.getLevel(user.getHeroManager()),hero.getStar(), heroAttributeMap,position));
|
||||
heroAllAttribute.put(heroInfo.getHeroId(), new FamilyHeroInfo(hero.getTemplateId(), hero.getLevel(user.getHeroManager()),hero.getStar(), heroAttributeMap,position,hero.getGodSoulLv()));
|
||||
}
|
||||
return heroAllAttribute;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,14 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
|||
|
||||
private int skin;
|
||||
|
||||
///神魂绑定英雄 神魂等级:<hero动态id>
|
||||
private Map<Integer,List<String>>godSoulBindMap=new HashMap<>();
|
||||
|
||||
private int godSoulLv;
|
||||
|
||||
//被神魂绑定英雄 英雄动态id:英雄神魂等级(反绑)
|
||||
private Map<String,Integer>godSoulBeBindMap=new HashMap<>();
|
||||
|
||||
public Hero() {
|
||||
//绑定关系
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
|
|
@ -463,6 +471,57 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
|||
updateString("skin", skin);
|
||||
}
|
||||
|
||||
public Map<Integer,List<String>> getGodSoulBindMap() {
|
||||
return godSoulBindMap;
|
||||
}
|
||||
|
||||
///神魂绑定 changeType 1:增加或者修改 2:移除
|
||||
public void setGodSoulBindMap(int changeType,int lv,List<String>heroIds) {
|
||||
if (changeType==1){
|
||||
godSoulBindMap.put(lv,heroIds);
|
||||
}else {
|
||||
int curLv= godSoulBindMap.size();
|
||||
for (int i = 1; i < curLv+1; i++) {
|
||||
if (i>=lv){
|
||||
godSoulBindMap.remove(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.godSoulLv=godSoulBindMap.size();
|
||||
updateString("godSoulLv", godSoulLv);
|
||||
updateString("godSoulBindMap", godSoulBindMap);
|
||||
}
|
||||
|
||||
public Map<String,Integer> getGodSoulBeBindMap() {
|
||||
return godSoulBeBindMap;
|
||||
}
|
||||
|
||||
public int getGodSoulLv() {
|
||||
return godSoulLv;
|
||||
}
|
||||
|
||||
///设置被神魂绑定关系 changeType 1:增加 2:移除
|
||||
public void setGodSoulBeBindMap(int changeType,String heroId,int godSoulLv) {
|
||||
if (changeType==1){
|
||||
godSoulBeBindMap.put(heroId,godSoulLv);
|
||||
}else{
|
||||
godSoulBeBindMap.remove(heroId);
|
||||
}
|
||||
updateString("godSoulBeBindMap", godSoulBeBindMap);
|
||||
}
|
||||
|
||||
///检测该英雄是否已经被当前英雄绑定
|
||||
public boolean CheckGodSoulIsBind(int level,String _heroId){
|
||||
for (Map.Entry<Integer, List<String>> listEntry : godSoulBindMap.entrySet()) {
|
||||
if (listEntry.getKey()==level)continue;
|
||||
if (listEntry.getValue().contains(_heroId)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int compareTo(Hero o) {
|
||||
int compareValue = o.getOriginalLevel() - this.getOriginalLevel();
|
||||
|
|
|
|||
|
|
@ -7,12 +7,14 @@ import com.ljsd.jieling.logic.dao.root.User;
|
|||
import com.ljsd.jieling.logic.hero.HongMengAttributeEnum;
|
||||
import config.SLikeAbilityConfig;
|
||||
import config.SSpecialConfig;
|
||||
import org.omg.CORBA.PUBLIC_MEMBER;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
public class HeroManager extends MongoBase {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(HeroManager.class);
|
||||
/**
|
||||
* 玩家英雄列表
|
||||
*/
|
||||
|
|
@ -252,13 +254,33 @@ public class HeroManager extends MongoBase {
|
|||
if (heroMap.containsKey(heroId)){
|
||||
removeString(getMongoKey()+".heroMap." + heroId);
|
||||
Poster.getPoster().dispatchEvent(new RemoveHeroEvent(uid,heroId));
|
||||
removeHeroGodSoul(heroId);
|
||||
heroMap.remove(heroId);
|
||||
try {
|
||||
if(UserManager.getUser(uid).getPlayerInfoManager().getMaxforceHero().equals(heroId)){
|
||||
UserManager.getUser(uid).getPlayerInfoManager().setMaxforceHero("");
|
||||
}
|
||||
}catch (Exception e){}
|
||||
}catch (Exception e){
|
||||
LOGGER.info("removeHero uid={},heroId={},Exception={}",uid,heroId,e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///移除英雄设置神魂绑定相关信息
|
||||
public void removeHeroGodSoul(String heroId){
|
||||
Hero hero= heroMap.get(heroId);
|
||||
Map<Integer, List<String>>godSoulBindMap=hero.getGodSoulBindMap();
|
||||
for (Map.Entry<Integer, List<String>> integerListEntry : godSoulBindMap.entrySet()) {
|
||||
List<String>heroList=integerListEntry.getValue();
|
||||
for (String bindId : heroList) {
|
||||
Hero bingHero= heroMap.get(bindId);
|
||||
bingHero.setGodSoulBeBindMap(2,heroId,0);
|
||||
}
|
||||
}
|
||||
Map<String,Integer>godSoulBeBindMap=hero.getGodSoulBeBindMap();
|
||||
for (Map.Entry<String, Integer> stringIntegerEntry : godSoulBeBindMap.entrySet()) {
|
||||
Hero bingHero= heroMap.get(stringIntegerEntry.getKey());
|
||||
bingHero.setGodSoulBindMap(2,stringIntegerEntry.getValue(),null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -271,7 +293,7 @@ public class HeroManager extends MongoBase {
|
|||
}
|
||||
|
||||
public void addHeroHandBook(int heroId,int star){
|
||||
if(heroHandBook.containsKey(heroId)){
|
||||
if(heroHandBook.containsKey(heroId)&&heroHandBook.get(heroId)>=star){
|
||||
return;
|
||||
}
|
||||
heroHandBook.put(heroId,Math.max(heroHandBook.getOrDefault(heroId,0),star));
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@ public class TaSuiHero {
|
|||
|
||||
private int star;
|
||||
|
||||
private int godSoulLv;
|
||||
|
||||
public int getTempId() {
|
||||
return tempId;
|
||||
}
|
||||
|
|
@ -25,9 +27,14 @@ public class TaSuiHero {
|
|||
return star;
|
||||
}
|
||||
|
||||
public TaSuiHero(int tempId, int leve, int star) {
|
||||
public int getGodSoulLv() {
|
||||
return godSoulLv;
|
||||
}
|
||||
|
||||
public TaSuiHero(int tempId, int leve, int star,int godSoulLv) {
|
||||
this.tempId = tempId;
|
||||
this.leve = leve;
|
||||
this.star = star;
|
||||
this.godSoulLv=godSoulLv;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ public class ArenaOfHero {
|
|||
private int createType;
|
||||
private int changeId;
|
||||
private int skin;
|
||||
private int godSoulLv;//神魂等级
|
||||
private Set<String> jewelInfo = new HashSet<>();
|
||||
private Map<Integer,Long> attributeMap = new HashMap<>();
|
||||
private Map<Integer,Map<Integer,Long>> attributeMapByTeam = new HashMap<>();
|
||||
|
|
@ -167,4 +168,12 @@ public class ArenaOfHero {
|
|||
public void setSkin(int skin) {
|
||||
this.skin = skin;
|
||||
}
|
||||
|
||||
public int getGodSoulLv() {
|
||||
return godSoulLv;
|
||||
}
|
||||
|
||||
public void setGodSoulLv(int godSoulLv) {
|
||||
this.godSoulLv = godSoulLv;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,7 +200,7 @@ public class BattleNode extends AbstractExpedition {
|
|||
Map<Integer,Long> longAttribute = new HashMap<>();
|
||||
robotHeroAttribute.forEach((k,v)->longAttribute.put(k,(long)v));
|
||||
force+=HeroLogic.getInstance().calForce(longAttribute);
|
||||
heroAllAttribute.put(id.toString(), new FamilyHeroInfo(id, property.getId(), property.getStar(), longAttribute,innerPosition++));
|
||||
heroAllAttribute.put(id.toString(), new FamilyHeroInfo(id, property.getId(), property.getStar(), longAttribute,innerPosition++,0));
|
||||
}
|
||||
|
||||
fightInfo.setForce(force);
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class SpecialNode extends AbstractExpedition {
|
|||
int force = HeroLogic.getInstance().calForce(longAttribute);
|
||||
fightInfo.setForce(force);
|
||||
//试炼节点 放到第二个位置上
|
||||
heroAllAttribute.put(Integer.toString(heroId), new FamilyHeroInfo(heroId,level,robot.getStar(),longAttribute,2));
|
||||
heroAllAttribute.put(Integer.toString(heroId), new FamilyHeroInfo(heroId,level,robot.getStar(),longAttribute,2,0));
|
||||
fightInfo.updateHeroSkill(String.valueOf(heroId),skills.substring(0,skills.length()-1));
|
||||
// 获取灵兽信息
|
||||
SRobotProperty property = STableManager.getConfig(SRobotProperty.class).get(level);
|
||||
|
|
|
|||
|
|
@ -131,6 +131,7 @@ public class GuildFightLogic {
|
|||
.setHeroTid(familyHeroInfo.getTempleteId())
|
||||
.setStar(familyHeroInfo.getStar())
|
||||
.setLevel(familyHeroInfo.getLevel())
|
||||
.setGodSoulLv(familyHeroInfo.getGodSoulLv())
|
||||
.build()
|
||||
);
|
||||
Map<Integer, Long> attribute = entry.getValue().getAttribute();
|
||||
|
|
|
|||
|
|
@ -331,6 +331,7 @@ public class FightUtil {
|
|||
.setStar(hero.getStar())
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
|
|
@ -398,6 +399,7 @@ public class FightUtil {
|
|||
.setStar(hero.getStar())
|
||||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
|
|
@ -438,6 +440,7 @@ public class FightUtil {
|
|||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setStar(hero.getStar())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
|
|
@ -661,6 +664,7 @@ public class FightUtil {
|
|||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(hero.getStar())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
|
|
@ -707,6 +711,7 @@ public class FightUtil {
|
|||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(hero.getStar())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv((hero.getGodSoulLv()))
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
|
|
@ -747,6 +752,7 @@ public class FightUtil {
|
|||
.setPosition(teamPosHeroInfo.getPosition())
|
||||
.setStar(hero.getStar())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,7 @@ public class SevenWorldFightHandler implements IFightEventProcesor {
|
|||
.setStar(hero.getStar())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setForceScore(HeroLogic.getInstance().calTeamForce(user,teamId))
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build();
|
||||
heroFightInfos.add(heroFightInfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ import java.math.BigDecimal;
|
|||
import java.util.*;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.function.IntToDoubleFunction;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class HeroLogic {
|
||||
|
|
@ -1548,7 +1549,7 @@ public class HeroLogic {
|
|||
// 消耗道具
|
||||
ItemUtil.itemCost(user, removeItemMap, BIReason.COMPLEX_EQUIP_CONSUME, 0);
|
||||
|
||||
rankUpHeroExecute(targetHero);
|
||||
rankUpHeroExecute(user,targetHero);
|
||||
user.getHeroManager().addHeroStar(targetHero.getTemplateId(), targetHero.getStar());
|
||||
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(), targetHero.getTemplateId(), targetHero.getStar()));
|
||||
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.UPSTAR.getType(), targetHero.getTemplateId()));
|
||||
|
|
@ -1608,7 +1609,7 @@ public class HeroLogic {
|
|||
}
|
||||
|
||||
|
||||
private void rankUpHeroExecute(Hero hero) throws Exception {
|
||||
private void rankUpHeroExecute(User user,Hero hero) throws Exception {
|
||||
//是否解锁法宝
|
||||
SGameSetting gameSetting = STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting();
|
||||
int[][] equipTalismanaUnlock = gameSetting.getEquipTalismanaUnlock();
|
||||
|
|
@ -1620,8 +1621,8 @@ public class HeroLogic {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
hero.upStar(1);
|
||||
user.getHeroManager().addHeroHandBook(hero.getTemplateId(),hero.getStar());
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1927,6 +1928,9 @@ public class HeroLogic {
|
|||
}
|
||||
}
|
||||
});
|
||||
if (hero.getGodSoulLv()>0){
|
||||
skillList.addAll(GetGodSoulSkill(hero.getTemplateId(),hero.getGodSoulLv()));
|
||||
}
|
||||
|
||||
return skillList;
|
||||
}
|
||||
|
|
@ -2297,6 +2301,14 @@ public class HeroLogic {
|
|||
}
|
||||
sb.append(sPlayerHeadIcon.getSkill()[0][0]).append(DIVISION);
|
||||
}
|
||||
|
||||
//神魂技能
|
||||
if (hero.getGodSoulLv()>0) {
|
||||
List<Integer>godSoulSkills= HeroLogic.getInstance().GetGodSoulSkill(hero.getTemplateId(),hero.getGodSoulLv());
|
||||
for (Integer godSoulSkill : godSoulSkills) {
|
||||
sb.append(godSoulSkill).append(DIVISION);
|
||||
}
|
||||
}
|
||||
return sb;
|
||||
}
|
||||
|
||||
|
|
@ -5758,4 +5770,64 @@ public class HeroLogic {
|
|||
fBuilder.setLikableRemainTime(remainTime);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测神魂绑定方法
|
||||
* @param user
|
||||
* @param heroId 当前神将
|
||||
* @param bindHeroList 绑定的神将列表
|
||||
* @param heroRankupId 神将绑定条件id
|
||||
* @param needNum 需要神将数量
|
||||
* @param index 检测开始索引
|
||||
* @return
|
||||
*/
|
||||
public boolean CheckHeroBindCondition(User user,String heroId,List<String>bindHeroList,int heroRankupId,int needNum,int index){
|
||||
if (needNum+index>bindHeroList.size())//首先判断数量是否满足条件
|
||||
{
|
||||
return false;
|
||||
}
|
||||
SHeroRankupGroup heroRankupGroup=STableManager.getConfig(SHeroRankupGroup.class).get(heroRankupId);
|
||||
for (int i = index; i < needNum+index; i++) {
|
||||
Hero bindHero= user.getHeroManager().getHero(bindHeroList.get(i));
|
||||
Hero hero= user.getHeroManager().getHero(heroId);
|
||||
if (bindHero.getStar()<heroRankupGroup.getStarLimit()){//星级要求
|
||||
return false;
|
||||
}
|
||||
if (heroRankupGroup.getIsId()>0){//需要指定神将
|
||||
if (bindHero.getTemplateId()!=heroRankupGroup.getIsId()) {
|
||||
return false;
|
||||
}
|
||||
}else if(heroRankupGroup.getIssame()>0) {//需要相同神将
|
||||
if (bindHero.getTemplateId()!=hero.getTemplateId()) {
|
||||
return false;
|
||||
}
|
||||
}else {
|
||||
SCHero heroConfig=SCHero.getsCHero().get(hero.getTemplateId());
|
||||
SCHero bindHeroConfig=SCHero.getsCHero().get(bindHero.getTemplateId());
|
||||
if (heroRankupGroup.getIsSameClan()>0){//需要同系神将
|
||||
if (heroConfig.getPropertyName()!=bindHeroConfig.getPropertyName()){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (heroRankupGroup.getIsSameJob()>0) {//需要同职业
|
||||
if (heroConfig.getProfession()!=bindHeroConfig.getProfession()){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
///获取英雄神魂技能
|
||||
public List<Integer> GetGodSoulSkill(int heroTId,int godSoulLv){
|
||||
List<Integer>skillList=new ArrayList<>();
|
||||
SCHero tempHero = SCHero.getsCHero().get(heroTId);
|
||||
for (int[] ints : tempHero.getSoulSkill()) {
|
||||
if (ints[0]<=godSoulLv){
|
||||
skillList.add(ints[1]);
|
||||
}
|
||||
}
|
||||
return skillList;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -570,7 +570,13 @@ public class PlayerLogic {
|
|||
Map<Integer, TaSuiHero> taSuiHeroMap = user.getHeroManager().getTaSuiHeroMap();
|
||||
for(Map.Entry<Integer,TaSuiHero> entry:taSuiHeroMap.entrySet()){
|
||||
TaSuiHero hero = entry.getValue();
|
||||
CommonProto.TeamSimpleInfo info = CommonProto.TeamSimpleInfo.newBuilder().setHeroTid(hero.getTempId()).setLevel(hero.getLeve()).setStar(hero.getStar()).setPosition(entry.getKey()).build();
|
||||
CommonProto.TeamSimpleInfo info = CommonProto.TeamSimpleInfo.newBuilder()
|
||||
.setHeroTid(hero.getTempId())
|
||||
.setLevel(hero.getLeve())
|
||||
.setStar(hero.getStar())
|
||||
.setPosition(entry.getKey())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build();
|
||||
teamInfo.addTeam(info);
|
||||
}
|
||||
teamInfo.setTotalForce(user.getHeroManager().getTaSuiLingXiaoRankForce());
|
||||
|
|
@ -632,7 +638,7 @@ public class PlayerLogic {
|
|||
for(Map.Entry<Integer,CommonProto.Hero> item : sArenaRobotConfig.getHeroMapList().entrySet()){
|
||||
Integer heroTid = item.getKey();
|
||||
Integer heroStar = item.getValue().getStar();
|
||||
teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder().setHeroid(String.valueOf(heroTid)).setHeroTid(heroTid).setLevel(sArenaRobotConfig.getRoleLv()).setStar(heroStar).setPosition(position++).build());
|
||||
teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder().setHeroid(String.valueOf(heroTid)).setHeroTid(heroTid).setLevel(sArenaRobotConfig.getRoleLv()).setStar(heroStar).setPosition(position++).setGodSoulLv( item.getValue().getGodSoulLv()).build());
|
||||
}
|
||||
oneInfo.setTeam(teamInfo);
|
||||
//TODO 玉虚论道三队伍
|
||||
|
|
@ -730,7 +736,7 @@ public class PlayerLogic {
|
|||
for(Map.Entry<Integer,CommonProto.Hero> item : sArenaRobotConfig.getHeroMapList().entrySet()){
|
||||
Integer heroTid = item.getKey();
|
||||
Integer heroStar = item.getValue().getStar();
|
||||
teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder().setHeroid(String.valueOf(heroTid)).setHeroTid(heroTid).setLevel(sArenaRobotConfig.getRoleLv()).setStar(heroStar).setPosition(position++).build());
|
||||
teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder().setHeroid(String.valueOf(heroTid)).setHeroTid(heroTid).setLevel(sArenaRobotConfig.getRoleLv()).setStar(heroStar).setPosition(position++).setGodSoulLv(item.getValue().getGodSoulLv()).build());
|
||||
}
|
||||
teamInfo.setTotalForce(sArenaRobotConfig.getYxldTotalForce1());
|
||||
|
||||
|
|
@ -738,7 +744,7 @@ public class PlayerLogic {
|
|||
for(Map.Entry<Integer,CommonProto.Hero> item : sArenaRobotConfig.getHeroMapList2().entrySet()){
|
||||
Integer heroTid = item.getKey();
|
||||
Integer heroStar = item.getValue().getStar();
|
||||
teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder().setHeroid(String.valueOf(heroTid)).setHeroTid(heroTid).setLevel(sArenaRobotConfig.getRoleLv()).setStar(heroStar).setPosition(position++).build());
|
||||
teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder().setHeroid(String.valueOf(heroTid)).setHeroTid(heroTid).setLevel(sArenaRobotConfig.getRoleLv()).setStar(heroStar).setPosition(position++).setGodSoulLv(item.getValue().getGodSoulLv()).build());
|
||||
}
|
||||
teamInfo.setTotalForce(sArenaRobotConfig.getYxldTotalForce2());
|
||||
|
||||
|
|
@ -746,7 +752,7 @@ public class PlayerLogic {
|
|||
for(Map.Entry<Integer,CommonProto.Hero> item : sArenaRobotConfig.getHeroMapList3().entrySet()){
|
||||
Integer heroTid = item.getKey();
|
||||
Integer heroStar = item.getValue().getStar();
|
||||
teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder().setHeroid(String.valueOf(heroTid)).setHeroTid(heroTid).setLevel(sArenaRobotConfig.getRoleLv()).setStar(heroStar).setPosition(position++).build());
|
||||
teamInfo.addTeam(CommonProto.TeamSimpleInfo.newBuilder().setHeroid(String.valueOf(heroTid)).setHeroTid(heroTid).setLevel(sArenaRobotConfig.getRoleLv()).setStar(heroStar).setPosition(position++).setGodSoulLv(item.getValue().getGodSoulLv()).build());
|
||||
}
|
||||
teamInfo.setTotalForce(sArenaRobotConfig.getYxldTotalForce3());
|
||||
}
|
||||
|
|
@ -756,6 +762,67 @@ public class PlayerLogic {
|
|||
//oneInfo.setTeam(teamInfo);
|
||||
return oneInfo;
|
||||
}
|
||||
//跨服三队伍
|
||||
public CommonProto.TeamOneInfo.Builder getUserTeamOneInfo(int uid,List<Integer> crossTeamId) throws Exception {
|
||||
User user = UserManager.getUser(uid);
|
||||
CommonProto.TeamOneInfo.Builder oneInfo = CBean2Proto.getTeamOneInfo(user);
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
for(int teamId:crossTeamId){
|
||||
CommonProto.TeamOneTeamInfo.Builder teamInfo = CommonProto.TeamOneTeamInfo.newBuilder();
|
||||
// 总战力
|
||||
teamInfo.setTotalForce(HeroLogic.getInstance().calTeamTotalForce(user,teamId,false));
|
||||
|
||||
if(teamId==GlobalsDef.TASUILINGXIAO_CHALLENGE){
|
||||
Map<Integer, TaSuiHero> taSuiHeroMap = user.getHeroManager().getTaSuiHeroMap();
|
||||
for(Map.Entry<Integer,TaSuiHero> entry:taSuiHeroMap.entrySet()){
|
||||
TaSuiHero hero = entry.getValue();
|
||||
CommonProto.TeamSimpleInfo info = CommonProto.TeamSimpleInfo.newBuilder().setHeroTid(hero.getTempId()).setLevel(hero.getLeve()).setStar(hero.getStar()).setPosition(entry.getKey()).setGodSoulLv(hero.getGodSoulLv()).build();
|
||||
teamInfo.addTeam(info);
|
||||
}
|
||||
teamInfo.setTotalForce(user.getHeroManager().getTaSuiLingXiaoRankForce());
|
||||
|
||||
}else{
|
||||
if(teamPosManager.getTeamPosForHero().containsKey(teamId)){
|
||||
// 添加队伍信息
|
||||
List<TeamPosHeroInfo> heroInfos = teamPosManager.getTeamPosForHero().get(teamId);
|
||||
for (TeamPosHeroInfo heroInfo:heroInfos) {
|
||||
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
|
||||
teamInfo.addTeam(CBean2Proto.getSimpleTeamInfoByHero(user, hero,heroInfo.getPosition()));
|
||||
}
|
||||
// 紫府神印
|
||||
List<String> collect = heroInfos.stream().map(TeamPosHeroInfo::getHeroId).collect(Collectors.toList());
|
||||
teamInfo.addAllSealShow(CBean2Proto.getPurpleSealShow(user,collect));
|
||||
}
|
||||
|
||||
}
|
||||
//加入灵兽信息
|
||||
PokemonManager pokemonManager = user.getPokemonManager();
|
||||
if(!pokemonManager.getPokemonTeamMap().isEmpty()){
|
||||
for(Map.Entry<Integer,String> entry:pokemonManager.getPokemonTeamMap().entrySet()){
|
||||
Pokemon pokemon = pokemonManager.getPokemonMap().get(entry.getValue());
|
||||
if(pokemon==null){
|
||||
continue;
|
||||
}
|
||||
teamInfo.addPokemonInfos(CBean2Proto.getSimpleTeamInfoByPokeMon(pokemon,entry.getKey()));
|
||||
}
|
||||
}
|
||||
int guildId = user.getPlayerInfoManager().getGuildId();
|
||||
if(guildId!=0){
|
||||
if(GuilidManager.guildInfoMap.containsKey(guildId)){
|
||||
String name = GuilidManager.guildInfoMap.get(guildId).getName();
|
||||
oneInfo.setGuildName(name);
|
||||
}
|
||||
|
||||
}
|
||||
if(teamId==GlobalsDef.CROSS_YU_XU_LUN_DAO_ONE ||teamId==GlobalsDef.CROSS_YU_XU_LUN_DAO_TWO || teamId==GlobalsDef.CROSS_YU_XU_LUN_DAO_THREE ){
|
||||
oneInfo.addCrossTeam(teamInfo);
|
||||
}else{
|
||||
oneInfo.setTeam(teamInfo);
|
||||
}
|
||||
}
|
||||
return oneInfo;
|
||||
}
|
||||
|
||||
|
||||
//获取跨服玩家信息
|
||||
public CommonProto.TeamOneInfo getCrossYxldMyTeamInfo(User user,List<Integer> team) throws Exception{
|
||||
|
|
@ -792,6 +859,7 @@ public class PlayerLogic {
|
|||
.setStar(hero.getStar())
|
||||
.setPosition(heroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
|
@ -862,6 +930,7 @@ public class PlayerLogic {
|
|||
.setStar(hero.getStar())
|
||||
.setPosition(heroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
|
@ -968,6 +1037,7 @@ public class PlayerLogic {
|
|||
.setStar(hero.getStar())
|
||||
.setPosition(heroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
|
@ -1050,6 +1120,7 @@ public class PlayerLogic {
|
|||
.setStar(hero.getStar())
|
||||
.setPosition(heroInfo.getPosition())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
|
@ -1226,7 +1297,7 @@ public class PlayerLogic {
|
|||
CommonProto.Hero.Builder heroBuilder = CommonProto.Hero.newBuilder().
|
||||
setLevel(hero.getLevel(user.getHeroManager()))
|
||||
.setEspecialEquipLevel(hero.getEspecialEquipLevel())
|
||||
.setStar(hero.getStar()).setId(hero.getId())
|
||||
.setStar(hero.getStar()).setId(hero.getId()).setGodSoulLv(hero.getGodSoulLv())
|
||||
.setHeroId(hero.getTemplateId())
|
||||
.setBreakId(hero.getBreakIdByHongMeng(user.getHeroManager()))
|
||||
.setStarBreakId(hero.getStarBreakId());
|
||||
|
|
@ -1271,6 +1342,7 @@ public class PlayerLogic {
|
|||
}
|
||||
// 皮肤
|
||||
heroBuilder.setSkinId(hero.getSkin());
|
||||
heroBuilder.setGodSoulLv(hero.getGodSoulLv());
|
||||
// 英雄技能
|
||||
int profession = SCHero.getsCHero().get(hero.getTemplateId()).getProfession();
|
||||
int skill = user.getGuildMyInfo().getGuildSkill().getOrDefault(profession, 0);
|
||||
|
|
@ -1282,6 +1354,20 @@ public class PlayerLogic {
|
|||
return builder.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 跨服英雄属性展示特殊处理
|
||||
* @param id
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
private CommonProto.SpecialEffects crossPropertyHandle(int id,int value){
|
||||
int values = value;
|
||||
if (id == 53 || id == 57 || id == 58){
|
||||
values = value-10000;
|
||||
}
|
||||
return CommonProto.SpecialEffects.newBuilder().setPropertyId(id).setPropertyValue(values).build();
|
||||
}
|
||||
|
||||
public void takeSevenScoreReward(ISession iSession) throws Exception {
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
int msgId = MessageTypeProto.MessageType.TAKE_SEVEN_HAPPY_REWARD_RESPONSE_VALUE;
|
||||
|
|
@ -1503,41 +1589,6 @@ public class PlayerLogic {
|
|||
}
|
||||
return levelUpdateCount;
|
||||
}
|
||||
// private boolean priviliageCheck(User user, int privilageTypeId, int checkNum,boolean isUpdate){
|
||||
// Map<Integer, VipInfo> vipInfo = user.getPlayerInfoManager().getVipInfo();
|
||||
// if(privilageTypeId == 0){
|
||||
// return true;
|
||||
// }
|
||||
// List<SPrivilegeTypeConfig> sPrivilegeTypeConfigs = SPrivilegeTypeConfig.privilegeByType.get(privilageTypeId);
|
||||
// List<Integer> typePrivileges = new ArrayList<>();
|
||||
// for(SPrivilegeTypeConfig config:sPrivilegeTypeConfigs){
|
||||
// if(!vipInfo.containsKey(config.getId())){
|
||||
// continue;
|
||||
// }
|
||||
// typePrivileges.add(config.getId());
|
||||
// }
|
||||
// if(typePrivileges.isEmpty()){
|
||||
// return false;
|
||||
// }
|
||||
// for(Integer privilageId:typePrivileges){
|
||||
// VipInfo info = vipInfo.get(privilageId);
|
||||
// if(info.getEffectTime()!=0&&TimeUtils.now()/1000>info.getEffectTime()){
|
||||
// continue;
|
||||
// }
|
||||
// int mCount = getMaxCountByPrivilege(user,privilageId);
|
||||
// if(mCount==-1){
|
||||
// return true;
|
||||
// }
|
||||
// if((info.getCount()+checkNum>mCount)|| (info.getEffectTime()!=0&&TimeUtils.now()/1000>info.getEffectTime())){
|
||||
// continue;
|
||||
// }
|
||||
// if (isUpdate){
|
||||
// user.getPlayerInfoManager().updateVipPrivilage(privilageId, checkNum);
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
private int getMaxCountByPrivilege(User user,int privilegeId){
|
||||
SPrivilegeTypeConfig sPrivilegeTypeConfig = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(privilegeId);
|
||||
Map<Integer, Map<Integer, Integer>> conditionMap = SPrivilegeTypeConfig.conditionMap.get(sPrivilegeTypeConfig.getUnlockType());
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.ljsd.jieling.logic.rank;
|
||||
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
import com.ljsd.jieling.logic.dao.GuilidManager;
|
||||
|
|
@ -11,6 +12,7 @@ import org.slf4j.LoggerFactory;
|
|||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
|
|
@ -37,15 +39,10 @@ public class CrossRankManager {
|
|||
return CrossRankManager.Instance.INSTANCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 上次排行榜初始化时间
|
||||
*/
|
||||
private long time = 0L;
|
||||
|
||||
/**
|
||||
* 跨服排行处理
|
||||
*/
|
||||
public void crossRankHandle(boolean choice){
|
||||
public void crossRankHandle(){
|
||||
// 时间验证
|
||||
if (isTime()){
|
||||
// 全部排行遍历
|
||||
|
|
@ -57,11 +54,20 @@ public class CrossRankManager {
|
|||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
if(crossGroup != -1){
|
||||
AbstractRank rank = RankContext.getRankEnum(type);
|
||||
// 获取本服排行榜数据
|
||||
Set<ZSetOperations.TypedTuple<String>> range = RedisUtil.getInstence().getZsetreverseRangeWithScores(rank.getRedisKey(), "", 0, 100, true);
|
||||
// 批量放入跨服排行榜
|
||||
// 获取跨服key
|
||||
String key = RedisUtil.getInstence().getKey(rank.getCrossRedisKey(),"",false);
|
||||
RedisUtil.getInstence().zsetAddAall(key,range);
|
||||
// 清理旧榜数据
|
||||
RedisUtil.getInstence().del(key);
|
||||
// 获取本组的服务器列表
|
||||
List<String> servers = GlobleSystemLogic.getInstence().getCrossServersByGroup();
|
||||
for (String server : servers) {
|
||||
String localKey = RedisUtil.getInstence().getKey(server, rank.getRedisKey(), false);
|
||||
// 获取本地服排行榜数据
|
||||
Set<ZSetOperations.TypedTuple<String>> range =
|
||||
RedisUtil.getInstence().getZsetreverseRangeWithScores(localKey,"",0,100, false);
|
||||
// 批量放入跨服排行榜
|
||||
RedisUtil.getInstence().zsetAddAall(key,range);
|
||||
}
|
||||
LOGGER.info("=====================跨服排行榜处理========,key:{}",key);
|
||||
}
|
||||
}
|
||||
|
|
@ -74,14 +80,17 @@ public class CrossRankManager {
|
|||
* @return
|
||||
*/
|
||||
private boolean isTime(){
|
||||
long now = TimeUtils.now();
|
||||
long twoHour = TimeUtils.HOUR * 2;
|
||||
if (now >= twoHour+time){
|
||||
time = now;
|
||||
return true;
|
||||
}else{
|
||||
int group = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
if (group == -1){
|
||||
return false;
|
||||
}
|
||||
String key = RedisUtil.getInstence().getKey(RedisKey.CROSS_RANK_UPDATE, String.valueOf(group), false);
|
||||
Object object = RedisUtil.getInstence().get(key);
|
||||
if (object != null){
|
||||
return false;
|
||||
}
|
||||
RedisUtil.getInstence().set(key,"1",TimeUtils.HOUR * 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -95,25 +104,4 @@ public class CrossRankManager {
|
|||
LOGGER.info("==================工会缓存处理=============");
|
||||
}
|
||||
|
||||
/**
|
||||
* 清理跨服排行榜
|
||||
*/
|
||||
public void cleanCrossRank(){
|
||||
for (RankEnum value : RankEnum.values()) {
|
||||
int type = value.getType();
|
||||
//跨服
|
||||
if (RankContext.isCrossRank2(type) && RankContext.isCrossRank(type)) {
|
||||
// 获取分组id,是否跨服
|
||||
int crossGroup = GlobleSystemLogic.getInstence().getCrossGroup();
|
||||
if (crossGroup != -1) {
|
||||
AbstractRank rank = RankContext.getRankEnum(type);
|
||||
String key = RedisUtil.getInstence().getKey(rank.getCrossRedisKey(),"",false);
|
||||
RedisUtil.getInstence().del(key);
|
||||
time = 0L;
|
||||
LOGGER.info("=====================跨服排行榜清理========,key:{},time:{}",key,time);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ import com.ljsd.jieling.globals.Global;
|
|||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
import com.ljsd.jieling.logic.activity.crossService.CrossServiceLogic;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.TeamEnum;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
|
|
|
|||
|
|
@ -402,8 +402,8 @@ public class BuyGoodsNewLogic {
|
|||
}
|
||||
//周卡
|
||||
if(type==GiftGoodsType.WEEKCARD){
|
||||
//WeekCardLogic.getInstance().buyWeekCard(user,config.getId());
|
||||
//WeekCardLogic.getInstance().sendWeekCardInitInfo(session);
|
||||
WeekCardLogic.getInstance().buyWeekCard(user,config.getId());
|
||||
WeekCardLogic.getInstance().sendWeekCardInitInfo(session);
|
||||
}
|
||||
if(drop!=null&&session!=null){
|
||||
PlayerInfoProto.DirectBuyIndication build = PlayerInfoProto.DirectBuyIndication.newBuilder().setDrop(drop).build();
|
||||
|
|
|
|||
|
|
@ -162,10 +162,10 @@ public class MinuteTask extends Thread {
|
|||
}
|
||||
|
||||
try {
|
||||
CrossRankManager.getInstance().crossRankHandle(false);
|
||||
CrossRankManager.getInstance().crossRankHandle();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
LOGGER.error("跨服排行榜初始化一次,Exception::=>{}",e.toString());
|
||||
LOGGER.error("跨服排行榜初始化异常,Exception::=>{}",e.toString());
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
|
||||
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2021-10-21")
|
||||
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2021-10-28")
|
||||
public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOfHero._Fields>, java.io.Serializable, Cloneable, Comparable<ArenaOfHero> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ArenaOfHero");
|
||||
|
||||
|
|
@ -55,6 +55,7 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
private static final org.apache.thrift.protocol.TField ATTRIBUTE_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("attributeMap", org.apache.thrift.protocol.TType.MAP, (short)15);
|
||||
private static final org.apache.thrift.protocol.TField ATTRIBUTE_MAP_BY_TEAM_FIELD_DESC = new org.apache.thrift.protocol.TField("attributeMapByTeam", org.apache.thrift.protocol.TType.MAP, (short)16);
|
||||
private static final org.apache.thrift.protocol.TField ATTRIBUTE_MAP_BY_TEAM_BATTLE_FIELD_DESC = new org.apache.thrift.protocol.TField("attributeMapByTeamBattle", org.apache.thrift.protocol.TType.MAP, (short)17);
|
||||
private static final org.apache.thrift.protocol.TField GOD_SOUL_LV_FIELD_DESC = new org.apache.thrift.protocol.TField("godSoulLv", org.apache.thrift.protocol.TType.I32, (short)18);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
|
|
@ -79,6 +80,7 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
public Map<Integer,Long> attributeMap; // optional
|
||||
public Map<Integer,Map<Integer,Long>> attributeMapByTeam; // optional
|
||||
public Map<Integer,Map<Integer,Long>> attributeMapByTeamBattle; // optional
|
||||
public int godSoulLv; // optional
|
||||
|
||||
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
||||
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
||||
|
|
@ -98,7 +100,8 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
JEWEL_INFO((short)14, "jewelInfo"),
|
||||
ATTRIBUTE_MAP((short)15, "attributeMap"),
|
||||
ATTRIBUTE_MAP_BY_TEAM((short)16, "attributeMapByTeam"),
|
||||
ATTRIBUTE_MAP_BY_TEAM_BATTLE((short)17, "attributeMapByTeamBattle");
|
||||
ATTRIBUTE_MAP_BY_TEAM_BATTLE((short)17, "attributeMapByTeamBattle"),
|
||||
GOD_SOUL_LV((short)18, "godSoulLv");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
|
|
@ -147,6 +150,8 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
return ATTRIBUTE_MAP_BY_TEAM;
|
||||
case 17: // ATTRIBUTE_MAP_BY_TEAM_BATTLE
|
||||
return ATTRIBUTE_MAP_BY_TEAM_BATTLE;
|
||||
case 18: // GOD_SOUL_LV
|
||||
return GOD_SOUL_LV;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
@ -197,8 +202,9 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
private static final int __CREATETYPE_ISSET_ID = 7;
|
||||
private static final int __CHANGEID_ISSET_ID = 8;
|
||||
private static final int __SKIN_ISSET_ID = 9;
|
||||
private static final int __GODSOULLV_ISSET_ID = 10;
|
||||
private short __isset_bitfield = 0;
|
||||
private static final _Fields optionals[] = {_Fields.ID,_Fields.TEMPLATE_ID,_Fields.LEVEL,_Fields.STAR,_Fields.EQUIP_BY_POSITION_MAP,_Fields.SOUL_EQUIP_BY_POSITION_MAP,_Fields.BREAK_ID,_Fields.STAR_BREAK_ID,_Fields.CREATE_TIME,_Fields.ESPECIAL_EQUIP_LEVEL,_Fields.CREATE_TYPE,_Fields.CHANGE_ID,_Fields.SKIN,_Fields.JEWEL_INFO,_Fields.ATTRIBUTE_MAP,_Fields.ATTRIBUTE_MAP_BY_TEAM,_Fields.ATTRIBUTE_MAP_BY_TEAM_BATTLE};
|
||||
private static final _Fields optionals[] = {_Fields.ID,_Fields.TEMPLATE_ID,_Fields.LEVEL,_Fields.STAR,_Fields.EQUIP_BY_POSITION_MAP,_Fields.SOUL_EQUIP_BY_POSITION_MAP,_Fields.BREAK_ID,_Fields.STAR_BREAK_ID,_Fields.CREATE_TIME,_Fields.ESPECIAL_EQUIP_LEVEL,_Fields.CREATE_TYPE,_Fields.CHANGE_ID,_Fields.SKIN,_Fields.JEWEL_INFO,_Fields.ATTRIBUTE_MAP,_Fields.ATTRIBUTE_MAP_BY_TEAM,_Fields.ATTRIBUTE_MAP_BY_TEAM_BATTLE,_Fields.GOD_SOUL_LV};
|
||||
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
|
||||
static {
|
||||
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
|
||||
|
|
@ -251,6 +257,8 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32),
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))));
|
||||
tmpMap.put(_Fields.GOD_SOUL_LV, new org.apache.thrift.meta_data.FieldMetaData("godSoulLv", org.apache.thrift.TFieldRequirementType.OPTIONAL,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ArenaOfHero.class, metaDataMap);
|
||||
}
|
||||
|
|
@ -322,6 +330,7 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
}
|
||||
this.attributeMapByTeamBattle = __this__attributeMapByTeamBattle;
|
||||
}
|
||||
this.godSoulLv = other.godSoulLv;
|
||||
}
|
||||
|
||||
public ArenaOfHero deepCopy() {
|
||||
|
|
@ -357,6 +366,8 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
this.attributeMap = null;
|
||||
this.attributeMapByTeam = null;
|
||||
this.attributeMapByTeamBattle = null;
|
||||
setGodSoulLvIsSet(false);
|
||||
this.godSoulLv = 0;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
|
@ -827,6 +838,29 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
}
|
||||
}
|
||||
|
||||
public int getGodSoulLv() {
|
||||
return this.godSoulLv;
|
||||
}
|
||||
|
||||
public ArenaOfHero setGodSoulLv(int godSoulLv) {
|
||||
this.godSoulLv = godSoulLv;
|
||||
setGodSoulLvIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetGodSoulLv() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GODSOULLV_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field godSoulLv is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetGodSoulLv() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __GODSOULLV_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setGodSoulLvIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GODSOULLV_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case ID:
|
||||
|
|
@ -965,6 +999,14 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
}
|
||||
break;
|
||||
|
||||
case GOD_SOUL_LV:
|
||||
if (value == null) {
|
||||
unsetGodSoulLv();
|
||||
} else {
|
||||
setGodSoulLv((Integer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1021,6 +1063,9 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
case ATTRIBUTE_MAP_BY_TEAM_BATTLE:
|
||||
return getAttributeMapByTeamBattle();
|
||||
|
||||
case GOD_SOUL_LV:
|
||||
return Integer.valueOf(getGodSoulLv());
|
||||
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
|
@ -1066,6 +1111,8 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
return isSetAttributeMapByTeam();
|
||||
case ATTRIBUTE_MAP_BY_TEAM_BATTLE:
|
||||
return isSetAttributeMapByTeamBattle();
|
||||
case GOD_SOUL_LV:
|
||||
return isSetGodSoulLv();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
|
@ -1236,6 +1283,15 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_godSoulLv = true && this.isSetGodSoulLv();
|
||||
boolean that_present_godSoulLv = true && that.isSetGodSoulLv();
|
||||
if (this_present_godSoulLv || that_present_godSoulLv) {
|
||||
if (!(this_present_godSoulLv && that_present_godSoulLv))
|
||||
return false;
|
||||
if (this.godSoulLv != that.godSoulLv)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1328,6 +1384,11 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
if (present_attributeMapByTeamBattle)
|
||||
list.add(attributeMapByTeamBattle);
|
||||
|
||||
boolean present_godSoulLv = true && (isSetGodSoulLv());
|
||||
list.add(present_godSoulLv);
|
||||
if (present_godSoulLv)
|
||||
list.add(godSoulLv);
|
||||
|
||||
return list.hashCode();
|
||||
}
|
||||
|
||||
|
|
@ -1509,6 +1570,16 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetGodSoulLv()).compareTo(other.isSetGodSoulLv());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetGodSoulLv()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.godSoulLv, other.godSoulLv);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1658,6 +1729,12 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
}
|
||||
first = false;
|
||||
}
|
||||
if (isSetGodSoulLv()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("godSoulLv:");
|
||||
sb.append(this.godSoulLv);
|
||||
first = false;
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
@ -1933,6 +2010,14 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 18: // GOD_SOUL_LV
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
|
||||
struct.godSoulLv = iprot.readI32();
|
||||
struct.setGodSoulLvIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
|
|
@ -2110,6 +2195,11 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (struct.isSetGodSoulLv()) {
|
||||
oprot.writeFieldBegin(GOD_SOUL_LV_FIELD_DESC);
|
||||
oprot.writeI32(struct.godSoulLv);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
|
@ -2179,7 +2269,10 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
if (struct.isSetAttributeMapByTeamBattle()) {
|
||||
optionals.set(16);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 17);
|
||||
if (struct.isSetGodSoulLv()) {
|
||||
optionals.set(17);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 18);
|
||||
if (struct.isSetId()) {
|
||||
oprot.writeString(struct.id);
|
||||
}
|
||||
|
|
@ -2286,12 +2379,15 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
}
|
||||
}
|
||||
}
|
||||
if (struct.isSetGodSoulLv()) {
|
||||
oprot.writeI32(struct.godSoulLv);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, ArenaOfHero struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
BitSet incoming = iprot.readBitSet(17);
|
||||
BitSet incoming = iprot.readBitSet(18);
|
||||
if (incoming.get(0)) {
|
||||
struct.id = iprot.readString();
|
||||
struct.setIdIsSet(true);
|
||||
|
|
@ -2446,6 +2542,10 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
}
|
||||
struct.setAttributeMapByTeamBattleIsSet(true);
|
||||
}
|
||||
if (incoming.get(17)) {
|
||||
struct.godSoulLv = iprot.readI32();
|
||||
struct.setGodSoulLvIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -389,6 +389,7 @@ public class CBean2Proto {
|
|||
.setCreatetype(hero.getCreateType())
|
||||
.setChangeId(hero.getChangeId())
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
@ -403,7 +404,14 @@ public class CBean2Proto {
|
|||
soulPoss.add(builder.build());
|
||||
}
|
||||
}
|
||||
|
||||
List<CommonProto.HeroGodSoulInfo>godSoulList=new ArrayList<>();
|
||||
for (Map.Entry<Integer, List<String>> godSoul : hero.getGodSoulBindMap().entrySet()) {
|
||||
CommonProto.HeroGodSoulInfo godSoulInfo=CommonProto.HeroGodSoulInfo.newBuilder()
|
||||
.setLevel(godSoul.getKey())
|
||||
.addAllHeros(godSoul.getValue())
|
||||
.build();
|
||||
godSoulList.add(godSoulInfo);
|
||||
}
|
||||
return CommonProto.Hero
|
||||
.newBuilder()
|
||||
.setId(hero.getId())
|
||||
|
|
@ -421,6 +429,8 @@ public class CBean2Proto {
|
|||
.setCreatetype(hero.getCreateType())
|
||||
.setChangeId(hero.getChangeId())
|
||||
.setSkinId(hero.getSkin())
|
||||
.addAllGodSoulList(godSoulList)
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
|
@ -1073,7 +1083,7 @@ public class CBean2Proto {
|
|||
}
|
||||
|
||||
public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByHero(User user, Hero hero,int position){
|
||||
return CommonProto.TeamSimpleInfo.newBuilder().setHeroid(hero.getId()).setHeroTid(hero.getTemplateId()).setLevel(hero.getLevel(user.getHeroManager())).setStar(hero.getStar()).setPosition(position).setSkinId(hero.getSkin()).build();
|
||||
return CommonProto.TeamSimpleInfo.newBuilder().setHeroid(hero.getId()).setHeroTid(hero.getTemplateId()).setLevel(hero.getLevel(user.getHeroManager())).setStar(hero.getStar()).setPosition(position).setSkinId(hero.getSkin()).setGodSoulLv(hero.getGodSoulLv()).build();
|
||||
}
|
||||
public static CommonProto.TeamSimpleInfo getSimpleTeamInfoByPokeMon(Pokemon pokemon,int position){
|
||||
return CommonProto.TeamSimpleInfo.newBuilder().setHeroid(pokemon.getId()).setHeroTid(pokemon.getTmpId()).setLevel(pokemon.getLevel()).setStar(pokemon.getStar()).setPosition(position).build();
|
||||
|
|
@ -1150,6 +1160,7 @@ public class CBean2Proto {
|
|||
.setStar(hero.getStar())
|
||||
.setPosition(position)
|
||||
.setSkinId(hero.getSkin())
|
||||
.setGodSoulLv(hero.getGodSoulLv())
|
||||
.build();
|
||||
}
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ struct ArenaOfHero {
|
|||
15:optional map<i32,i64> attributeMap;
|
||||
16:optional map<i32,map<i32,i64>> attributeMapByTeam ;
|
||||
17:optional map<i32,map<i32,i64>> attributeMapByTeamBattle ;
|
||||
18:optional i32 godSoulLv;//神魂等级
|
||||
}
|
||||
|
||||
struct PropertyItem {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ import org.slf4j.Logger;
|
|||
import org.slf4j.LoggerFactory;
|
||||
|
||||
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
|
||||
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2021-10-21")
|
||||
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2021-10-28")
|
||||
public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOfHero._Fields>, java.io.Serializable, Cloneable, Comparable<ArenaOfHero> {
|
||||
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ArenaOfHero");
|
||||
|
||||
|
|
@ -55,6 +55,7 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
private static final org.apache.thrift.protocol.TField ATTRIBUTE_MAP_FIELD_DESC = new org.apache.thrift.protocol.TField("attributeMap", org.apache.thrift.protocol.TType.MAP, (short)15);
|
||||
private static final org.apache.thrift.protocol.TField ATTRIBUTE_MAP_BY_TEAM_FIELD_DESC = new org.apache.thrift.protocol.TField("attributeMapByTeam", org.apache.thrift.protocol.TType.MAP, (short)16);
|
||||
private static final org.apache.thrift.protocol.TField ATTRIBUTE_MAP_BY_TEAM_BATTLE_FIELD_DESC = new org.apache.thrift.protocol.TField("attributeMapByTeamBattle", org.apache.thrift.protocol.TType.MAP, (short)17);
|
||||
private static final org.apache.thrift.protocol.TField GOD_SOUL_LV_FIELD_DESC = new org.apache.thrift.protocol.TField("godSoulLv", org.apache.thrift.protocol.TType.I32, (short)18);
|
||||
|
||||
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
|
||||
static {
|
||||
|
|
@ -79,6 +80,7 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
public Map<Integer,Long> attributeMap; // optional
|
||||
public Map<Integer,Map<Integer,Long>> attributeMapByTeam; // optional
|
||||
public Map<Integer,Map<Integer,Long>> attributeMapByTeamBattle; // optional
|
||||
public int godSoulLv; // optional
|
||||
|
||||
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
|
||||
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
|
||||
|
|
@ -98,7 +100,8 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
JEWEL_INFO((short)14, "jewelInfo"),
|
||||
ATTRIBUTE_MAP((short)15, "attributeMap"),
|
||||
ATTRIBUTE_MAP_BY_TEAM((short)16, "attributeMapByTeam"),
|
||||
ATTRIBUTE_MAP_BY_TEAM_BATTLE((short)17, "attributeMapByTeamBattle");
|
||||
ATTRIBUTE_MAP_BY_TEAM_BATTLE((short)17, "attributeMapByTeamBattle"),
|
||||
GOD_SOUL_LV((short)18, "godSoulLv");
|
||||
|
||||
private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
|
||||
|
||||
|
|
@ -147,6 +150,8 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
return ATTRIBUTE_MAP_BY_TEAM;
|
||||
case 17: // ATTRIBUTE_MAP_BY_TEAM_BATTLE
|
||||
return ATTRIBUTE_MAP_BY_TEAM_BATTLE;
|
||||
case 18: // GOD_SOUL_LV
|
||||
return GOD_SOUL_LV;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
@ -197,8 +202,9 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
private static final int __CREATETYPE_ISSET_ID = 7;
|
||||
private static final int __CHANGEID_ISSET_ID = 8;
|
||||
private static final int __SKIN_ISSET_ID = 9;
|
||||
private static final int __GODSOULLV_ISSET_ID = 10;
|
||||
private short __isset_bitfield = 0;
|
||||
private static final _Fields optionals[] = {_Fields.ID,_Fields.TEMPLATE_ID,_Fields.LEVEL,_Fields.STAR,_Fields.EQUIP_BY_POSITION_MAP,_Fields.SOUL_EQUIP_BY_POSITION_MAP,_Fields.BREAK_ID,_Fields.STAR_BREAK_ID,_Fields.CREATE_TIME,_Fields.ESPECIAL_EQUIP_LEVEL,_Fields.CREATE_TYPE,_Fields.CHANGE_ID,_Fields.SKIN,_Fields.JEWEL_INFO,_Fields.ATTRIBUTE_MAP,_Fields.ATTRIBUTE_MAP_BY_TEAM,_Fields.ATTRIBUTE_MAP_BY_TEAM_BATTLE};
|
||||
private static final _Fields optionals[] = {_Fields.ID,_Fields.TEMPLATE_ID,_Fields.LEVEL,_Fields.STAR,_Fields.EQUIP_BY_POSITION_MAP,_Fields.SOUL_EQUIP_BY_POSITION_MAP,_Fields.BREAK_ID,_Fields.STAR_BREAK_ID,_Fields.CREATE_TIME,_Fields.ESPECIAL_EQUIP_LEVEL,_Fields.CREATE_TYPE,_Fields.CHANGE_ID,_Fields.SKIN,_Fields.JEWEL_INFO,_Fields.ATTRIBUTE_MAP,_Fields.ATTRIBUTE_MAP_BY_TEAM,_Fields.ATTRIBUTE_MAP_BY_TEAM_BATTLE,_Fields.GOD_SOUL_LV};
|
||||
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
|
||||
static {
|
||||
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
|
||||
|
|
@ -251,6 +257,8 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32),
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))));
|
||||
tmpMap.put(_Fields.GOD_SOUL_LV, new org.apache.thrift.meta_data.FieldMetaData("godSoulLv", org.apache.thrift.TFieldRequirementType.OPTIONAL,
|
||||
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
|
||||
metaDataMap = Collections.unmodifiableMap(tmpMap);
|
||||
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ArenaOfHero.class, metaDataMap);
|
||||
}
|
||||
|
|
@ -322,6 +330,7 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
}
|
||||
this.attributeMapByTeamBattle = __this__attributeMapByTeamBattle;
|
||||
}
|
||||
this.godSoulLv = other.godSoulLv;
|
||||
}
|
||||
|
||||
public ArenaOfHero deepCopy() {
|
||||
|
|
@ -357,6 +366,8 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
this.attributeMap = null;
|
||||
this.attributeMapByTeam = null;
|
||||
this.attributeMapByTeamBattle = null;
|
||||
setGodSoulLvIsSet(false);
|
||||
this.godSoulLv = 0;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
|
@ -827,6 +838,29 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
}
|
||||
}
|
||||
|
||||
public int getGodSoulLv() {
|
||||
return this.godSoulLv;
|
||||
}
|
||||
|
||||
public ArenaOfHero setGodSoulLv(int godSoulLv) {
|
||||
this.godSoulLv = godSoulLv;
|
||||
setGodSoulLvIsSet(true);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void unsetGodSoulLv() {
|
||||
__isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __GODSOULLV_ISSET_ID);
|
||||
}
|
||||
|
||||
/** Returns true if field godSoulLv is set (has been assigned a value) and false otherwise */
|
||||
public boolean isSetGodSoulLv() {
|
||||
return EncodingUtils.testBit(__isset_bitfield, __GODSOULLV_ISSET_ID);
|
||||
}
|
||||
|
||||
public void setGodSoulLvIsSet(boolean value) {
|
||||
__isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __GODSOULLV_ISSET_ID, value);
|
||||
}
|
||||
|
||||
public void setFieldValue(_Fields field, Object value) {
|
||||
switch (field) {
|
||||
case ID:
|
||||
|
|
@ -965,6 +999,14 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
}
|
||||
break;
|
||||
|
||||
case GOD_SOUL_LV:
|
||||
if (value == null) {
|
||||
unsetGodSoulLv();
|
||||
} else {
|
||||
setGodSoulLv((Integer)value);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1021,6 +1063,9 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
case ATTRIBUTE_MAP_BY_TEAM_BATTLE:
|
||||
return getAttributeMapByTeamBattle();
|
||||
|
||||
case GOD_SOUL_LV:
|
||||
return Integer.valueOf(getGodSoulLv());
|
||||
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
|
@ -1066,6 +1111,8 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
return isSetAttributeMapByTeam();
|
||||
case ATTRIBUTE_MAP_BY_TEAM_BATTLE:
|
||||
return isSetAttributeMapByTeamBattle();
|
||||
case GOD_SOUL_LV:
|
||||
return isSetGodSoulLv();
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
|
|
@ -1236,6 +1283,15 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_godSoulLv = true && this.isSetGodSoulLv();
|
||||
boolean that_present_godSoulLv = true && that.isSetGodSoulLv();
|
||||
if (this_present_godSoulLv || that_present_godSoulLv) {
|
||||
if (!(this_present_godSoulLv && that_present_godSoulLv))
|
||||
return false;
|
||||
if (this.godSoulLv != that.godSoulLv)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1328,6 +1384,11 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
if (present_attributeMapByTeamBattle)
|
||||
list.add(attributeMapByTeamBattle);
|
||||
|
||||
boolean present_godSoulLv = true && (isSetGodSoulLv());
|
||||
list.add(present_godSoulLv);
|
||||
if (present_godSoulLv)
|
||||
list.add(godSoulLv);
|
||||
|
||||
return list.hashCode();
|
||||
}
|
||||
|
||||
|
|
@ -1509,6 +1570,16 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
return lastComparison;
|
||||
}
|
||||
}
|
||||
lastComparison = Boolean.valueOf(isSetGodSoulLv()).compareTo(other.isSetGodSoulLv());
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
if (isSetGodSoulLv()) {
|
||||
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.godSoulLv, other.godSoulLv);
|
||||
if (lastComparison != 0) {
|
||||
return lastComparison;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1658,6 +1729,12 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
}
|
||||
first = false;
|
||||
}
|
||||
if (isSetGodSoulLv()) {
|
||||
if (!first) sb.append(", ");
|
||||
sb.append("godSoulLv:");
|
||||
sb.append(this.godSoulLv);
|
||||
first = false;
|
||||
}
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
|
@ -1933,6 +2010,14 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
case 18: // GOD_SOUL_LV
|
||||
if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
|
||||
struct.godSoulLv = iprot.readI32();
|
||||
struct.setGodSoulLvIsSet(true);
|
||||
} else {
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
|
||||
}
|
||||
|
|
@ -2110,6 +2195,11 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
oprot.writeFieldEnd();
|
||||
}
|
||||
}
|
||||
if (struct.isSetGodSoulLv()) {
|
||||
oprot.writeFieldBegin(GOD_SOUL_LV_FIELD_DESC);
|
||||
oprot.writeI32(struct.godSoulLv);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
|
@ -2179,7 +2269,10 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
if (struct.isSetAttributeMapByTeamBattle()) {
|
||||
optionals.set(16);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 17);
|
||||
if (struct.isSetGodSoulLv()) {
|
||||
optionals.set(17);
|
||||
}
|
||||
oprot.writeBitSet(optionals, 18);
|
||||
if (struct.isSetId()) {
|
||||
oprot.writeString(struct.id);
|
||||
}
|
||||
|
|
@ -2286,12 +2379,15 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
}
|
||||
}
|
||||
}
|
||||
if (struct.isSetGodSoulLv()) {
|
||||
oprot.writeI32(struct.godSoulLv);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(org.apache.thrift.protocol.TProtocol prot, ArenaOfHero struct) throws org.apache.thrift.TException {
|
||||
TTupleProtocol iprot = (TTupleProtocol) prot;
|
||||
BitSet incoming = iprot.readBitSet(17);
|
||||
BitSet incoming = iprot.readBitSet(18);
|
||||
if (incoming.get(0)) {
|
||||
struct.id = iprot.readString();
|
||||
struct.setIdIsSet(true);
|
||||
|
|
@ -2446,6 +2542,10 @@ public class ArenaOfHero implements org.apache.thrift.TBase<ArenaOfHero, ArenaOf
|
|||
}
|
||||
struct.setAttributeMapByTeamBattleIsSet(true);
|
||||
}
|
||||
if (incoming.get(17)) {
|
||||
struct.godSoulLv = iprot.readI32();
|
||||
struct.setGodSoulLvIsSet(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,12 @@ public class SCHero implements BaseConfig{
|
|||
|
||||
private int joinWishDay;
|
||||
|
||||
private int[][] soul;
|
||||
|
||||
private int[][] soulSkill;
|
||||
|
||||
private int isSoulOpen;
|
||||
|
||||
private Map<Integer,Integer> secondaryFactorMap;
|
||||
|
||||
private Map<Integer, List<Integer>> skillListByStar;
|
||||
|
|
@ -360,4 +366,16 @@ public class SCHero implements BaseConfig{
|
|||
public int getJoinWishDay() {
|
||||
return joinWishDay;
|
||||
}
|
||||
|
||||
public int[][] getSoul() {
|
||||
return soul;
|
||||
}
|
||||
|
||||
public int[][] getSoulSkill() {
|
||||
return soulSkill;
|
||||
}
|
||||
|
||||
public int getIsSoulOpen() {
|
||||
return isSoulOpen;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ public class SHeroRankupGroup implements BaseConfig {
|
|||
private int[] items;
|
||||
|
||||
private int[][] itemCamp;
|
||||
|
||||
private int isSameJob;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
|
@ -50,4 +52,8 @@ public class SHeroRankupGroup implements BaseConfig {
|
|||
public int[][] getItemCamp() {
|
||||
return itemCamp;
|
||||
}
|
||||
|
||||
public int getIsSameJob() {
|
||||
return isSameJob;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue