Merge branch 'master_test_gn' into 开发/dev_dh
commit
91c2a4bf0c
|
|
@ -107,6 +107,7 @@ public interface ActivityType {
|
||||||
int DAILY_PREFERENTIAL_GIFT = 89;//每日特惠礼包开启的活动
|
int DAILY_PREFERENTIAL_GIFT = 89;//每日特惠礼包开启的活动
|
||||||
int NEW_RECHARGE_SUM_DAY_6 = 90;//新积天豪礼6元充值活动
|
int NEW_RECHARGE_SUM_DAY_6 = 90;//新积天豪礼6元充值活动
|
||||||
int NEW_RECHARGE_SUM_DAY_30 = 92;//新积天豪礼30元充值活动
|
int NEW_RECHARGE_SUM_DAY_30 = 92;//新积天豪礼30元充值活动
|
||||||
|
int NEW_DAILY_RECHARGE = 93;//新每日充值
|
||||||
int SPECIAL_MONSTER_RANDOM_ACTIVITY = 100;//灵兽宝阁活动
|
int SPECIAL_MONSTER_RANDOM_ACTIVITY = 100;//灵兽宝阁活动
|
||||||
int SPECIAL_MONSTER_GIFT_ACTIVITY = 101;//灵兽礼包
|
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),//新积天豪礼
|
NEW_RECHARGE_SUM_DAY_30(ActivityType.NEW_RECHARGE_SUM_DAY_30,NewRechargeSumDayActivity::new),//新积天豪礼
|
||||||
DAILY_PREFERENTIAL_GIFT(ActivityType.DAILY_PREFERENTIAL_GIFT,DailyPreferentialGiftActivity::new),
|
DAILY_PREFERENTIAL_GIFT(ActivityType.DAILY_PREFERENTIAL_GIFT,DailyPreferentialGiftActivity::new),
|
||||||
SUMMON_TREASURE(ActivityType.SUMMON_TREASURE,SummonTreasureActivity::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;
|
private int type;
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,85 @@
|
||||||
|
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.ActivityManager;
|
||||||
|
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.Collections;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2668,6 +2668,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()) {
|
for (Map.Entry<Integer, Long> entry : user.getPlayerInfoManager().getUserSkinValidTime().entrySet()) {
|
||||||
if (!SPlayerHeadIcon.getHeadIconMap().containsKey(entry.getKey())) {
|
if (!SPlayerHeadIcon.getHeadIconMap().containsKey(entry.getKey())) {
|
||||||
|
|
|
||||||
|
|
@ -187,6 +187,8 @@ public class BuyGoodsNewLogic {
|
||||||
LOGGER.error("购买失败!bag是否为空:{}",bag == null);
|
LOGGER.error("购买失败!bag是否为空:{}",bag == null);
|
||||||
return resultRes;
|
return resultRes;
|
||||||
}
|
}
|
||||||
|
Poster.getPoster().dispatchEvent(new RechargeRewardEvent(user.getId(),(int)price));
|
||||||
|
|
||||||
//成功购买
|
//成功购买
|
||||||
// if (goodsId == GlobalsDef.DAILY_GOODS_FAST_ID) {
|
// if (goodsId == GlobalsDef.DAILY_GOODS_FAST_ID) {
|
||||||
// //每日礼包一键购买之后,把所有单个的每日礼包的购买次数加一
|
// //每日礼包一键购买之后,把所有单个的每日礼包的购买次数加一
|
||||||
|
|
|
||||||
|
|
@ -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