鸿蒙 切分支
parent
1c3102157d
commit
11ac7ec7ad
|
|
@ -156,6 +156,7 @@ public enum ErrorCode implements IErrorCode {
|
||||||
NOT_IN_TAKE_TIME(126, "不在领取期间"),
|
NOT_IN_TAKE_TIME(126, "不在领取期间"),
|
||||||
USER_LEVE_DOWN(127,"玩家等级不够"),
|
USER_LEVE_DOWN(127,"玩家等级不够"),
|
||||||
HAS_AWAKE(130,"已达最大星级"),
|
HAS_AWAKE(130,"已达最大星级"),
|
||||||
|
BAG_FULL(135,"背包内存储空间不足,无法领取附件"),
|
||||||
SERVER_DEFINE_SELF(20000,"操作失败")
|
SERVER_DEFINE_SELF(20000,"操作失败")
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
|
||||||
|
|
@ -298,4 +298,8 @@ public interface BIReason {
|
||||||
int SKIN_USE_CONSUME = 1073;//激活皮肤消耗
|
int SKIN_USE_CONSUME = 1073;//激活皮肤消耗
|
||||||
int SUB_ACTIVITY_CONSUME = 1074;//易经宝库
|
int SUB_ACTIVITY_CONSUME = 1074;//易经宝库
|
||||||
int SUB_ACTIVITY_CONSUME_FINISH = 1075;//易经宝库活动结束补发消耗
|
int SUB_ACTIVITY_CONSUME_FINISH = 1075;//易经宝库活动结束补发消耗
|
||||||
|
|
||||||
|
int OPEN_HONGMENG_GRAID = 1076; // 开鸿蒙阵格子消耗
|
||||||
|
int CLEAR_HONGMENG_GRAID = 1077; // 清鸿蒙阵格子cd
|
||||||
|
int HONGMENG_UPGRIDE = 1078; // 鸿蒙碑升级消耗
|
||||||
}
|
}
|
||||||
|
|
@ -13,7 +13,7 @@ public interface GlobalItemType {
|
||||||
int CARD = 1; // 卡牌
|
int CARD = 1; // 卡牌
|
||||||
int CARD_FRAGMENT = 2; // 卡牌碎片
|
int CARD_FRAGMENT = 2; // 卡牌碎片
|
||||||
int EQUIP = 3; //装备
|
int EQUIP = 3; //装备
|
||||||
int POKENMON_COMONPENT = 4; //异妖组件
|
int POKENMON_COMONPENT = 4; //异妖组件(暂时无用)
|
||||||
int RANDOM_ITME = 5; // 随机道具
|
int RANDOM_ITME = 5; // 随机道具
|
||||||
int RUNNE = 6; //符文
|
int RUNNE = 6; //符文
|
||||||
int BLUE_IMAGE=7; // 蓝图
|
int BLUE_IMAGE=7; // 蓝图
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,8 @@ import com.ljsd.jieling.logic.activity.event.UserOnlineEvent;
|
||||||
import com.ljsd.jieling.logic.dao.*;
|
import com.ljsd.jieling.logic.dao.*;
|
||||||
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
|
import com.ljsd.jieling.logic.hero.HongMengAttributeEnum;
|
||||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||||
import com.ljsd.jieling.logic.question.QuestionLogic;
|
import com.ljsd.jieling.logic.question.QuestionLogic;
|
||||||
|
|
@ -77,7 +79,8 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
BuyGoodsLogic.initOwernBagInfo(user);
|
BuyGoodsLogic.initOwernBagInfo(user);
|
||||||
// Poster.getPoster().dispatchEvent(new UserOnlineEvent(userId));
|
// Poster.getPoster().dispatchEvent(new UserOnlineEvent(userId));
|
||||||
user.getUserMissionManager().onGameEvent(user, GameEvent.LOGIN_GAME,0);
|
user.getUserMissionManager().onGameEvent(user, GameEvent.LOGIN_GAME,0);
|
||||||
playerInfoManager.setLoginTime(TimeUtils.now());
|
long now = TimeUtils.now();
|
||||||
|
playerInfoManager.setLoginTime(now);
|
||||||
Map<Integer, Integer> guidePoints = playerInfoManager.getGuidePoints();
|
Map<Integer, Integer> guidePoints = playerInfoManager.getGuidePoints();
|
||||||
Map<Integer, VipInfo> vipInfo = playerInfoManager.getVipInfo();
|
Map<Integer, VipInfo> vipInfo = playerInfoManager.getVipInfo();
|
||||||
List<CommonProto.NewPlayerGuidePoint> list = new ArrayList<>();
|
List<CommonProto.NewPlayerGuidePoint> list = new ArrayList<>();
|
||||||
|
|
@ -119,7 +122,8 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
.setPhoneNum(user.getPlayerInfoManager().getPhoneBindInfo().getPhoneNum())
|
.setPhoneNum(user.getPlayerInfoManager().getPhoneBindInfo().getPhoneNum())
|
||||||
.setState(user.getPlayerInfoManager().getPhoneBindInfo().getState()).build();
|
.setState(user.getPlayerInfoManager().getPhoneBindInfo().getState()).build();
|
||||||
RechargeInfo rechargeInfo = playerInfoManager.getRechargeInfo();
|
RechargeInfo rechargeInfo = playerInfoManager.getRechargeInfo();
|
||||||
Map<Integer, Integer> totalCountMap = user.getHeroManager().getTotalCount();
|
HeroManager heroManager = user.getHeroManager();
|
||||||
|
Map<Integer, Integer> totalCountMap = heroManager.getTotalCount();
|
||||||
int alreadyCount =0;
|
int alreadyCount =0;
|
||||||
for(Integer id : STableManager.getFigureConfig(HeroStaticConfig.class).getRandomHeroIds()){
|
for(Integer id : STableManager.getFigureConfig(HeroStaticConfig.class).getRandomHeroIds()){
|
||||||
Integer count = totalCountMap.get(id);
|
Integer count = totalCountMap.get(id);
|
||||||
|
|
@ -144,7 +148,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
questState=user.getQuestionManager().getQuestState();
|
questState=user.getQuestionManager().getQuestState();
|
||||||
}
|
}
|
||||||
//图鉴信息
|
//图鉴信息
|
||||||
Map<Integer, Integer> heroHandBook = user.getHeroManager().getHeroHandBook();
|
Map<Integer, Integer> heroHandBook = heroManager.getHeroHandBook();
|
||||||
List<CommonProto.EveryHeroHandBook> heroHandBookList = new ArrayList<>();
|
List<CommonProto.EveryHeroHandBook> heroHandBookList = new ArrayList<>();
|
||||||
heroHandBook.forEach((k,v)->heroHandBookList.add(CommonProto.EveryHeroHandBook.newBuilder().setHeroId(k).setMaxStar(v).build()));
|
heroHandBook.forEach((k,v)->heroHandBookList.add(CommonProto.EveryHeroHandBook.newBuilder().setHeroId(k).setMaxStar(v).build()));
|
||||||
|
|
||||||
|
|
@ -165,7 +169,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
remove.removeAll(user.getItemManager().getItemMap().keySet());
|
remove.removeAll(user.getItemManager().getItemMap().keySet());
|
||||||
remove.forEach(n->{
|
remove.forEach(n->{
|
||||||
try {
|
try {
|
||||||
System.out.println("n = " + n);
|
LOGGER.info("GET_PLAYERINFO_REQUEST uid n = {}", userId, n);
|
||||||
user.getItemManager().newItem(n, 0);
|
user.getItemManager().newItem(n, 0);
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
@ -186,8 +190,30 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
user.getPlayerInfoManager().getMonthCard().put(Global.LMONTHCARDID, (int) (System.currentTimeMillis() / 1000));
|
user.getPlayerInfoManager().getMonthCard().put(Global.LMONTHCARDID, (int) (System.currentTimeMillis() / 1000));
|
||||||
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID));
|
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID));
|
||||||
}
|
}
|
||||||
|
// 刷新鸿蒙阵
|
||||||
|
// HeroLogic.getInstance().addOrUpdateHongmeng(user);
|
||||||
|
// 组装鸿蒙阵信息
|
||||||
|
List<PlayerInfoProto.HongmengHeroInfo> hongmengHeroInfos = new ArrayList<>();
|
||||||
|
Map<Integer, String> resonances = heroManager.getResonances();
|
||||||
|
Map<Integer, Long> resonancesTime = heroManager.getResonancesTime();
|
||||||
|
for (Map.Entry<Integer, String> entry : resonances.entrySet()) {
|
||||||
|
PlayerInfoProto.HongmengHeroInfo hongmengHeroInfo = PlayerInfoProto.HongmengHeroInfo.newBuilder()
|
||||||
|
.setGridId(entry.getKey())
|
||||||
|
.setHeroId(entry.getValue())
|
||||||
|
.setTime(resonancesTime.containsKey(entry.getKey()) ? (resonancesTime.get(entry.getKey()) - now < 0 ? 0 : (resonancesTime.get(entry.getKey()) - now) / 1000) : 0)
|
||||||
|
.build();
|
||||||
|
hongmengHeroInfos.add(hongmengHeroInfo);
|
||||||
|
}
|
||||||
|
List<PlayerInfoProto.HongmengAddition> hongmengAdditions = new ArrayList<>();
|
||||||
|
Map<HongMengAttributeEnum, Integer> resonanceAddition = heroManager.getResonanceAddition();
|
||||||
|
for (Map.Entry<HongMengAttributeEnum, Integer> entry : resonanceAddition.entrySet()) {
|
||||||
|
PlayerInfoProto.HongmengAddition hongmengAddition = PlayerInfoProto.HongmengAddition
|
||||||
|
.newBuilder()
|
||||||
|
.setAdditionType(entry.getKey().getPropertyId())
|
||||||
|
.setValue(entry.getValue())
|
||||||
|
.build();
|
||||||
|
hongmengAdditions.add(hongmengAddition);
|
||||||
|
}
|
||||||
StoreLogic.reloadStoreInfo(user,7);//重载功能商店
|
StoreLogic.reloadStoreInfo(user,7);//重载功能商店
|
||||||
PlayerInfoProto.GetPlayerInfoResponse getPlayerInfoResponse
|
PlayerInfoProto.GetPlayerInfoResponse getPlayerInfoResponse
|
||||||
= PlayerInfoProto.GetPlayerInfoResponse.newBuilder()
|
= PlayerInfoProto.GetPlayerInfoResponse.newBuilder()
|
||||||
|
|
@ -207,7 +233,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
.setTreasureLevel(playerInfoManager.getTreasureLevel())
|
.setTreasureLevel(playerInfoManager.getTreasureLevel())
|
||||||
.setSignInInfo(CommonProto.SignInInfo.newBuilder().setDays(playerInfoManager.getSign()+1).setState(playerInfoManager.getSignTotay()).build())
|
.setSignInInfo(CommonProto.SignInInfo.newBuilder().setDays(playerInfoManager.getSign()+1).setState(playerInfoManager.getSignTotay()).build())
|
||||||
.setMonsterAttackTime(user.getMapManager().getLastMonsterAttack())
|
.setMonsterAttackTime(user.getMapManager().getLastMonsterAttack())
|
||||||
.setFirstTenth(user.getHeroManager().getFirstTenth())
|
.setFirstTenth(heroManager.getFirstTenth())
|
||||||
.setIsDayFirst(playerInfoManager.getIsdayFirst())
|
.setIsDayFirst(playerInfoManager.getIsdayFirst())
|
||||||
.setEndInfo(endless)
|
.setEndInfo(endless)
|
||||||
.setPlayerBindPhone(playerBindPhone)
|
.setPlayerBindPhone(playerBindPhone)
|
||||||
|
|
@ -222,6 +248,10 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
||||||
.setExpeditionLeve(user.getExpeditionManager().getExpeditionLeve())
|
.setExpeditionLeve(user.getExpeditionManager().getExpeditionLeve())
|
||||||
.setHadLuckTime( user.getPlayerInfoManager().getLuckWheelLimitTime())
|
.setHadLuckTime( user.getPlayerInfoManager().getLuckWheelLimitTime())
|
||||||
.setHadAdvanceLuckTime(user.getPlayerInfoManager().getLuckAdvanceWheelLimitTime())
|
.setHadAdvanceLuckTime(user.getPlayerInfoManager().getLuckAdvanceWheelLimitTime())
|
||||||
|
.addAllHongmengGuards(heroManager.getHongmengGuard())
|
||||||
|
.setHongmengTablet(heroManager.getHongmengTablet())
|
||||||
|
.addAllHongmengHeroInfos(hongmengHeroInfos)
|
||||||
|
.addAllHongmengAdditions(hongmengAdditions)
|
||||||
.build();
|
.build();
|
||||||
ReportUtil.onReportEvent(user, ReportEventEnum.APP_LOGIN.getType());
|
ReportUtil.onReportEvent(user, ReportEventEnum.APP_LOGIN.getType());
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.ljsd.jieling.handler.hero;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||||
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class HongmengCleanTimeRequestHandler extends BaseHandler<HeroInfoProto.CleanResonanceTimeRequest> {
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return MessageTypeProto.MessageType.HONGMENG_CLEAN_TIME_RESQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processWithProto(ISession session, HeroInfoProto.CleanResonanceTimeRequest proto) throws Exception {
|
||||||
|
int gridId = proto.getGridId();
|
||||||
|
HeroLogic.getInstance().cleanTime(session, MessageTypeProto.MessageType.HONGMENG_CLEAN_TIME_RESPONSE, gridId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.ljsd.jieling.handler.hero;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||||
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class HongmengOpenResonanceRequestHandler extends BaseHandler<HeroInfoProto.OpenResonanceRequest> {
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return MessageTypeProto.MessageType.HONGMENG_OPEN_RESONANCE_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processWithProto(ISession session, HeroInfoProto.OpenResonanceRequest proto) throws Exception {
|
||||||
|
HeroLogic.getInstance().openResonance(session, MessageTypeProto.MessageType.HONGMENG_OPEN_RESONANCE_RESPONSE, proto.getGridId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.ljsd.jieling.handler.hero;
|
||||||
|
|
||||||
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||||
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class HongmengResonanceRequestHandler extends BaseHandler<HeroInfoProto.ResonanceRequest> {
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return MessageTypeProto.MessageType.HONGMENG_RESONANCE_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processWithProto(ISession session, HeroInfoProto.ResonanceRequest proto) throws Exception {
|
||||||
|
if (proto.getType() == 1) {
|
||||||
|
HeroLogic.getInstance().resonance(session, MessageTypeProto.MessageType.HONGMENG_RESONANCE_RESPONSE, proto.getHeroId(), proto.getGridId());
|
||||||
|
} else {
|
||||||
|
HeroLogic.getInstance().unLoadResonance(session, MessageTypeProto.MessageType.HONGMENG_RESONANCE_RESPONSE, proto.getGridId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.ljsd.jieling.handler.hero;
|
||||||
|
|
||||||
|
import com.google.protobuf.GeneratedMessage;
|
||||||
|
import com.ljsd.jieling.handler.BaseHandler;
|
||||||
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class HongmengUpgradRequestHandler extends BaseHandler {
|
||||||
|
@Override
|
||||||
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
|
return MessageTypeProto.MessageType.HONGMENG_UPGRADE_REQUEST;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void processWithProto(ISession iSession, GeneratedMessage proto) throws Exception {
|
||||||
|
HeroLogic.getInstance().updateHongmengTablet(iSession, MessageTypeProto.MessageType.HONGMENG_UPGRADE_RESPONSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,18 +4,20 @@ import com.ljsd.jieling.handler.BaseHandler;
|
||||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import com.ljsd.jieling.protocols.HeroInfoProto;
|
||||||
import com.ljsd.jieling.protocols.MessageTypeProto;
|
import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class GetAllPokemonHandler extends BaseHandler {
|
public class GetAllPokemonHandler extends BaseHandler<HeroInfoProto.GetAllPokemonRequest> {
|
||||||
@Override
|
@Override
|
||||||
public MessageTypeProto.MessageType getMessageCode() {
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
return MessageTypeProto.MessageType.GET_ALL_POKEMON_REQUEST;
|
return MessageTypeProto.MessageType.GET_ALL_POKEMON_REQUEST;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
public void processWithProto(ISession iSession, HeroInfoProto.GetAllPokemonRequest proto) throws Exception {
|
||||||
HeroLogic.getInstance().getAllPokemon(iSession);
|
HeroLogic.getInstance().getAllPokemon(iSession,proto.getStart());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,13 @@
|
||||||
package com.ljsd.jieling.logic.dao;
|
package com.ljsd.jieling.logic.dao;
|
||||||
|
|
||||||
import com.ljsd.common.mogodb.MongoBase;
|
import com.ljsd.common.mogodb.MongoBase;
|
||||||
import com.ljsd.jieling.db.mongo.MongoKey;
|
|
||||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||||
import com.ljsd.jieling.logic.activity.event.RemoveHeroEvent;
|
import com.ljsd.jieling.logic.activity.event.RemoveHeroEvent;
|
||||||
import com.ljsd.jieling.logic.dao.root.User;
|
import com.ljsd.jieling.logic.dao.root.User;
|
||||||
|
import com.ljsd.jieling.logic.hero.HongMengAttributeEnum;
|
||||||
|
import org.luaj.vm2.ast.Str;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class HeroManager extends MongoBase {
|
public class HeroManager extends MongoBase {
|
||||||
|
|
||||||
|
|
@ -30,6 +30,19 @@ public class HeroManager extends MongoBase {
|
||||||
this.setRootCollection(User._COLLECTION_NAME);
|
this.setRootCollection(User._COLLECTION_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 鸿蒙守卫
|
||||||
|
private List<String> hongmengGuard = new ArrayList<>();
|
||||||
|
// 共鸣英雄<格子id,英雄id>
|
||||||
|
private Map<Integer, String> resonances = new HashMap<>();
|
||||||
|
// 共鸣英雄<格子id,冷却时间>
|
||||||
|
private Map<Integer, Long> resonancesTime = new HashMap<>();
|
||||||
|
// 共鸣加成
|
||||||
|
private Map<HongMengAttributeEnum, Integer> resonanceAddition = new HashMap<>();
|
||||||
|
// 鸿蒙碑等级
|
||||||
|
private int hongmengTablet;
|
||||||
|
// 鸿蒙碑最大等级
|
||||||
|
private Set<Integer> hongmengMaxLevel = new HashSet<>();
|
||||||
|
|
||||||
public void updateRandCount(int type,int count){
|
public void updateRandCount(int type,int count){
|
||||||
updateString("totalCount." + type, count);
|
updateString("totalCount." + type, count);
|
||||||
totalCount.put(type,count);
|
totalCount.put(type,count);
|
||||||
|
|
@ -129,5 +142,64 @@ public class HeroManager extends MongoBase {
|
||||||
skinInfo.remove(skinId);
|
skinInfo.remove(skinId);
|
||||||
removeString(getMongoKey()+"skinInfo."+skinId);
|
removeString(getMongoKey()+"skinInfo."+skinId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<String> getHongmengGuard() {
|
||||||
|
return hongmengGuard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHongmengGuard(List<String> hongmengGuard) {
|
||||||
|
this.hongmengGuard = hongmengGuard;
|
||||||
|
updateString("hongmengGuard", hongmengGuard);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<Integer, String> getResonances() {
|
||||||
|
return resonances;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResonances(Map<Integer, String> resonances) {
|
||||||
|
this.resonances = resonances;
|
||||||
|
updateString("resonances", resonances);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateResonances(int index, String heroId) {
|
||||||
|
this.resonances.put(index, heroId);
|
||||||
|
updateString("resonances."+ index, heroId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<Integer, Long> getResonancesTime() {
|
||||||
|
return resonancesTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void updateResonancesTime(int index, long time) {
|
||||||
|
this.resonancesTime.put(index, time);
|
||||||
|
updateString("resonancesTime."+ index, time);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<HongMengAttributeEnum, Integer> getResonanceAddition() {
|
||||||
|
return resonanceAddition;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResonanceAddition(Map<HongMengAttributeEnum, Integer> resonanceAddition) {
|
||||||
|
this.resonanceAddition = resonanceAddition;
|
||||||
|
updateString("resonanceAddition", resonanceAddition);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getHongmengTablet() {
|
||||||
|
return hongmengTablet;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHongmengTablet(int hongmengTablet) {
|
||||||
|
this.hongmengTablet = hongmengTablet;
|
||||||
|
updateString("hongmengTablet", hongmengTablet);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Set<Integer> getHongmengMaxLevel() {
|
||||||
|
return hongmengMaxLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHongmengMaxLevel(Set<Integer> hongmengMaxLevel) {
|
||||||
|
this.hongmengMaxLevel = hongmengMaxLevel;
|
||||||
|
updateString("hongmengMaxLevel", hongmengMaxLevel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,15 @@
|
||||||
package com.ljsd.jieling.logic.hero;
|
package com.ljsd.jieling.logic.hero;
|
||||||
|
|
||||||
import com.ljsd.GameApplication;
|
|
||||||
import com.ljsd.jieling.chat.logic.ChatLogic;
|
import com.ljsd.jieling.chat.logic.ChatLogic;
|
||||||
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
import com.ljsd.jieling.config.clazzStaticCfg.CommonStaticConfig;
|
||||||
import com.ljsd.jieling.config.clazzStaticCfg.HeroStaticConfig;
|
import com.ljsd.jieling.config.clazzStaticCfg.HeroStaticConfig;
|
||||||
import com.ljsd.jieling.core.GlobalsDef;
|
import com.ljsd.jieling.core.GlobalsDef;
|
||||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
|
||||||
import com.ljsd.jieling.db.redis.RedisKey;
|
import com.ljsd.jieling.db.redis.RedisKey;
|
||||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||||
import com.ljsd.jieling.exception.ErrorCode;
|
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.globals.Global;
|
import com.ljsd.jieling.globals.Global;
|
||||||
|
|
||||||
import com.ljsd.jieling.globals.GlobalItemType;
|
import com.ljsd.jieling.globals.GlobalItemType;
|
||||||
import com.ljsd.jieling.jbean.ActivityMission;
|
import com.ljsd.jieling.jbean.ActivityMission;
|
||||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||||
|
|
@ -29,7 +26,6 @@ import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||||
import com.ljsd.jieling.logic.fight.passiveSkillCal.PassiveskillCalEnum;
|
import com.ljsd.jieling.logic.fight.passiveSkillCal.PassiveskillCalEnum;
|
||||||
import com.ljsd.jieling.logic.item.ItemLogic;
|
import com.ljsd.jieling.logic.item.ItemLogic;
|
||||||
import com.ljsd.jieling.logic.mission.GameEvent;
|
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||||
import com.ljsd.jieling.logic.mission.MissionLoigc;
|
|
||||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
|
@ -40,7 +36,6 @@ import com.ljsd.jieling.protocols.MessageTypeProto;
|
||||||
import com.ljsd.jieling.util.*;
|
import com.ljsd.jieling.util.*;
|
||||||
import config.*;
|
import config.*;
|
||||||
import manager.STableManager;
|
import manager.STableManager;
|
||||||
import org.luaj.vm2.ast.Str;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import util.MathUtils;
|
import util.MathUtils;
|
||||||
|
|
@ -51,7 +46,6 @@ import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
public class HeroLogic{
|
public class HeroLogic{
|
||||||
|
|
@ -2900,7 +2894,7 @@ public class HeroLogic{
|
||||||
* @param iSession
|
* @param iSession
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public void getAllPokemon(ISession iSession) throws Exception {
|
public void getAllPokemon(ISession iSession,int start) throws Exception {
|
||||||
int uid = iSession.getUid();
|
int uid = iSession.getUid();
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
PokemonManager pokemonManager = user.getPokemonManager();
|
PokemonManager pokemonManager = user.getPokemonManager();
|
||||||
|
|
@ -2916,32 +2910,32 @@ public class HeroLogic{
|
||||||
for(String key:removeKey){
|
for(String key:removeKey){
|
||||||
pokemonManager.removePokemon(key);
|
pokemonManager.removePokemon(key);
|
||||||
}
|
}
|
||||||
//
|
|
||||||
// //TODO 测试
|
|
||||||
// if(pokemonMap.isEmpty()){
|
|
||||||
// for(SDifferDemonsConfig sDifferDemonsConfig : SDifferDemonsConfig.sDifferDemonsConfigMap.values() ){
|
|
||||||
// pokemonManager.addPokemon(new Pokemon(sDifferDemonsConfig.getId()));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
List<CommonProto.PokemonInfo> pokemonInfoList = new ArrayList<>();
|
List<CommonProto.PokemonInfo> pokemonInfoList = new ArrayList<>();
|
||||||
//
|
|
||||||
|
int pageSize = Global.SEND_CARD_COUNT;
|
||||||
|
int index = 0;
|
||||||
for(Pokemon pokemon : pokemonMap.values()){
|
for(Pokemon pokemon : pokemonMap.values()){
|
||||||
pokemonInfoList.add(CBean2Proto.getPokemon(pokemon));
|
if(index>=start&&index<start+pageSize){
|
||||||
|
pokemonInfoList.add(CBean2Proto.getPokemon(pokemon));
|
||||||
|
}
|
||||||
|
index++;
|
||||||
}
|
}
|
||||||
List<CommonProto.TeamPokemonInfo> teamPokemonInfos = new ArrayList<>();
|
HeroInfoProto.GetAllPokemonResponse.Builder builder = HeroInfoProto.GetAllPokemonResponse.newBuilder().addAllPokemonInfo(pokemonInfoList);
|
||||||
for (Map.Entry<Integer, String> entry : pokemonManager.getPokemonTeamMap().entrySet()) {
|
if(pokemonInfoList.size()<pageSize){
|
||||||
CommonProto.TeamPokemonInfo teamPokemonInfo = CommonProto.TeamPokemonInfo.newBuilder()
|
List<CommonProto.TeamPokemonInfo> teamPokemonInfos = new ArrayList<>();
|
||||||
.setPokemonId(entry.getValue())
|
for (Map.Entry<Integer, String> entry : pokemonManager.getPokemonTeamMap().entrySet()) {
|
||||||
.setPosition(entry.getKey())
|
CommonProto.TeamPokemonInfo teamPokemonInfo = CommonProto.TeamPokemonInfo.newBuilder()
|
||||||
.build();
|
.setPokemonId(entry.getValue())
|
||||||
teamPokemonInfos.add(teamPokemonInfo);
|
.setPosition(entry.getKey())
|
||||||
|
.build();
|
||||||
|
teamPokemonInfos.add(teamPokemonInfo);
|
||||||
|
}
|
||||||
|
builder.addAllTeamPokemonInfos(teamPokemonInfos)
|
||||||
|
.addAllPokemonGot(pokemonManager.getPokemonGot())
|
||||||
|
.addAllPokemonBookEnabled(pokemonManager.getPokemonBookEnabled());
|
||||||
}
|
}
|
||||||
HeroInfoProto.GetAllPokemonResponse build = HeroInfoProto.GetAllPokemonResponse.newBuilder().addAllPokemonInfo(pokemonInfoList)
|
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.GET_ALL_POKEMON_RESPONSE_VALUE,builder.build(),true);
|
||||||
.addAllTeamPokemonInfos(teamPokemonInfos)
|
|
||||||
.addAllPokemonGot(pokemonManager.getPokemonGot())
|
|
||||||
.addAllPokemonBookEnabled(pokemonManager.getPokemonBookEnabled())
|
|
||||||
.build();
|
|
||||||
MessageUtil.sendMessage(iSession,1,MessageTypeProto.MessageType.GET_ALL_POKEMON_RESPONSE_VALUE,build,true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -3272,7 +3266,6 @@ public class HeroLogic{
|
||||||
* 灵兽涅槃
|
* 灵兽涅槃
|
||||||
* @param session
|
* @param session
|
||||||
* @param pokemonId
|
* @param pokemonId
|
||||||
* @param level
|
|
||||||
* @param messageType
|
* @param messageType
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
|
|
@ -3407,4 +3400,287 @@ public class HeroLogic{
|
||||||
|
|
||||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ================共鸣、鸿蒙碑=========
|
||||||
|
/**
|
||||||
|
* 添加或更新鸿蒙守卫
|
||||||
|
* @param user
|
||||||
|
*/
|
||||||
|
public void addOrUpdateHongmeng(User user) {
|
||||||
|
if (user.getPlayerInfoManager().getLevel() < SSpecialConfig.getIntegerValue(SSpecialConfig.HONGMENG_OPENLEVEL)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
HeroManager heroManager = user.getHeroManager();
|
||||||
|
Collection<Hero> values = heroManager.getHeroMap().values();
|
||||||
|
List<Hero> heroes = new ArrayList<>(values);
|
||||||
|
Collections.sort(heroes, new Comparator<Hero>() {
|
||||||
|
@Override
|
||||||
|
public int compare(Hero hero1, Hero hero2) {
|
||||||
|
int compareValue = hero2.getLevel() - hero1.getLevel();
|
||||||
|
if (compareValue != 0) {
|
||||||
|
return compareValue;
|
||||||
|
}
|
||||||
|
return Integer.compare(hero2.getStar(), hero1.getStar());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
List<String> hongmengs = heroManager.getHongmengGuard();
|
||||||
|
hongmengs.clear();
|
||||||
|
// 只要任意鸿蒙守卫中有未穿戴装备的部位,就不会触发装备共鸣,共鸣区域放入神将时不再自动卸下装备 1:不卸下装备
|
||||||
|
int isUnloadEquip = 1;
|
||||||
|
|
||||||
|
// 只要任意鸿蒙守卫未穿戴魂宝/灵宝,或强化等级为0,便不会触发对应宝物的共鸣
|
||||||
|
int soulEquip = 1000;
|
||||||
|
int spiritEquip = 1000;
|
||||||
|
|
||||||
|
// 共鸣等级=鸿蒙守卫中最低的等级
|
||||||
|
int resonanceLevel = 1000;
|
||||||
|
|
||||||
|
// 共鸣法宝=鸿蒙守卫中法宝强化最低等级
|
||||||
|
int especialEquipLevel = 100;
|
||||||
|
|
||||||
|
// 是否开启鸿蒙碑
|
||||||
|
int tablet = 1;
|
||||||
|
Collection<String> values2 = heroManager.getResonances().values();
|
||||||
|
Map<String, PropertyItem> equipMap = user.getEquipManager().getEquipMap();
|
||||||
|
String[] openLevel = SSpecialConfig.getStringValue(SSpecialConfig.HONGMENG_UPGRADE_LIMIT).split("#");
|
||||||
|
for (int i = 0; i < heroes.size(); i++) {
|
||||||
|
Hero hero = heroes.get(i);
|
||||||
|
if (values2.contains(hero.getId())) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (hero.getEquipByPositionMap().size() != 4 && isUnloadEquip == 1) {
|
||||||
|
isUnloadEquip = 0;
|
||||||
|
}
|
||||||
|
if (hero.getJewelInfo().isEmpty()) {
|
||||||
|
soulEquip = 0;
|
||||||
|
spiritEquip = 0;
|
||||||
|
} else {
|
||||||
|
for (String jewel : hero.getJewelInfo()) {
|
||||||
|
PropertyItem propertyItem = equipMap.get(jewel);
|
||||||
|
if (propertyItem == null) {
|
||||||
|
soulEquip = 0;
|
||||||
|
spiritEquip = 0;
|
||||||
|
} else {
|
||||||
|
SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(propertyItem.getEquipId());
|
||||||
|
if (config == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// getLocation 1魂宝 2灵宝
|
||||||
|
if (config.getLocation() == 1) {
|
||||||
|
soulEquip = propertyItem.getLevel() < soulEquip ? propertyItem.getLevel() : soulEquip;
|
||||||
|
} else {
|
||||||
|
spiritEquip = propertyItem.getLevel() < soulEquip ? propertyItem.getLevel() : soulEquip;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hero.getEspecialEquipLevel() < especialEquipLevel) {
|
||||||
|
especialEquipLevel = hero.getEspecialEquipLevel();
|
||||||
|
}
|
||||||
|
if (hero.getLevel() < Integer.parseInt(openLevel[1])) {
|
||||||
|
tablet = 0;
|
||||||
|
}
|
||||||
|
if (hero.getLevel() < resonanceLevel) {
|
||||||
|
resonanceLevel = hero.getLevel();
|
||||||
|
}
|
||||||
|
hongmengs.add(hero.getId());
|
||||||
|
if (hongmengs.size() >= Integer.parseInt(openLevel[0])) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hongmengs.size() < Integer.parseInt(openLevel[0])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
heroManager.setHongmengGuard(hongmengs);
|
||||||
|
// 计算共鸣属性
|
||||||
|
Map<HongMengAttributeEnum, Integer> resonanceAddition = heroManager.getResonanceAddition();
|
||||||
|
resonanceAddition.clear();
|
||||||
|
resonanceAddition.put(HongMengAttributeEnum.LEVEL, resonanceLevel);
|
||||||
|
resonanceAddition.put(HongMengAttributeEnum.EQUIP, isUnloadEquip);
|
||||||
|
resonanceAddition.put(HongMengAttributeEnum.SOUL_EQUIP, soulEquip);
|
||||||
|
resonanceAddition.put(HongMengAttributeEnum.SPIRIT_EQUIP, spiritEquip);
|
||||||
|
resonanceAddition.put(HongMengAttributeEnum.MAGIC_WEAPON, especialEquipLevel);
|
||||||
|
heroManager.setResonanceAddition(resonanceAddition);
|
||||||
|
// 鸿蒙碑
|
||||||
|
if (tablet == 1 && heroManager.getHongmengTablet() == 0) {
|
||||||
|
// 开启鸿蒙碑
|
||||||
|
heroManager.setHongmengTablet(Integer.parseInt(openLevel[1]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开启共鸣区域格子
|
||||||
|
* @param session
|
||||||
|
* @param messageType
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void openResonance(ISession session, MessageTypeProto.MessageType messageType, int graidId) throws Exception {
|
||||||
|
User user = UserManager.getUser(session.getUid());
|
||||||
|
HeroManager heroManager = user.getHeroManager();
|
||||||
|
Map<Integer, String> resonances = heroManager.getResonances();
|
||||||
|
if (resonances.containsKey(graidId)) {
|
||||||
|
LOGGER.info("openResonance uid=>{} has open=>{}", user.getId(), graidId);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
SHongmeng hongmeng = SHongmeng.hongmengs.get(graidId);
|
||||||
|
if (hongmeng == null) {
|
||||||
|
LOGGER.info("openResonance uid=>{} graidId not exist=>{}", user.getId(), graidId);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
Map<Integer, Integer> cost1 = new HashMap<>(1);
|
||||||
|
cost1.put(hongmeng.getPropPrice()[0], hongmeng.getPropPrice()[1]);
|
||||||
|
boolean checkCost1 = ItemUtil.checkCost(user, cost1);
|
||||||
|
if (checkCost1) {
|
||||||
|
ItemUtil.itemCost(user, cost1, BIReason.OPEN_HONGMENG_GRAID, graidId);
|
||||||
|
} else {
|
||||||
|
Map<Integer, Integer> cost2 = new HashMap<>(1);
|
||||||
|
cost2.put(hongmeng.getMoneyPrice()[0], hongmeng.getMoneyPrice()[1]);
|
||||||
|
boolean checkCost2 = ItemUtil.checkCost(user, cost2);
|
||||||
|
if (!checkCost2) {
|
||||||
|
LOGGER.info("openResonance uid=>{} cost item not enough=>{}", user.getId(), graidId);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
ItemUtil.itemCost(user, cost2, BIReason.OPEN_HONGMENG_GRAID, graidId);
|
||||||
|
}
|
||||||
|
resonances.put(graidId, "");
|
||||||
|
heroManager.setResonances(resonances);
|
||||||
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 共鸣
|
||||||
|
* @param session
|
||||||
|
* @param messageType
|
||||||
|
* @param heroId 需要共鸣的神将id
|
||||||
|
* @param index 需要放的共鸣区位置
|
||||||
|
*/
|
||||||
|
public void resonance(ISession session, MessageTypeProto.MessageType messageType, String heroId, int index) throws Exception {
|
||||||
|
User user = UserManager.getUser(session.getUid());
|
||||||
|
HeroManager heroManager = user.getHeroManager();
|
||||||
|
Hero hero = heroManager.getHeroMap().get(heroId);
|
||||||
|
if (hero == null) {
|
||||||
|
LOGGER.info("resonance uid=>{} no the heroId=>{}", user.getId(), heroId);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
if (heroManager.getHongmengGuard().contains(heroId)) {
|
||||||
|
LOGGER.info("resonance uid=>{} the heroId=>{} is HongmengGuard", user.getId(), heroId);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
Map<Integer, String> resonances = heroManager.getResonances();
|
||||||
|
String resonanceInfo = resonances.get(index);
|
||||||
|
if (resonanceInfo == null || !resonanceInfo.isEmpty()) {
|
||||||
|
LOGGER.info("resonance uid=>{} the index not open=>{}", user.getId(), index);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
Map<Integer, Long> resonancesTime = heroManager.getResonancesTime();
|
||||||
|
if (resonancesTime.get(index) != null && resonancesTime.get(index) > TimeUtils.now()) {
|
||||||
|
LOGGER.info("resonance uid=>{} time =>{}", user.getId(), resonancesTime.get(index));
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
// 添加到共鸣区
|
||||||
|
heroManager.updateResonances(index, heroId);
|
||||||
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 卸下共鸣英雄
|
||||||
|
* @param session
|
||||||
|
* @param messageType
|
||||||
|
* @param index
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void unLoadResonance(ISession session, MessageTypeProto.MessageType messageType, int index) throws Exception{
|
||||||
|
User user = UserManager.getUser(session.getUid());
|
||||||
|
HeroManager heroManager = user.getHeroManager();
|
||||||
|
Map<Integer, String> resonances = heroManager.getResonances();
|
||||||
|
String resonanceInfo = resonances.get(index);
|
||||||
|
if (resonanceInfo == null || resonanceInfo.isEmpty()) {
|
||||||
|
LOGGER.info("unLoadResonance uid=>{} the index not open=>{}", user.getId(), index);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
Hero hero = heroManager.getHero(resonanceInfo);
|
||||||
|
if (hero == null) {
|
||||||
|
LOGGER.info("unLoadResonance uid=>{} cur hero is null {}", user.getId(), resonanceInfo);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
heroManager.updateResonances(index, "");
|
||||||
|
heroManager.updateResonancesTime(index, TimeUtils.now() + SSpecialConfig.getIntegerValue(SSpecialConfig.HONGMENG_LATTICE_WAIT_TIME) * 1000);
|
||||||
|
heroManager.updateResonances(index, resonanceInfo);
|
||||||
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 花费妖晶清除共鸣冷却时间
|
||||||
|
* @param session
|
||||||
|
* @param messageType
|
||||||
|
* @param index
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void cleanTime(ISession session, MessageTypeProto.MessageType messageType, int index) throws Exception {
|
||||||
|
User user = UserManager.getUser(session.getUid());
|
||||||
|
HeroManager heroManager = user.getHeroManager();
|
||||||
|
Map<Integer, String> resonances = heroManager.getResonances();
|
||||||
|
String resonanceInfo = resonances.get(index);
|
||||||
|
if (resonanceInfo == null) {
|
||||||
|
LOGGER.info("cleanTime uid=>{} the index not open=>{}", user.getId(), index);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
Map<Integer, Long> resonancesTime = heroManager.getResonancesTime();
|
||||||
|
Long unloadTime = resonancesTime.get(index);
|
||||||
|
if (unloadTime == null || unloadTime <= TimeUtils.now()) {
|
||||||
|
LOGGER.info("cleanTime uid=>{} time =>{}", user.getId(), unloadTime);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
String[] stringValue = SSpecialConfig.getStringValue(SSpecialConfig.HONGMENG_LATTICE_PRICE).split("#");
|
||||||
|
long time = unloadTime - TimeUtils.now();
|
||||||
|
int count = (int) (time / 1000 * Integer.parseInt(stringValue[0]));
|
||||||
|
Map<Integer, Integer> cost = new HashMap<>(1);
|
||||||
|
cost.put(Integer.parseInt(stringValue[1]), count);
|
||||||
|
boolean checkCost = ItemUtil.checkCost(user, cost);
|
||||||
|
if (!checkCost) {
|
||||||
|
LOGGER.info("cleanTime uid=>{} item not enough =>{}", user.getId(), unloadTime);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
ItemUtil.itemCost(user, cost, BIReason.CLEAR_HONGMENG_GRAID, index);
|
||||||
|
heroManager.updateResonancesTime(index, 0L);
|
||||||
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 升级鸿蒙碑
|
||||||
|
* @param session
|
||||||
|
* @param messageType
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
public void updateHongmengTablet(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
|
||||||
|
User user = UserManager.getUser(session.getUid());
|
||||||
|
HeroManager heroManager = user.getHeroManager();
|
||||||
|
if (heroManager.getHongmengTablet() == 0) {
|
||||||
|
LOGGER.info("updateHongmengTablet uid=>{} HongmengTablet not open=>{}", user.getId(), 0);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
String[] split = SSpecialConfig.getStringValue(SSpecialConfig.HONGMENG_UPGRADE_LIMIT).split("#");
|
||||||
|
int maxLevel = heroManager.getHongmengMaxLevel().size() * SSpecialConfig.getIntegerValue(SSpecialConfig.HONGMENG_ONEHERO_OPENLEVEL) + Integer.parseInt(split[0]);
|
||||||
|
if (heroManager.getHongmengTablet() >= maxLevel) {
|
||||||
|
LOGGER.info("updateHongmengTablet uid=>{} curLevel={} maxLevel =>{}", user.getId(), heroManager.getHongmengTablet(), maxLevel);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
int nextLevel = heroManager.getHongmengTablet() + 1;
|
||||||
|
SHongmengUP hongmengUP = SHongmengUP.hongmengUPLevels.get(nextLevel);
|
||||||
|
if (hongmengUP == null) {
|
||||||
|
LOGGER.info("updateHongmengTablet uid=>{} curLevel={} maxLevel =>{} nextLevel=>{}", user.getId(), heroManager.getHongmengTablet(), maxLevel, nextLevel);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
int[][] levelUp = hongmengUP.getLevelUp();
|
||||||
|
boolean b = ItemUtil.itemCost(user, levelUp, BIReason.HONGMENG_UPGRIDE, nextLevel);
|
||||||
|
if (!b) {
|
||||||
|
LOGGER.info("updateHongmengTablet uid=>{} nextLevel=>{} need item not enough", user.getId(), nextLevel);
|
||||||
|
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||||
|
}
|
||||||
|
heroManager.setHongmengTablet(nextLevel);
|
||||||
|
MessageUtil.sendMessage(session, 1, messageType.getNumber(), null);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.ljsd.jieling.logic.hero;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 鸿蒙阵 加成类型
|
||||||
|
*/
|
||||||
|
public enum HongMengAttributeEnum {
|
||||||
|
|
||||||
|
LEVEL(1),
|
||||||
|
EQUIP(2),
|
||||||
|
SOUL_EQUIP(3), // 魂宝
|
||||||
|
SPIRIT_EQUIP(4),// 灵宝
|
||||||
|
MAGIC_WEAPON(5), // 法宝
|
||||||
|
;
|
||||||
|
private int propertyId;
|
||||||
|
|
||||||
|
HongMengAttributeEnum(int propertyId) {
|
||||||
|
this.propertyId = propertyId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPropertyId() {
|
||||||
|
return propertyId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -233,6 +233,7 @@ public class MailLogic {
|
||||||
if (isLimit){
|
if (isLimit){
|
||||||
throw new ErrorCodeException(ErrorCode.ITEM_POCKET_IS_FULL);
|
throw new ErrorCodeException(ErrorCode.ITEM_POCKET_IS_FULL);
|
||||||
}
|
}
|
||||||
|
CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, itemArr, BIReason.TAKE_MAIL_REWARD);
|
||||||
for (String mailId : mailIdsList){
|
for (String mailId : mailIdsList){
|
||||||
Mail mail = mailManager.getMail(mailId);
|
Mail mail = mailManager.getMail(mailId);
|
||||||
mail.setState(Global.MAIL_DRAW_ST_GOT);
|
mail.setState(Global.MAIL_DRAW_ST_GOT);
|
||||||
|
|
@ -240,7 +241,6 @@ public class MailLogic {
|
||||||
mail.setNoUseDeleteTime(TimeUtils.now()+TimeUtils.DAY*Global.MAIL_NOUSE_DELETE_TIME);
|
mail.setNoUseDeleteTime(TimeUtils.now()+TimeUtils.DAY*Global.MAIL_NOUSE_DELETE_TIME);
|
||||||
mailManager.addMail(mail);
|
mailManager.addMail(mail);
|
||||||
}
|
}
|
||||||
CommonProto.Drop.Builder dropBuilder = ItemUtil.drop(user, itemArr, BIReason.TAKE_MAIL_REWARD);
|
|
||||||
|
|
||||||
PlayerInfoProto.TakeMailResponse takeMailResponse = PlayerInfoProto.TakeMailResponse.newBuilder()
|
PlayerInfoProto.TakeMailResponse takeMailResponse = PlayerInfoProto.TakeMailResponse.newBuilder()
|
||||||
.setDrop(dropBuilder)
|
.setDrop(dropBuilder)
|
||||||
|
|
|
||||||
|
|
@ -549,7 +549,6 @@ public class ItemUtil {
|
||||||
private static int getItemType(SItem sItem) {
|
private static int getItemType(SItem sItem) {
|
||||||
int itemType = sItem.getItemType();
|
int itemType = sItem.getItemType();
|
||||||
switch (sItem.getItemType()) {
|
switch (sItem.getItemType()) {
|
||||||
case GlobalItemType.POKENMON_COMONPENT:
|
|
||||||
case GlobalItemType.RUNNE:
|
case GlobalItemType.RUNNE:
|
||||||
case GlobalItemType.CARD_FRAGMENT:
|
case GlobalItemType.CARD_FRAGMENT:
|
||||||
case GlobalItemType.BLUE_IMAGE:
|
case GlobalItemType.BLUE_IMAGE:
|
||||||
|
|
@ -594,6 +593,9 @@ public class ItemUtil {
|
||||||
List<CommonProto.Item> itemProtoList = new CopyOnWriteArrayList<>();
|
List<CommonProto.Item> itemProtoList = new CopyOnWriteArrayList<>();
|
||||||
ItemManager itemManager = user.getItemManager();
|
ItemManager itemManager = user.getItemManager();
|
||||||
List<CommonProto.Item> sendToFront = new CopyOnWriteArrayList<>();
|
List<CommonProto.Item> sendToFront = new CopyOnWriteArrayList<>();
|
||||||
|
//超过上限不能直接获得
|
||||||
|
Map<Integer,Integer> extraItem = new HashMap<>(itemMap.size());
|
||||||
|
|
||||||
for (Map.Entry<Integer, Integer> entry : itemMap.entrySet()) {
|
for (Map.Entry<Integer, Integer> entry : itemMap.entrySet()) {
|
||||||
SItem sItem = SItem.getsItemMap().get (entry.getKey());
|
SItem sItem = SItem.getsItemMap().get (entry.getKey());
|
||||||
int itemNumlimit = sItem.getItemNumlimit();
|
int itemNumlimit = sItem.getItemNumlimit();
|
||||||
|
|
@ -611,15 +613,30 @@ public class ItemUtil {
|
||||||
if(sItem.getId()==Global.MISSING_ROOM_ITEM&&reason==BIReason.ADVENTURE_BASE_REWARD){
|
if(sItem.getId()==Global.MISSING_ROOM_ITEM&&reason==BIReason.ADVENTURE_BASE_REWARD){
|
||||||
itemNumlimit = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(user.getPlayerInfoManager().getLevel()).getMazeTreasureMax();
|
itemNumlimit = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(user.getPlayerInfoManager().getLevel()).getMazeTreasureMax();
|
||||||
}
|
}
|
||||||
if(item.getItemNum()>= itemNumlimit){
|
//数量超过了
|
||||||
|
if(item.getItemNum()> itemNumlimit){
|
||||||
|
|
||||||
|
//如果是寻龙玉,直接返回不给
|
||||||
|
if(sItem.getId()==Global.MISSING_ROOM_ITEM&&reason==BIReason.ADVENTURE_BASE_REWARD){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if(reason==BIReason.TAKE_MAIL_REWARD){
|
||||||
|
throw new ErrorCodeException(ErrorCode.BAG_FULL);
|
||||||
|
}else{
|
||||||
|
extraItem.put(entry.getKey(),extraItem.getOrDefault(entry.getKey(),0)+entry.getValue());
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (item.getItemNum() + entry.getValue() >= itemNumlimit){
|
if (item.getItemNum() + entry.getValue() > itemNumlimit){
|
||||||
if(sItem.getId()==Global.MISSING_ROOM_ITEM&&reason==BIReason.ADVENTURE_BASE_REWARD){
|
if(sItem.getId()==Global.MISSING_ROOM_ITEM&&reason==BIReason.ADVENTURE_BASE_REWARD){
|
||||||
item.setItemNum(item.getItemNum() + entry.getValue());
|
item.setItemNum(item.getItemNum() + entry.getValue());
|
||||||
}else{
|
}else{
|
||||||
itemNum = itemNumlimit -item.getItemNum();
|
if(reason==BIReason.TAKE_MAIL_REWARD){
|
||||||
item.setItemNum(itemNumlimit);
|
throw new ErrorCodeException(ErrorCode.BAG_FULL);
|
||||||
|
}else{
|
||||||
|
extraItem.put(entry.getKey(),extraItem.getOrDefault(entry.getKey(),0)+entry.getValue());
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
item.setItemNum(item.getItemNum() + entry.getValue());
|
item.setItemNum(item.getItemNum() + entry.getValue());
|
||||||
|
|
@ -629,20 +646,12 @@ public class ItemUtil {
|
||||||
if(itemNum>=0){
|
if(itemNum>=0){
|
||||||
itemProtoList.add(CBean2Proto.getItem(item,itemNum));
|
itemProtoList.add(CBean2Proto.getItem(item,itemNum));
|
||||||
}
|
}
|
||||||
// int eventType = ParamEventBean.UserItemEvent;
|
|
||||||
// if(currencyMap.contains(entry.getKey())){
|
|
||||||
// eventType = ParamEventBean.UserCurrencyEvent;
|
|
||||||
// }
|
|
||||||
// KtEventUtils.onKtEvent(user, eventType,reason,GlobalsDef.addReason,entry.getKey(),itemNum,item.getItemNum());
|
|
||||||
ReportUtil.onReportEvent(user,ReportEventEnum.GET_ITEM.getType(),itemNum,String.valueOf(reason),item.getItemId());
|
ReportUtil.onReportEvent(user,ReportEventEnum.GET_ITEM.getType(),itemNum,String.valueOf(reason),item.getItemId());
|
||||||
|
|
||||||
baseItemReport(user,item.getItemId(),itemNum,1,reason);
|
baseItemReport(user,item.getItemId(),itemNum,1,reason);
|
||||||
|
|
||||||
if(sItem.getItemType() == GlobalItemType.POKENMON_COMONPENT && sItem.getQuantity()>=SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_differ_content_parm)){
|
|
||||||
SDifferDemonsConfig sDifferDemonsConfig = SDifferDemonsConfig.sDifferDemonsConfigMapByComId.get(sItem.getId());
|
|
||||||
String nickName = user.getPlayerInfoManager().getNickName();
|
|
||||||
String message = SErrorCodeEerverConfig.getI18NMessage("lamp_lottery_differ_content_"+ sItem.getQuantity(), new Object[]{nickName,sDifferDemonsConfig.getName(),sItem.getName()});
|
|
||||||
ChatLogic.getInstance().sendSysChatMessage(message,Global.LUCKY_LUCK,sItem.getId(),0,0,0,0,0);
|
|
||||||
}
|
|
||||||
if(sItem.getId() == Global.EXP){
|
if(sItem.getId() == Global.EXP){
|
||||||
userLevelUp(user,itemNum);
|
userLevelUp(user,itemNum);
|
||||||
}
|
}
|
||||||
|
|
@ -665,11 +674,25 @@ public class ItemUtil {
|
||||||
//日志记录
|
//日志记录
|
||||||
ItemLogic.getInstance().addItemLog(new ItemLog(user.getId(),0,user.getPlayerInfoManager().getLevel(),String.valueOf(TimeUtils.now()),reason,sItem.getId(),itemNum,item.getItemNum()));
|
ItemLogic.getInstance().addItemLog(new ItemLog(user.getId(),0,user.getPlayerInfoManager().getLevel(),String.valueOf(TimeUtils.now()),reason,sItem.getId(),itemNum,item.getItemNum()));
|
||||||
}
|
}
|
||||||
|
for(Map.Entry<Integer,Integer> entry:extraItem.entrySet()){
|
||||||
|
itemProtoList.add(CBean2Proto.getItem(itemManager.getItemMap().get(entry.getKey()),entry.getValue()));
|
||||||
|
}
|
||||||
if (dropBuilder != null) {
|
if (dropBuilder != null) {
|
||||||
dropBuilder.addAllItemlist(itemProtoList);
|
dropBuilder.addAllItemlist(itemProtoList);
|
||||||
}
|
}
|
||||||
if(!sendToFront.isEmpty()){
|
if(!sendToFront.isEmpty()){
|
||||||
MessageUtil.sendBagIndication(user.getId(),0,sendToFront);
|
MessageUtil.sendBagIndication(user.getId(),0,sendToFront,extraItem.size()>0);
|
||||||
|
}
|
||||||
|
if(extraItem.size()>0){
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
for(Map.Entry<Integer,Integer> entry:extraItem.entrySet()){
|
||||||
|
builder.append(entry.getKey()).append("#").append(entry.getValue());
|
||||||
|
String title = SErrorCodeEerverConfig.getI18NMessage("item_max_mail_title");
|
||||||
|
SItem item = SItem.getsItemMap().get(entry.getKey());
|
||||||
|
String content = SErrorCodeEerverConfig.getI18NMessage("item_max_mail_content",new String[]{item.getName(),String.valueOf(item.getItemNumlimit())});
|
||||||
|
MailLogic.getInstance().sendMail(user.getId(),title,content,builder.toString(),TimeUtils.nowInt(),Global.MAIL_EFFECTIVE_TIME);
|
||||||
|
builder = new StringBuilder();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -815,7 +838,7 @@ public class ItemUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!sendToFront.isEmpty()){
|
if(!sendToFront.isEmpty()){
|
||||||
MessageUtil.sendBagIndication(user.getId(),1,sendToFront);
|
MessageUtil.sendBagIndication(user.getId(),1,sendToFront,false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -871,7 +894,7 @@ public class ItemUtil {
|
||||||
}
|
}
|
||||||
user.getItemManager().setItemMap(itemMap);
|
user.getItemManager().setItemMap(itemMap);
|
||||||
if(!sendToFront.isEmpty()){
|
if(!sendToFront.isEmpty()){
|
||||||
MessageUtil.sendBagIndication(user.getId(),0,sendToFront);
|
MessageUtil.sendBagIndication(user.getId(),0,sendToFront,false);
|
||||||
}
|
}
|
||||||
for(PropertyItem equip:equips){
|
for(PropertyItem equip:equips){
|
||||||
equipsToBag(user,isVictory,equip,rewardStr);
|
equipsToBag(user,isVictory,equip,rewardStr);
|
||||||
|
|
@ -965,10 +988,10 @@ public class ItemUtil {
|
||||||
sendToFront.add(CBean2Proto.getItem(myItem,-1));
|
sendToFront.add(CBean2Proto.getItem(myItem,-1));
|
||||||
}
|
}
|
||||||
if(!sendToFront.isEmpty()){
|
if(!sendToFront.isEmpty()){
|
||||||
MessageUtil.sendBagIndication(user.getId(),0,sendToFront);
|
MessageUtil.sendBagIndication(user.getId(),0,sendToFront,false);
|
||||||
}
|
}
|
||||||
if(!sendTemToFront.isEmpty()){
|
if(!sendTemToFront.isEmpty()){
|
||||||
MessageUtil.sendBagIndication(user.getId(),1,sendTemToFront);
|
MessageUtil.sendBagIndication(user.getId(),1,sendTemToFront,false);
|
||||||
}
|
}
|
||||||
user.getUserMissionManager().onGameEvent(user,GameEvent.CONSUMER_MATERIAL,useItemMap);
|
user.getUserMissionManager().onGameEvent(user,GameEvent.CONSUMER_MATERIAL,useItemMap);
|
||||||
Poster.getPoster().dispatchEvent(new UseItemEvent(user.getId(),useItemMap));
|
Poster.getPoster().dispatchEvent(new UseItemEvent(user.getId(),useItemMap));
|
||||||
|
|
|
||||||
|
|
@ -95,15 +95,15 @@ public class MessageUtil {
|
||||||
user.getPlayerInfoManager().setReds(reds);
|
user.getPlayerInfoManager().setReds(reds);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendBagIndication(int sendUid,int type, List<CommonProto.Item> sendToFront) {
|
public static void sendBagIndication(int sendUid,int type, List<CommonProto.Item> sendToFront,boolean isMax) {
|
||||||
if(null!= SimpleTransaction.current()){
|
if(null!= SimpleTransaction.current()){
|
||||||
PlayerInfoProto.UpdateBagIndication.Builder build = PlayerInfoProto.UpdateBagIndication.newBuilder().addAllItem(sendToFront).setType(type);
|
PlayerInfoProto.UpdateBagIndication.Builder build = PlayerInfoProto.UpdateBagIndication.newBuilder().addAllItem(sendToFront).setType(type).setIsMax(isMax?1:0);
|
||||||
SimpleTransaction.current().dealWhileCommit(new SimpleTransaction.SendTask(build.build(), MessageTypeProto.MessageType.UPDATE_BAG_INDICATION_VALUE));
|
SimpleTransaction.current().dealWhileCommit(new SimpleTransaction.SendTask(build.build(), MessageTypeProto.MessageType.UPDATE_BAG_INDICATION_VALUE));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ISession session = OnlineUserManager.sessionMap.get(sendUid);
|
ISession session = OnlineUserManager.sessionMap.get(sendUid);
|
||||||
if(session!=null){
|
if(session!=null){
|
||||||
PlayerInfoProto.UpdateBagIndication build = PlayerInfoProto.UpdateBagIndication.newBuilder().addAllItem(sendToFront).setType(type).build();
|
PlayerInfoProto.UpdateBagIndication build = PlayerInfoProto.UpdateBagIndication.newBuilder().addAllItem(sendToFront).setType(type).setIsMax(isMax?1:0).build();
|
||||||
MessageUtil.sendIndicationMessage(session,1,MessageTypeProto.MessageType.UPDATE_BAG_INDICATION_VALUE,build,true);
|
MessageUtil.sendIndicationMessage(session,1,MessageTypeProto.MessageType.UPDATE_BAG_INDICATION_VALUE,build,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,40 @@
|
||||||
|
package config;
|
||||||
|
|
||||||
|
import manager.STableManager;
|
||||||
|
import manager.Table;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Table(name = "Hongmeng")
|
||||||
|
public class SHongmeng implements BaseConfig{
|
||||||
|
|
||||||
|
public static Map<Integer, SHongmeng> hongmengs;
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
private int[] propPrice;
|
||||||
|
|
||||||
|
private int[] moneyPrice;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() throws Exception {
|
||||||
|
hongmengs = STableManager.getConfig(SHongmeng.class);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SHongmeng getHongmengById(int id){
|
||||||
|
return hongmengs.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getPropPrice() {
|
||||||
|
return propPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getMoneyPrice() {
|
||||||
|
return moneyPrice;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,44 @@
|
||||||
|
package config;
|
||||||
|
|
||||||
|
import manager.STableManager;
|
||||||
|
import manager.Table;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
@Table(name = "HongmengUP")
|
||||||
|
public class SHongmengUP implements BaseConfig{
|
||||||
|
|
||||||
|
public static Map<Integer, SHongmengUP> hongmengUPs;
|
||||||
|
|
||||||
|
public static Map<Integer, SHongmengUP> hongmengUPLevels;
|
||||||
|
|
||||||
|
private int id;
|
||||||
|
|
||||||
|
private int hongmengLevel;
|
||||||
|
|
||||||
|
private int[][] levelUp;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init() throws Exception {
|
||||||
|
hongmengUPs = STableManager.getConfig(SHongmengUP.class);
|
||||||
|
hongmengUPLevels = new HashMap<>();
|
||||||
|
for (SHongmengUP hongmengUP : hongmengUPs.values()) {
|
||||||
|
hongmengUPLevels.put(hongmengUP.getHongmengLevel(), hongmengUP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public int getHongmengLevel() {
|
||||||
|
return hongmengLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[][] getLevelUp() {
|
||||||
|
return levelUp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -69,6 +69,11 @@ public class SSpecialConfig implements BaseConfig {
|
||||||
public static final String GUILD_WAR_ISOPEN = "Guild_war_isopen";//老公会战是否开启
|
public static final String GUILD_WAR_ISOPEN = "Guild_war_isopen";//老公会战是否开启
|
||||||
public static final String LUCKYTURNDAILYLIMIT = "LuckyTurnDailyLimit";//幸运探宝每日上限
|
public static final String LUCKYTURNDAILYLIMIT = "LuckyTurnDailyLimit";//幸运探宝每日上限
|
||||||
|
|
||||||
|
public static final String HONGMENG_OPENLEVEL = "Hongmeng_OpenLevel";//鸿蒙阵开启等级
|
||||||
|
public static final String HONGMENG_LATTICE_WAIT_TIME = "Hongmeng_Lattice_Waitingtime";//鸿蒙阵每个格子冷却时间(s)
|
||||||
|
public static final String HONGMENG_LATTICE_PRICE = "Hongmeng_Lattice_Price";//鸿蒙阵格子刷新价格s
|
||||||
|
public static final String HONGMENG_UPGRADE_LIMIT = "Hongmeng_upgrade_limit";//鸿蒙阵升级开启限制
|
||||||
|
public static final String HONGMENG_ONEHERO_OPENLEVEL = "Hongmeng_Onehero_OpenLevel";//鸿蒙阵每个觉醒神将提升的等级
|
||||||
|
|
||||||
public static final String REPLACE_ITEM_ID = "replace_item_id";//置换玉道具ID
|
public static final String REPLACE_ITEM_ID = "replace_item_id";//置换玉道具ID
|
||||||
public static final String REPLACE_COST = "replace_cost";//置换玉消耗
|
public static final String REPLACE_COST = "replace_cost";//置换玉消耗
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue