Merge branch 'master_test_gn' into master_test_gn_xxp
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/logic/activity/ActivityTypeEnum.java # serverlogic/src/main/java/com/ljsd/jieling/logic/hardStage/HardStageLogic.javaback_recharge
commit
c48bf9a268
|
@ -170,6 +170,7 @@ public enum ErrorCode implements IErrorCode {
|
|||
|
||||
LOCK_FILL(140,"锁定数量已满,无法刷新"),
|
||||
REDPACKET_DAILY_LIMIT(141,"今日福利红包已达领取上限"),
|
||||
CHAMPION_BET_GUESS_OVER_TIME(142,"巅峰赛竞猜超时,请重新进入页面")
|
||||
|
||||
;
|
||||
private static final Set<Integer> CodeSet = new HashSet<>();
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.ljsd.jieling.logic.activity.ActivityLogic;
|
|||
import com.ljsd.jieling.logic.activity.event.NewWelfareEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.NewWelfareTypeEnum;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
|
@ -137,7 +138,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
Map<Integer, Integer> heroHandBook = heroManager.getHeroHandBook();
|
||||
List<CommonProto.EveryHeroHandBook> heroHandBookList = new ArrayList<>();
|
||||
heroHandBook.forEach((k,v)->heroHandBookList.add(CommonProto.EveryHeroHandBook.newBuilder().setHeroId(k).setMaxStar(v).build()));
|
||||
|
||||
initHeroStar(user);
|
||||
Set<Integer> equipHandBookSet = user.getEquipManager().getEquipHandBook().keySet();
|
||||
int equipPool = user.getEquipManager().getSoulEquipPool();
|
||||
List<CommonProto.GiftGoodsInfo> goodsBagInfo = new ArrayList<>(SRechargeCommodityNewConfig.configMap.size());
|
||||
|
@ -221,6 +222,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
ReportUtil.onReportEvent(user, ReportEventEnum.APP_LOGIN.getType());
|
||||
try {
|
||||
//hotfix
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),-1));
|
||||
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_TASK_TYPE,0,user);
|
||||
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.WorldLevelIndication_VALUE, PlayerInfoProto.WorldLevelIndication.newBuilder().setWorldLeve(GlobleSystemLogic.getGloableWorldLeveCache()).build(), true);
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);
|
||||
|
@ -235,5 +237,17 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化英雄星级map(针对老号)
|
||||
* @param user
|
||||
*/
|
||||
private void initHeroStar(User user){
|
||||
if(user.getHeroManager().getHeroStarMap().size()>1){
|
||||
return;
|
||||
}
|
||||
for(Hero hero : user.getHeroManager().getHeroMap().values()){
|
||||
user.getHeroManager().addHeroStar(hero.getTemplateId(),hero.getStar());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,8 @@ import com.ljsd.jieling.util.ItemUtil;
|
|||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SArenaRobotConfig;
|
||||
import manager.STableManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import rpc.protocols.ArenaInfoProto;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
@ -36,6 +38,9 @@ import java.util.Map;
|
|||
* 0 全量 1 : 只给ChampionBetInfo
|
||||
*/
|
||||
public class ChampionBetInfoHandler extends BaseHandler<ArenaInfoProto.ChampionGetBetRequest> {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(ChampionBetInfoHandler.class);
|
||||
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.CHAMPION_BET_INFO_REQUEST;
|
||||
|
@ -247,9 +252,7 @@ public class ChampionBetInfoHandler extends BaseHandler<ArenaInfoProto.ChampionG
|
|||
.build());
|
||||
builder.setWinUid(myGuessID);
|
||||
builder.setMyBetCoins(mineBetCoins);
|
||||
|
||||
|
||||
|
||||
LOGGER.info("竞猜1uid=>{},竞猜2uid{}",builder.getChampionBattleInfo().getMyInfo().getUid(),builder.getChampionBattleInfo().getEnemyInfo().getUid());
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ public class ChampionGuessHandler extends BaseHandler<ArenaInfoProto.ChampionBet
|
|||
ArenaRecord arenaRecord = RedisUtil.getInstence().getMapValue(RedisKey.CHAMPION_ARENA_RECORD, "", selectUid, ArenaRecord.class);
|
||||
if(arenaRecord.getAttackId()!=winUid && arenaRecord.getDefUid()!=winUid){
|
||||
LOGGER.error("the uid={} guess winner={} is not exists,recordId={}",uid,winUid,arenaRecord.getId());
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
throw new ErrorCodeException(ErrorCode.CHAMPION_BET_GUESS_OVER_TIME);
|
||||
}
|
||||
User user = UserManager.getUser(uid);
|
||||
int[] arenaItem = STableManager.getFigureConfig(CommonStaticConfig.class).getsChampionshipSetting().getArenaItem();
|
||||
|
|
|
@ -11,6 +11,8 @@ import com.ljsd.jieling.globals.BIReason;
|
|||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.ShanHeSheJiTuStarEvent;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
|
@ -81,6 +83,11 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
}
|
||||
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(teamId);
|
||||
PlayerInfoProto.HardStageFightResponse.Builder fightStartResponse = PlayerInfoProto.HardStageFightResponse.newBuilder();
|
||||
//山河社稷埋点
|
||||
int logType = nodeConfig.getChapter();
|
||||
int logSectionId = nodeConfig.getSection();
|
||||
int logResult = 0;
|
||||
int logStarNum = 0;
|
||||
//直接发奖励
|
||||
if (nodeConfig.getStageType() == 2) {
|
||||
Map<Integer, HardStageChapter> chapt = user.getHardStageManager().getChapterMap(user);
|
||||
|
@ -90,6 +97,7 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
node.setState(1);
|
||||
dropList.addAll(HardStageLogic.getFirstRewards(user, nodeConfig));
|
||||
HardStageLogic.updateChapterAndNodeLevel(user,nodeConfig);
|
||||
logResult = 1;
|
||||
}
|
||||
} else if (nodeConfig.getStageType() == 1 || nodeConfig.getStageType() == 3) {
|
||||
if (teamPosHeroInfos == null || teamPosHeroInfos.size() == 0) {
|
||||
|
@ -123,8 +131,6 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
}else {
|
||||
fightStartResponse.setCurrentIsHonour(false);
|
||||
}
|
||||
|
||||
//System.err.print("0:" + resultNum[0] + " 1:" + resultNum[1] + " 2:" + resultNum[2]);
|
||||
int resultCode = (int) fight[0][0];
|
||||
if (resultCode == -1) {
|
||||
throw new ErrorCodeException(ErrorCode.FIGHT_EXCEPTION);
|
||||
|
@ -141,7 +147,7 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
fightStartResponse.setFightData(fightData);
|
||||
FightRecordLogic.getInstance().addRecordMap(user, fightData);
|
||||
if (resultCode == 1) {//通过
|
||||
HardStageLogic.passNode(iSession, nodeConfig, resultNum, dropList);
|
||||
logStarNum = HardStageLogic.passNode(iSession, nodeConfig, resultNum, dropList);
|
||||
//战斗回放
|
||||
int force = HeroLogic.getInstance().calTeamTotalForce(user, teamId, false);
|
||||
// 首次通关记录
|
||||
|
@ -205,5 +211,7 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
|||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.HARD_STAGE_FIGHT_START_RESPONSE.getNumber(), fightStartResponse.build(), true);
|
||||
//更新消息
|
||||
HardStageLogic.sendHardStageIndication(user);
|
||||
//埋点数据
|
||||
ReportUtil.onReportEvent(user, ReportEventEnum.HARD_STAGE.getType(),logType ,logSectionId ,String.valueOf(logResult) ,logStarNum );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
|||
import com.ljsd.jieling.logic.store.StoreLogic;
|
||||
import com.ljsd.jieling.logic.store.StoreType;
|
||||
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.PushRechargeType;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.*;
|
||||
import com.ljsd.jieling.util.*;
|
||||
|
@ -2190,7 +2191,7 @@ public class MapLogic {
|
|||
Poster.getPoster().dispatchEvent(new FightMainEvent(user.getId(),fightId));
|
||||
Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.LEVEL_FIGHT.getType(),fightId));
|
||||
user.getMainLevelManager().updateFight(updateFightId,state);
|
||||
BuyGoodsNewLogic.openPush(session,user,1,fightId,0);
|
||||
BuyGoodsNewLogic.openPush(session,user, PushRechargeType.main_line.getType(),fightId,0);
|
||||
if(state == -1){
|
||||
//删除为0的
|
||||
Map<Integer, Integer> fightStateInfo = user.getMainLevelManager().getFightStateInfo();
|
||||
|
@ -2295,7 +2296,7 @@ public class MapLogic {
|
|||
ReportUtil.onReportEvent(user,ReportEventEnum.COMPLETE_XINMO.getType(),checkFightId,sFloodConfig.getMonster(),MonsterUtil.getMonsterForce(new int[]{sFloodConfig.getMonster()}),new Date(),"",null,null,"失败");
|
||||
return;
|
||||
}
|
||||
BuyGoodsNewLogic.openPush(session,user,2,sFloodConfig.getId(),0);
|
||||
BuyGoodsNewLogic.openPush(session,user,PushRechargeType.tower.getType(),sFloodConfig.getId(),0);
|
||||
//排行榜
|
||||
// String rankKey = RedisKey.getKey(RedisKey.MONSTER_ATTACK_RANK,"", false);
|
||||
// RedisUtil.getInstence().zsetAddOneOffsetByTime(rankKey, String.valueOf(user.getId()), checkFightId);
|
||||
|
|
|
@ -8,6 +8,7 @@ import com.ljsd.jieling.logic.dao.root.User;
|
|||
import com.ljsd.jieling.logic.redpacket.WelfareRedPackEvent;
|
||||
import com.ljsd.jieling.logic.redpacket.WelfareRedPacketType;
|
||||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.PushRechargeType;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import config.SSpiritAnimal;
|
||||
import rpc.protocols.CommonProto;
|
||||
|
@ -88,7 +89,7 @@ public class CircleGame extends ColorGame{
|
|||
if(ssa != null && ssa.getQuality()==5){
|
||||
Poster.getPoster().dispatchEvent(new WelfareRedPackEvent(user.getId(), WelfareRedPacketType.game_pokemon.getType(),1));
|
||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||
BuyGoodsNewLogic.openPush(session,user,8,5,1);
|
||||
BuyGoodsNewLogic.openPush(session,user, PushRechargeType.pokemon_quality.getType(),5,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,23 +13,21 @@ public class Cmd_fightrecord extends GmAbstract {
|
|||
|
||||
@Override
|
||||
public String exec2(String[] args){
|
||||
if (args.length < 2){
|
||||
return "";
|
||||
}
|
||||
// 获取玩家战报系统
|
||||
String content = Optional.ofNullable(args[0]).orElse("");
|
||||
String parm = Optional.ofNullable(args[1]).orElse("");
|
||||
String sign = Optional.ofNullable(args[0]).orElse("");
|
||||
String content = Optional.ofNullable(args[1]).orElse("");
|
||||
String result = "";
|
||||
if (content.equals("delete")){
|
||||
if (sign.equals("delete")){
|
||||
FightRecordLogic.getInstance().delete();
|
||||
LOGGER.info("战报信息,delete");
|
||||
}
|
||||
else if (content.equals("all")){
|
||||
result = FightRecordLogic.getInstance().getAll(Integer.parseInt(parm));
|
||||
System.out.printf("战报信息,all:{%s}",result);
|
||||
else if (sign.equals("all")){
|
||||
result = FightRecordLogic.getInstance().getAll(Integer.parseInt(content));
|
||||
LOGGER.info("战报信息,all:{}",result);
|
||||
}
|
||||
else {
|
||||
result = FightRecordLogic.getInstance().getOneRecord(content);
|
||||
System.out.printf("战报信息,OneRecord:{%s}",result);
|
||||
LOGGER.info("战报信息,OneRecord:{}",result);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -108,6 +108,8 @@ public enum ReportEventEnum {
|
|||
COMPLETE_TRAVEL(73,"complete_travel",CommonEventHandler.getInstance(),new String[]{"stage_id_travel"}),
|
||||
// 新将来袭
|
||||
TA_SUI_LING_XIAO(74,"tasuilingxiao_boss",CommonEventHandler.getInstance(),new String[]{"boss_id","damage_num","reward_nums_list"}),
|
||||
//山河社稷图
|
||||
HARD_STAGE(75 ,"Sunvo_figure",CommonEventHandler.getInstance(),new String[]{"Sunvo_figure_type","Sunvo_figure_id","combat_results","get_star"}),
|
||||
|
||||
VIP_LEVEL_UP(100,"", new VipLevelUpEventHandler(),new String[]{""});
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@ import com.ljsd.jieling.logic.activity.ActivityLogic;
|
|||
import com.ljsd.jieling.logic.activity.FightMainEventHandler;
|
||||
import com.ljsd.jieling.logic.activity.RemoveEventHeroHandler;
|
||||
import com.ljsd.jieling.logic.activity.UserLevelEventHandler;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
||||
import com.ljsd.jieling.logic.redpacket.WelfareRedPackSendHandler;
|
||||
import com.ljsd.jieling.logic.activity.eventhandler.ActivityStateChangeHandler;
|
||||
import com.ljsd.jieling.logic.activity.eventhandler.BuyGoodsDirectHandler;
|
||||
|
@ -380,6 +382,9 @@ public class GlobalDataManaager implements IManager {
|
|||
// 道具刷新
|
||||
BuyGoodsNewLogic.refreshWelfareState(user);
|
||||
user.getUserMissionManager().onGameEvent(user, GameEvent.LOGIN_GAME,0);
|
||||
|
||||
// 惊喜礼盒,事件推送
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),-1));
|
||||
}
|
||||
user.getPlayerInfoManager().setLoginTime(TimeUtils.now());
|
||||
}
|
||||
|
|
|
@ -1608,17 +1608,18 @@ public class ActivityLogic implements IEventHandler{
|
|||
int count = mission.getV();
|
||||
// up奖励id
|
||||
int upRewardId = mission.getChoiceRewardId();
|
||||
|
||||
// 排序权重map
|
||||
Map<Integer, Integer> weight = new TreeMap<>(SWishActivityPool.weight);
|
||||
// 常驻卡池
|
||||
Map<Integer, SWishActivityPool> poolMap = SWishActivityPool.map;
|
||||
// 根据活动获取本期得全部up信息
|
||||
Map<Integer, int[]> up = SWishActivityUp.upMap.get(activityId);
|
||||
// 根据玩家选取得up奖励id获取详细信息
|
||||
int[] incs = up.get(upRewardId);
|
||||
// 讲up奖励id得权重加入到整个卡池权重中
|
||||
weight.put(weight.size()+1,incs[2]);
|
||||
//拿到当前阵营
|
||||
int camp = incs[4];
|
||||
// 排序权重map
|
||||
Map<Integer, Integer> weight = new TreeMap<>(SWishActivityPool.weight.get(camp));
|
||||
// 常驻卡池
|
||||
Map<Integer, SWishActivityPool> poolMap = SWishActivityPool.map;
|
||||
// 将up奖励id得权重加入到整个卡池权重中
|
||||
weight.put(-1,incs[2]);
|
||||
// 计算总权重
|
||||
int totalWeight = weight.values().stream().mapToInt(Integer::intValue).sum();
|
||||
|
||||
|
|
|
@ -95,5 +95,7 @@ public interface ActivityType {
|
|||
int DEMON_TREASURE = 36;//降妖夺宝
|
||||
int NEW_GENERAL_ATTACK = 200;//新将来袭
|
||||
|
||||
int SUPER_BOX = 69;//惊喜礼盒
|
||||
int HERO_STAR = 500;
|
||||
|
||||
}
|
||||
|
|
|
@ -73,6 +73,8 @@ public enum ActivityTypeEnum {
|
|||
TA_SUI_LING_XIAO(ActivityType.TA_SUI_LING_XIAO,TaSuiLingXiaoActivity::new),
|
||||
CHOICE_DRAW_CRAD(ActivityType.CHOICE_DRAW_CRAD,ChoiceDrawCardActivity::new),
|
||||
HARD_STAGE_EXERCISE(ActivityType.HARD_STAGE_EXERCISE,HardStageExerciseActivity::new),
|
||||
SUPER_BOX(ActivityType.SUPER_BOX,SuperBoxActivity::new),
|
||||
HERO_STAR(ActivityType.HERO_STAR,HeroStarActivity::new),
|
||||
;
|
||||
private int type;
|
||||
private Function<Integer, AbstractActivity> toActivityFunction;
|
||||
|
|
|
@ -0,0 +1,135 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
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 com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SActivityRewardConfig;
|
||||
import config.SGlobalActivity;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class HeroStarActivity extends AbstractActivity {
|
||||
private int heroId;
|
||||
|
||||
public HeroStarActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, HeroUpStarEvent.class);
|
||||
Poster.getPoster().listenEvent(this, FiveStarGetEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
User user = null;
|
||||
if(event instanceof FiveStarGetEvent){
|
||||
FiveStarGetEvent fiveStarGetEvent = (FiveStarGetEvent)event;
|
||||
if(heroId != fiveStarGetEvent.getHeroid())
|
||||
return;
|
||||
user = UserManager.getUser(fiveStarGetEvent.getUid());
|
||||
}else if(event instanceof HeroUpStarEvent){
|
||||
HeroUpStarEvent heroUpStarEvent = (HeroUpStarEvent) event;
|
||||
if(heroUpStarEvent.getHeroTid() != heroId){
|
||||
return;
|
||||
}
|
||||
user = UserManager.getUser(heroUpStarEvent.getUid());
|
||||
}
|
||||
|
||||
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if( null == activityMission){
|
||||
return;
|
||||
}
|
||||
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
|
||||
List<SActivityRewardConfig> list = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||
|
||||
int maxstar = user.getHeroManager().getHeroStarMap().get(heroId);
|
||||
for (SActivityRewardConfig sActivityRewardConfig : list) {
|
||||
if (maxstar >= sActivityRewardConfig.getValues()[0][1]) {
|
||||
ActivityProgressInfo activityProgressInfo = activityProgressInfoMap.getOrDefault(sActivityRewardConfig.getId(), null);
|
||||
if (null == activityProgressInfo)
|
||||
continue;
|
||||
if(activityProgressInfo.getState()<1){
|
||||
activityProgressInfo.setState(1);
|
||||
}else{
|
||||
continue;
|
||||
}
|
||||
activityMission.getActivityMissionMap().put(sActivityRewardConfig.getId(), activityProgressInfo);
|
||||
}
|
||||
}
|
||||
//更新进度
|
||||
ISession sessionByUid = OnlineUserManager.getSessionByUid(user.getId());
|
||||
sendActivityProgress(sessionByUid, activityMission, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initActivity(User user) throws Exception {
|
||||
SGlobalActivity globalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||
if(globalActivity == null){
|
||||
return;
|
||||
}
|
||||
ActivityLogic.getInstance().initAllActivityMission(user.getActivityManager().getActivityMissionMap(),globalActivity.getId());
|
||||
if(user.getActivityManager().getActivityMissionMap().get(globalActivity.getId()) == null){
|
||||
return;
|
||||
}
|
||||
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if( null == activityMission){
|
||||
return;
|
||||
}
|
||||
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
|
||||
List<SActivityRewardConfig> list = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||
heroId = list.get(0).getValues()[0][0];
|
||||
Integer maxstar = user.getHeroManager().getHeroStarMap().get(heroId);
|
||||
if(maxstar == null){
|
||||
return;
|
||||
}
|
||||
|
||||
for (SActivityRewardConfig sActivityRewardConfig : list) {
|
||||
if (maxstar.intValue() >= sActivityRewardConfig.getValues()[0][1]) {
|
||||
ActivityProgressInfo activityProgressInfo = activityProgressInfoMap.getOrDefault(sActivityRewardConfig.getId(), null);
|
||||
if (null == activityProgressInfo)
|
||||
continue;
|
||||
if(activityProgressInfo.getState()<1){
|
||||
activityProgressInfo.setState(1);
|
||||
}
|
||||
activityMission.getActivityMissionMap().put(sActivityRewardConfig.getId(), activityProgressInfo);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean takeReward(ISession session, int missionId) throws Exception {
|
||||
PlayerInfoProto.TakeActivityRewardResponse build = null;
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||
if (sGlobalActivity == null || !user.getActivityManager().getActivityMissionMap().containsKey(id)) {
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
ActivityMission activityMission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
Map<Integer, ActivityProgressInfo> activityProgressInfoMap = activityMission.getActivityMissionMap();
|
||||
ActivityProgressInfo activityProgressInfo = activityProgressInfoMap.get(missionId);
|
||||
if (activityProgressInfo == null || activityProgressInfo.getState() == 2) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("活动奖励已经领取"));
|
||||
}
|
||||
activityProgressInfo.setState(2);
|
||||
SActivityRewardConfig sActivityRewardConfig = SActivityRewardConfig.getsActivityRewardConfigByMissionId(missionId);
|
||||
if(sActivityRewardConfig==null){
|
||||
throw new ErrorCodeException(ErrorCode.SERVER_SELF_DEFINE);
|
||||
}
|
||||
sendActivityProgress(session, activityMission, null);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, sActivityRewardConfig.getReward(), BIReason.TAKE_ACTIVITY_REWARD);
|
||||
build = PlayerInfoProto.TakeActivityRewardResponse.newBuilder().setDrop(drop).build();
|
||||
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,264 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
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.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SuperBoxEvent;
|
||||
import com.ljsd.jieling.logic.dao.ServerConfig;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import config.SGlobalActivity;
|
||||
import config.SSurpriseBox;
|
||||
import manager.STableManager;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author hj
|
||||
* 惊喜礼盒活动
|
||||
*
|
||||
* 礼盒状态:
|
||||
* 已解锁可购买 1
|
||||
* 已解锁不可购买 2
|
||||
* 未解锁可见可预览 3
|
||||
* 未解锁可见不可预览 4
|
||||
* 未解锁不可见 5
|
||||
* 已购买 6
|
||||
*/
|
||||
@SuppressWarnings("ALL")
|
||||
public class SuperBoxActivity extends AbstractActivity {
|
||||
|
||||
SuperBoxActivity(int id) {
|
||||
super(id);
|
||||
Poster.getPoster().listenEvent(this, SuperBoxEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initActivity(User user) throws Exception {
|
||||
ActivityMission mission = new ActivityMission();
|
||||
// 读表获取阶段奖励信息
|
||||
Map<Integer, SSurpriseBox> boxMap = SSurpriseBox.map.getOrDefault(id,new HashMap<>());
|
||||
if (boxMap.isEmpty()){
|
||||
LOGGER.error("惊喜礼盒初始化失败,活动id:"+id);
|
||||
}
|
||||
List<Integer> list = boxMap.values().stream().mapToInt(SSurpriseBox::getId).boxed().collect(Collectors.toList());
|
||||
// 初始化阶段奖励
|
||||
ActivityLogic.getInstance().initOtherMission(mission, list);
|
||||
user.getActivityManager().getActivityMissionMap().put(id, mission);
|
||||
// 修改状态
|
||||
updateState(user);
|
||||
LOGGER.info("惊喜礼盒初始化..."+id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEvent(IEvent event) throws Exception {
|
||||
// 类型验证
|
||||
if (!(event instanceof SuperBoxEvent)) {
|
||||
return;
|
||||
}
|
||||
// 获取信息
|
||||
SuperBoxEvent event1 = (SuperBoxEvent) event;
|
||||
User user = UserManager.getUser(event1.getUserId());
|
||||
// 礼包处理
|
||||
giftHandle(user, event1.getGiftId());
|
||||
// 状态刷新
|
||||
updateState(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼包处理
|
||||
* @param user
|
||||
* @param giftId
|
||||
* @param missionMap
|
||||
*/
|
||||
private void giftHandle(User user, int giftId){
|
||||
if (giftId == -1){
|
||||
// 非礼包处理
|
||||
return;
|
||||
}
|
||||
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
return;
|
||||
}
|
||||
Map<Integer, ActivityProgressInfo> missionMap = mission.getActivityMissionMap();
|
||||
Collection<SSurpriseBox> boxes = SSurpriseBox.map.getOrDefault(id, new HashMap<>(0)).values();
|
||||
|
||||
for (SSurpriseBox box : boxes) {
|
||||
if (box.getPackId() == giftId){
|
||||
// 当前礼包状态处理
|
||||
ActivityProgressInfo current = missionMap.get(box.getId());
|
||||
if (current != null){
|
||||
current.setState(ActivityType.HAD_TAKED);
|
||||
current.setProgrss(8);
|
||||
missionMap.put(box.getId(),current);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改状态
|
||||
* 次数代码非必要不要进行修改,包含N多的嵌套if
|
||||
* 不要问我为啥写的这么恶心,因为我自己也不知怎么写出来的
|
||||
* @param user
|
||||
*/
|
||||
private void updateState(User user){
|
||||
long now = TimeUtils.now();
|
||||
long start = getSrartTime();
|
||||
long end = getEndTime();
|
||||
// 验证活动是否开启
|
||||
if (now < start || now > end){
|
||||
return;
|
||||
}
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
// 计算过去了几天
|
||||
int days = TimeUtils.getSoFarWentDays(start, now)+1;
|
||||
mission.setV(days);
|
||||
// mission 单个礼包
|
||||
Map<Integer, ActivityProgressInfo> missionMap = mission.getActivityMissionMap();
|
||||
Map<Integer, SSurpriseBox> boxMap = SSurpriseBox.map.get(id);
|
||||
// 极为恶心的循环,包含超多的if-else
|
||||
for (Map.Entry<Integer, ActivityProgressInfo> entry : missionMap.entrySet()) {
|
||||
int k = entry.getKey();
|
||||
ActivityProgressInfo v = entry.getValue();
|
||||
int progrss = v.getProgrss();
|
||||
// 是否已购买
|
||||
if (progrss == 8){
|
||||
// 已购买
|
||||
continue;
|
||||
}
|
||||
|
||||
SSurpriseBox box = boxMap.get(k);
|
||||
// 未购买, 是否解锁
|
||||
if (days >= box.getUnlockDay()){
|
||||
// 已解锁, 可买天数
|
||||
if (days >= box.getBuyDay()){
|
||||
// 可买, 是否购买前置礼包
|
||||
if (checkBuyAgo(user,box.getId())){
|
||||
// 已购买前置. 是否需要特权, 是否激活特权
|
||||
progrss = checkRule(user,box.getRule())?1:4;
|
||||
}else {
|
||||
// 未购买前置
|
||||
progrss = 3;
|
||||
}
|
||||
}else {
|
||||
// 不可买
|
||||
progrss = 2;
|
||||
}
|
||||
}else {
|
||||
// 未解锁, 是否可见
|
||||
if (days >= box.getVisibleDay()){
|
||||
// 可见, 是否可预览
|
||||
progrss = days >= box.getViewDay()?6:7;
|
||||
}else {
|
||||
// 不可见
|
||||
progrss = 5;
|
||||
}
|
||||
}
|
||||
v.setProgrss(progrss);
|
||||
mission.getActivityMissionMap().put(k,v);
|
||||
}
|
||||
|
||||
LOGGER.info("========================惊喜礼盒状态刷新,uid={}",user.getId());
|
||||
|
||||
// 客户端推送
|
||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||
sendActivityProgress(session, mission, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
* @return
|
||||
*/
|
||||
public long getSrartTime(){
|
||||
long startTime = 0;
|
||||
SGlobalActivity activity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||
// 绝对时间
|
||||
if (activity.getTime() == ActivityType.OPEN_TYPE_TIME){
|
||||
startTime = activity.getStartTimeLong();
|
||||
}
|
||||
// 开服时间
|
||||
else if (activity.getTime() == ActivityType.OPEN_TYPE_SERVER) {
|
||||
String openTime = GameApplication.serverConfig.getOpenTime();
|
||||
startTime = TimeUtils.stringToTimeLong2(openTime);
|
||||
}
|
||||
return startTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
* @return
|
||||
*/
|
||||
public long getEndTime(){
|
||||
long endTime = 0;
|
||||
SGlobalActivity activity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||
// 绝对时间
|
||||
if (activity.getTime() == ActivityType.OPEN_TYPE_TIME){
|
||||
endTime = activity.getEndTimeLong();
|
||||
}
|
||||
// 开服时间
|
||||
else if (activity.getTime() == ActivityType.OPEN_TYPE_SERVER) {
|
||||
String openTime = GameApplication.serverConfig.getOpenTime();
|
||||
long timeLong2 = TimeUtils.stringToTimeLong2(openTime);
|
||||
endTime = timeLong2 + activity.getEndTimeLong() * 1000;
|
||||
}
|
||||
return endTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证前置礼包购买状态
|
||||
* @param user
|
||||
* @param boxId
|
||||
* @return
|
||||
*/
|
||||
private boolean checkBuyAgo(User user, int boxId){
|
||||
boolean result = true;
|
||||
// 获取消息
|
||||
Map<Integer, ActivityProgressInfo> missionMap = user.getActivityManager().getActivityMissionMap().get(id).getActivityMissionMap();
|
||||
SSurpriseBox box = STableManager.getConfig(SSurpriseBox.class).get(boxId);
|
||||
// 非空
|
||||
if (!missionMap.isEmpty() && box != null){
|
||||
// 前置礼包状态验证
|
||||
ActivityProgressInfo info = missionMap.get(box.getLimitPackFId());
|
||||
// info为null代表没有前置条件, state==2代表已买过
|
||||
if (info != null && info.getState() == ActivityType.WILL_TAKE){
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测特殊权限
|
||||
* 0走默认 true
|
||||
* @param user
|
||||
* @param ruleId
|
||||
* @return
|
||||
*/
|
||||
private boolean checkRule(User user, int ruleId){
|
||||
boolean result = true;
|
||||
switch (ruleId){
|
||||
case 1:
|
||||
// 普通月卡
|
||||
result = user.getPlayerInfoManager().getMonthCard().get(Global.MONTHCARDID) != null;
|
||||
break;
|
||||
case 2:
|
||||
// 高级月卡
|
||||
result = user.getPlayerInfoManager().getMonthCard().get(Global.LMONTHCARDID) != null;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
public class FiveStarGetEvent implements IEvent {
|
||||
private int uid;
|
||||
private int heroid;
|
||||
|
||||
public FiveStarGetEvent(int uid,int heroid){
|
||||
this.uid = uid;
|
||||
this.heroid = heroid;
|
||||
}
|
||||
|
||||
public int getHeroid() {
|
||||
return heroid;
|
||||
}
|
||||
|
||||
public int getUid() {
|
||||
return uid;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.ljsd.jieling.logic.activity.event;
|
||||
|
||||
/**
|
||||
* @Author hj
|
||||
* @Date 2021/5/26 11:05
|
||||
* @Description:
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class SuperBoxEvent implements IEvent {
|
||||
|
||||
private int userId;
|
||||
private int giftId = -1;//礼包id
|
||||
|
||||
public SuperBoxEvent(int userId, int giftId) {
|
||||
this.userId = userId;
|
||||
this.giftId = giftId;
|
||||
}
|
||||
|
||||
public int getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(int userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public int getGiftId() {
|
||||
return giftId;
|
||||
}
|
||||
|
||||
public void setGiftId(int giftId) {
|
||||
this.giftId = giftId;
|
||||
}
|
||||
|
||||
}
|
|
@ -11,6 +11,7 @@ import com.ljsd.jieling.logic.dao.UserManager;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.NewRechargeInfo;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.PushRechargeType;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
|
@ -36,6 +37,6 @@ public class HeroFiveStarGetEventHandler implements IEventHandler {
|
|||
int star = ((HeroFiveStarGetEvent) event).getStar();
|
||||
int num = ((HeroFiveStarGetEvent) event).getNum();
|
||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||
BuyGoodsNewLogic.openPush(session,user,4,star,num);
|
||||
BuyGoodsNewLogic.openPush(session,user, PushRechargeType.card_star.getType(),star,num);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.ljsd.jieling.logic.activity.event.PokemonFiveStarGetEvent;
|
|||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.PushRechargeType;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
||||
public class PokemonFiveStarGetEventHandler implements IEventHandler {
|
||||
|
@ -20,6 +21,6 @@ public class PokemonFiveStarGetEventHandler implements IEventHandler {
|
|||
int star = ((PokemonFiveStarGetEvent) event).getStar();
|
||||
int num = ((PokemonFiveStarGetEvent) event).getNum();
|
||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||
BuyGoodsNewLogic.openPush(session,user,8,star,num);
|
||||
BuyGoodsNewLogic.openPush(session,user, PushRechargeType.pokemon_quality.getType(),star,num);
|
||||
}
|
||||
}
|
|
@ -444,10 +444,13 @@ public class ChampionshipLogic {
|
|||
costs[0] = new int[2];
|
||||
costs[0][0] = arenaItemId;
|
||||
costs[0][1] = itemNum;
|
||||
// Map<Integer, Long> itemReward = new HashMap<>(1);
|
||||
// itemReward.put(rewardItemId, (long) (itemNum / sChampionshipSetting.getExchangeItem()));
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("champion_bet_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("champion_bet_content");
|
||||
MailLogic.getInstance().sendMail(user.getId(),title,content,rewardItemId+"#"+(itemNum / sChampionshipSetting.getExchangeItem()),TimeUtils.nowInt(),Global.MAIL_EFFECTIVE_TIME);
|
||||
ItemUtil.itemCost(user, costs, BIReason.CHAMPIONM_EXCHANGE_CONSUME, sendId);
|
||||
Map<Integer, Long> itemReward = new HashMap<>(1);
|
||||
itemReward.put(rewardItemId, (long) (itemNum / sChampionshipSetting.getExchangeItem()));
|
||||
ItemUtil.addItem(user, itemReward, null, BIReason.CHAMPIONM_EXCHANGE_REWARD);
|
||||
// ItemUtil.addItem(user, itemReward, null, BIReason.CHAMPIONM_EXCHANGE_REWARD);
|
||||
}
|
||||
LOGGER.info("the uid={},send rewardnum={}", itemNum / sChampionshipSetting.getExchangeItem());
|
||||
|
||||
|
|
|
@ -30,6 +30,7 @@ public class HeroManager extends MongoBase {
|
|||
|
||||
private Map<Integer,Integer> heroHandBook = new HashMap<>();
|
||||
private Set<Integer> heroHandBookEnabled = new HashSet<>();
|
||||
private Map<Integer,Integer> heroStarMap = new HashMap<>();
|
||||
|
||||
|
||||
private Map<String,Hero> endlessHeroInfo = new HashMap<>();
|
||||
|
@ -96,6 +97,7 @@ public class HeroManager extends MongoBase {
|
|||
updateString("heroMap." + hero.getId(), hero);
|
||||
heroMap.put(hero.getId(), hero);
|
||||
addHeroHandBook(hero.getTemplateId(),hero.getStar());
|
||||
addHeroStar(hero.getTemplateId(),hero.getStar());
|
||||
}
|
||||
|
||||
public Hero getHero(String heroId) {
|
||||
|
@ -136,6 +138,18 @@ public class HeroManager extends MongoBase {
|
|||
return heroHandBook;
|
||||
}
|
||||
|
||||
public void addHeroStar(int heroId,int star){
|
||||
if(heroStarMap.getOrDefault(heroId,0) >= star){
|
||||
return;
|
||||
}
|
||||
heroStarMap.put(heroId,Math.max(heroStarMap.getOrDefault(heroId,0),star));
|
||||
updateString("heroStarMap." + heroId, star);
|
||||
}
|
||||
|
||||
public Map<Integer,Integer> getHeroStarMap(){
|
||||
return heroStarMap;
|
||||
}
|
||||
|
||||
public int getFirstTenth() {
|
||||
return firstTenth;
|
||||
}
|
||||
|
|
|
@ -625,7 +625,7 @@ public class GuildLogic {
|
|||
}
|
||||
targetUser.getGuildMyInfo().setJoinTime(TimeUtils.nowInt());
|
||||
ReportUtil.onReportEvent(targetUser, ReportEventEnum.JOIN_GUILD.getType(),String.valueOf(guildInfo.getId()),guildInfo.getName(),guildInfo.getLevel(),guildInfo.getTotalMembers());
|
||||
sendNewGuyRedPacket(guildInfo);
|
||||
sendNewGuyRedPacket(guildInfo,applyId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -669,7 +669,7 @@ public class GuildLogic {
|
|||
guildInfo.removeDefendInfo(targetUid);
|
||||
}
|
||||
targetUser.getPlayerInfoManager().setGuildId(0);
|
||||
targetUser.getPlayerInfoManager().setWelfareRedPackets(new HashMap<Integer,Integer>());
|
||||
targetUser.getPlayerInfoManager().setWelfareRedPackets(clearRedPacketMap(user));
|
||||
targetUser.getGuildMyInfo().clearOfLevelGuild();
|
||||
addGuildLog(guildInfo.getId(),GuildDef.Log.KICK,targetUser.getPlayerInfoManager().getNickName());
|
||||
// Family.FamilyKickIndication build = Family.FamilyKickIndication.newBuilder().setType(1).build();
|
||||
|
@ -944,7 +944,7 @@ public class GuildLogic {
|
|||
RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(uid),cache);
|
||||
guildInfo.removeMember(uidType,uid);
|
||||
user.getPlayerInfoManager().setGuildId(0);
|
||||
user.getPlayerInfoManager().setWelfareRedPackets(new HashMap<Integer,Integer>());
|
||||
user.getPlayerInfoManager().setWelfareRedPackets(clearRedPacketMap(user));
|
||||
user.getGuildMyInfo().clearOfLevelGuild();
|
||||
addGuildLog(guildInfo.getId(),GuildDef.Log.LEVEL,user.getPlayerInfoManager().getNickName());
|
||||
MessageUtil.sendMessage(session,1,msgId,null,true);
|
||||
|
@ -1227,6 +1227,7 @@ public class GuildLogic {
|
|||
* @throws Exception
|
||||
*/
|
||||
public static void addWelfareRedPacket(int uid,int redId) throws Exception {
|
||||
LOGGER.info("添加福利礼包,uid:{},redId:{}",uid,redId);
|
||||
User user = UserManager.getUser(uid);
|
||||
SGuildRedPackConfig config = SGuildRedPackConfig.sGuildRedPackConfigMap.get(redId);
|
||||
if(config==null || config.getBaseType() != 2){
|
||||
|
@ -1259,9 +1260,12 @@ public class GuildLogic {
|
|||
});
|
||||
for(SGuildRedPackConfig c : serise){
|
||||
if(config.getGroupId() == 1){
|
||||
Integer state = redPacketsMap.get(c.getRuleId()[0]);
|
||||
if(state != null && c.getId() == config.getId()){
|
||||
redPacketsMap.put(c.getRuleId()[0],1);
|
||||
Integer state = redPacketsMap.get(c.getId());
|
||||
if(state != null && state == -1){
|
||||
continue;
|
||||
}
|
||||
if(c.getId() == config.getId()){
|
||||
redPacketsMap.put(c.getId(),1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -1272,7 +1276,6 @@ public class GuildLogic {
|
|||
if(c.getId() == config.getId()){
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}else{
|
||||
if(c.getId() == config.getId()){
|
||||
redPacketsMap.put(config.getId(),1);
|
||||
|
@ -1289,8 +1292,8 @@ public class GuildLogic {
|
|||
}
|
||||
|
||||
public static void sendWelfareRedPacketInfo(User user){
|
||||
Map<Integer,Integer> redPacketsMap = user.getPlayerInfoManager().getWelfareRedPackets();
|
||||
initWelfareRedPacketInfo(user);
|
||||
Map<Integer,Integer> redPacketsMap = user.getPlayerInfoManager().getWelfareRedPackets();
|
||||
PlayerInfoProto.WelfareRedPacketPush.Builder build = PlayerInfoProto.WelfareRedPacketPush.newBuilder();
|
||||
for(Map.Entry<Integer,Integer> entry : redPacketsMap.entrySet()){
|
||||
if(entry.getValue() >= 0){
|
||||
|
@ -1321,25 +1324,9 @@ public class GuildLogic {
|
|||
for(SGuildRedPackConfig config : SGuildRedPackConfig.sWelfareRedPackByRule.values()){
|
||||
if(redPacketsMap.containsKey(config.getId()))
|
||||
continue;
|
||||
if(config.getRuleType() == 3){
|
||||
if(config.getGroupId() == 2){
|
||||
int num = user.getMapManager().getLastMonsterAttack();
|
||||
for(SGuildRedPackConfig config1 : SGuildRedPackConfig.welfareRedPackBySerise.get(config.getRuleId()[0])){
|
||||
if(num >= config1.getRuleId()[1]){
|
||||
redPacketsMap.put(config.getId(),1);
|
||||
}else{
|
||||
redPacketsMap.put(config.getId(),0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(config.getId()==SGuildRedPackConfig.welfareRedPackBySerise.get(config.getRuleId()[0]).get(0).getId())
|
||||
redPacketsMap.put(config.getId(),0);
|
||||
}
|
||||
}else{
|
||||
redPacketsMap.put(config.getId(),0);
|
||||
}
|
||||
redPacketsMap.put(config.getId(),0);
|
||||
}
|
||||
user.getPlayerInfoManager().setWelfareRedPackets(redPacketsMap);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1445,7 +1432,7 @@ public class GuildLogic {
|
|||
}
|
||||
}
|
||||
RedPackage packInfo = RedisUtil.getInstence().getMapValue(RedisKey.FAMILY_RED_PACKAGE, String.valueOf(guildId), String.valueOf(redId), RedPackage.class);
|
||||
PlayerManager playerInfoManager = UserManager.getUser(session.getUid()).getPlayerInfoManager();
|
||||
PlayerManager playerInfoManager = UserManager.getUser(packInfo.getUid()).getPlayerInfoManager();
|
||||
builder.setSendName(playerInfoManager.getNickName())
|
||||
.setHead(playerInfoManager.getHead())
|
||||
.setHeadFrame(playerInfoManager.getHeadFrame())
|
||||
|
@ -1728,18 +1715,18 @@ public class GuildLogic {
|
|||
return true;
|
||||
}
|
||||
|
||||
private static void sendNewGuyRedPacket(GuildInfo guildInfo) throws Exception{
|
||||
private static void sendNewGuyRedPacket(GuildInfo guildInfo,int userId) throws Exception{
|
||||
for(int id : guildInfo.getMembers().get(GlobalsDef.CHAIRMAN)){
|
||||
User user = UserManager.getUser(id);
|
||||
if(user == null)
|
||||
User chairman = UserManager.getUser(id);
|
||||
if(chairman == null)
|
||||
continue;
|
||||
if(guildInfo.getHistoryMember().contains(user.getId())){
|
||||
if(guildInfo.getHistoryMember().contains(userId)){
|
||||
return;
|
||||
}else{
|
||||
guildInfo.getHistoryMember().add(user.getId());
|
||||
guildInfo.getHistoryMember().add(userId);
|
||||
guildInfo.updateHistoryMember();
|
||||
}
|
||||
Poster.getPoster().dispatchEvent(new WelfareRedPackEvent(user.getId(), WelfareRedPacketType.newfish_come.getType(),0));
|
||||
Poster.getPoster().dispatchEvent(new WelfareRedPackEvent(chairman.getId(), WelfareRedPacketType.newfish_come.getType(),0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1753,4 +1740,16 @@ public class GuildLogic {
|
|||
}
|
||||
}
|
||||
|
||||
private static Map<Integer,Integer> clearRedPacketMap(User user){
|
||||
Map<Integer,Integer> map = user.getPlayerInfoManager().getWelfareRedPackets();
|
||||
for(Map.Entry<Integer,Integer> entry : map.entrySet()){
|
||||
if(entry.getValue().intValue() == -1){
|
||||
continue;
|
||||
}else{
|
||||
entry.setValue(0);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,10 +11,8 @@ import com.ljsd.jieling.logic.dao.root.User;
|
|||
import com.ljsd.jieling.logic.fight.specialparm.SpecialForTeamBuildEnum;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemMap;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import com.sun.codemodel.internal.JForEach;
|
||||
import config.*;
|
||||
import org.assertj.core.util.Lists;
|
||||
import org.slf4j.Logger;
|
||||
|
@ -24,12 +22,8 @@ import rpc.protocols.MessageTypeProto;
|
|||
import rpc.protocols.PlayerInfoProto;
|
||||
import util.StringUtil;
|
||||
|
||||
import javax.swing.text.StyledEditorKit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class HardStageLogic {
|
||||
|
||||
|
@ -49,6 +43,30 @@ public class HardStageLogic {
|
|||
CommonProto.HardStageInfo.Builder builder = CommonProto.HardStageInfo.newBuilder();
|
||||
int needSaveChapterId = 0;
|
||||
int needSaveStarNum = 0;
|
||||
//对策划改表的容错
|
||||
//int maxChapter = map.keySet().stream().mapToInt(Integer::intValue).max().getAsInt();
|
||||
OptionalInt maxChapter = map.keySet().stream().mapToInt(Integer::intValue).max();
|
||||
if(maxChapter.isPresent()){
|
||||
if(map.containsKey(maxChapter.getAsInt())){
|
||||
int maxId = map.get(maxChapter.getAsInt()).getNodeList().stream().mapToInt(n->n.getId()).max().getAsInt();
|
||||
|
||||
if(map.get(maxChapter.getAsInt()).getNodeList().stream().filter(n -> n.getId()== maxId&& n.isHasPass()==true).collect(Collectors.toList()).size()>0){
|
||||
SHardStage config = SHardStage.getConfigMap().get(maxId);
|
||||
if(config != null){
|
||||
if (SHardStage.getPreList(config.getId()) != null) {
|
||||
SHardStage.getPreList(config.getId()).stream().forEach(n -> {
|
||||
if (n != null) {
|
||||
if(user.getHardStageManager().openNewNode(user.getPlayerInfoManager().getLevel(), n)){
|
||||
user.getHardStageManager().updateString("chapterMap." + maxChapter.getAsInt(), map.get(maxChapter.getAsInt()));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<Integer, HardStageChapter> entry : map.entrySet()) {
|
||||
//章节信息
|
||||
CommonProto.HardStageChapter.Builder chapterBuilder = CommonProto.HardStageChapter.newBuilder();
|
||||
|
@ -209,6 +227,9 @@ public class HardStageLogic {
|
|||
buff = SHardStageBuff.getConfigMap().get(nodeConfig.getHardStageBuff());
|
||||
if (buff.getType() == 2 || buff.getType() == 3) {
|
||||
skillSb.append(buff.getPassiveSkillLogic()).append("#");
|
||||
/*for (int passiveId:buff.getPassiveSkillLogic()) {
|
||||
skillSb.append(passiveId).append("#");
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -239,19 +260,16 @@ public class HardStageLogic {
|
|||
/**
|
||||
* 通过节点
|
||||
*/
|
||||
public static void passNode(ISession iSession, SHardStage nodeConfig, int[] resultNum, List<Integer> dropList) throws Exception {
|
||||
public static int passNode(ISession iSession, SHardStage nodeConfig, int[] resultNum, List<Integer> dropList) throws Exception {
|
||||
User user = UserManager.getUser(iSession.getUid());
|
||||
if (user == null) {
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
Map<Integer, HardStageChapter> chapterMap = user.getHardStageManager().getChapterMap(user);
|
||||
HardStageNode node = chapterMap.get(nodeConfig.getChapter()).getNode(nodeConfig.getId());
|
||||
int star = 0;
|
||||
if (node.getType() == 1) {//大节点
|
||||
int star = passReward(user, node, resultNum, dropList);//星级通关奖励
|
||||
//山河试炼活动
|
||||
/*if(star >0 ){
|
||||
Poster.getPoster().dispatchEvent(new HardStageExerciseEvent(iSession.getUid(),star));
|
||||
}*/
|
||||
star = passReward(user, node, resultNum, dropList);//星级通关奖励
|
||||
chapterMap.get(nodeConfig.getChapter()).addStars(star);
|
||||
if (!node.isHasPass()) {
|
||||
node.setHasPass(true);
|
||||
|
@ -276,8 +294,10 @@ public class HardStageLogic {
|
|||
updateChapterAndNodeLevel(user,nodeConfig);
|
||||
user.getHardStageManager().updateString("chapterMap." + nodeConfig.getChapter(), chapterMap.get(nodeConfig.getChapter()));
|
||||
}
|
||||
|
||||
}
|
||||
sendHardStageIndication(user);
|
||||
return star;
|
||||
}
|
||||
public static void updateChapterAndNodeLevel(User user, SHardStage nodeConfig ){
|
||||
if( nodeConfig.getChapter() >=user.getHardStageManager().getCurChapter()){
|
||||
|
|
|
@ -35,6 +35,7 @@ import com.ljsd.jieling.logic.player.PlayerLogic;
|
|||
import com.ljsd.jieling.logic.redpacket.WelfareRedPackEvent;
|
||||
import com.ljsd.jieling.logic.redpacket.WelfareRedPacketType;
|
||||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.PushRechargeType;
|
||||
import com.ljsd.jieling.network.server.ProtocolsManager;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.*;
|
||||
|
@ -1158,6 +1159,7 @@ public class HeroLogic{
|
|||
ItemUtil.itemCost(user,removeItemMap,BIReason.COMPLEX_EQUIP_CONSUME,0);
|
||||
|
||||
rankUpHeroExecute(targetHero);
|
||||
user.getHeroManager().addHeroStar(targetHero.getTemplateId(),targetHero.getStar());
|
||||
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),targetHero.getTemplateId(),targetHero.getStar()));
|
||||
|
||||
targetHero.setStarBreakId(scHeroRankUpConfig.getId());
|
||||
|
@ -3702,7 +3704,7 @@ public class HeroLogic{
|
|||
consumeBuilder.append(consume[0]).append("#").append(consume[1]);
|
||||
}
|
||||
ReportUtil.onReportEvent(user,ReportEventEnum.BEAST_STAR.getType(),pokemon.getTmpId(),oldStar,pokemon.getStar(),consumeBuilder.toString());
|
||||
BuyGoodsNewLogic.openPush(session,user,9,pokemon.getStar(),1);
|
||||
BuyGoodsNewLogic.openPush(session,user, PushRechargeType.pokemon_star.getType(),pokemon.getStar(),1);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.ljsd.jieling.logic.mission.main.MissionStateChangeInfo;
|
|||
import com.ljsd.jieling.logic.redpacket.WelfareRedPackEvent;
|
||||
import com.ljsd.jieling.logic.redpacket.WelfareRedPacketType;
|
||||
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.PushRechargeType;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -26,7 +27,7 @@ public class UserLevelEventProcessor implements BaseGameEventProcessor{
|
|||
int upLevel = (int)parm[1];
|
||||
|
||||
ISession session = OnlineUserManager.getSessionByUid(user.getId());
|
||||
BuyGoodsNewLogic.openPush(session,user,3,upLevel,0);
|
||||
BuyGoodsNewLogic.openPush(session,user, PushRechargeType.user_level.getType(),upLevel,0);
|
||||
BuyGoodsNewLogic.sendGiftGooodsIndication(user.getId());
|
||||
Poster.getPoster().dispatchEvent(new WelfareRedPackEvent(user.getId(), WelfareRedPacketType.player_level.getType(),upLevel));
|
||||
}
|
||||
|
|
|
@ -16,10 +16,7 @@ import com.ljsd.jieling.logic.GlobalDataManaager;
|
|||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||
import com.ljsd.jieling.logic.activity.event.BuyGoodsDirectEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.NewWelfareEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.NewWelfareTypeEnum;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.*;
|
||||
import com.ljsd.jieling.logic.dao.PlayerManager;
|
||||
import com.ljsd.jieling.logic.dao.RechargeInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
|
@ -31,6 +28,7 @@ import com.ljsd.jieling.logic.mail.MailLogic;
|
|||
import com.ljsd.jieling.logic.mission.GameEvent;
|
||||
import com.ljsd.jieling.logic.player.PlayerLogic;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.NewRechargeInfo;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.PushRechargeType;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.RechargeType;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.*;
|
||||
import com.ljsd.jieling.logic.store.newRechargeInfo.rechargeHandler.RechargeHandler;
|
||||
|
@ -172,7 +170,7 @@ public class BuyGoodsNewLogic {
|
|||
double priceTemp =config.getPrice();
|
||||
int cfgType = SSpecialConfig.getIntegerValue(SSpecialConfig.EXCHANGE_FORCE_TYPE);
|
||||
double price = priceTemp==0?0: SExchangeRate.doubleIntegerHashMap.get(cfgType).get((int)priceTemp);
|
||||
if(amount!=-999&&!MathUtils.doubleEquals(amount,price * 100)){
|
||||
if(amount!=-999&&!MathUtils.doubleEquals(amount,price * 100)&&!"support-order".equals(orderId)){
|
||||
resultRes.setResultCode(0);
|
||||
resultRes.setResultMsg("charge count error");
|
||||
LOGGER.error("charge count error, uid={},the goodId={}, currentPrice={},realPrice={}",uid,goodsId, amount,price);
|
||||
|
@ -220,6 +218,9 @@ public class BuyGoodsNewLogic {
|
|||
//活动
|
||||
user.getPlayerInfoManager().setRechargedaily(user.getPlayerInfoManager().getRechargedaily()+price);
|
||||
changeActivity(user,price,info);
|
||||
|
||||
// 惊喜礼盒,事件推送
|
||||
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),config.getId()));
|
||||
}
|
||||
if(!info.getIsFirst()){
|
||||
info.setIsFirst(true);
|
||||
|
@ -239,7 +240,7 @@ public class BuyGoodsNewLogic {
|
|||
notifyPaySuccessFul(uid,goodsId,amount != -999);
|
||||
MongoUtil.getLjsdMongoTemplate().lastUpdate();
|
||||
sendGiftGoodsWithoutJudge(uid);
|
||||
|
||||
openPush(session,user, PushRechargeType.point_recharge.getType(),goodsId,1);
|
||||
// 扶持订单不需要上报
|
||||
if(price>0 && !orderId.equals("support-order")){
|
||||
// 以下为充值上报
|
||||
|
@ -502,12 +503,10 @@ public class BuyGoodsNewLogic {
|
|||
}else{
|
||||
boolean open = true;
|
||||
if(System.currentTimeMillis() > bag.getStartTime()){
|
||||
if(bag.getType() != RechargeType.timeLimit.getType()){
|
||||
for(String[] con : bag.getCondition()){
|
||||
if(!judgeOpen(con,user)){
|
||||
open = false;
|
||||
break;
|
||||
}
|
||||
for(String[] con : bag.getCondition()){
|
||||
if(!judgeOpen(con,user)){
|
||||
open = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else {
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
package com.ljsd.jieling.logic.store.newRechargeInfo;
|
||||
|
||||
public enum PushRechargeType {
|
||||
main_line(1),
|
||||
tower(2),
|
||||
user_level(3),
|
||||
card_star(4),
|
||||
fail(5),
|
||||
tower_fail(6),
|
||||
once_pay(7),
|
||||
pokemon_quality(8),
|
||||
pokemon_star(9),
|
||||
point_recharge(10),
|
||||
;
|
||||
|
||||
private int type;
|
||||
|
||||
PushRechargeType(int type){
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
}
|
|
@ -29,7 +29,7 @@ public class ThreadManager implements IManager {
|
|||
private static MongoDataHandlerTask mongoDataHandlerTask;
|
||||
private static ItemLogTask itemLogTask;
|
||||
public static int SLEEP_INTEVAL_TIME = 60; //每1分钟检查一次
|
||||
private static OnlineUserTapTask onlineUserTapTask;//5分钟上报一次
|
||||
//private static OnlineUserTapTask onlineUserTapTask;//5分钟上报一次
|
||||
|
||||
private static Set<Future<?>> scheduledFutureSets = new HashSet<>();
|
||||
|
||||
|
@ -42,13 +42,13 @@ public class ThreadManager implements IManager {
|
|||
mongoDataHandlerTask = ConfigurableApplicationContextManager.getBean(MongoDataHandlerTask.class);
|
||||
dataReportTask = ConfigurableApplicationContextManager.getBean(DataReportTask.class);
|
||||
itemLogTask = ConfigurableApplicationContextManager.getBean(ItemLogTask.class);
|
||||
onlineUserTapTask = ConfigurableApplicationContextManager.getBean(OnlineUserTapTask.class);
|
||||
//onlineUserTapTask = ConfigurableApplicationContextManager.getBean(OnlineUserTapTask.class);
|
||||
|
||||
new RetrySendIndicationThread("retry-indi").start();
|
||||
mongoDataHandlerTask.start();
|
||||
dataReportTask.start();
|
||||
itemLogTask.start();
|
||||
onlineUserTapTask.start();
|
||||
//onlineUserTapTask.start();
|
||||
|
||||
scheduledExecutor = new ScheduledThreadPoolExecutor(8, new ScheduleThreadFactory());
|
||||
scheduledExecutor.setExecuteExistingDelayedTasksAfterShutdownPolicy(false);
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
package com.ljsd.jieling.thread.task;
|
||||
|
||||
import com.ljsd.GameApplication;
|
||||
import com.ljsd.jieling.config.reportData.DataMessageUtils;
|
||||
import com.ljsd.jieling.ktbeans.OnlineProp;
|
||||
import com.ljsd.jieling.ktbeans.OnlineUserCalEvent;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.ktbeans.sendbeans.ReportServerEvent;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
|
@ -8,7 +11,7 @@ import com.ljsd.jieling.logic.dao.UserManager;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import util.TimeUtils;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
@ -30,6 +33,16 @@ public class OnlineUserReportTask extends Thread {
|
|||
@Override
|
||||
public void run() {
|
||||
try{
|
||||
//5分钟上报一次
|
||||
if(TimeUtils.getMiunte()%5 == 0){
|
||||
int serverId = GameApplication.serverId;
|
||||
Set<Integer> uids = OnlineUserManager.sessionMap.keySet();
|
||||
OnlineUserCalEvent onlineUserCalEvent = new OnlineUserCalEvent();
|
||||
onlineUserCalEvent.setAppid(GameApplication.serverProperties.getAppId()==null?"APPID":GameApplication.serverProperties.getAppId());
|
||||
onlineUserCalEvent.setOnlines(new OnlineProp[]{new OnlineProp(String.valueOf(serverId),uids.size(), TimeUtils.now()/1000)});
|
||||
DataMessageUtils.sendOnlinePost(onlineUserCalEvent);
|
||||
}
|
||||
|
||||
Set<Integer> uids = OnlineUserManager.sessionMap.keySet();
|
||||
Map<String,Integer> channelMap = new HashMap<>();
|
||||
for(int uid:uids){
|
||||
|
|
|
@ -464,6 +464,9 @@ public class CBean2Proto {
|
|||
SHardStageBuff buff = SHardStageBuff.getConfigMap().get(nodeConfig.getHardStageBuff());
|
||||
if(buff.getType()==1 || buff.getType()==3){
|
||||
monsterSkillList.append(buff.getPassiveSkillLogic()).append("#");
|
||||
/*for (int passiveId:buff.getPassiveSkillLogic()) {
|
||||
monsterSkillList.append(passiveId).append("#");
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,10 +20,7 @@ import com.ljsd.jieling.ktbeans.ReportUtil;
|
|||
import com.ljsd.jieling.ktbeans.parmsBean.ParamEventBean;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||
import com.ljsd.jieling.logic.activity.event.HeroFiveStarGetEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.UseItemEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.UserLevelEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.*;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.hero.HeroLogic;
|
||||
|
@ -1262,6 +1259,7 @@ public class ItemUtil {
|
|||
SItem sItem = SItem.getsItemMap().get(entry.getKey());
|
||||
extraDropAop(user,dropBuilder,sItem);
|
||||
}
|
||||
fiveStarEvent(user,entry.getKey());
|
||||
if(reason != BIReason.HERO_RANDOM){
|
||||
fiveStarPushByCombine(user,entry.getKey(),count);
|
||||
}
|
||||
|
@ -1728,4 +1726,11 @@ public class ItemUtil {
|
|||
}
|
||||
}
|
||||
|
||||
public static void fiveStarEvent(User user,int itemId){
|
||||
SCHero scHero = SCHero.getsCHero().get(itemId);
|
||||
if(scHero != null && scHero.getStar()==5){
|
||||
Poster.getPoster().dispatchEvent(new FiveStarGetEvent(user.getId(),itemId));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -497,6 +497,7 @@ public class MessageUtil {
|
|||
if(url == null){
|
||||
return v3;
|
||||
}
|
||||
LOGGER.info("天眼封禁userId:{},zonId:{},content:{},URL:{}",me.getId(),String.valueOf(GameApplication.serverId),msg,url);
|
||||
skyEyeExtraMap.put("url",url);
|
||||
v3.setExtra(JSON.toJSONString(skyEyeExtraMap));
|
||||
return v3;
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
package config;
|
||||
|
||||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Table(name ="SurpriseBox")
|
||||
public class SSurpriseBox implements BaseConfig {
|
||||
|
||||
private int id;
|
||||
|
||||
private int activityId;
|
||||
|
||||
private int packId;
|
||||
|
||||
private int unlockDay;
|
||||
|
||||
private int visibleDay;
|
||||
|
||||
private int viewDay;
|
||||
|
||||
private int buyDay;
|
||||
|
||||
private int limitPackFId;
|
||||
|
||||
private int limitPackBId;
|
||||
|
||||
private int rule;
|
||||
|
||||
/**
|
||||
* key: 活动id value: 对象list
|
||||
*/
|
||||
public static Map<Integer, Map<Integer,SSurpriseBox>> map = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SSurpriseBox> config = STableManager.getConfig(SSurpriseBox.class);
|
||||
config.values().forEach(v->{
|
||||
Map<Integer, SSurpriseBox> boxMap = map.getOrDefault(v.getActivityId(), new HashMap<>());
|
||||
boxMap.put(v.getId(),v);
|
||||
map.put(v.getActivityId(),boxMap);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public int getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
public int getPackId() {
|
||||
return packId;
|
||||
}
|
||||
|
||||
public int getVisibleDay() {
|
||||
return visibleDay;
|
||||
}
|
||||
|
||||
public int getBuyDay() {
|
||||
return buyDay;
|
||||
}
|
||||
|
||||
public int getLimitPackFId() {
|
||||
return limitPackFId;
|
||||
}
|
||||
|
||||
public int getLimitPackBId() {
|
||||
return limitPackBId;
|
||||
}
|
||||
|
||||
public int getRule() {
|
||||
return rule;
|
||||
}
|
||||
|
||||
public int getUnlockDay() {
|
||||
return unlockDay;
|
||||
}
|
||||
|
||||
public int getViewDay() {
|
||||
return viewDay;
|
||||
}
|
||||
}
|
|
@ -3,9 +3,7 @@ package config;
|
|||
import manager.STableManager;
|
||||
import manager.Table;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
import java.util.*;
|
||||
|
||||
@Table(name ="WishActivityPool")
|
||||
public class SWishActivityPool implements BaseConfig {
|
||||
|
@ -16,17 +14,31 @@ public class SWishActivityPool implements BaseConfig {
|
|||
|
||||
private int getRate;
|
||||
|
||||
public static Map<Integer,Integer> weight = new TreeMap<>();
|
||||
private int camp;
|
||||
|
||||
public static Map<Integer,Map<Integer,Integer>> weight = new TreeMap<>();
|
||||
|
||||
public static Map<Integer,SWishActivityPool> map = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
Map<Integer, SWishActivityPool> config = STableManager.getConfig(SWishActivityPool.class);
|
||||
List<Integer> allCamp = new ArrayList<>(10);
|
||||
Map<Integer,Map<Integer,Integer>> mapTemp = new HashMap<>();
|
||||
config.values().forEach(v->{
|
||||
map.put(v.getId(),v);
|
||||
weight.put(v.getId(),v.getGetRate());
|
||||
//weight修改成只有当前卡池和对应权重
|
||||
if(v.getCamp()!=0){
|
||||
mapTemp.putIfAbsent(v.getCamp(),new HashMap<>());
|
||||
mapTemp.get(v.getCamp()).put(v.getId(),v.getGetRate());
|
||||
}else{
|
||||
allCamp.add(v.getId());
|
||||
}
|
||||
});
|
||||
//把通用系的的放进去
|
||||
allCamp.forEach(i->mapTemp.forEach((k,v)->v.put(i,map.get(i).getGetRate())));
|
||||
//最后再赋值
|
||||
weight = mapTemp;
|
||||
}
|
||||
|
||||
|
||||
|
@ -42,5 +54,7 @@ public class SWishActivityPool implements BaseConfig {
|
|||
return getRate;
|
||||
}
|
||||
|
||||
|
||||
public int getCamp() {
|
||||
return camp;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue