Merge branch 'master_test_gn' into master_test_gn_xxp
commit
5031f7d9e8
|
@ -203,6 +203,12 @@ public class CoreService implements RPCRequestIFace.Iface {
|
|||
rpcArenaManager.setPracticeSkillMap(user.getHeroManager().getPracticeSkillMap());
|
||||
rpcArenaManager.setFaBaoGongMingSkillMap(user.getHeroManager().getFaBaoGongMingSkillMap());
|
||||
rpcArenaManager.setMaxHistoryForce(user.getPlayerInfoManager().getMaxForce());
|
||||
// 身外化身数据
|
||||
List<Integer> list = user.getHeroManager().getTransformationList().values().stream()
|
||||
.filter(v -> v.getStatus() == 1)
|
||||
.mapToInt(TransformationInfo::getCardId)
|
||||
.boxed().collect(Collectors.toList());
|
||||
rpcArenaManager.setTfInfoList(list);
|
||||
LOGGER.info("跨服,获取玩家英雄信息耗时:{}ms",TimeUtils.now()-start);
|
||||
return rpcArenaManager;
|
||||
}catch (Exception e){
|
||||
|
|
|
@ -3335,6 +3335,8 @@ public class MapLogic {
|
|||
STrialConfig sTrialConfig = sTrialConfigMap.ceilingEntry(floor).getValue();
|
||||
response = getBoxReward(sTrialConfig.getBoxPosition(), sTrialConfig.getBoxReward(), user, curXY, type);
|
||||
}
|
||||
//森罗幻境自动挂机奖励展示
|
||||
PlayerLogic.TowerGetRewardInfoShow(response.getBoxDrop(),user);
|
||||
if (response == null) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
|
@ -3461,6 +3463,8 @@ public class MapLogic {
|
|||
if (response == null) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
//森罗幻境自动挂机奖励展示
|
||||
PlayerLogic.TowerGetRewardInfoShow(response.getDrop(),user);
|
||||
MessageUtil.sendMessage(session, 1, messageType.getNumber(), response, true);
|
||||
}
|
||||
|
||||
|
|
|
@ -128,6 +128,8 @@ public class MapManager extends MongoBase {
|
|||
|
||||
private EndlessTreasureReward endlessTreasureReward = new EndlessTreasureReward();
|
||||
|
||||
//森罗幻境自动挂机奖励展示 TODO 不入库
|
||||
private Map<Integer,Integer> towerGetRewardInfoShowMap = new HashMap<>();
|
||||
public MapManager() {
|
||||
this.setRootCollection(User._COLLECTION_NAME);
|
||||
}
|
||||
|
@ -970,6 +972,13 @@ public class MapManager extends MongoBase {
|
|||
setTreasureIsBuy(0);
|
||||
}
|
||||
|
||||
public Map<Integer, Integer> getTowerGetRewardInfoShowMap() {
|
||||
return towerGetRewardInfoShowMap;
|
||||
}
|
||||
|
||||
public void setTowerGetRewardInfoShowMap(Map<Integer, Integer> towerGetRewardInfoShowMap) {
|
||||
this.towerGetRewardInfoShowMap = towerGetRewardInfoShowMap;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3,13 +3,17 @@ package com.ljsd.jieling.handler.map.mapHandler;
|
|||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.MapLogic;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.FightInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class MapFastFightRequestHandler extends BaseHandler {
|
||||
@Override
|
||||
|
@ -21,6 +25,8 @@ public class MapFastFightRequestHandler extends BaseHandler {
|
|||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
FightInfoProto.FastFightResponse.Builder builder = FightInfoProto.FastFightResponse.newBuilder();
|
||||
MapLogic.getInstance().getMap(UserManager.getUser(iSession.getUid())).fastFight(iSession.getUid(), builder);
|
||||
//森罗幻境自动挂机奖励展示
|
||||
PlayerLogic.TowerGetRewardInfoShow(builder.getEnventDrop(),UserManager.getUser(iSession.getUid()));
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.MAP_FAST_FIGHT_RESPONSE.getNumber(), builder.build(), true);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
package com.ljsd.jieling.handler.map.mapHandler;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import org.springframework.stereotype.Component;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MapInfoProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Component
|
||||
public class TowerGetRewardInfoShowHandler extends BaseHandler<MapInfoProto.TowerGetRewardInfoShowRequest> {
|
||||
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.TowerGetRewardInfoShowRequest;
|
||||
}
|
||||
@Override
|
||||
public GeneratedMessage processWithProto(int uid, MapInfoProto.TowerGetRewardInfoShowRequest proto) throws Exception {
|
||||
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder();
|
||||
User user = UserManager.getUser(uid);
|
||||
if(user == null){
|
||||
return MapInfoProto.TowerGetRewardInfoShowResponse.newBuilder().build();
|
||||
}
|
||||
Map<Integer,Integer> dropShow = user.getMapManager().getTowerGetRewardInfoShowMap();
|
||||
if(dropShow == null || dropShow.size() == 0){
|
||||
return MapInfoProto.TowerGetRewardInfoShowResponse.newBuilder().build();
|
||||
}
|
||||
for(Map.Entry<Integer,Integer> keyVal : dropShow.entrySet()){
|
||||
CommonProto.Item.Builder item = CommonProto.Item.newBuilder();
|
||||
item.setItemId(keyVal.getKey());
|
||||
item.setItemNum((long)keyVal.getValue());
|
||||
drop.addItemlist(item.build());
|
||||
}
|
||||
dropShow.clear();
|
||||
return MapInfoProto.TowerGetRewardInfoShowResponse.newBuilder().setDrop(drop).build();
|
||||
}
|
||||
}
|
|
@ -22,6 +22,7 @@ import com.ljsd.jieling.logic.fight.GameFightType;
|
|||
import com.ljsd.jieling.logic.fight.PVEFightEvent;
|
||||
import com.ljsd.jieling.logic.fight.result.FightResult;
|
||||
import com.ljsd.jieling.logic.hero.HeroAttributeEnum;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.store.StoreLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.CommonProto;
|
||||
|
@ -670,6 +671,8 @@ public class TowerMap extends AbstractMap {
|
|||
response.setEssenceValue(-1);
|
||||
response.setCell(CBean2Proto.getCell(cell));
|
||||
response.setDrop(drop);
|
||||
//森罗幻境自动挂机奖励展示
|
||||
PlayerLogic.TowerGetRewardInfoShow(response.getDrop(),user);
|
||||
response.setMonsterNum(monsterAmount);
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||
}
|
||||
|
|
|
@ -356,22 +356,6 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
|||
* @return
|
||||
*/
|
||||
public Set<Integer> getCloseGoods(User user){
|
||||
//超值返利活动临时处理 下次大更新之前可以直接删掉
|
||||
if (id==90||id==9000){
|
||||
HashSet<Integer> set = new HashSet<>();
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
return set;
|
||||
}
|
||||
Map<Integer, ActivityProgressInfo> map = mission.getActivityMissionMap();
|
||||
for (Map.Entry<Integer, ActivityProgressInfo> progressInfoEntry : map.entrySet()) {
|
||||
SActivityRewardConfig rewardConfig=SActivityRewardConfig.getsActivityRewardConfigByMissionId(progressInfoEntry.getKey());
|
||||
if (progressInfoEntry.getValue().getState()==ActivityType.HAD_TAKED||(progressInfoEntry.getValue().getState()==ActivityType.WILL_TAKE&&mission.getV()+1!=rewardConfig.getSort())){
|
||||
set.add(rewardConfig.getValues()[0][0]);
|
||||
}
|
||||
}
|
||||
return set;
|
||||
}
|
||||
return new HashSet<>(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -107,6 +107,7 @@ public interface ActivityType {
|
|||
int DAILY_PREFERENTIAL_GIFT = 89;//每日特惠礼包开启的活动
|
||||
int NEW_RECHARGE_SUM_DAY_6 = 90;//新积天豪礼6元充值活动
|
||||
int NEW_RECHARGE_SUM_DAY_30 = 92;//新积天豪礼30元充值活动
|
||||
int NEW_DAILY_RECHARGE = 93;//新每日充值
|
||||
int SPECIAL_MONSTER_RANDOM_ACTIVITY = 100;//灵兽宝阁活动
|
||||
int SPECIAL_MONSTER_GIFT_ACTIVITY = 101;//灵兽礼包
|
||||
|
||||
|
|
|
@ -98,7 +98,8 @@ public enum ActivityTypeEnum {
|
|||
NEW_RECHARGE_SUM_DAY_30(ActivityType.NEW_RECHARGE_SUM_DAY_30,NewRechargeSumDayActivity::new),//新积天豪礼
|
||||
DAILY_PREFERENTIAL_GIFT(ActivityType.DAILY_PREFERENTIAL_GIFT,DailyPreferentialGiftActivity::new),
|
||||
SUMMON_TREASURE(ActivityType.SUMMON_TREASURE,SummonTreasureActivity::new),//招募秘宝
|
||||
NEW_PLAYER_SHOP(ActivityType.NEW_PLAYER_SHOP, NewPlayerShopActivity::new)
|
||||
NEW_PLAYER_SHOP(ActivityType.NEW_PLAYER_SHOP, NewPlayerShopActivity::new),
|
||||
NEW_DAILY_RECHARGE(ActivityType.NEW_DAILY_RECHARGE, RechargeRewardActivity::new)
|
||||
;
|
||||
|
||||
private int type;
|
||||
|
|
|
@ -77,7 +77,7 @@ public class ArenaRankActivity extends AbstractActivity {
|
|||
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("arena_activity_mail_txt", new Object[]{rank}, new int[0], "#");
|
||||
int[][] rewardByRank = null;
|
||||
for (SActivityRankingReward sActivityRankingReward : sActivityRankingRewards) {
|
||||
if (sActivityRankingReward.getMinRank() >= rank && sActivityRankingReward.getMaxRank() <= rank) {
|
||||
if (sActivityRankingReward.getMinRank() >= rank && rank <= sActivityRankingReward.getMaxRank()) {
|
||||
rewardByRank = sActivityRankingReward.getRankingReward();
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,74 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.event.*;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import config.SActivityRewardConfig;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
//充值奖励活动
|
||||
public class RechargeRewardActivity extends AbstractActivity {
|
||||
|
||||
public RechargeRewardActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, RechargeRewardEvent.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception{
|
||||
if (!(event instanceof RechargeRewardEvent))
|
||||
return;
|
||||
User user = UserManager.getUser(((RechargeRewardEvent) event).getUid());
|
||||
if (null == user) {
|
||||
return;
|
||||
}
|
||||
List<SActivityRewardConfig> rewardConfigList = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id).stream().filter(n->n.getValues()[0][0]==((RechargeRewardEvent) event).getRechargeCount()).collect(Collectors.toList());
|
||||
if(rewardConfigList == null || rewardConfigList.size() == 0){
|
||||
return ;
|
||||
}
|
||||
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if( null == activityMission){
|
||||
return;
|
||||
}
|
||||
int rewrdId = rewardConfigList.get(0).getId();
|
||||
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
|
||||
if(!activityProgressInfoMap.containsKey(rewrdId)){
|
||||
return;
|
||||
}
|
||||
if(activityProgressInfoMap.get(rewrdId).getState() == 0){
|
||||
activityProgressInfoMap.get(rewrdId).setProgrss(((RechargeRewardEvent) event).getRechargeCount());
|
||||
activityProgressInfoMap.get(rewrdId).setState(2);
|
||||
}
|
||||
//更新进度
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId());
|
||||
sendActivityProgress(sessionByUid, activityMission, null);
|
||||
}
|
||||
@Override
|
||||
boolean takeRewardsProcess(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||
int[][] values = sActivityRewardConfig.getValues();
|
||||
int missionProgress = activityProgressInfo.getProgrss();
|
||||
return missionProgress == values[0][0] && activityProgressInfo.getState() == 2;
|
||||
}
|
||||
@Override
|
||||
public boolean checkActivityMissionFinishAndTake(int uid,int activityId,ActivityMission activityMission) {
|
||||
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
|
||||
if (activityProgressInfoMap.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
for (Map.Entry<Integer, ActivityProgressInfo> item : activityProgressInfoMap.entrySet()) {
|
||||
ActivityProgressInfo activityProgressInfo = item.getValue();
|
||||
int missionStatus = activityProgressInfo.getState();
|
||||
if (missionStatus == ActivityType.WILL_TAKE || missionStatus == 2) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
public class RechargeRewardEvent implements IEvent {
|
||||
private int uid;
|
||||
private int rechargeCount;//充值金额
|
||||
|
||||
public RechargeRewardEvent(int uid, int rechargeCount) {
|
||||
this.uid = uid;
|
||||
this.rechargeCount = rechargeCount;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setUid(int uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public int getRechargeCount() {
|
||||
return rechargeCount;
|
||||
}
|
||||
|
||||
public void setRechargeCount(int rechargeCount) {
|
||||
this.rechargeCount = rechargeCount;
|
||||
}
|
||||
}
|
|
@ -45,7 +45,7 @@ public class UserManager {
|
|||
private static Map<Integer,Long> userMapPutTime = new ConcurrentHashMap<>(); //离线读入
|
||||
private static AtomicInteger login_f_num = new AtomicInteger(0);//登陆计数
|
||||
private static final int LOGIN_F_LIMIT = 100;//报警界限
|
||||
private static final long LIVE_TIME = 12 * 60 * 60 * 1000L;
|
||||
private static final long LIVE_TIME = 3 * 60 * 60 * 1000L;
|
||||
|
||||
public static void addUser(User user) {
|
||||
userMap.put(user.getId(), user);
|
||||
|
|
|
@ -7,5 +7,5 @@ import config.SPassiveSkillLogicConfig;
|
|||
import java.util.Map;
|
||||
|
||||
public interface PassiveSkillProcessor {
|
||||
void process(SPassiveSkillLogicConfig config, Hero hero, Map<Integer, Long> heroSkillAdMap);
|
||||
void process(SPassiveSkillLogicConfig config, Hero hero, Map<Integer, Long> heroSkillAdMap,User user,int teamId);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.ljsd.jieling.logic.fight.passiveSkillCal;
|
||||
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import config.SCHero;
|
||||
|
@ -8,11 +10,12 @@ import config.SPropertyConfig;
|
|||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
//90 94 171
|
||||
public enum PassiveskillCalEnum {
|
||||
SingleAdd(90,(config,hero,heroSkillAdMap)->{
|
||||
SingleAdd(90,(config,hero,heroSkillAdMap,user,teamId)->{
|
||||
float[] value = config.getValue();
|
||||
int battlePropertyId = (int) value[0];
|
||||
SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByBattlePID(battlePropertyId);
|
||||
|
@ -32,7 +35,7 @@ public enum PassiveskillCalEnum {
|
|||
int extraValue = (int) cal(optCode, parm);
|
||||
heroSkillAdMap.put(sPropertyConfig.getPropertyId(),heroSkillAdMap.getOrDefault(sPropertyConfig.getPropertyId(), Long.valueOf(0))+extraValue);
|
||||
}),
|
||||
AllAdd(94,(config,hero,heroSkillAdMap)->{
|
||||
AllAdd(94,(config,hero,heroSkillAdMap,user,teamId)->{
|
||||
float[] value = config.getValue();
|
||||
int battlePropertyId = (int) value[1];
|
||||
SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByBattlePID(battlePropertyId);
|
||||
|
@ -53,12 +56,7 @@ public enum PassiveskillCalEnum {
|
|||
int extraValue = (int) cal(optCode, parm);
|
||||
heroSkillAdMap.put(sPropertyConfig.getPropertyId(),heroSkillAdMap.getOrDefault(sPropertyConfig.getPropertyId(), Long.valueOf(0))+extraValue);
|
||||
}),
|
||||
HEROAFTER100ADD(171,(config,hero,heroSkillAdMap)->{
|
||||
int uid = Integer.parseInt(hero.getId().substring(0, 8));
|
||||
User user = UserManager.getUserInMem(uid);
|
||||
if (user == null){
|
||||
return;
|
||||
}
|
||||
HEROAFTER100ADD(171,(config,hero,heroSkillAdMap,user,teamId)->{
|
||||
float[] value = config.getValue();
|
||||
int battlePropertyId = (int) value[0];
|
||||
SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByBattlePID(battlePropertyId);
|
||||
|
@ -70,7 +68,7 @@ public enum PassiveskillCalEnum {
|
|||
int parm = (int) value[1]*times;
|
||||
heroSkillAdMap.put(sPropertyConfig.getPropertyId(),heroSkillAdMap.getOrDefault(sPropertyConfig.getPropertyId(), Long.valueOf(0))+parm);
|
||||
}),//武将100级后每升一级[c]额外增加[d]
|
||||
HERO_PROFESSION_ADD(129,(config,hero,heroSkillAdMap)->{
|
||||
HERO_PROFESSION_ADD(129,(config,hero,heroSkillAdMap,user,teamId)->{
|
||||
float[] value = config.getValue();
|
||||
|
||||
if(SCHero.getsCHero().get(hero.getTemplateId()).getPropertyName()!=value[0]){
|
||||
|
@ -93,6 +91,36 @@ public enum PassiveskillCalEnum {
|
|||
}
|
||||
int extraValue = (int) cal(optCode, parm);
|
||||
heroSkillAdMap.put(sPropertyConfig.getPropertyId(),heroSkillAdMap.getOrDefault(sPropertyConfig.getPropertyId(), Long.valueOf(0))+extraValue);
|
||||
}),
|
||||
HERO_HAVE_PROFESSION_ADD(413,(config,hero,heroSkillAdMap,user,teamId)->{
|
||||
//被动技能,编队每增加一个同属性英雄属性额外增加一定数值
|
||||
float[] value = config.getValue();
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
int haveNum=0;
|
||||
for (TeamPosHeroInfo teamPosHeroInfo : teamPosHeroInfos) {
|
||||
Hero localHero=user.getHeroManager().getHero(teamPosHeroInfo.getHeroId());
|
||||
if(SCHero.getsCHero().get(localHero.getTemplateId()).getPropertyName()==value[0]){
|
||||
haveNum++;
|
||||
}
|
||||
}
|
||||
|
||||
float parm = value[1];
|
||||
int optCode = (int) value[3];
|
||||
|
||||
SPropertyConfig sPropertyConfig = SPropertyConfig.getsPropertyConfigByBattlePID((int)(value[2]));
|
||||
|
||||
if(optCode%2==0){
|
||||
if( sPropertyConfig.getStyle()!= GlobalsDef.PERCENT_TYPE){
|
||||
sPropertyConfig = SPropertyConfig.getsPropertyConfigByTargetPropertyId(sPropertyConfig.getPropertyId());
|
||||
}
|
||||
parm = value[1]*10000*haveNum;
|
||||
}
|
||||
|
||||
if( sPropertyConfig.getStyle()== GlobalsDef.PERCENT_TYPE){
|
||||
parm = value[1]*10000*haveNum;
|
||||
}
|
||||
int extraValue = (int) cal(optCode, parm);
|
||||
heroSkillAdMap.put(sPropertyConfig.getPropertyId(),heroSkillAdMap.getOrDefault(sPropertyConfig.getPropertyId(), Long.valueOf(0))+extraValue);
|
||||
}),
|
||||
;
|
||||
private int type;
|
||||
|
|
|
@ -573,9 +573,9 @@ public class FriendLogic {
|
|||
if (haveRewardMap.containsKey(uid) && haveRewardMap.get(uid) != 0) {
|
||||
throw new ErrorCodeException(ErrorCode.FRIENDS_SEMD_YET);
|
||||
}
|
||||
friendManager.updateGiveMap(friendId,1);
|
||||
friendManager.updateGiveMap(friendUid,1);
|
||||
friendManager1.updateHaveRewardMap(uid,1);
|
||||
sendFriendStatedication(uid,friendId,2);
|
||||
sendFriendStatedication(uid,friendUid,2);
|
||||
times++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1820,7 +1820,7 @@ public class HeroLogic {
|
|||
}
|
||||
}
|
||||
}
|
||||
return star;
|
||||
return Math.min(star,scHero.getMaxRank());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2667,6 +2667,18 @@ public class HeroLogic {
|
|||
}
|
||||
}
|
||||
}
|
||||
// 法宝聚灵总星级增加属性
|
||||
Map<Integer, STrumpStar> trumpStarMap = STableManager.getConfig(STrumpStar.class);
|
||||
// 按照累计星数倒叙排列
|
||||
List<STrumpStar> trumpStars = trumpStarMap.values().stream().sorted(Comparator.comparing(STrumpStar::getStarNum).reversed()).collect(Collectors.toList());
|
||||
// 玩家全部的总星级
|
||||
int sumStar = heroManager.getFaBaoSoulMap().values().stream().mapToInt(v -> v).sum();
|
||||
for (STrumpStar star : trumpStars) {
|
||||
if (sumStar >= star.getStarNum()){
|
||||
combinedAttribute(star.getPropList(), heroAllAttribute);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//玩家皮肤加成
|
||||
for (Map.Entry<Integer, Long> entry : user.getPlayerInfoManager().getUserSkinValidTime().entrySet()) {
|
||||
if (!SPlayerHeadIcon.getHeadIconMap().containsKey(entry.getKey())) {
|
||||
|
@ -3037,7 +3049,7 @@ public class HeroLogic {
|
|||
if (null != config.getValue() && config.getValue().length > 2 && config.getValue()[2] != 4) {
|
||||
PassiveskillCalEnum passiveskillCalEnum = PassiveskillCalEnum.calEnumMap.get(config.getType());
|
||||
if (null != passiveskillCalEnum) {
|
||||
passiveskillCalEnum.getPassiveSkillProcessor().process(config, hero, heroSkillAdMap);
|
||||
passiveskillCalEnum.getPassiveSkillProcessor().process(config, hero, heroSkillAdMap,user,teamId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3077,7 +3089,7 @@ public class HeroLogic {
|
|||
if (null != configTmp.getValue() && configTmp.getValue().length > 2 && configTmp.getValue()[2] == 4) {
|
||||
PassiveskillCalEnum passiveskillCalEnum = PassiveskillCalEnum.calEnumMap.get(configTmp.getType());
|
||||
if (null != passiveskillCalEnum) {
|
||||
passiveskillCalEnum.getPassiveSkillProcessor().process(configTmp, hero, heroSkillAdMap);
|
||||
passiveskillCalEnum.getPassiveSkillProcessor().process(configTmp, hero, heroSkillAdMap,user,teamId);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -4080,10 +4092,18 @@ public class HeroLogic {
|
|||
}
|
||||
// 卸下魂印
|
||||
Map<Integer, Integer> soulEquipByPositionMap = hero.getSoulEquipByPositionMap();
|
||||
for (Integer value : soulEquipByPositionMap.values()) {
|
||||
dropMap.put(value, 1);
|
||||
Map<Integer, Integer> hunying = null;
|
||||
if (!soulEquipByPositionMap.isEmpty()) {
|
||||
hunying = new HashMap<>(soulEquipByPositionMap.size());
|
||||
Set<Integer> unload = new HashSet<>(soulEquipByPositionMap.size());
|
||||
for (Map.Entry<Integer, Integer> entry : soulEquipByPositionMap.entrySet()) {
|
||||
hunying.put(entry.getValue(), 1);
|
||||
unload.add(entry.getKey());
|
||||
}
|
||||
for (Integer integer : unload) {
|
||||
hero.removeSoulEquip(integer);
|
||||
}
|
||||
}
|
||||
|
||||
for (int[] ints : returnPercent) {
|
||||
for (int i = 1; i < ints.length; i++) {
|
||||
SHeroRankupGroup sHeroRankupGroup=STableManager.getConfig(SHeroRankupGroup.class).get(ints[i]);
|
||||
|
@ -4105,22 +4125,13 @@ public class HeroLogic {
|
|||
}
|
||||
ItemUtil.itemCost(user, cost, BIReason.HERO_RETURN, hero.getTemplateId());
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, ItemUtil.mapToArray(dropMap), BIReason.HERO_RETURN);
|
||||
if (!soulEquipByPositionMap.isEmpty()) {
|
||||
List<CommonProto.Item> itemlistList = drop.getItemlistList();
|
||||
Set<Integer> needRemove = new HashSet<>(soulEquipByPositionMap.size());
|
||||
for (int i = 0; i < itemlistList.size(); i++) {
|
||||
CommonProto.Item item = itemlistList.get(i);
|
||||
if (soulEquipByPositionMap.values().contains(item.getItemId())) {
|
||||
needRemove.add(i);
|
||||
}
|
||||
}
|
||||
for (Integer index : needRemove) {
|
||||
drop.removeItemlist(index);
|
||||
}
|
||||
if (hunying != null) {
|
||||
ItemUtil.drop(user, ItemUtil.mapToArray(hunying), BIReason.HERO_RETURN);
|
||||
}
|
||||
hero.setLevel(1);
|
||||
hero.setBreakId(0);
|
||||
hero.setStar(5);
|
||||
hero.setStarBreakId(0);
|
||||
//鸿蒙阵
|
||||
addOrUpdateHongmeng(session);
|
||||
HeroInfoProto.HeroReturnResponse build = HeroInfoProto.HeroReturnResponse.newBuilder().setDrop(drop).build();
|
||||
|
|
|
@ -924,20 +924,10 @@ public class ItemLogic {
|
|||
PlayerInfoProto.EquipUpLevelResponse.Builder response = PlayerInfoProto.EquipUpLevelResponse.newBuilder();
|
||||
response.setResult(false);
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
int type = SComposeActivity.getTypeById(activityId,equipId);
|
||||
if(type == -1){
|
||||
LOGGER.error("type找不到配置,活动id:{},装备id:{}",activityId,equipId);
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
SComposeBook config = SComposeBook.getBookById(type,equipId);
|
||||
if(config == null){
|
||||
LOGGER.error("config找不到配置,type:{},装备id:{}",type,equipId);
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
}
|
||||
int[][] itemC = config.getNeedCost();
|
||||
if(itemC[0][0] != itemId || itemC[0][1] != itemNum){
|
||||
LOGGER.error("itemCost不匹配,item:{},num:{},conItem:{},conNum:{}",itemId,itemNum,itemC[0],itemC[1]);
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL);
|
||||
Map<Integer, SComposeBook> config = STableManager.getConfig(SComposeBook.class);
|
||||
SComposeBook composeBook = config.get(equipId);
|
||||
if(composeBook == null){
|
||||
throw new ErrorCodeException(ErrorCode.CFG_NULL,"云游商人,idkey配置不存在:"+equipId);
|
||||
}
|
||||
ActivityMission misson = user.getActivityManager().getActivityMissionMap().get(activityId);
|
||||
if(misson == null){
|
||||
|
@ -945,24 +935,24 @@ public class ItemLogic {
|
|||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
|
||||
}
|
||||
Map<Integer, SComposeActivity> integerSComposeActivityMap = SComposeActivity.getConfigMap().get(activityId);
|
||||
int typeId = integerSComposeActivityMap.get(type).getId();
|
||||
int typeId = integerSComposeActivityMap.get(composeBook.getType()).getId();
|
||||
ActivityProgressInfo progress = misson.getActivityMissionMap().get(typeId);
|
||||
if(progress == null){
|
||||
LOGGER.error("progress为空,type:{}",type);
|
||||
LOGGER.error("progress为空,type:{}",composeBook.getType());
|
||||
throw new ErrorCodeException(ErrorCode.ACTIVITY_NOT_OPEN);
|
||||
}
|
||||
if(progress.getProgrss() <= 0){
|
||||
LOGGER.error("progress次数不足,num:{}",progress.getProgrss());
|
||||
throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT);
|
||||
}
|
||||
boolean itemCost = ItemUtil.itemCost(user, new int[][]{{equipId, 1},{itemId, itemNum}}, BIReason.EQUIP_UPLEVEL_COST, equipId);
|
||||
boolean itemCost = ItemUtil.itemCost(user, new int[][]{composeBook.getNeedItems()[0],composeBook.getNeedCost()[0]}, BIReason.EQUIP_UPLEVEL_COST, equipId);
|
||||
if(!itemCost){
|
||||
LOGGER.error("item不足,equipId:{},itemId:{},itemNum:{}",equipId,itemId,itemNum);
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
progress.setProgrss(progress.getProgrss()-1);
|
||||
user.getActivityManager().getActivityMissionMap().put(activityId,misson);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user,new int[][]{{config.getGoalItems()[0][0],config.getGoalItems()[0][1]}},BIReason.EQUIP_UPLEVEL_REWARD);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user,new int[][]{composeBook.getGoalItems()[0]},BIReason.EQUIP_UPLEVEL_REWARD);
|
||||
response.setResult(true);
|
||||
response.setDrop(drop);
|
||||
MessageUtil.sendMessage(session,1,messageType.getNumber(),response.build(),true);
|
||||
|
|
|
@ -17,9 +17,9 @@ public class GotSoulMarkManager extends AbstractDataManager {
|
|||
public CumulationData.Result updateData(CumulationData data, MissionType missionType, Object... parm) {
|
||||
CumulationData.Result result = null;
|
||||
int itemId = (int)parm[0];
|
||||
int num = (int)parm[1];
|
||||
long num = (long)parm[1];
|
||||
if(missionType == MissionType.GOT_SOUL_MARK){
|
||||
data.addQualitySoulMarkNum(STableManager.getConfig(SItem.class).get(itemId).getQuantity(),num);
|
||||
data.addQualitySoulMarkNum(STableManager.getConfig(SItem.class).get(itemId).getQuantity(),(int)num);
|
||||
result = new CumulationData.Result(missionType);
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -1784,4 +1784,41 @@ public class PlayerLogic {
|
|||
User user = gson.fromJson(userStr, User.class);
|
||||
return user;
|
||||
}
|
||||
|
||||
//森罗幻境自动挂机奖励展示
|
||||
public static void TowerGetRewardInfoShow(CommonProto.Drop drop,User user){
|
||||
Map<Integer,Integer> mapItemShow =user.getMapManager().getTowerGetRewardInfoShowMap();
|
||||
for(CommonProto.Item item :drop.getItemlistList()){
|
||||
if(mapItemShow.containsKey(item.getItemId())){
|
||||
mapItemShow.put(item.getItemId(),mapItemShow.get(item.getItemId())+(int)item.getItemNum());
|
||||
}else{
|
||||
mapItemShow.put(item.getItemId(),(int)item.getItemNum());
|
||||
}
|
||||
LOGGER.error("掉落1->{}->{}",item.getItemId(),item.getItemNum());
|
||||
}
|
||||
for(CommonProto.Equip equip:drop.getEquipIdList()){
|
||||
if(mapItemShow.containsKey(equip.getEquipId())){
|
||||
mapItemShow.put(equip.getEquipId(),mapItemShow.get(equip.getEquipId())+1);
|
||||
}else{
|
||||
mapItemShow.put(equip.getEquipId(),1);
|
||||
}
|
||||
LOGGER.error("掉落2->{}->{}",equip.getEquipId(),1);
|
||||
}
|
||||
for(CommonProto.Hero hero:drop.getHeroList()){
|
||||
if(mapItemShow.containsKey(hero.getHeroId())){
|
||||
mapItemShow.put(hero.getHeroId(),mapItemShow.get(hero.getHeroId())+1);
|
||||
}else{
|
||||
mapItemShow.put(hero.getHeroId(),1);
|
||||
}
|
||||
LOGGER.error("掉落3->{}->{}",hero.getHeroId(),1);
|
||||
}
|
||||
for(CommonProto.PokemonInfo pokemonInfo:drop.getPokemonList()){
|
||||
if(mapItemShow.containsKey(pokemonInfo.getTempId())){
|
||||
mapItemShow.put(pokemonInfo.getTempId(),mapItemShow.get(pokemonInfo.getTempId())+1);
|
||||
}else{
|
||||
mapItemShow.put(pokemonInfo.getTempId(),1);
|
||||
}
|
||||
LOGGER.error("掉落4->{}->{}",pokemonInfo.getTempId(),1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -187,6 +187,8 @@ public class BuyGoodsNewLogic {
|
|||
LOGGER.error("购买失败!bag是否为空:{}",bag == null);
|
||||
return resultRes;
|
||||
}
|
||||
Poster.getPoster().dispatchEvent(new RechargeRewardEvent(user.getId(),(int)price));
|
||||
|
||||
//成功购买
|
||||
// if (goodsId == GlobalsDef.DAILY_GOODS_FAST_ID) {
|
||||
// //每日礼包一键购买之后,把所有单个的每日礼包的购买次数加一
|
||||
|
|
|
@ -1430,9 +1430,7 @@ public class ItemUtil {
|
|||
// 鸿蒙阵推送
|
||||
HeroLogic.getInstance().addOrUpdateHongmeng(OnlineUserManager.getSessionByUid(user.getId()));
|
||||
heroList.add(CBean2Proto.getHero(hero));
|
||||
if (reason == BIReason.HERO_RETURN) {
|
||||
return;
|
||||
}
|
||||
if (reason != BIReason.HERO_RETURN) {
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
if (scHero.getStar() >= SSpecialConfig.getIntegerValue(SSpecialConfig.lamp_lottery_content_parm)) { //策划资质改成星级
|
||||
String message = SErrorCodeEerverConfig.getI18NMessageNeedConvert("lamp_lottery_content", new Object[]{playerInfoManager.getNameColor(), playerInfoManager.getNickName(), scHero.getStar(), scHero.getReadingName()},new int[]{0,0,0,1});
|
||||
|
@ -1441,6 +1439,7 @@ public class ItemUtil {
|
|||
}
|
||||
}
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.GET_HERO,heroStar[0],heroStar[1]);
|
||||
}
|
||||
// KtEventUtils.onKtEvent(user, ParamEventBean.UserItemEvent,reason,GlobalsDef.addReason,cardId,1,heroStar[1]);
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.GET_HERO.getType(),String.valueOf(cardId),String.valueOf(hero.getStar()),String.valueOf(reason));
|
||||
}
|
||||
|
|
|
@ -180,6 +180,9 @@ public abstract class TaskKit {
|
|||
// 最佳的线程数 = CPU可用核心数 / (1 - 阻塞系数)
|
||||
// TODO 阻塞系数是不是需要有个setter方法能让使用者自由设置呢?
|
||||
num = (int)(cores / (1 - 0.9));
|
||||
if (num > 8) {
|
||||
num = 8;
|
||||
}
|
||||
}
|
||||
catch (Throwable e) {
|
||||
// 异常发生时姑且返回10个任务线程池
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="TrumpStar")
|
||||
public class STrumpStar implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int starNum;
|
||||
|
||||
private int[][] propList;
|
||||
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getStarNum() {
|
||||
return starNum;
|
||||
}
|
||||
|
||||
public int[][] getPropList() {
|
||||
return propList;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue