Merge branch 'master_test_gn' into master_test_gn_arena
commit
6c60f45c88
|
|
@ -4,18 +4,19 @@ import com.ljsd.jieling.handler.BaseHandler;
|
||||||
import com.ljsd.jieling.logic.family.GuildLogic;
|
import com.ljsd.jieling.logic.family.GuildLogic;
|
||||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||||
import com.ljsd.jieling.network.session.ISession;
|
import com.ljsd.jieling.network.session.ISession;
|
||||||
|
import rpc.protocols.Family;
|
||||||
import rpc.protocols.MessageTypeProto;
|
import rpc.protocols.MessageTypeProto;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@Component
|
@Component
|
||||||
public class FamilyRecommandHandler extends BaseHandler {
|
public class FamilyRecommandHandler extends BaseHandler<Family.FamilyRecommandRequest> {
|
||||||
@Override
|
@Override
|
||||||
public MessageTypeProto.MessageType getMessageCode() {
|
public MessageTypeProto.MessageType getMessageCode() {
|
||||||
return MessageTypeProto.MessageType.FAMILY_RECOMEND_REQUEST;
|
return MessageTypeProto.MessageType.FAMILY_RECOMEND_REQUEST;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
public void processWithProto(ISession session, Family.FamilyRecommandRequest proto) throws Exception {
|
||||||
GuildLogic.recommendFamily(iSession);
|
GuildLogic.recommendFamily(session,proto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,9 @@ public class StartHardStageRequestHandler extends BaseHandler<PlayerInfoProto.Ha
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//参与奖励
|
//参与奖励
|
||||||
user.getUserMissionManager().onGameEvent(user, GameEvent.HARSTAGE_PARTICIPATION_REWARD,1);
|
if(nodeConfig.getStageType()!= 2){
|
||||||
|
user.getUserMissionManager().onGameEvent(user, GameEvent.HARSTAGE_PARTICIPATION_REWARD,1);
|
||||||
|
}
|
||||||
//排行榜章节
|
//排行榜章节
|
||||||
int hardStageId = SHardStage.getStageIdByChapterAndSection(user.getHardStageManager().getCurChapter(), user.getHardStageManager().getCurNode());
|
int hardStageId = SHardStage.getStageIdByChapterAndSection(user.getHardStageManager().getCurChapter(), user.getHardStageManager().getCurNode());
|
||||||
Poster.getPoster().dispatchEvent(new ShanHeSheJiTuStarEvent(iSession.getUid(), 1, hardStageId));
|
Poster.getPoster().dispatchEvent(new ShanHeSheJiTuStarEvent(iSession.getUid(), 1, hardStageId));
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ public class GlobalDataManaager implements IManager {
|
||||||
if( limitDay[0] == 2 ){
|
if( limitDay[0] == 2 ){
|
||||||
//此时是开服第几天
|
//此时是开服第几天
|
||||||
long day = TimeUtils.getGapDaysByTwoTime(GameApplication.serverConfig.getOpenTime(),TimeUtils.getTimeStamp2(TimeUtils.now()))+1;
|
long day = TimeUtils.getGapDaysByTwoTime(GameApplication.serverConfig.getOpenTime(),TimeUtils.getTimeStamp2(TimeUtils.now()))+1;
|
||||||
if(day < limitDay[1]){
|
if(day <= limitDay[1]){
|
||||||
closeList.add(id);
|
closeList.add(id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -155,10 +155,10 @@ public class GlobalDataManaager implements IManager {
|
||||||
//开服几天后开启
|
//开服几天后开启
|
||||||
if(getServerOpenTimeCompareSpecialTimeResult()){
|
if(getServerOpenTimeCompareSpecialTimeResult()){
|
||||||
int[]limitDay = sGlobalSystemConfig.getIfOpen();
|
int[]limitDay = sGlobalSystemConfig.getIfOpen();
|
||||||
if(limitDay.length>0 && limitDay != null){
|
if(limitDay.length > 0){
|
||||||
if( limitDay[0] == 2 ){
|
if( limitDay[0] == 2 ){
|
||||||
long day = TimeUtils.getGapDaysByTwoTime(GameApplication.serverConfig.getOpenTime(),TimeUtils.getTimeStamp2(TimeUtils.now()))+1;
|
long day = TimeUtils.getGapDaysByTwoTime(GameApplication.serverConfig.getOpenTime(),TimeUtils.getTimeStamp2(TimeUtils.now()))+1;
|
||||||
if(day < limitDay[1]){
|
if(day <= limitDay[1]){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,7 @@ public class MistyTripActivity extends AbstractActivity {
|
||||||
Map<Integer, ActivityProgressInfo> map = mission.getActivityMissionMap();
|
Map<Integer, ActivityProgressInfo> map = mission.getActivityMissionMap();
|
||||||
List<SActivityRewardConfig> rewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
List<SActivityRewardConfig> rewardConfigs = SActivityRewardConfig.getsActivityRewardConfigByActivityId(id);
|
||||||
// 创角色第几天
|
// 创角色第几天
|
||||||
int days = TimeUtils.getSoFarWentDays(user.getPlayerInfoManager().getCreateTime(), TimeUtils.now());
|
int days = TimeUtils.getSoFarWentDays(user.getPlayerInfoManager().getCreateTime(), TimeUtils.now())+1;
|
||||||
for (SActivityRewardConfig config : rewardConfigs) {
|
for (SActivityRewardConfig config : rewardConfigs) {
|
||||||
// 单个页签信息
|
// 单个页签信息
|
||||||
ActivityProgressInfo info = map.getOrDefault(config.getId(), null);
|
ActivityProgressInfo info = map.getOrDefault(config.getId(), null);
|
||||||
|
|
|
||||||
|
|
@ -48,12 +48,6 @@ public class TreasureActivity extends AbstractActivity {
|
||||||
if(user.getPlayerInfoManager().getHadBuyTreasure() == 1){
|
if(user.getPlayerInfoManager().getHadBuyTreasure() == 1){
|
||||||
LOGGER.info("[青龙秘宝初始化] [重置秘宝解锁状态] [uid:{}]",user.getId());
|
LOGGER.info("[青龙秘宝初始化] [重置秘宝解锁状态] [uid:{}]",user.getId());
|
||||||
user.getPlayerInfoManager().setHadBuyTreasure(0);
|
user.getPlayerInfoManager().setHadBuyTreasure(0);
|
||||||
int id=0;
|
|
||||||
for(SRechargeCommodityNewConfig sRechargeCommodityConfig : SRechargeCommodityNewConfig.configMap.values()){
|
|
||||||
if(sRechargeCommodityConfig.getType() == GiftGoodsType.SUN_LONG){
|
|
||||||
id=sRechargeCommodityConfig.getId();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.ljsd.jieling.logic.family;
|
package com.ljsd.jieling.logic.family;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.google.protobuf.GeneratedMessage;
|
import com.google.protobuf.GeneratedMessage;
|
||||||
import com.google.protobuf.Message;
|
import com.google.protobuf.Message;
|
||||||
import com.ljsd.GameApplication;
|
import com.ljsd.GameApplication;
|
||||||
|
|
@ -235,10 +236,10 @@ public class GuildLogic {
|
||||||
* @param session
|
* @param session
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static void recommendFamily(ISession session) throws Exception {
|
public static void recommendFamily(ISession session,Family.FamilyRecommandRequest proto) throws Exception {
|
||||||
int uid = session.getUid();
|
int uid = session.getUid();
|
||||||
User user = UserManager.getUser(uid);
|
User user = UserManager.getUser(uid);
|
||||||
int msgId = MessageTypeProto.MessageType.FAMILY_RECOMEND_RESPONSE_VALUE;
|
|
||||||
Collection<GuildInfo> guildInfos = GuilidManager.recommandGuild(user);
|
Collection<GuildInfo> guildInfos = GuilidManager.recommandGuild(user);
|
||||||
Family.FamilyRecommandResponse.Builder builder = Family.FamilyRecommandResponse.newBuilder();
|
Family.FamilyRecommandResponse.Builder builder = Family.FamilyRecommandResponse.newBuilder();
|
||||||
Map<Integer, GuildApply> applyGuildInfos = GuilidManager.getApplyGuildInfos(uid, 1);
|
Map<Integer, GuildApply> applyGuildInfos = GuilidManager.getApplyGuildInfos(uid, 1);
|
||||||
|
|
@ -255,18 +256,20 @@ public class GuildLogic {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//工会临时改成推荐20个 下个版本改成分页
|
|
||||||
int i = 0;
|
int page = proto.getPage();
|
||||||
for(GuildInfo guildInfo : guildInfos){
|
List<List<GuildInfo>> partition = Lists.partition(new ArrayList<>(guildInfos), 10);
|
||||||
if(i >= 20){
|
// 防止超出下标
|
||||||
break;
|
if (page <= partition.size()){
|
||||||
|
for(GuildInfo guildInfo : partition.get(page-1)){
|
||||||
|
builder.addFamilyRecomandInfo(Family.FamilyRecomandInfo.newBuilder().
|
||||||
|
setFamilyBaseInfo(CBean2Proto.getFamilyBaseInfo(guildInfo))
|
||||||
|
.setIsApply(applyGuildInfos.containsKey(guildInfo.getId())?1:0)
|
||||||
|
.build());
|
||||||
}
|
}
|
||||||
builder.addFamilyRecomandInfo(Family.FamilyRecomandInfo.newBuilder().
|
|
||||||
setFamilyBaseInfo(CBean2Proto.getFamilyBaseInfo(guildInfo))
|
|
||||||
.setIsApply(applyGuildInfos.containsKey(guildInfo.getId())?1:0)
|
|
||||||
.build());
|
|
||||||
i++;
|
|
||||||
}
|
}
|
||||||
|
// 返回信息
|
||||||
|
int msgId = MessageTypeProto.MessageType.FAMILY_RECOMEND_RESPONSE_VALUE;
|
||||||
MessageUtil.sendMessage(session,1,msgId,builder.build(),true);
|
MessageUtil.sendMessage(session,1,msgId,builder.build(),true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -939,6 +939,7 @@ public class ItemLogic {
|
||||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||||
}
|
}
|
||||||
progress.setProgrss(progress.getProgrss()-1);
|
progress.setProgrss(progress.getProgrss()-1);
|
||||||
|
user.getActivityManager().getActivityMissionMap().put(activityId,misson);
|
||||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user,new int[][]{{config.getGoalItems()[0][0],config.getGoalItems()[0][1]}},BIReason.EQUIP_UPLEVEL_REWARD);
|
CommonProto.Drop.Builder drop = ItemUtil.drop(user,new int[][]{{config.getGoalItems()[0][0],config.getGoalItems()[0][1]}},BIReason.EQUIP_UPLEVEL_REWARD);
|
||||||
response.setResult(true);
|
response.setResult(true);
|
||||||
response.setDrop(drop);
|
response.setDrop(drop);
|
||||||
|
|
|
||||||
|
|
@ -639,9 +639,11 @@ public class BuyGoodsNewLogic {
|
||||||
Set<Integer> list = new HashSet<>();
|
Set<Integer> list = new HashSet<>();
|
||||||
// 礼包是否打开
|
// 礼包是否打开
|
||||||
NewRechargeInfo rechargeInfo = user.getPlayerInfoManager().getNewRechargeInfo();
|
NewRechargeInfo rechargeInfo = user.getPlayerInfoManager().getNewRechargeInfo();
|
||||||
|
Map<Integer, SRechargeCommodityNewConfig> configMap = SRechargeCommodityNewConfig.configMap;
|
||||||
// 次数,推送,永久礼包一起处理
|
// 次数,推送,永久礼包一起处理
|
||||||
ArrayList<AbstractWelfareBag> welfareBags = new ArrayList<>(rechargeInfo.getPerpetualMap().values());
|
ArrayList<AbstractWelfareBag> welfareBags = new ArrayList<>(rechargeInfo.getPerpetualMap().values());
|
||||||
welfareBags.addAll(rechargeInfo.getTimeLimitMap().values());
|
welfareBags.addAll(rechargeInfo.getTimeLimitMap().values());
|
||||||
|
welfareBags.addAll(rechargeInfo.getReceiveMap().values());
|
||||||
welfareBags.addAll(rechargeInfo.getPushMap().values());
|
welfareBags.addAll(rechargeInfo.getPushMap().values());
|
||||||
for (AbstractWelfareBag bag : welfareBags) {
|
for (AbstractWelfareBag bag : welfareBags) {
|
||||||
if(bag.isOpen()){
|
if(bag.isOpen()){
|
||||||
|
|
@ -650,18 +652,8 @@ public class BuyGoodsNewLogic {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 接收礼包单独处理
|
|
||||||
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());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 走表判断开启的礼包
|
// 走表判断开启的礼包
|
||||||
Map<Integer, SRechargeCommodityNewConfig> configMap = SRechargeCommodityNewConfig.configMap;
|
|
||||||
Map<Integer, SGlobalActivity> activityMap = SGlobalActivity.getsGlobalActivityMap();
|
Map<Integer, SGlobalActivity> activityMap = SGlobalActivity.getsGlobalActivityMap();
|
||||||
Map<Integer, ActivityMission> missionMap = user.getActivityManager().getActivityMissionMap();
|
Map<Integer, ActivityMission> missionMap = user.getActivityManager().getActivityMissionMap();
|
||||||
|
|
||||||
|
|
@ -683,16 +675,23 @@ public class BuyGoodsNewLogic {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 活动未开启的礼包
|
for (String[] open : config.getCondition()) {
|
||||||
if (mission.getActivityState() != ActivityType.OPEN_STATE){
|
// 活动未开启的礼包
|
||||||
for (String[] open : config.getCondition()) {
|
if ("3".equals(open[0])){
|
||||||
if ("3".equals(open[0])){
|
if (mission.getActivityState() != ActivityType.OPEN_STATE){
|
||||||
if (open[1].equals(String.valueOf(activityId))){
|
if (open[1].equals(String.valueOf(activityId))){
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 功能未开启的表
|
||||||
|
if ("2".equals(open[0])){
|
||||||
|
if (!GlobalDataManaager.getInstance().checkIsOpen(Integer.parseInt(open[1]))){
|
||||||
|
iterator.remove();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 单独活动信息处理
|
// 单独活动信息处理
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue