Merge branch 'master_test_gn' into dh_dev_ridingsward
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.javaback_recharge
commit
bfc5667bb8
|
@ -70,6 +70,8 @@ public enum FunctionIdEnum {
|
|||
HongMeng(86,null),
|
||||
CrossYuxulundao(87,null),//跨服-玉虚论道
|
||||
CrossSevenWorld(112,new SevenWorldFunction()),//七界试炼
|
||||
FourQua(113,null),//四象心法
|
||||
Likable(114,null),//好感度
|
||||
WeekGood(9091,null),
|
||||
|
||||
;
|
||||
|
|
|
@ -111,6 +111,7 @@ public interface GlobalsDef {
|
|||
int MAIN_LEVEL_UNLOCK_PRIVILEGE = 2;
|
||||
int VIP_UNLOCK_PRIVILEGE = 3;
|
||||
int RECHARGE_UNLOCK_PRIVILEGE = 4;
|
||||
int LIKABLE_UNLOCK=6;//好感度解锁类型
|
||||
|
||||
//特殊商店id
|
||||
int DAILY_GOODS_FAST_ID = 1004;//每日礼包一键购买的礼包ID
|
||||
|
|
|
@ -24,6 +24,7 @@ public interface VipPrivilegeType {
|
|||
int FREE_HERO_RANDOM = 14;//免费抽取妖灵师
|
||||
int FREE_SECRET_RANDOM = 15; //解锁免费抽取秘盒
|
||||
int TOWER_RESRT_NUM= 17; //每日试炼重置次数
|
||||
int SHOP_DIAN_JING = 21; // 点金
|
||||
int TIME_RANDOM_FREE = 32;//东海寻仙每日赠送招募次数
|
||||
int FAST_BUY_COUNT = 33;//极速探索购买次数
|
||||
int MISSING_ROOM_CONSUME =34;//寻宝达人寻宝消耗降低
|
||||
|
|
|
@ -347,6 +347,8 @@ public interface BIReason {
|
|||
|
||||
int SIXIANG_UP_STAR_COST=1106;//四象心法进阶消耗
|
||||
|
||||
int HERO_UP_LIKEBLE_COST=1107;//英雄提升好感度消耗
|
||||
|
||||
int FOUR_CHALLENGE_FIRST = 1201;//四灵试炼首通
|
||||
int FOUR_CHALLENGE_SWEEP = 1202;//四灵试炼扫荡
|
||||
|
||||
|
@ -356,8 +358,10 @@ public interface BIReason {
|
|||
int SEVEN_WORLD_ACTIVITY_END = 1213;//七界活动结束
|
||||
|
||||
int SEVEN_WORLD_TREASURE = 1214;//七界秘宝
|
||||
|
||||
|
||||
int RIDING_SWARD_REWARD = 1215;//御剑行领取奖励
|
||||
int RIDING_SWARD_BET = 1216;//御剑行押注消耗
|
||||
|
||||
int LEVEL_UP_REWARD = 1220;// 玩家升级赠与的道具
|
||||
|
||||
}
|
|
@ -34,6 +34,7 @@ public interface GlobalItemType {
|
|||
int SpecialMonsterItem=22; // 灵兽碎片
|
||||
// 万能狗粮
|
||||
int AllPowerful_DogFood = 25;
|
||||
int LikableCostItem=27;//好感度功能消耗道具
|
||||
//物品使用类型
|
||||
int NO_USE = 0 ; //不使用
|
||||
int RANDOM_USE = 1; // 随机使用
|
||||
|
|
|
@ -78,9 +78,11 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
List<CommonProto.NewPlayerGuidePoint> list = new ArrayList<>();
|
||||
Map<Integer, SPrivilegeTypeConfig> privilegeTypeConfigMap = SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap();
|
||||
for(Map.Entry<Integer, SPrivilegeTypeConfig> entry:privilegeTypeConfigMap.entrySet()){
|
||||
//如果是<4 系统内置特权
|
||||
if(entry.getValue().getUnlockType()<4&&!vipInfo.containsKey(entry.getKey())){
|
||||
playerInfoManager.addVipInfo(entry.getKey());
|
||||
//如果是<4 系统内置特权 (6是新增的好感度特权收益加成 2021.9.26)
|
||||
if(entry.getValue().getUnlockType()<4||entry.getValue().getUnlockType()==6){
|
||||
if (!vipInfo.containsKey(entry.getKey())){
|
||||
playerInfoManager.addVipInfo(entry.getKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
List<CommonProto.Privilege> privilegeList = new ArrayList<>();
|
||||
|
|
|
@ -27,6 +27,7 @@ public class GetQiMenDunJiaHitListHandler extends BaseHandler<ActivityProto.qiMe
|
|||
return MessageTypeProto.MessageType.qiMenDunJiaHitListRequest;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GeneratedMessage processWithProto(int uid, ActivityProto.qiMenDunJiaHitListRequest proto) throws Exception {
|
||||
// 用户信息
|
||||
User user = UserManager.getUser(uid);
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
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.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SSpecialConfig;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
///获取好感度数据请求
|
||||
@Component
|
||||
public class GetLikableDataRequestHandler extends BaseHandler {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.GET_LIKABLE_DATA_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession session, PacketNetData netData) throws Exception {
|
||||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
Map<Integer,Integer> likaMap=user.getHeroManager().getHeroLikableMap();
|
||||
List<CommonProto.LikableInfo> _list=new ArrayList<>();
|
||||
for (Map.Entry<Integer, Integer> integerEntry : likaMap.entrySet()) {
|
||||
CommonProto.LikableInfo likaInfo=CommonProto.LikableInfo.newBuilder()
|
||||
.setHeroStaticid(integerEntry.getKey())
|
||||
.setLikableNum(integerEntry.getValue())
|
||||
.build();
|
||||
_list.add(likaInfo);
|
||||
}
|
||||
int remainTime= SSpecialConfig.getIntegerValue(SSpecialConfig.LIKE_ABILITY)-user.getHeroManager().getLikableSendTime();
|
||||
HeroInfoProto.GetLikableDataResponse response=HeroInfoProto.GetLikableDataResponse.newBuilder()
|
||||
.addAllInfoList(_list)
|
||||
.setLikableRemainTime(remainTime)
|
||||
.build();
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.GET_LIKABLE_DATA_RESPONSE_VALUE,response,true);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,156 @@
|
|||
package com.ljsd.jieling.handler.hero;
|
||||
|
||||
import com.ljsd.common.mogodb.util.GlobalData;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.HeroManager;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
//英雄好感度提升消息
|
||||
@Component
|
||||
public class HeroUpLikableRequestHandler extends BaseHandler<HeroInfoProto.HeroUpLikableRequest> {
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.HERO_UP_LIKABLE_REQUEST;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void processWithProto(ISession session, HeroInfoProto.HeroUpLikableRequest proto) throws Exception {
|
||||
int heroStaticId=proto.getHeroStaticId();//英雄静态id
|
||||
int itemId=proto.getItemId();//消耗道具id
|
||||
int itemNum=proto.getItemNum();//消耗道具数量
|
||||
int uid = session.getUid();
|
||||
|
||||
User user = UserManager.getUser(uid);
|
||||
HeroManager heroManager=user.getHeroManager();
|
||||
|
||||
if (itemNum+heroManager.getLikableSendTime()> SSpecialConfig.getIntegerValue(SSpecialConfig.LIKE_ABILITY)){
|
||||
LOGGER.error("好感度赠送次数超出每日限制");
|
||||
throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT);
|
||||
}
|
||||
int[][]costArr=new int[1][2];
|
||||
costArr[0][0]=itemId;
|
||||
costArr[0][1]=itemNum;
|
||||
boolean costResult = ItemUtil.itemCost(user,costArr, BIReason.HERO_UP_LIKEBLE_COST,heroStaticId);
|
||||
if (costResult){
|
||||
SItem _item= SItem.getsItemMap().get(itemId);
|
||||
int profession=SCHero.getsCHero().get(heroStaticId).getPropertyName();
|
||||
String[]addArr=_item.getResolveReward().split("\\|");
|
||||
String addStr=addArr[profession-1];
|
||||
int singleAddNum=Integer.parseInt(addStr.split("#")[1]);
|
||||
int allAddNum=singleAddNum*itemNum;
|
||||
int curHeroLikableNum = heroManager.getHeroLikableMap().containsKey(heroStaticId)?user.getHeroManager().getHeroLikableMap().get(heroStaticId):0;
|
||||
int oldLv=GetHeroLikableLvByLikaNum(curHeroLikableNum);
|
||||
curHeroLikableNum+=allAddNum;
|
||||
int curLv=GetHeroLikableLvByLikaNum(curHeroLikableNum);
|
||||
if (curLv>oldLv){
|
||||
Map<Integer,Integer>curHeroPropAdd=GetHeroLikableAddPeop(curLv);
|
||||
heroManager.putHeroLikablePropAddMap(heroStaticId,curHeroPropAdd);
|
||||
}
|
||||
int oldAllLikaLv=GetAllLikableLvByLikaNum(GetAllHeroLikableNum(heroManager.getHeroLikableMap()));
|
||||
heroManager.putHeroLikableMap(heroStaticId,curHeroLikableNum);
|
||||
int curAllLikaLv=GetAllLikableLvByLikaNum(GetAllHeroLikableNum(heroManager.getHeroLikableMap()));
|
||||
if (curAllLikaLv>oldAllLikaLv){
|
||||
Map<Integer,Integer>allHeroPropAdd=GetAllHeroLikableAddPeop(curAllLikaLv);
|
||||
heroManager.putAllLikablePropAddMap(allHeroPropAdd);
|
||||
int[][]condition= SPrivilegeTypeConfig.getsPrivilegeTypeConfigMap().get(2).getCondition();
|
||||
user.getPlayerInfoManager().updateVipPrivilage(1,condition[curAllLikaLv][1]);
|
||||
}
|
||||
int sendTime= heroManager.getLikableSendTime()+itemNum;
|
||||
heroManager.UpdateLikableSendTime(sendTime);
|
||||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.HERO_UP_LIKABLE_RESPONSE_VALUE, null,true);
|
||||
}else{
|
||||
LOGGER.error("好感度提升材料不足");
|
||||
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
|
||||
}
|
||||
}
|
||||
///通过神将好感度获取好感度等级
|
||||
public int GetHeroLikableLvByLikaNum(int _likaNum){
|
||||
int likaLv=0;
|
||||
for (Map.Entry<Integer, Integer> integerEntry : SLikeAbilityConfig.heroLikeAbilityByLevel.entrySet()) {
|
||||
if (integerEntry.getKey()==SLikeAbilityConfig.heroLikeAbilityByLevel.size()-1)break;
|
||||
if (_likaNum>=integerEntry.getValue()){
|
||||
likaLv= integerEntry.getKey()+1;
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return likaLv;
|
||||
}
|
||||
///通过总好感度获取好感度等级
|
||||
public int GetAllLikableLvByLikaNum(int _likaNum){
|
||||
int likaLv=0;
|
||||
for (Map.Entry<Integer, Integer> integerEntry : SLikeAbilityConfig.allLikeAbilityByLevel.entrySet()) {
|
||||
if (integerEntry.getKey()==SLikeAbilityConfig.allLikeAbilityByLevel.size()-1)break;
|
||||
if (_likaNum>=integerEntry.getValue()){
|
||||
likaLv= integerEntry.getKey()+1;
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return likaLv;
|
||||
}
|
||||
//通过当前等级获取神将好感度属性加成
|
||||
public Map<Integer,Integer>GetHeroLikableAddPeop(int _lv){
|
||||
Map<Integer,Integer>_propMap=new HashMap<>();
|
||||
for (int i = 0; i <= _lv; i++) {
|
||||
SLikeAbilityConfig _config= SLikeAbilityConfig.heroLikeAbilityConfigMap.get(i);
|
||||
if (_config.getProperty()==null)continue;
|
||||
for (int[] ints : _config.getProperty()) {
|
||||
if (_propMap.containsKey(ints[0])) {
|
||||
int absProp=_propMap.get(ints[0])+ints[1];
|
||||
_propMap.put(ints[0],absProp);
|
||||
}else{
|
||||
_propMap.put(ints[0],ints[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return _propMap;
|
||||
}
|
||||
|
||||
//通过当前总好感度等级获取好感度属性加成
|
||||
public Map<Integer,Integer>GetAllHeroLikableAddPeop(int _allLv){
|
||||
Map<Integer,Integer>_propMap=new HashMap<>();
|
||||
for (int i = 0; i <= _allLv; i++) {
|
||||
SLikeAbilityConfig _config= SLikeAbilityConfig.allLikeAbilityConfigMap.get(i);
|
||||
if (_config.getProperty()!=null){
|
||||
for (int[] ints : _config.getProperty()) {
|
||||
if(ints.length<=0)continue;
|
||||
if (_propMap.containsKey(ints[0])) {
|
||||
int absProp=_propMap.get(ints[0])+ints[1];
|
||||
_propMap.put(ints[0],absProp);
|
||||
}else{
|
||||
_propMap.put(ints[0],ints[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return _propMap;
|
||||
}
|
||||
|
||||
//获取总的好感度
|
||||
public int GetAllHeroLikableNum(Map<Integer,Integer>_heroLikableMap){
|
||||
int likableNum=0;
|
||||
for (Map.Entry<Integer, Integer> integerEntry : _heroLikableMap.entrySet()) {
|
||||
likableNum+=integerEntry.getValue();
|
||||
}
|
||||
return likableNum;
|
||||
}
|
||||
}
|
|
@ -33,6 +33,7 @@ public class SixiangUpRequestHandler extends BaseHandler<HeroInfoProto.SixiangUp
|
|||
public void processWithProto(ISession session, HeroInfoProto.SixiangUpRequest proto) throws Exception {
|
||||
int professionId=proto.getProfessionId();//职业id
|
||||
int uid = session.getUid();
|
||||
|
||||
User user = UserManager.getUser(uid);
|
||||
SixiangProfessionInfo professionInfo = user.getHeroManager().getSixiangDataMap().get(professionId);
|
||||
if (CheckCurUpIsLimit(professionInfo)) {
|
||||
|
@ -91,7 +92,7 @@ public class SixiangUpRequestHandler extends BaseHandler<HeroInfoProto.SixiangUp
|
|||
MessageUtil.sendMessage(session,1, MessageTypeProto.MessageType.SIXIANG_UP_RESPONSE_VALUE,response,true);
|
||||
}else{
|
||||
LOGGER.error("四象心法强化材料不足");
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE_SELF);
|
||||
throw new ErrorCodeException(ErrorCode.HERO_ITEM_NOT);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -438,8 +438,17 @@ public class JourneyMap {
|
|||
for(int i=0;i<commonRewardArray.length-1;i++){
|
||||
commonRewardArray[i] = common[randomNum.get(i)-1];
|
||||
}
|
||||
int finalReward = travelConfig.getFinalReward();
|
||||
commonRewardArray[commonRewardArray.length-1] = finalReward;
|
||||
//int []finalReward = travelConfig.getFinalReward();
|
||||
//commonRewardArray[commonRewardArray.length-1] = finalReward;
|
||||
|
||||
int []commonRewardArrayNew = Arrays.copyOf(commonRewardArray,commonRewardArray.length
|
||||
+travelConfig.getFinalReward().length);
|
||||
|
||||
System.arraycopy(travelConfig.getFinalReward(),0,commonRewardArrayNew,
|
||||
commonRewardArray.length,travelConfig.getFinalReward().length);
|
||||
commonRewardArray=commonRewardArrayNew;
|
||||
|
||||
|
||||
if(!pathInfo.isFirstPass()){
|
||||
commonRewardArray = Arrays.copyOf(commonRewardArray,commonRewardArray.length+1);
|
||||
commonRewardArray[commonRewardArray.length-1] = travelConfig.getFirstReward();
|
||||
|
|
|
@ -457,6 +457,7 @@ public class GlobalDataManaager implements IManager {
|
|||
}
|
||||
}
|
||||
fBuilder.setExpeditionLeve(user.getExpeditionManager().getExpeditionLeve());
|
||||
HeroLogic.getInstance().ResetLikableSendTime(user,fBuilder);//重置好感度次数
|
||||
if(session.getFiveReady() == 1){ //客户端准备好接受五点刷新请求
|
||||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.FIVE_PLAYER_REFLUSH_INDICATION_VALUE,fBuilder.build(),true);
|
||||
}else{
|
||||
|
|
|
@ -137,7 +137,8 @@ public class ActivityLogic implements IEventHandler{
|
|||
return;
|
||||
}
|
||||
// 网页支付在登陆之前充值的金额
|
||||
double value = (double) result;
|
||||
double value = Double.parseDouble((String) result);
|
||||
// double value = (double) result;
|
||||
// 玩家缓存更新
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.DAILY_RECHARGE,(int)(value*1000));
|
||||
// 删除key
|
||||
|
@ -1753,16 +1754,17 @@ public class ActivityLogic implements IEventHandler{
|
|||
List<int[]> list = new ArrayList<>();
|
||||
for (int i = 0; i < num; i++) {
|
||||
// 小圈抽奖,根据返回判断是否需要抽外圈
|
||||
boolean result = qiMenRandom(user, activityId,2, list, hits);
|
||||
boolean result = qiMenRandom(user,2, list, hits);
|
||||
if (result){
|
||||
// 大圈/外圈抽奖
|
||||
qiMenRandom(user, activityId, 1, list, hits);
|
||||
qiMenRandom(user, 1, list, hits);
|
||||
}
|
||||
}
|
||||
// 处理奖励
|
||||
int[][] rewards = Utils.changeList(list);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.dropPer(user, rewards, BIReason.QIMENDUNJIA_DRAW);
|
||||
|
||||
// 事件分发
|
||||
Poster.getPoster().dispatchEvent(new QiMenDunJiaEvent(user.getId(),activityId,num));
|
||||
response.setDrop(drop).addAllIdList(hits);
|
||||
return response.build();
|
||||
}
|
||||
|
@ -1794,7 +1796,7 @@ public class ActivityLogic implements IEventHandler{
|
|||
* @param hits 抽中的索引id
|
||||
* @return true:需要进行外圈抽奖 false:不需要外圈抽奖
|
||||
*/
|
||||
private boolean qiMenRandom(User user,int activityId, int type, List<int[]> list, List<Integer> hits){
|
||||
private boolean qiMenRandom(User user, int type, List<int[]> list, List<Integer> hits){
|
||||
boolean result = false;
|
||||
|
||||
// 根据类型获取卡池
|
||||
|
@ -1830,10 +1832,6 @@ public class ActivityLogic implements IEventHandler{
|
|||
|
||||
// 外圈抽奖用,抽中全部
|
||||
if (rewardPool.size() >= SLingLongPool.map.get(type).size()){
|
||||
if (type == 1){
|
||||
// 事件分发
|
||||
Poster.getPoster().dispatchEvent(new QiMenDunJiaEvent(user.getId(),activityId,1));
|
||||
}
|
||||
rewardPool.clear();
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,9 @@ import com.ljsd.jieling.logic.activity.event.Poster;
|
|||
import com.ljsd.jieling.logic.activity.event.RemoveHeroEvent;
|
||||
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 java.util.*;
|
||||
|
||||
|
@ -111,6 +113,30 @@ public class HeroManager extends MongoBase {
|
|||
return sixiangPropUpMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 好感度数据
|
||||
* key: 英雄静态id value:好感度值
|
||||
*/
|
||||
private Map<Integer,Integer> heroLikableMap = new HashMap<>();
|
||||
|
||||
public Map<Integer, Integer> getHeroLikableMap() {
|
||||
return heroLikableMap;
|
||||
}
|
||||
//神将好感度属性加成
|
||||
private Map<Integer,Map<Integer,Integer>>heroLikablePropAddMap=new HashMap<>();
|
||||
|
||||
public Map<Integer,Map<Integer,Integer>>getHeroLikablePropAddMap() {
|
||||
return heroLikablePropAddMap;
|
||||
}
|
||||
//所有神将总好感度带来的属性加成(包含特权加成)
|
||||
private Map<Integer,Integer>allLikablePropAddMap=new HashMap<>();
|
||||
public Map<Integer,Integer>getAllLikablePropAddMap() {
|
||||
return allLikablePropAddMap;
|
||||
}
|
||||
|
||||
private int likableSendTime;//好感度已赠送次数
|
||||
|
||||
public int getLikableSendTime() { return likableSendTime; }
|
||||
/**
|
||||
* 心愿可以选择的英雄列表
|
||||
*/
|
||||
|
@ -158,6 +184,27 @@ public class HeroManager extends MongoBase {
|
|||
updateString("sixiangPropUpMap."+professionId, _propMap);
|
||||
}
|
||||
|
||||
public void putHeroLikableMap(int heroStaticId,int likableNum) {
|
||||
heroLikableMap.put(heroStaticId,likableNum);
|
||||
updateString("heroLikableMap."+heroStaticId, likableNum);
|
||||
}
|
||||
|
||||
public void putHeroLikablePropAddMap(int heroStaticId,Map<Integer,Integer> _propMap) {
|
||||
heroLikablePropAddMap.put(heroStaticId,_propMap);
|
||||
updateString("heroLikablePropAddMap."+heroStaticId, _propMap);
|
||||
}
|
||||
|
||||
public void putAllLikablePropAddMap(Map<Integer,Integer> _propMap) {
|
||||
allLikablePropAddMap=_propMap;
|
||||
updateString("allLikablePropAddMap", allLikablePropAddMap);
|
||||
}
|
||||
|
||||
//刷新好感度赠送次数 参数传当日已赠送次数
|
||||
public void UpdateLikableSendTime(int _sendTime) {
|
||||
likableSendTime=_sendTime;
|
||||
updateString("likableSendTime", _sendTime);
|
||||
}
|
||||
|
||||
|
||||
public void updateRandCount(int type, int count){
|
||||
updateString("totalCount." + type, count);
|
||||
|
@ -493,6 +540,7 @@ public class HeroManager extends MongoBase {
|
|||
updateString("wishOpenHeroList", wishOpenHeroList);
|
||||
}
|
||||
|
||||
///获取四象心法共鸣等级
|
||||
public int GetSiXiangGongMingLv(){
|
||||
int gongmingLv=0;
|
||||
if (this.sixiangDataMap.size()<4){
|
||||
|
@ -506,5 +554,24 @@ public class HeroManager extends MongoBase {
|
|||
}
|
||||
return gongmingLv;
|
||||
}
|
||||
|
||||
///通过总好感度获取好感度等级
|
||||
public int GetAllLikableLv(){
|
||||
int likaLv=0;
|
||||
int likableNum=0;
|
||||
for (Map.Entry<Integer, Integer> integerEntry : heroLikableMap.entrySet()) {
|
||||
likableNum+=integerEntry.getValue();
|
||||
}
|
||||
for (Map.Entry<Integer, Integer> integerEntry : SLikeAbilityConfig.allLikeAbilityByLevel.entrySet()) {
|
||||
if (likableNum>=integerEntry.getValue()){
|
||||
likaLv= integerEntry.getKey()+1;
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
return likaLv;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,13 +3,52 @@ package com.ljsd.jieling.logic.dao;
|
|||
import com.ljsd.common.mogodb.MongoBase;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class ItemManager extends MongoBase {
|
||||
|
||||
|
||||
private Map<Integer, Item> itemMap = new ConcurrentHashMap<>();
|
||||
///兼容线上数据,计算统计装备(为了做白金装备图鉴,需要初始化统计一次用户身上所有装备)true:已经计算过了 false:未计算
|
||||
private boolean isAbsEquip;
|
||||
|
||||
public boolean getIsAbsEquip() {
|
||||
return isAbsEquip;
|
||||
}
|
||||
public void setAbsEquip(boolean absEquip) {
|
||||
isAbsEquip = absEquip;
|
||||
updateString("isAbsEquip", isAbsEquip);
|
||||
}
|
||||
|
||||
private Map<Integer, Long> equipBookMap = new HashMap<>();
|
||||
|
||||
public Map<Integer, Long> getEquipBookMap() {
|
||||
return equipBookMap;
|
||||
}
|
||||
public void setEquipBookMap(int equipId,long addNum) {
|
||||
long _num=addNum;
|
||||
if (this.equipBookMap.containsKey(equipId)){
|
||||
_num+=this.equipBookMap.get(equipId);
|
||||
}
|
||||
this.equipBookMap.put(equipId,_num);
|
||||
updateString("equipBookMap." + equipId, _num);
|
||||
}
|
||||
private Set<Integer> equipBookEnabled = new HashSet<>();
|
||||
|
||||
public Set<Integer> getEquipBookEnabled() {
|
||||
return equipBookEnabled;
|
||||
}
|
||||
|
||||
public void addEquipBookEnabled(int bookId) {
|
||||
this.equipBookEnabled.add(bookId);
|
||||
updateString("equipBookEnabled", equipBookEnabled);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public ItemManager() {
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
|
|
|
@ -204,10 +204,11 @@ public class HeroLogic{
|
|||
//宝器
|
||||
if(type==4){
|
||||
Map<String, PropertyItem> equipMap = user.getEquipManager().getEquipMap();
|
||||
Set<String> needRemove = new HashSet<>(equipMap.size());
|
||||
for(Map.Entry<String, PropertyItem> equipInfoEntry : equipMap.entrySet()){
|
||||
PropertyItem value = equipInfoEntry.getValue();
|
||||
if (value == null) {
|
||||
equipManager.remove(equipInfoEntry.getKey());
|
||||
needRemove.add(equipInfoEntry.getKey());
|
||||
LOGGER.info("getAllEquipInfo uid={} remove null jewel{}", uid, equipInfoEntry.getKey());
|
||||
continue;
|
||||
}
|
||||
|
@ -215,6 +216,11 @@ public class HeroLogic{
|
|||
equipList.add(CBean2Proto.getEquipProto(value));
|
||||
}
|
||||
}
|
||||
if (!needRemove.isEmpty()) {
|
||||
for (String id : needRemove) {
|
||||
equipManager.remove(id);
|
||||
}
|
||||
}
|
||||
}else {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
|
@ -360,7 +366,8 @@ public class HeroLogic{
|
|||
}
|
||||
|
||||
//特殊活动寻宝迷踪
|
||||
if(sLotterySetting.getActivityId() == 8201){
|
||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(sLotterySetting.getActivityId());
|
||||
if(sGlobalActivity!= null &&sGlobalActivity.getType() == 82 ){
|
||||
Poster.getPoster().dispatchEvent(new XunBaoMiZongEvent(user,0));
|
||||
}
|
||||
|
||||
|
@ -1199,6 +1206,10 @@ public class HeroLogic{
|
|||
RedisUtil.getInstence().zsetAddOne(key, String.valueOf(user.getId()), teamForce);
|
||||
|
||||
}
|
||||
if (teamId == GlobalsDef.FORMATION_NORMAL) {
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(iSession.getUid()));
|
||||
}
|
||||
|
||||
// 跨服 更新编队信息
|
||||
if (teamId == GlobalsDef.WORLD_TEAM_ARENA_DEFENSE) {
|
||||
CrossServiceLogic.getInstance().dispose(user);
|
||||
|
@ -2295,6 +2306,9 @@ public class HeroLogic{
|
|||
//魂印图鉴加成
|
||||
Set<Integer> equipBookEnabled = equipManager.getEquipBookEnabled();
|
||||
bonuses(equipBookEnabled,heroAllAttribute);
|
||||
//白金装备加成
|
||||
Set<Integer> whiteBookEnabled = user.getItemManager().getEquipBookEnabled();
|
||||
bonuses(whiteBookEnabled,heroAllAttribute);
|
||||
//英雄皮肤加成 记得判断皮肤过期
|
||||
int skin = hero.getSkin();
|
||||
if(skin!=0){
|
||||
|
@ -2361,6 +2375,17 @@ public class HeroLogic{
|
|||
int[][]skillProp=ItemUtil.mapToArray(skillPropertyMap);
|
||||
combinedAttribute(skillProp,heroAllAttribute);
|
||||
|
||||
//英雄好感度属性加成
|
||||
if (user.getHeroManager().getHeroLikablePropAddMap().containsKey(scHero.getId())){
|
||||
int[][]likableProp=ItemUtil.mapToArray(user.getHeroManager().getHeroLikablePropAddMap().get(scHero.getId()));
|
||||
combinedAttribute(likableProp,heroAllAttribute);
|
||||
}
|
||||
//英雄总好感度属性加成
|
||||
if (user.getHeroManager().getAllLikablePropAddMap().size()>0){
|
||||
int[][]allLikableProp=ItemUtil.mapToArray(user.getHeroManager().getAllLikablePropAddMap());
|
||||
combinedAttribute(allLikableProp,heroAllAttribute);
|
||||
}
|
||||
|
||||
//装备总战力评分
|
||||
int equipForce=0;
|
||||
Iterator<Map.Entry<Integer, Integer>> iterator = hero.getEquipByHongmengPositionMap(user.getHeroManager()).entrySet().iterator();
|
||||
|
@ -3855,9 +3880,33 @@ public class HeroLogic{
|
|||
for (int enabled:user.getEquipManager().getEquipBookEnabled()){
|
||||
builder.addAllBookEnabled(enabled);
|
||||
}
|
||||
//添加白金装备羁绊
|
||||
for (Integer enabled : user.getItemManager().getEquipBookEnabled()) {
|
||||
builder.addAllBookEnabled(enabled);
|
||||
}
|
||||
|
||||
for (Integer equip:equipManager.getEquipList()) {
|
||||
builder.addEquipGot(equip);
|
||||
|
||||
}
|
||||
if (!user.getItemManager().getIsAbsEquip()) {
|
||||
for (Map.Entry<Integer, Item> equipEntry : user.getItemManager().getItemMap().entrySet()) {
|
||||
if (SItem.getsItemMap().get(equipEntry.getKey()).getItemType()==3) {
|
||||
user.getItemManager().setEquipBookMap(equipEntry.getValue().getItemId(),equipEntry.getValue().getItemNum());
|
||||
}
|
||||
}
|
||||
for (Map.Entry<String, Hero> stringHeroEntry : user.getHeroManager().getHeroMap().entrySet()) {
|
||||
for (Map.Entry<Integer, Integer> entry : stringHeroEntry.getValue().getEquipByPositionMap().entrySet()) {
|
||||
user.getItemManager().setEquipBookMap(entry.getValue(),1);
|
||||
}
|
||||
}
|
||||
user.getItemManager().setAbsEquip(true);
|
||||
}
|
||||
for (Map.Entry<Integer, Long> entry : user.getItemManager().getEquipBookMap().entrySet()) {
|
||||
CommonProto.EquipBookInfo equipBook=CommonProto.EquipBookInfo.newBuilder()
|
||||
.setEquipId(entry.getKey())
|
||||
.setNum(entry.getValue().intValue())
|
||||
.build();
|
||||
builder.addEquipList(equipBook);
|
||||
}
|
||||
MessageUtil.sendMessage(session,1,MessageTypeProto.MessageType.GET_ALL_PROPERTY_INFO_RESPONSE_VALUE,builder.build(),true);
|
||||
}
|
||||
|
@ -3878,7 +3927,7 @@ public class HeroLogic{
|
|||
if(user.getPlayerInfoManager().getLevel()<bookConfig.getOpenLevel()){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
int[] teamers = bookConfig.getTeamers();
|
||||
int[][] teamers = bookConfig.getTeamers();
|
||||
int[][] reward = bookConfig.getReward();
|
||||
CommonProto.Drop.Builder drop = null;
|
||||
//神将激活
|
||||
|
@ -3896,9 +3945,8 @@ public class HeroLogic{
|
|||
}
|
||||
}
|
||||
//判断羁绊神将是否在集合
|
||||
for(int tmp:teamers){
|
||||
if(!hero.contains(tmp)){
|
||||
System.out.println(tmp);
|
||||
for(int[]tmp:teamers){
|
||||
if(!hero.contains(tmp[0])){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
|
@ -3913,8 +3961,8 @@ public class HeroLogic{
|
|||
if(equipManager.getEquipBookEnabled().contains(bookId)){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
for (int equip:teamers){
|
||||
if (!equipManager.getEquipList().contains(equip)){
|
||||
for (int[]equip:teamers){
|
||||
if (!equipManager.getEquipList().contains(equip[0])){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
|
@ -3928,14 +3976,29 @@ public class HeroLogic{
|
|||
if(pokemonManager.getPokemonBookEnabled().contains(bookId)){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
for(int pokemon:teamers){
|
||||
if(!pokemonManager.getPokemonGot().contains(pokemon)){
|
||||
for(int[]pokemon:teamers){
|
||||
if(!pokemonManager.getPokemonGot().contains(pokemon[0])){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
pokemonManager.addPokemonBookEnabled(bookId);
|
||||
drop = ItemUtil.drop(user,reward , BIReason.ACTIVATION_HERO_FETTER);
|
||||
}
|
||||
|
||||
//白金装备激活
|
||||
if(bookConfig.getFetterType()==4){
|
||||
ItemManager itemManager = user.getItemManager();
|
||||
if(itemManager.getEquipBookEnabled().contains(bookId)){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
for(int[]pokemon:teamers){
|
||||
if(!itemManager.getEquipBookMap().containsKey(pokemon[0])||itemManager.getEquipBookMap().get(pokemon[0])<pokemon[1]){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
}
|
||||
itemManager.addEquipBookEnabled(bookId);
|
||||
drop = ItemUtil.drop(user,reward , BIReason.ACTIVATION_HERO_FETTER);
|
||||
}
|
||||
PlayerInfoProto.UseAndPriceItemResponse.Builder useAndPriceItemResponse = PlayerInfoProto.UseAndPriceItemResponse.newBuilder();
|
||||
if (drop != null) {
|
||||
useAndPriceItemResponse.setDrop(drop);
|
||||
|
@ -5264,5 +5327,11 @@ public class HeroLogic{
|
|||
MessageUtil.sendIndicationMessage(session,1, MessageTypeProto.MessageType.PurpleMansionSealIndication_VALUE,build2,true);
|
||||
|
||||
}
|
||||
///0点重置好感度赠送次数
|
||||
public void ResetLikableSendTime(User user,PlayerInfoProto.FivePlayerUpdateIndication.Builder fBuilder){
|
||||
user.getHeroManager().UpdateLikableSendTime(0);
|
||||
int remainTime=SSpecialConfig.getIntegerValue(SSpecialConfig.LIKE_ABILITY)-user.getHeroManager().getLikableSendTime();
|
||||
fBuilder.setLikableRemainTime(remainTime);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -932,7 +932,9 @@ public class ItemLogic {
|
|||
LOGGER.error("misson为空,activityId:{}",activityId);
|
||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
|
||||
}
|
||||
ActivityProgressInfo progress = misson.getActivityMissionMap().get(type);
|
||||
Map<Integer, SComposeActivity> integerSComposeActivityMap = SComposeActivity.getConfigMap().get(activityId);
|
||||
int typeId = integerSComposeActivityMap.get(type).getId();
|
||||
ActivityProgressInfo progress = misson.getActivityMissionMap().get(typeId);
|
||||
if(progress == null){
|
||||
LOGGER.error("progress为空,type:{}",type);
|
||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
|
||||
|
|
|
@ -1224,6 +1224,9 @@ public class PlayerLogic {
|
|||
case GlobalsDef.VIP_UNLOCK_PRIVILEGE:
|
||||
cond = user.getPlayerInfoManager().getVipLevel();
|
||||
break;
|
||||
case GlobalsDef.LIKABLE_UNLOCK:
|
||||
cond = user.getHeroManager().GetAllLikableLv();
|
||||
break;
|
||||
default:{
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -10,12 +10,15 @@ import com.ljsd.jieling.logic.dao.root.GuildCache;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.family.CrossDeathPathLogic;
|
||||
import com.ljsd.jieling.logic.rank.IRank;
|
||||
import config.SGuildCheckpointConfig;
|
||||
import manager.STableManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
|
@ -369,9 +372,18 @@ public abstract class AbstractRank implements IRank {
|
|||
RedisUtil.getInstence().zsetRemoveOne(RedisKey.getKey(redisKey,rkey,false),value);
|
||||
}
|
||||
public void removeAllRank(String rkey){
|
||||
Map<Integer, SGuildCheckpointConfig> configMap = STableManager.getConfig(SGuildCheckpointConfig.class);
|
||||
if (configMap == null || configMap.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
Set<String> dimKey = RedisUtil.getInstence().getDimKey(RedisKey.getKey(redisKey, rkey, false) + "*", 200);
|
||||
dimKey.forEach(item->RedisUtil.getInstence().del(item));
|
||||
// Set<String> dimKey = RedisUtil.getInstence().getDimKey(RedisKey.getKey(redisKey, rkey, false) + "*", 200);
|
||||
String[] dimKey = new String[configMap.size()];
|
||||
int index = 0;
|
||||
for (Integer integer : configMap.keySet()) {
|
||||
dimKey[index] = RedisKey.getKey(redisKey, rkey, false) + integer;
|
||||
}
|
||||
RedisUtil.getInstence().del(dimKey);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -351,9 +351,12 @@ public class BuyGoodsNewLogic {
|
|||
String subKey = RedisUtil.getInstence().getKey(String.valueOf(user.getId()), String.valueOf(ActivityType.DAILY_RECHARGE),false);
|
||||
String key = RedisUtil.getInstence().getKey(RedisKey.WEB_PAY, subKey);
|
||||
// 计算金额
|
||||
double num = Optional.ofNullable(RedisUtil.getInstence().get(key))
|
||||
.map(v-> (double)v + price)
|
||||
.orElse(price);
|
||||
Object o = RedisUtil.getInstence().get(key);
|
||||
double num = price;
|
||||
if (o != null) {
|
||||
num = Double.parseDouble((String) o) + price;
|
||||
}
|
||||
|
||||
// 明天零点(实际是今天的23:59:30)
|
||||
long tomorrowZero = TimeUtils.getTomorrowZero2();
|
||||
// 赋值
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.ljsd.jieling.logic.store;
|
||||
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
||||
import com.ljsd.jieling.db.mongo.MongoUtil;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
|
@ -479,8 +481,8 @@ public class StoreLogic implements IEventHandler {
|
|||
for(int[] extra : extraAdd){
|
||||
int type = extra[0];
|
||||
if(type == 1){
|
||||
SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.sPlayerLevelConfigMap.get(user.getPlayerInfoManager().getLevel());
|
||||
add += sPlayerLevelConfig.getExtraAdd();
|
||||
// SPlayerLevelConfig sPlayerLevelConfig = SPlayerLevelConfig.sPlayerLevelConfigMap.get(user.getPlayerInfoManager().getLevel());
|
||||
// add += sPlayerLevelConfig.getExtraAdd();
|
||||
}else if(type == 2){
|
||||
int addPrivageId = extra[1];
|
||||
// PlayerLogic.getInstance().getMaxCountByPrivilegeType(user,addPrivageId);
|
||||
|
@ -492,7 +494,24 @@ public class StoreLogic implements IEventHandler {
|
|||
for(int i=0;i<length;i++){
|
||||
dropItems[i] = new int[2];
|
||||
dropItems[i][0]= goods[i][0];
|
||||
dropItems[i][1]= (int)(goods[i][1]*itemNum *(add/10000F) );
|
||||
int levelAdd = 0;
|
||||
if(storeId==Global.GODSTORID){
|
||||
if (sStoreConfig.getSort() == 1) {
|
||||
levelAdd = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(user.getPlayerInfoManager().getLevel()).getGoldExtraNum1();
|
||||
} else if (sStoreConfig.getSort() == 2) {
|
||||
levelAdd = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(user.getPlayerInfoManager().getLevel()).getGoldExtraNum2();
|
||||
} else {
|
||||
levelAdd = SPlayerLevelConfig.getsPlayerLevelConfigMap().get(user.getPlayerInfoManager().getLevel()).getGoldExtraNum3();
|
||||
}
|
||||
}
|
||||
// if (levelAdd > 0) {
|
||||
// Map<Integer, Integer> map = SPrivilegeTypeConfig.conditionMap.get(GlobalsDef.VIP_UNLOCK_PRIVILEGE).get(VipPrivilegeType.SHOP_DIAN_JING);
|
||||
// Integer orDefault = map.getOrDefault(user.getPlayerInfoManager().getVipLevel(), 0);
|
||||
// if (orDefault != null && orDefault != 0) {
|
||||
// add += orDefault;
|
||||
// }
|
||||
// }
|
||||
dropItems[i][1] = ((goods[i][1] + levelAdd) * itemNum * (add / 1000)) / 10;
|
||||
}
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, dropItems, BIReason.STORE_BUY_ITEM);
|
||||
if(!storeGiftType.contains(SStoreTypeConfig.getsStoreTypeConfigMap().get(storeId).getStoreType() )){
|
||||
|
|
|
@ -8,6 +8,7 @@ public class DataReportTask extends Thread {
|
|||
|
||||
public DataReportTask(){
|
||||
setName("DataReportTask");
|
||||
setPriority(2);//优先级设置低点
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -15,9 +16,15 @@ public class DataReportTask extends Thread {
|
|||
// return;
|
||||
// }
|
||||
try {
|
||||
int i = 0;
|
||||
while(true){
|
||||
ReportUserEvent event = ReportUtil.queue.take();
|
||||
ReportUtil.doReport(event);
|
||||
i++;
|
||||
if (i >= 1000) {
|
||||
i = 0;
|
||||
Thread.sleep(100);
|
||||
}
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
|
|
|
@ -33,6 +33,7 @@ import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
|||
import com.ljsd.jieling.logic.store.newRechargeInfo.PushRechargeType;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.HeroInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
import config.SGameSetting;
|
||||
|
@ -531,6 +532,7 @@ public class ItemUtil {
|
|||
case GlobalItemType.SOUL_MARK:
|
||||
case GlobalItemType.ITEM:
|
||||
case GlobalItemType.EQUIP:
|
||||
case GlobalItemType.LikableCostItem:
|
||||
putCountLongMap(itemId,amount, itemObj.getItemMap());
|
||||
break;
|
||||
case GlobalItemType.CARD:
|
||||
|
@ -597,12 +599,19 @@ public class ItemUtil {
|
|||
List<CommonProto.Item> sendToFront = new CopyOnWriteArrayList<>();
|
||||
//超过上限不能直接获得
|
||||
Map<Integer,Integer> extraItem = new HashMap<>(itemMap.size());
|
||||
|
||||
List<Integer>changeEquipList=null;
|
||||
for (Map.Entry<Integer, Long> entry : itemMap.entrySet()) {
|
||||
SItem sItem = SItem.getsItemMap().get (entry.getKey());
|
||||
if (sItem.getItemBaseType()==6){
|
||||
equipManager.addEquipList(entry.getKey());
|
||||
}
|
||||
if (sItem.getItemType()==3){
|
||||
if (changeEquipList==null) {
|
||||
changeEquipList=new ArrayList<>();
|
||||
}
|
||||
itemManager.setEquipBookMap(entry.getKey(),entry.getValue());
|
||||
changeEquipList.add(entry.getKey());
|
||||
}
|
||||
long itemNumlimit = sItem.getItemNumlimit();
|
||||
long itemNum = entry.getValue().intValue();
|
||||
if(itemNum <= 0){
|
||||
|
@ -679,6 +688,9 @@ public class ItemUtil {
|
|||
//日志记录
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user.getId(),0,user.getPlayerInfoManager().getLevel(),String.valueOf(TimeUtils.now()),reason,sItem.getId(),itemNum,item.getItemNum()));
|
||||
}
|
||||
//发送装备图鉴修改推送
|
||||
SendEquipBookIndication(user.getId(),itemManager,changeEquipList);
|
||||
|
||||
for(Map.Entry<Integer,Integer> entry:extraItem.entrySet()){
|
||||
itemProtoList.add(CBean2Proto.getItem(itemManager.getItemMap().get(entry.getKey()),entry.getValue()));
|
||||
}
|
||||
|
@ -719,12 +731,19 @@ public class ItemUtil {
|
|||
List<CommonProto.Item> sendToFront = new CopyOnWriteArrayList<>();
|
||||
//超过上限不能直接获得
|
||||
Map<Integer,Integer> extraItem = new HashMap<>(itemMap.size());
|
||||
|
||||
List<Integer>changeEquipList=null;
|
||||
for (Map.Entry<Integer, Long> entry : itemMap.entrySet()) {
|
||||
SItem sItem = SItem.getsItemMap().get (entry.getKey());
|
||||
if (sItem.getItemBaseType()==6){
|
||||
equipManager.addEquipList(entry.getKey());
|
||||
}
|
||||
if (sItem.getItemType()==3){
|
||||
if (changeEquipList==null) {
|
||||
changeEquipList=new ArrayList<>();
|
||||
}
|
||||
itemManager.setEquipBookMap(entry.getKey(),entry.getValue());
|
||||
changeEquipList.add(entry.getKey());
|
||||
}
|
||||
|
||||
long itemNumlimit = sItem.getItemNumlimit();
|
||||
long itemNum = entry.getValue().intValue();
|
||||
|
@ -802,6 +821,10 @@ public class ItemUtil {
|
|||
//日志记录
|
||||
ItemLogic.getInstance().addItemLog(new ItemLog(user.getId(),0,user.getPlayerInfoManager().getLevel(),String.valueOf(TimeUtils.now()),reason,sItem.getId(),itemNum,item.getItemNum()));
|
||||
}
|
||||
|
||||
//发送装备图鉴修改推送
|
||||
SendEquipBookIndication(user.getId(),itemManager,changeEquipList);
|
||||
|
||||
for(Map.Entry<Integer,Integer> entry:extraItem.entrySet()){
|
||||
itemProtoList.add(CBean2Proto.getItem(itemManager.getItemMap().get(entry.getKey()),entry.getValue()));
|
||||
}
|
||||
|
@ -825,8 +848,25 @@ public class ItemUtil {
|
|||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
///发送装备图鉴修改推送
|
||||
private static void SendEquipBookIndication(int _uid,ItemManager _itemManage, List<Integer>_equipList){
|
||||
if (_equipList==null||_equipList.isEmpty())return;
|
||||
List<CommonProto.EquipBookInfo>equipList=new ArrayList<>();
|
||||
for (Integer integer : _equipList) {
|
||||
if (_itemManage.getEquipBookMap().containsKey(integer)) {
|
||||
CommonProto.EquipBookInfo equipInfo=CommonProto.EquipBookInfo.newBuilder()
|
||||
.setEquipId(integer)
|
||||
.setNum(_itemManage.getEquipBookMap().get(integer).intValue())
|
||||
.build();
|
||||
equipList.add(equipInfo);
|
||||
}
|
||||
}
|
||||
HeroInfoProto.EquipBookIndication build=HeroInfoProto.EquipBookIndication.newBuilder()
|
||||
.addAllChangeEquipList(equipList)
|
||||
.build();
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(_uid);
|
||||
MessageUtil.sendIndicationMessage(sessionByUid,1, MessageTypeProto.MessageType.EQUIP_BOOK_INDICATION_VALUE,build,true);
|
||||
}
|
||||
|
||||
/**
|
||||
* 玩家升级 //zsx 保留 TODO 由事件分发到 playlogic 去处理
|
||||
|
@ -860,7 +900,7 @@ public class ItemUtil {
|
|||
if (sPlayerLevelConfig == null) {
|
||||
throw new ErrorCodeException("服务器表配置错误");
|
||||
}
|
||||
|
||||
List<int[][]> levelUpRewards = new ArrayList<>();
|
||||
int levelUpExp = sPlayerLevelConfig.getExp();
|
||||
// 循环,直到经验不足继续升级或者等级最高
|
||||
while (exp >= levelUpExp && playerInfoManager.getLevel() < maxLevel.getPlayerLv()) {
|
||||
|
@ -891,8 +931,16 @@ public class ItemUtil {
|
|||
levelUpExp = sPlayerLevelConfig.getExp();
|
||||
// 玩家升级报送
|
||||
Repot37EventUtil.onKtEvent(user, Repot37EventUtil.Report37EventType.ROLE_LEVEUP_EVENT);
|
||||
// 升级赠送道具
|
||||
int[][] levelUpReward = sPlayerLevelConfig.getLevelUpReward();
|
||||
if (levelUpReward != null && levelUpReward.length > 0) {
|
||||
levelUpRewards.add(levelUpReward);
|
||||
}
|
||||
}
|
||||
CommonProto.Drop.Builder drop = null;
|
||||
if (!levelUpRewards.isEmpty()) {
|
||||
drop = ItemUtil.drop(user, levelUpRewards, BIReason.LEVEL_UP_REWARD);
|
||||
}
|
||||
|
||||
// 更新经验
|
||||
playerInfoManager.setExp((int) exp);
|
||||
|
||||
|
@ -904,9 +952,14 @@ public class ItemUtil {
|
|||
|
||||
// 在线玩家消息推送
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId());
|
||||
if(sessionByUid!=null){
|
||||
PlayerInfoProto.UpdateUserExpIndicaiton build = PlayerInfoProto.UpdateUserExpIndicaiton.newBuilder().setExp((int)playerInfoManager.getExp()).setLevel(playerInfoManager.getLevel()).build();
|
||||
MessageUtil.sendIndicationMessage(sessionByUid,1, MessageTypeProto.MessageType.UPDATE_USER_EXP_INDICATION_VALUE,build,true);
|
||||
if (sessionByUid != null) {
|
||||
PlayerInfoProto.UpdateUserExpIndicaiton.Builder build = PlayerInfoProto.UpdateUserExpIndicaiton.newBuilder();
|
||||
build.setExp((int) playerInfoManager.getExp());
|
||||
build.setLevel(playerInfoManager.getLevel());
|
||||
if (drop != null) {
|
||||
build.setDrop(drop);
|
||||
}
|
||||
MessageUtil.sendIndicationMessage(sessionByUid, 1, MessageTypeProto.MessageType.UPDATE_USER_EXP_INDICATION_VALUE, build.build(), true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1421,6 +1474,7 @@ public class ItemUtil {
|
|||
case GlobalItemType.ITEM:
|
||||
case GlobalItemType.SOUL_MARK:
|
||||
case GlobalItemType.EQUIP:
|
||||
case GlobalItemType.LikableCostItem:
|
||||
putCountMap(itemId,itemNum,itemMap);
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -21,7 +21,7 @@ public class SFreeTravel implements BaseConfig {
|
|||
|
||||
private int[] commonReward;
|
||||
|
||||
private int finalReward;
|
||||
private int[] finalReward;
|
||||
|
||||
private int[][] treasureChest;
|
||||
|
||||
|
@ -76,7 +76,7 @@ public class SFreeTravel implements BaseConfig {
|
|||
return commonReward;
|
||||
}
|
||||
|
||||
public int getFinalReward() {
|
||||
public int[] getFinalReward() {
|
||||
return finalReward;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,81 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
@Table(name ="LikeAbility")
|
||||
public class SLikeAbilityConfig implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int type;
|
||||
|
||||
private int level;
|
||||
|
||||
private int favorDegree;
|
||||
|
||||
private int[][] property;
|
||||
|
||||
private int[][] privilegeProperty;
|
||||
|
||||
|
||||
public static Map<Integer, SLikeAbilityConfig> sLikeAbilityConfigMap;
|
||||
|
||||
public static Map<Integer, SLikeAbilityConfig> heroLikeAbilityConfigMap;
|
||||
public static Map<Integer, Integer> heroLikeAbilityByLevel;
|
||||
|
||||
public static Map<Integer, SLikeAbilityConfig> allLikeAbilityConfigMap;
|
||||
public static Map<Integer, Integer> allLikeAbilityByLevel;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
heroLikeAbilityConfigMap=new HashMap<>();
|
||||
allLikeAbilityConfigMap=new HashMap<>();
|
||||
heroLikeAbilityByLevel=new TreeMap<>();
|
||||
allLikeAbilityByLevel=new TreeMap<>();
|
||||
sLikeAbilityConfigMap = STableManager.getConfig(SLikeAbilityConfig.class);
|
||||
int heroLike=0;
|
||||
int allLike=0;
|
||||
for (SLikeAbilityConfig value : sLikeAbilityConfigMap.values()) {
|
||||
if (value.type==1){
|
||||
allLikeAbilityConfigMap.put(value.level,value);
|
||||
allLike+=value.getFavorDegree();
|
||||
allLikeAbilityByLevel.put(value.level,allLike);
|
||||
}else {
|
||||
heroLikeAbilityConfigMap.put(value.level,value);
|
||||
heroLike+=value.getFavorDegree();
|
||||
heroLikeAbilityByLevel.put(value.level,heroLike);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public int getFavorDegree() {
|
||||
return favorDegree;
|
||||
}
|
||||
|
||||
public int[][] getProperty() {
|
||||
return property;
|
||||
}
|
||||
|
||||
public int[][] getPrivilegeProperty() {
|
||||
return privilegeProperty;
|
||||
}
|
||||
}
|
||||
|
|
@ -21,6 +21,14 @@ public class SPlayerLevelConfig implements BaseConfig {
|
|||
|
||||
private int mazeTreasureMax;
|
||||
|
||||
private int goldExtraNum1;
|
||||
|
||||
private int goldExtraNum2;
|
||||
|
||||
private int goldExtraNum3;
|
||||
|
||||
private int[][] levelUpReward;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
@ -52,6 +60,22 @@ public class SPlayerLevelConfig implements BaseConfig {
|
|||
return mazeTreasureMax;
|
||||
}
|
||||
|
||||
public int getGoldExtraNum1() {
|
||||
return goldExtraNum1;
|
||||
}
|
||||
|
||||
public int getGoldExtraNum2() {
|
||||
return goldExtraNum2;
|
||||
}
|
||||
|
||||
public int getGoldExtraNum3() {
|
||||
return goldExtraNum3;
|
||||
}
|
||||
|
||||
public int[][] getLevelUpReward() {
|
||||
return levelUpReward;
|
||||
}
|
||||
|
||||
public static Map<Integer, SPlayerLevelConfig> getsPlayerLevelConfigMap() {
|
||||
return sPlayerLevelConfigMap;
|
||||
}
|
||||
|
|
|
@ -114,6 +114,7 @@ public class SSpecialConfig implements BaseConfig {
|
|||
public static final String PRE_LOAD_REWARD = "PreLoadReward";
|
||||
|
||||
public static final String QIJIEHOLYCONFIG = "QIJIEHOLYCONFIG";//七界试炼遗物开启层数
|
||||
public static final String LIKE_ABILITY = "LikeAbility";//好感度功能,每日赠予礼物次数上限
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
|
|
@ -10,7 +10,7 @@ public class SSpiritAnimalBook implements BaseConfig {
|
|||
|
||||
private int id;
|
||||
|
||||
private int[] teamers;
|
||||
private int[][] teamers;
|
||||
|
||||
private int[][] activePara;
|
||||
|
||||
|
@ -33,7 +33,7 @@ public class SSpiritAnimalBook implements BaseConfig {
|
|||
return id;
|
||||
}
|
||||
|
||||
public int[] getTeamers() {
|
||||
public int[][] getTeamers() {
|
||||
return teamers;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue