Merge branch 'master_test_gn' of http://60.1.1.230/backend/jieling_server into master_test_gn

back_recharge
jiahuiwen 2021-11-01 15:25:54 +08:00
commit 51e47e6588
7 changed files with 50 additions and 56 deletions

View File

@ -23,6 +23,7 @@ import com.ljsd.jieling.logic.question.QuestionLogic;
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
import com.ljsd.jieling.logic.store.StoreLogic;
import com.ljsd.jieling.logic.store.newRechargeInfo.NewRechargeInfo;
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.ReceiveWelfareBag;
import com.ljsd.jieling.netty.cocdex.PacketNetData;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.thread.task.RPCServerTask;
@ -245,6 +246,8 @@ public class GetPlayerInfoHandler extends BaseHandler{
Poster.getPoster().dispatchEvent(new SuperBoxEvent(user.getId(),SuperBoxEvent.fund_old_user));
// 登峰造极孙悟空
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),10023,0));
// 无尽秘宝处理
endLessTreasureHandler(user);
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_TASK_TYPE,0,user);
MessageUtil.sendIndicationMessage(iSession, 1, MessageTypeProto.MessageType.WorldLevelIndication_VALUE, PlayerInfoProto.WorldLevelIndication.newBuilder().setWorldLeve(GlobleSystemLogic.getGlobalWorldLevelCache()).build(), true);
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);
@ -259,6 +262,22 @@ public class GetPlayerInfoHandler extends BaseHandler{
}
}
/**
*
* @param user
*/
private void endLessTreasureHandler(User user){
// 无尽秘宝礼包获取
ReceiveWelfareBag bagInfo = (ReceiveWelfareBag) user.getPlayerInfoManager().getNewRechargeInfo().getReceiveMap().get(107);
if (bagInfo == null){
return;
}
// 刷新礼包
if (user.getMapManager().getEndlessTreasureReward().getIsBuy() == 0 && bagInfo.isBought()){
bagInfo.refresh();
}
}
///登录获取四象心法数据
private List<CommonProto.SixiangxinfaInfo> getSixiangxinfaInfos(HeroManager heroManager) {
Map<Integer,SixiangProfessionInfo> sixiangDataMap = heroManager.getSixiangDataMap();

View File

@ -34,8 +34,8 @@ public class WeekCardHandler extends BaseHandler<ActivityProto.WeekCardRewardReq
@Override
public void processWithProto(ISession session, ActivityProto.WeekCardRewardRequest proto) throws Exception{
User user = UserManager.getUser(session.getUid());
return;
/*User user = UserManager.getUser(session.getUid());
int weekId = proto.getId();
Map<Integer, WeekCardInfo> weekCard = user.getPlayerInfoManager().getWeekCard();
ActivityProto.WeekCardRewardResponse.Builder res = ActivityProto.WeekCardRewardResponse.newBuilder();
@ -71,6 +71,6 @@ public class WeekCardHandler extends BaseHandler<ActivityProto.WeekCardRewardReq
singleWeekCard.setLeaveGetRewardDays(TimeUtils.getDayOfWeek());
user.getPlayerInfoManager().setWeekCard(weekCard);
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.WeekCardRewardResponse.getNumber(), res.build(), true);
*/
}
}

View File

@ -34,58 +34,15 @@ public class WeekCardInfoHandler extends BaseHandler<ActivityProto.WeekCardInfo
*/
@Override
public void processWithProto(ISession session, ActivityProto.WeekCardInfoRequest proto) throws Exception{
User user = UserManager.getUser(session.getUid());
return;
/*User user = UserManager.getUser(session.getUid());
int[] weekType = WeekCardLogic.getInstance().getWeekCardType(user);
if(weekType == null){
return;
}
ActivityProto.WeekCardInfoResponse.Builder res = ActivityProto.WeekCardInfoResponse.newBuilder();
List<CommonProto.WeekCard> weekCardList = WeekCardLogic.getInstance().initAllWeekCardInfo(user);
/*long time= user.getPlayerInfoManager().getWeekCardTimeFirst();
if(!TimeUtils.isSameWeek(time ,TimeUtils.now())){
user.getPlayerInfoManager().setWeekCardTimeFirstLevel(user.getPlayerInfoManager().getLevel());
user.getPlayerInfoManager().setWeekCardTimeFirst(TimeUtils.now());
}
int [] weekCardType = WeekCardLogic.getInstance().getWeekCardType(user);
Map<Integer, WeekCardInfo> weekCard = user.getPlayerInfoManager().getWeekCard();
Map<Integer,SWeekcardRotationConfig> config = STableManager.getConfig(SWeekcardRotationConfig.class);
boolean isSaveToDb =false;
for(int i= 0;i<weekCardType.length;i++){
if(config.containsKey(weekCardType[i])){
CommonProto.WeekCard.Builder weekCardProto = CommonProto.WeekCard.newBuilder();
//周卡是否存在 判断是否过期
if(!weekCard.containsKey(weekCardType[i])){
weekCard.put(weekCardType[i],new WeekCardInfo(weekCardType[i],false,0,0));
isSaveToDb = true;
}
WeekCardInfo singleWeekCard = weekCard.get(weekCardType[i]);
if(singleWeekCard.isBuy()){
//买过周卡
if(!TimeUtils.isSameWeek(singleWeekCard.getBugTime() ,TimeUtils.now())){
//周卡已经过期
singleWeekCard.setBuy(false);
singleWeekCard.setLeaveGetRewardDays(0);
isSaveToDb = true;
}
}
weekCardProto.setId(singleWeekCard.getId());
weekCardProto.setIsBuy(singleWeekCard.isBuy());
if(singleWeekCard.isBuy()){
weekCardProto.setLeaveGetRewardDays(TimeUtils.getDayOfWeek()-singleWeekCard.getLeaveGetRewardDays());
}else{
weekCardProto.setLeaveGetRewardDays(singleWeekCard.getLeaveGetRewardDays());
}
res.addAllWeekCardInfo(weekCardProto);
}
}
if(isSaveToDb){
user.getPlayerInfoManager().setWeekCard(weekCard);
}*/
res.addAllAllWeekCardInfo(weekCardList);
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.WeekCardInfoResponse.getNumber(), res.build(), true);
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.WeekCardInfoResponse.getNumber(), res.build(), true);*/
}
}

View File

@ -123,6 +123,8 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
}
long winCount = Arrays.stream(result).boxed().filter(n -> n == 1).count();
//换一批
CrossYuxulundaoLogic.getInstance().matchRivals(user);
List<ArenaEnemy> enemyList = arenaManager.getCrossYuxulundaoEnemies();
enemyList.forEach(n -> res.addArenaEnemys(CrossYuxulundaoLogic.getInstance().getMatchRivalInfo(n.getEnemyId(), 0)));
CSPlayer myQuery = CrossServiceLogic.getPlayerByRedis(user.getId());
@ -337,8 +339,17 @@ public class CrossYuxulundaoChallengeHandler extends BaseHandler<ArenaInfoProto.
CommonProto.FightTeamInfo fightTeamInfo = FightUtil.makePersonFightData(myUser, myteamId[i], null, null);
//对手 修行等级 区服名称 战斗类行 积分变化情况
CommonProto.FightTeamInfo defteamInfo = FightUtil.makeCrossPersonData(csPlayer, defTeamId[i], arenaRecord, crossArenaManager);
//根据战力判断先后手
int myforce = 0,defforce = 0;
if(arenaRecord.getYxldMyForce().get(i)!=null){
myforce =arenaRecord.getYxldMyForce().get(i);
}
if(arenaRecord.getYxldDefForce().get(i)!=null){
defforce = arenaRecord.getYxldDefForce().get(i);
}
FightResult fightResult = GetWorldArenaChallengeRequestHandler.getFightForPVP(myUser.getId(), defUserUid,
fightTeamInfo, defteamInfo, FightUtil.getFightSeed(), true);
fightTeamInfo, defteamInfo, FightUtil.getFightSeed(), myforce<defforce);
int seed = fightResult.getSeed();
CommonProto.FightData build = CommonProto.FightData.newBuilder()
.setFightMaxTime(SArenaSetting.getSArenaSetting().getMostTime())

View File

@ -49,6 +49,7 @@ 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.logic.store.newRechargeInfo.bean.ReceiveWelfareBag;
import com.ljsd.jieling.network.session.ISession;
import rpc.protocols.*;
import com.ljsd.jieling.util.*;
@ -3420,9 +3421,15 @@ public class MapLogic {
if(user.getMapManager().getEndlessTreasureReward().getCreateTime()<TimeUtils.nowInt()){
user.getMapManager().resetEndlessTreasure();
Item item = user.getItemManager().getItem(102);//升级积分清除
if(item!=null&&item.getItemNum()>0){
if(item !=null && item.getItemNum() > 0){
item.setItemNum(0);
}
// 无尽秘宝礼包刷新
ReceiveWelfareBag bagInfo = (ReceiveWelfareBag) user.getPlayerInfoManager().getNewRechargeInfo().getReceiveMap().get(107);
if (bagInfo == null){
return;
}
bagInfo.refresh();
LOGGER.info("刷新无尽秘宝uid=>{}",user.getId());
MapInfoProto.EndlessTreasureInfoResponse.Builder response = getEndlessResponseBuilder(user.getMapManager().getEndlessTreasureReward());
MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()),1, MessageTypeProto.MessageType.ENDLESS_TREASURE_REFRESH_INDICATION_VALUE,response.build(),true);

View File

@ -402,8 +402,8 @@ public class BuyGoodsNewLogic {
}
//周卡
if(type==GiftGoodsType.WEEKCARD){
WeekCardLogic.getInstance().buyWeekCard(user,config.getId());
WeekCardLogic.getInstance().sendWeekCardInitInfo(session);
//WeekCardLogic.getInstance().buyWeekCard(user,config.getId());
//WeekCardLogic.getInstance().sendWeekCardInitInfo(session);
}
if(drop!=null&&session!=null){
PlayerInfoProto.DirectBuyIndication build = PlayerInfoProto.DirectBuyIndication.newBuilder().setDrop(drop).build();

View File

@ -283,15 +283,15 @@ public class MinuteTask extends Thread {
}
}
//每周日23.50执行
//每周日23.30执行
public void everySundaySpecialClockTask() throws Exception {
Calendar calendar = Calendar.getInstance();
int hour = calendar.get(Calendar.HOUR_OF_DAY);
int minute = calendar.get(Calendar.MINUTE);
int w = calendar.get(Calendar.DAY_OF_WEEK) - 1;
if(w == 0 &&hour == 23 && minute ==50){
if(w == 0 &&hour == 23 && minute ==30){
LOGGER.info("everySundaySpecialClockTask yuxulundao send reward start ...");
//玉虚论道23.50分执行
//玉虚论道23.30分执行
CrossYuxulundaoLogic.getInstance().sendReward();
LOGGER.info("everySundaySpecialClockTask yuxulundao send reward end ...");
}