增加开服冲榜活动

master_yuenan
DESKTOP-C3M45P4\dengdan 2025-03-31 21:41:24 +08:00
parent 7d1a45d045
commit 3801f5f97a
5 changed files with 67 additions and 3 deletions

View File

@ -5,8 +5,11 @@ import com.ljsd.jieling.exception.ErrorCodeException;
import com.ljsd.jieling.exception.ErrorTableException;
import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.handler.BaseHandler;
import com.ljsd.jieling.logic.activity.event.OpenServerActivityEvent;
import com.ljsd.jieling.logic.activity.event.Poster;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.rank.RankEnum;
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.util.ItemUtil;
@ -46,7 +49,8 @@ public class MoneyBuyGiftHandler extends BaseHandler<PlayerInfoProto.GmBuyGoodRe
// 走礼包逻辑发送奖励
BuyGoodsNewLogic.moneyBuyGoods(iSession, goodsId);
int money = config.getOtherBuy1()[0][1];
//开服冲榜
Poster.getPoster().dispatchEvent(new OpenServerActivityEvent(user.getId(),money, RankEnum.MONEY_RANK.getType()));
}
}

View File

@ -30,6 +30,7 @@ import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.mission.MissionType;
import com.ljsd.jieling.logic.mission.event.MissionEventDistributor;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.logic.rank.RankEnum;
import com.ljsd.jieling.logic.store.StoreLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.tools.Utils;
@ -1680,6 +1681,8 @@ public class ActivityLogic implements IEventHandler{
int choiceRewardId = user.getActivityManager().getActivityMissionMap().get(activityId).getChoiceRewardIdByActivity(activityId);
//限时招募 计次数
user.getUserMissionManager().onGameEvent(user, GameEvent.ONE_MISSION_TYPE_CONSUME, MissionType.LIMIT_TIME_CHOICE_CARD, num);
//冲榜活动
Poster.getPoster().dispatchEvent(new OpenServerActivityEvent(user.getId(),num, RankEnum.XUNXIAN_RANK.getType()));
List<String> list = rewardArrayToList(markRewards);
ReportUtil.onReportEvent(user, ReportEventEnum.CHOICE_DRAW_CARD.getType(), choiceRewardId, num, markReward[0], markReward[1], list);
// 返回奖励信息

View File

@ -59,6 +59,12 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
heroStarHandle(user);
}else if(rankType == RankEnum.MONEY_RANK.getType()){
moneyHandle(user,event1.getCost(),id);
}else if(rankType == RankEnum.XUNXIAN_RANK.getType()){
xunxianHandle(user,event1.getCost(),id);
}else if(rankType == RankEnum.FABAO_RANK.getType()){
fabaoHandle(user,event1.getCost(),id);
}else if(rankType == RankEnum.HERO_RANK.getType()){
heroHandle(user,event1.getCost(),id);
}else{
}
@ -107,10 +113,53 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
}
AbstractRank rank = RankContext.getRankEnum(RankEnum.MONEY_RANK.getType());
int score = (int)rank.getScoreById(user.getId(),"");
if(score < 0){
score = 0;
}
int scoreCompute = score + money;
rank.addRank(user.getId(),"", scoreCompute);
}
/**
*
* @param user
*/
public static void heroHandle(User user,int cost,int actId){
if(cost <= 0){
return;
}
if(!isOpen(RankEnum.HERO_RANK.getType(),actId)){
return;
}
AbstractRank rank = RankContext.getRankEnum(RankEnum.HERO_RANK.getType());
int score = (int)rank.getScoreById(user.getId(),"");
if(score < 0){
score = 0;
}
int scoreCompute = score + cost;
rank.addRank(user.getId(),"", scoreCompute);
}
/**
*
* @param user
*/
public static void xunxianHandle(User user,int cost,int actId){
if(cost <= 0){
return;
}
if(!isOpen(RankEnum.XUNXIAN_RANK.getType(),actId)){
return;
}
AbstractRank rank = RankContext.getRankEnum(RankEnum.XUNXIAN_RANK.getType());
int score = (int)rank.getScoreById(user.getId(),"");
if(score < 0){
score = 0;
}
int scoreCompute = score + cost;
rank.addRank(user.getId(),"", scoreCompute);
}
/**
*
* @param user
@ -124,6 +173,9 @@ public class OpenServerCompeteRankActivity extends AbstractActivity {
}
AbstractRank rank = RankContext.getRankEnum(RankEnum.FABAO_RANK.getType());
int score = (int)rank.getScoreById(user.getId(),"");
if(score < 0){
score = 0;
}
int scoreCompute = score + cost;
rank.addRank(user.getId(),"", scoreCompute);
}

View File

@ -123,11 +123,11 @@ public class WeekCardLogic {
public void getWeekCardReward(User user, PlayerInfoProto.GetWeekCardRewardRequest proto) throws Exception {
Map<Integer, Integer> map = user.getPlayerInfoManager().getWeekCard().get(proto.getWeekcardId());
if (map == null){
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE,"卡id不存在"+proto.getWeekcardId());
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE,"卡id不存在"+proto.getWeekcardId());
}
SWeekcardConfig weekcardConfig = STableManager.getConfig(SWeekcardConfig.class).get(proto.getWeekcardId());
if (weekcardConfig == null){
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE,"卡id不存在配置表"+proto.getWeekcardId());
throw new ErrorCodeException(ErrorCode.SERVER_DEFINE,"卡id不存在配置表"+proto.getWeekcardId());
}
// 配置表

View File

@ -39,6 +39,7 @@ import com.ljsd.jieling.logic.mail.MailLogic;
import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.mission.MissionType;
import com.ljsd.jieling.logic.player.PlayerLogic;
import com.ljsd.jieling.logic.rank.RankEnum;
import com.ljsd.jieling.logic.redpacket.WelfareRedPackEvent;
import com.ljsd.jieling.logic.redpacket.WelfareRedPacketType;
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
@ -748,6 +749,8 @@ public class HeroLogic {
.iterator().next().getCount() -
user.getHeroManager().getRandomPoolByType().getOrDefault(11, new HashMap<>()).getOrDefault(7, 0);
builder.setMustCount(heroRandomCount);
//冲榜活动
Poster.getPoster().dispatchEvent(new OpenServerActivityEvent(user.getId(),perCount, RankEnum.HERO_RANK.getType()));
}
// 法宝卡池类型
if (sLotterySetting.getLotteryType() == 4) {
@ -755,6 +758,8 @@ public class HeroLogic {
.iterator().next().getCount() -
user.getHeroManager().getRandomPoolByType().getOrDefault(23, new HashMap<>()).getOrDefault(151, 0);
builder.setFabaoMustCount(fabaoRandomCount);
//冲榜活动
Poster.getPoster().dispatchEvent(new OpenServerActivityEvent(user.getId(),perCount, RankEnum.FABAO_RANK.getType()));
}
user.getUserMissionManager().onGameEvent(user, GameEvent.RANDOM_HERO, sLotterySetting.getLotteryType(), perCount);