Merge branch 'master_test_gn' into master_test_gn_arena
commit
663ca87868
|
|
@ -66,6 +66,7 @@ public enum FunctionIdEnum {
|
|||
Pokemon(79,null,MessageTypeProto.MessageType.POKEMON_COMONPENT_LEVELUP_REQUEST_VALUE,MessageTypeProto.MessageType.POKEMON_ADVANCED_REQUEST_VALUE),
|
||||
World_Arena(82,new WorldArenaFunction()),
|
||||
HongMeng(86,null),
|
||||
WeekGood(9091,null),
|
||||
;
|
||||
|
||||
private int functionType;
|
||||
|
|
|
|||
|
|
@ -214,11 +214,13 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
|||
User user = UserManager.getUser(session.getUid());
|
||||
List<int[][]> itemArrs = new LinkedList<>();
|
||||
getAllMissRewards(user, session, itemArrs);
|
||||
if (itemArrs.size() == 0)
|
||||
if (itemArrs.size() == 0) {
|
||||
return;
|
||||
}
|
||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||
if (null == sGlobalActivity)
|
||||
if (null == sGlobalActivity) {
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
String title = SErrorCodeEerverConfig.getI18NMessageNeedConvert("receive_activity_title", new Object[]{sGlobalActivity.getSesc()},new int[]{1},"#");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessageNeedConvert("receive_activity_txt", new Object[]{sGlobalActivity.getSesc()},new int[]{1},"#");
|
||||
String mailReward = ItemUtil.getMailReward(itemArrs);
|
||||
|
|
@ -308,8 +310,9 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
|||
|
||||
void onActivityEndSelfWithDealReward(User user) throws Exception {
|
||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||
if (sGlobalActivity.getIsMail() == 1)
|
||||
if (sGlobalActivity.getIsMail() == 1) {
|
||||
onActivityEndDealReward(user);
|
||||
}
|
||||
onActivityEndOnMySelf(user);
|
||||
}
|
||||
|
||||
|
|
@ -336,6 +339,15 @@ public abstract class AbstractActivity implements IActivity, IEventHandler {
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取关闭的礼包
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
public Set<Integer> getCloseGoods(User user){
|
||||
return new HashSet<>(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 活动结束邮件 有比较多的潜规则 单号1003747体现
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -17,8 +17,10 @@ import config.SGlobalActivity;
|
|||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class HeroStarActivity extends AbstractActivity {
|
||||
private int heroId;
|
||||
|
|
@ -132,4 +134,26 @@ public class HeroStarActivity extends AbstractActivity {
|
|||
MessageUtil.sendMessage(session, 1, rewardResponseValue, build, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Integer> getCloseGoods(User user){
|
||||
HashSet<Integer> set = new HashSet<>();
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
return set;
|
||||
}
|
||||
// 活动奖励条件
|
||||
List<SActivityRewardConfig> rewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||
for (SActivityRewardConfig rewardConfig : rewardConfigs) {
|
||||
Map<Integer, ActivityProgressInfo> map = mission.getActivityMissionMap();
|
||||
ActivityProgressInfo progressInfo = map.get(rewardConfig.getId());
|
||||
// 页签不存在或者状态不为可领取状态
|
||||
if (progressInfo == null || progressInfo.getState() != 1){
|
||||
int goodsId = rewardConfig.getValues()[2][0];
|
||||
set.add(goodsId);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return set;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@ import rpc.protocols.CommonProto;
|
|||
import rpc.protocols.PlayerInfoProto;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
public class MistyTripActivity extends AbstractActivity {
|
||||
|
||||
|
|
@ -115,5 +113,32 @@ public class MistyTripActivity extends AbstractActivity {
|
|||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Integer> getCloseGoods(User user){
|
||||
HashSet<Integer> set = new HashSet<>();
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
return set;
|
||||
}
|
||||
// 活动详细配置
|
||||
Map<Integer, ActivityProgressInfo> map = mission.getActivityMissionMap();
|
||||
List<SActivityRewardConfig> rewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||
// 创角色第几天
|
||||
int days = TimeUtils.getSoFarWentDays(user.getPlayerInfoManager().getCreateTime(), TimeUtils.now());
|
||||
for (SActivityRewardConfig config : rewardConfigs) {
|
||||
// 单个页签信息
|
||||
ActivityProgressInfo info = map.getOrDefault(config.getId(), null);
|
||||
if (info == null){
|
||||
continue;
|
||||
}
|
||||
int[][] values = config.getValues();
|
||||
// 条件,天数和任务数量
|
||||
if (days < values[0][1] || info.getProgrss() < values[0][0]){
|
||||
set.add(values[1][0]);
|
||||
}
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ class RechargeSumDayActivity extends AbstractActivity {
|
|||
/**
|
||||
* 根据配置解析数值进度完成度
|
||||
*/
|
||||
@Override
|
||||
boolean checkValue(ISession session, SActivityRewardConfig sActivityRewardConfig, ActivityProgressInfo activityProgressInfo) throws Exception {
|
||||
int[][] values = sActivityRewardConfig.getValues();
|
||||
User user = UserManager.getUser(session.getUid());
|
||||
|
|
|
|||
|
|
@ -265,4 +265,27 @@ public class SuperBoxActivity extends AbstractActivity {
|
|||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<Integer> getCloseGoods(User user){
|
||||
HashSet<Integer> set = new HashSet<>();
|
||||
ActivityMission mission = user.getActivityManager().getActivityMissionMap().get(id);
|
||||
if (mission == null){
|
||||
return set;
|
||||
}
|
||||
// 活动页签
|
||||
Map<Integer, ActivityProgressInfo> map = mission.getActivityMissionMap();
|
||||
Map<Integer, SSurpriseBox> boxMap = SSurpriseBox.map.get(id);
|
||||
// 活动奖励条件
|
||||
for (Map.Entry<Integer, ActivityProgressInfo> entry2 : map.entrySet()) {
|
||||
if (entry2.getValue().getProgrss() != 1){
|
||||
SSurpriseBox box = boxMap.getOrDefault(entry2.getKey(), null);
|
||||
if (box == null){
|
||||
continue;
|
||||
}
|
||||
set.add(box.getPackId());
|
||||
}
|
||||
}
|
||||
return set;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,7 +302,8 @@ public class DeathPathLogic {
|
|||
*/
|
||||
public void getBaseInfo(ISession session,MessageTypeProto.MessageType messageType) throws Exception {
|
||||
int uid = session.getUid();
|
||||
String count = (String) RedisUtil.getInstence().get(RedisKey.getKey(RedisKey.DEATH_PATH_CHALLENGE_COUNT, String.valueOf(uid), false));
|
||||
String changeString = GameApplication.serverProperties.getId() + RedisKey.Delimiter_colon + RedisKey.DEATH_PATH_CHALLENGE_COUNT + RedisKey.Delimiter_colon + String.valueOf(uid);
|
||||
String count = (String) RedisUtil.getInstence().get(changeString);
|
||||
int challengeCount = count==null?0:Integer.parseInt(count);
|
||||
// 结束时间和挑战次数
|
||||
Family.GetDeathPathInfoResponse.Builder response = Family.GetDeathPathInfoResponse.newBuilder()
|
||||
|
|
@ -314,7 +315,8 @@ public class DeathPathLogic {
|
|||
String key;
|
||||
// 是否是跨服
|
||||
Set<ZSetOperations.TypedTuple<String>> zSetReverseRangeWithScores;
|
||||
if (getGroupId() > 0) {
|
||||
boolean result = getGroupId() > 0;
|
||||
if (result) {
|
||||
key = guildRank.getCrossRedisKey();
|
||||
zSetReverseRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(key, String.valueOf(i), 0, 0,false);
|
||||
LOGGER.info("========================获取十绝阵内部信息,跨服:{}",uid);
|
||||
|
|
@ -331,7 +333,7 @@ public class DeathPathLogic {
|
|||
int guildId = Integer.parseInt(next.getValue());
|
||||
GuildInfoCache crossGuild = CrossDeathPathLogic.getCrossGuild(guildId);
|
||||
Integer serverId = Optional.ofNullable(CrossDeathPathLogic.getCrossGuild(guildId)).map(GuildInfoCache::getServerId).orElse(0);
|
||||
String serverName = CrossDeathPathLogic.getInstance().getServerNameByDeathPath(serverId);
|
||||
String serverName = result?CrossDeathPathLogic.getInstance().getServerNameByDeathPath(serverId):"";
|
||||
Family.DeathPathInfo info = Family.DeathPathInfo.newBuilder().setGuildName(crossGuild.getGuildName()).setPathId(i).setGid(guildId).setServerName(serverName).build();
|
||||
response.addInfos(info);
|
||||
}
|
||||
|
|
@ -347,7 +349,9 @@ public class DeathPathLogic {
|
|||
*/
|
||||
public void challenge(ISession session, int pathId, MessageTypeProto.MessageType messageType) throws Exception {
|
||||
int uid = session.getUid();
|
||||
String count = RedisUtil.getInstence().get(RedisKey.DEATH_PATH_CHALLENGE_COUNT, String.valueOf(uid),String.class);
|
||||
String changeStringKey = GameApplication.serverProperties.getId() + RedisKey.Delimiter_colon + RedisKey.DEATH_PATH_CHALLENGE_COUNT + RedisKey.Delimiter_colon + String.valueOf(uid);
|
||||
String count = (String) RedisUtil.getInstence().get(changeStringKey);
|
||||
//String count = RedisUtil.getInstence().get(RedisKey.DEATH_PATH_CHALLENGE_COUNT, String.valueOf(uid),String.class);
|
||||
if(!StringUtil.isEmpty(count)&&Integer.parseInt(count)>=SGuildSetting.sGuildSetting.getChallengeMaxTime()){
|
||||
throw new ErrorCodeException(ErrorCode.REFRESH_WHEL_TIME_NOT);
|
||||
}
|
||||
|
|
@ -375,7 +379,7 @@ public class DeathPathLogic {
|
|||
//更新排行榜数据
|
||||
tasks.offer(new DeathPathTask(uid,guildId,damage,pathId,getGroupId()));
|
||||
//挑战次数记录
|
||||
RedisUtil.getInstence().increment(RedisKey.getKey(RedisKey.DEATH_PATH_CHALLENGE_COUNT,String.valueOf(uid),false));
|
||||
RedisUtil.getInstence().increment(changeStringKey);
|
||||
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
|
||||
|
||||
// 跨服十绝阵添加
|
||||
|
|
|
|||
|
|
@ -255,12 +255,17 @@ public class GuildLogic {
|
|||
|
||||
}
|
||||
}
|
||||
//工会临时改成推荐20个 下个版本改成分页
|
||||
int i = 0;
|
||||
for(GuildInfo guildInfo : guildInfos){
|
||||
|
||||
if(i >= 20){
|
||||
break;
|
||||
}
|
||||
builder.addFamilyRecomandInfo(Family.FamilyRecomandInfo.newBuilder().
|
||||
setFamilyBaseInfo(CBean2Proto.getFamilyBaseInfo(guildInfo))
|
||||
.setIsApply(applyGuildInfos.containsKey(guildInfo.getId())?1:0)
|
||||
.build());
|
||||
i++;
|
||||
}
|
||||
MessageUtil.sendMessage(session,1,msgId,builder.build(),true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,24 +76,12 @@ public class CrossArenaRank extends AbstractRank {
|
|||
builder.addRanks(everyRank);
|
||||
}else{
|
||||
ArenaOfUser query = CrossServiceLogic.getInstance().query(Integer.valueOf(data.getValue()));
|
||||
String serverName = CrossDeathPathLogic.getInstance().getServerNameByDeathPath(query.getPlayerManager().getServerId());
|
||||
CommonProto.RankInfo.Builder everyRankInfo = CommonProto.RankInfo.newBuilder()
|
||||
.setRank(index)
|
||||
.setParam1(query.getHeroManager().getTotalForce())
|
||||
.setParam2(getParam2(data.getScore()))
|
||||
.setParam3(getParam3(data.getScore()));
|
||||
CommonProto.UserRank.Builder everyRank = CommonProto.UserRank.newBuilder()
|
||||
.setUid(query.getId())
|
||||
.setUserName(query.getPlayerManager().getName())
|
||||
.setLevel(query.getPlayerManager().getLevel())
|
||||
.setUserTitle(query.getPlayerManager().getUserTitle())
|
||||
.setUserSkin(80012)
|
||||
.setUserMount(query.getPlayerManager().getUserMount())
|
||||
.setRankInfo(everyRankInfo)
|
||||
.setForce(query.getHeroManager().getTotalForce())
|
||||
.setPracticeLevel(query.getPlayerManager().getPracticeLevel())
|
||||
.setServerName(serverName)
|
||||
.setSex(0);
|
||||
CommonProto.UserRank.Builder everyRank = getCrossOneUserRank(query,everyRankInfo);
|
||||
builder.addRanks(everyRank);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,17 +11,18 @@ import com.ljsd.jieling.exception.ErrorCode;
|
|||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.ktbeans.ReportEventEnum;
|
||||
import com.ljsd.jieling.ktbeans.ReportUtil;
|
||||
import com.ljsd.jieling.logic.GlobalDataManaager;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.activity.AbstractActivity;
|
||||
import com.ljsd.jieling.logic.activity.ActivityLogic;
|
||||
import com.ljsd.jieling.logic.activity.ActivityType;
|
||||
import com.ljsd.jieling.logic.activity.ActivityTypeEnum;
|
||||
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;
|
||||
import com.ljsd.jieling.logic.dao.VipInfo;
|
||||
import com.ljsd.jieling.logic.dao.*;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.expedition.ExpeditionLogic;
|
||||
import com.ljsd.jieling.logic.fight.CombatLogic;
|
||||
|
|
@ -636,26 +637,74 @@ public class BuyGoodsNewLogic {
|
|||
public static Set<Integer> getGoodsBagInfoFromDelive(int uid) throws Exception {
|
||||
User user = UserManager.getUser(uid);
|
||||
Set<Integer> list = new HashSet<>();
|
||||
// 礼包是否打开
|
||||
NewRechargeInfo rechargeInfo = user.getPlayerInfoManager().getNewRechargeInfo();
|
||||
for(AbstractWelfareBag bag : rechargeInfo.getPerpetualMap().values()){
|
||||
// 次数,推送,永久礼包一起处理
|
||||
ArrayList<AbstractWelfareBag> welfareBags = new ArrayList<>(rechargeInfo.getPerpetualMap().values());
|
||||
welfareBags.addAll(rechargeInfo.getTimeLimitMap().values());
|
||||
welfareBags.addAll(rechargeInfo.getPushMap().values());
|
||||
for (AbstractWelfareBag bag : welfareBags) {
|
||||
if(bag.isOpen()){
|
||||
list.add(bag.getModId());
|
||||
if (bag.getLimit() == 0 || bag.getLimit() > bag.getBuyTimes()){
|
||||
list.add(bag.getModId());
|
||||
}
|
||||
}
|
||||
}
|
||||
for(AbstractWelfareBag bag : rechargeInfo.getTimeLimitMap().values()){
|
||||
if(bag.isOpen()){
|
||||
list.add(bag.getModId());
|
||||
// 接收礼包单独处理
|
||||
for (AbstractWelfareBag value : rechargeInfo.getReceiveMap().values()) {
|
||||
ReceiveWelfareBag bag = (ReceiveWelfareBag)value;
|
||||
if(bag.isOpen() && bag.isBought()){
|
||||
if (bag.getLimit() == 0 || bag.getLimit() > bag.getBuyTimes()){
|
||||
list.add(bag.getModId());
|
||||
}
|
||||
}
|
||||
}
|
||||
for(AbstractWelfareBag bag : rechargeInfo.getReceiveMap().values()){
|
||||
if(bag.isOpen()){
|
||||
list.add(bag.getModId());
|
||||
|
||||
// 走表判断开启的礼包
|
||||
Map<Integer, SRechargeCommodityNewConfig> configMap = SRechargeCommodityNewConfig.configMap;
|
||||
Map<Integer, SGlobalActivity> activityMap = SGlobalActivity.getsGlobalActivityMap();
|
||||
Map<Integer, ActivityMission> missionMap = user.getActivityManager().getActivityMissionMap();
|
||||
|
||||
for (Map.Entry<Integer, ActivityMission> entry : missionMap.entrySet()) {
|
||||
int activityId = entry.getKey();
|
||||
ActivityMission mission = entry.getValue();
|
||||
// 遍历
|
||||
Iterator<Integer> iterator = list.iterator();
|
||||
while (iterator.hasNext()){
|
||||
SRechargeCommodityNewConfig config = configMap.get(iterator.next());
|
||||
// 表控制不显示
|
||||
if (config.getIsShowInWeb() == 0){
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
// 未加入公会,不显示公会红包
|
||||
if (user.getPlayerInfoManager().getGuildId() == 0 && config.getType() == 10){
|
||||
iterator.remove();
|
||||
continue;
|
||||
}
|
||||
|
||||
// 活动未开启的礼包
|
||||
if (mission.getActivityState() != ActivityType.OPEN_STATE){
|
||||
for (String[] open : config.getCondition()) {
|
||||
if ("3".equals(open[0])){
|
||||
if (open[1].equals(String.valueOf(activityId))){
|
||||
iterator.remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(AbstractWelfareBag bag : rechargeInfo.getPushMap().values()){
|
||||
if(bag.isOpen()){
|
||||
list.add(bag.getModId());
|
||||
// 单独活动信息处理
|
||||
SGlobalActivity activity = activityMap.get(activityId);
|
||||
if (activity == null){
|
||||
continue;
|
||||
}
|
||||
AbstractActivity activityType = ActivityTypeEnum.getActicityType(activityId);
|
||||
if (activityType == null || list.isEmpty()){
|
||||
continue;
|
||||
}
|
||||
list.removeAll(activityType.getCloseGoods(user));
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
@ -750,7 +799,7 @@ public class BuyGoodsNewLogic {
|
|||
}
|
||||
}
|
||||
|
||||
private static int judgePushCondition(User user,SPackPushConfig con){
|
||||
private static int judgePushCondition(User user,SPackPushConfig con){
|
||||
int[] scope = con.getScopeId();
|
||||
if(scope[0] == 1){//主线关卡
|
||||
int mainLevel = user.getMainLevelManager().getFightId();
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ public class SRechargeCommodityNewConfig implements BaseConfig {
|
|||
private String rechargeId9;
|
||||
private String rechargeId10;
|
||||
|
||||
|
||||
private int isShowInWeb;
|
||||
|
||||
private int[] forbid;
|
||||
|
||||
|
|
@ -205,4 +205,7 @@ public class SRechargeCommodityNewConfig implements BaseConfig {
|
|||
this.condition = condition;
|
||||
}
|
||||
|
||||
public int getIsShowInWeb() {
|
||||
return isShowInWeb;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue