Merge branch 'master_test_gn' into master_test_gn_fabao

yuanshuai 2021-11-18 17:49:27 +08:00
commit fbf48a1903
13 changed files with 95 additions and 49 deletions

View File

@ -255,6 +255,7 @@ public class GetPlayerInfoHandler extends BaseHandler{
Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),10023,0)); Poster.getPoster().dispatchEvent(new HeroUpStarEvent(user.getId(),10023,0));
// 无尽秘宝处理 // 无尽秘宝处理
endLessTreasureHandler(user); endLessTreasureHandler(user);
expeditionTreasureHandler(user);
user.getUserMissionManager().onGameEvent(user,GameEvent.DAILY_TASK_TYPE,0,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.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); MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.GET_PLAYERINFO_RESPONSE_VALUE, getPlayerInfoResponse, true);
@ -285,6 +286,22 @@ public class GetPlayerInfoHandler extends BaseHandler{
} }
} }
/**
*
* @param user
*/
private void expeditionTreasureHandler(User user){
// 天宫秘宝礼包获取
ReceiveWelfareBag bagInfo = (ReceiveWelfareBag) user.getPlayerInfoManager().getNewRechargeInfo().getReceiveMap().get(106);
if (bagInfo == null){
return;
}
// 刷新礼包
if (user.getExpeditionManager().getWorldTreasureReward().getIsBuy() == 0 && bagInfo.isBought()){
bagInfo.refresh();
}
}
///登录获取四象心法数据 ///登录获取四象心法数据
private List<CommonProto.SixiangxinfaInfo> getSixiangxinfaInfos(HeroManager heroManager) { private List<CommonProto.SixiangxinfaInfo> getSixiangxinfaInfos(HeroManager heroManager) {
Map<Integer,SixiangProfessionInfo> sixiangDataMap = heroManager.getSixiangDataMap(); Map<Integer,SixiangProfessionInfo> sixiangDataMap = heroManager.getSixiangDataMap();

View File

@ -26,7 +26,7 @@ public interface ActivityType {
// int RechargeTotal = 5; //累计充值 // int RechargeTotal = 5; //累计充值
int GrowthFund = 6; //成长基金 int GrowthFund = 6; //成长基金
int BLESSACTIVITY = 7;//云梦祈福 int BLESSACTIVITY = 7;//云梦祈福
int TREASURE = 8; //戒灵秘宝(孙龙的宝藏) int TREASURE = 8; //青龙秘宝(孙龙的宝藏)
int LUCKYCAT = 9;//招財貓 int LUCKYCAT = 9;//招財貓
int SERVERHAPPY = 10; //七日狂欢 int SERVERHAPPY = 10; //七日狂欢
int FORCERANK = 11; //战力排行 int FORCERANK = 11; //战力排行

View File

@ -25,9 +25,8 @@ class GrowthFundActivity extends AbstractActivity {
int[][] values = sActivityRewardConfig.getValues(); int[][] values = sActivityRewardConfig.getValues();
User user = UserManager.getUser(session.getUid()); User user = UserManager.getUser(session.getUid());
SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id); SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
AbstractWelfareBag bag = user.getPlayerInfoManager().getNewRechargeInfo().getReceiveMap().get(sGlobalActivity.getCanBuyRechargeId()[0]); ReceiveWelfareBag bag = (ReceiveWelfareBag)user.getPlayerInfoManager().getNewRechargeInfo().getReceiveMap().get(sGlobalActivity.getCanBuyRechargeId()[0]);
int buyTimes = bag.getBuyTimes(); if (!bag.isBought()){
if(buyTimes == 0){
return false; return false;
} }
int type = values[0][0]; int type = values[0][0];
@ -43,14 +42,6 @@ class GrowthFundActivity extends AbstractActivity {
return true; return true;
} }
@Override
public void onActivityEndOnMySelf(User user) throws Exception {
// SGlobalActivity sGlobalActivity = SGlobalActivity.getsGlobalActivityMap().get(id);
// if(sGlobalActivity.getCanBuyRechargeId()!=null&&sGlobalActivity.getCanBuyRechargeId().length>0){
// Arrays.stream(sGlobalActivity.getCanBuyRechargeId()).forEach(n->user.getPlayerInfoManager().getRechargeInfo().updateBuyGoodsTimes(n,0));
// }
}
@Override @Override
void updateProgress(ActivityMission activityMission, int count) { void updateProgress(ActivityMission activityMission, int count) {
activityMission.setV(count); activityMission.setV(count);

View File

@ -36,7 +36,6 @@ public class WorldTreasureReward extends MongoBase {
score = 0; score = 0;
setRewardStatusMap(new HashMap<>()); setRewardStatusMap(new HashMap<>());
setIsBuy(0); setIsBuy(0);
// updateRound(round+1);
} }
@Override @Override

View File

@ -1,5 +1,8 @@
package com.ljsd.jieling.logic.dao.cross; package com.ljsd.jieling.logic.dao.cross;
import com.ljsd.GameApplication;
import com.ljsd.jieling.db.mongo.AreaManager;
/** /**
* @Author hj * @Author hj
* @Date 2021/8/31 15:30:04 * @Date 2021/8/31 15:30:04
@ -189,6 +192,7 @@ public class CSPlayer {
} }
public int getServerId() { public int getServerId() {
int serverId = AreaManager.getInstance().getServerIdByUid(userId, GameApplication.serverId);
return serverId; return serverId;
} }

View File

@ -23,6 +23,7 @@ import com.ljsd.jieling.logic.mail.MailLogic;
import com.ljsd.jieling.logic.mission.GameEvent; import com.ljsd.jieling.logic.mission.GameEvent;
import com.ljsd.jieling.logic.store.BuyGoodsNewLogic; import com.ljsd.jieling.logic.store.BuyGoodsNewLogic;
import com.ljsd.jieling.logic.store.StoreLogic; import com.ljsd.jieling.logic.store.StoreLogic;
import com.ljsd.jieling.logic.store.newRechargeInfo.bean.ReceiveWelfareBag;
import com.ljsd.jieling.network.session.ISession; import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.util.ItemUtil; import com.ljsd.jieling.util.ItemUtil;
import com.ljsd.jieling.util.MessageUtil; import com.ljsd.jieling.util.MessageUtil;
@ -550,6 +551,12 @@ public class ExpeditionLogic {
//重置 //重置
if(TimeUtils.nowInt()>=createTime){ if(TimeUtils.nowInt()>=createTime){
user.getExpeditionManager().resetTreasureReward(); user.getExpeditionManager().resetTreasureReward();
// 天宫秘宝礼包刷新
ReceiveWelfareBag bagInfo = (ReceiveWelfareBag) user.getPlayerInfoManager().getNewRechargeInfo().getReceiveMap().get(106);
if (bagInfo == null){
return;
}
bagInfo.refresh();
sendAllTreasureInfo(user); sendAllTreasureInfo(user);
BuyGoodsNewLogic.sendGiftGooodsIndication(user.getId()); BuyGoodsNewLogic.sendGiftGooodsIndication(user.getId());
} }

View File

@ -330,13 +330,16 @@ public class FriendLogic {
public void sendAgree(ISession iSession, int type, int friendId ) throws Exception { public void sendAgree(ISession iSession, int type, int friendId ) throws Exception {
int msgId = MessageTypeProto.MessageType.FRIEND_INVITE_OPERATION_RESPONSE_VALUE; int msgId = MessageTypeProto.MessageType.FRIEND_INVITE_OPERATION_RESPONSE_VALUE;
int uid = iSession.getUid(); int uid = iSession.getUid();
// 自己的信息
User user = UserManager.getUser(uid); User user = UserManager.getUser(uid);
FriendManager friendManager = user.getFriendManager(); FriendManager friendManager = user.getFriendManager();
User friendUser = UserManager.getUserNotCache(friendId); // 好友的信息
if (friendId == 0 || friendUser == null){ User friendUser = null;
return; FriendManager friendManager1 = null;
if(friendId!=0){
friendUser = UserManager.getUserNotCache(friendId);
friendManager1 = friendUser.getFriendManager();
} }
FriendManager friendManager1 = friendUser.getFriendManager();
List<Integer> friends = friendManager.getFriends(); List<Integer> friends = friendManager.getFriends();
List<Integer> applyFriends = friendManager.getApplyFriends(); List<Integer> applyFriends = friendManager.getApplyFriends();
int maxFriends = SSpecialConfig.getIntegerValue(SSpecialConfig.FRIENDAMOUNT_LIMIT); int maxFriends = SSpecialConfig.getIntegerValue(SSpecialConfig.FRIENDAMOUNT_LIMIT);

View File

@ -1,5 +1,7 @@
package com.ljsd.jieling.logic.hero; package com.ljsd.jieling.logic.hero;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.ljsd.GameApplication; import com.ljsd.GameApplication;
import com.ljsd.fight.FamilyHeroInfo; import com.ljsd.fight.FamilyHeroInfo;
import com.ljsd.jieling.chat.logic.ChatLogic; import com.ljsd.jieling.chat.logic.ChatLogic;
@ -2725,7 +2727,16 @@ public class HeroLogic {
if (propertyItem == null) { if (propertyItem == null) {
continue; continue;
} }
Jewel j = (Jewel) propertyItem; Jewel j = null;
if (propertyItem instanceof Jewel){
j = (Jewel) propertyItem;
}else {
j = new Jewel();
j.setHeroId(propertyItem.getHeroId());
j.setLevel(propertyItem.getLevel());
j.setEquipId(propertyItem.getEquipId());
j.setBuildLevel(1);
}
SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(j.getEquipId()); SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(j.getEquipId());
// 进阶 // 进阶
Map<Integer, Map<Integer, SJewelRankupConfig>> rankPoolMap = SJewelRankupConfig.rankupMap.get(config.getRankupPool()); Map<Integer, Map<Integer, SJewelRankupConfig>> rankPoolMap = SJewelRankupConfig.rankupMap.get(config.getRankupPool());
@ -3306,7 +3317,6 @@ public class HeroLogic {
if (heroManager.getHero(equip.getHeroId()) == null) { if (heroManager.getHero(equip.getHeroId()) == null) {
equip.setHeroId(""); equip.setHeroId("");
} }
return;
} }
String remove = ""; String remove = "";

View File

@ -336,8 +336,11 @@ public class ItemLogic {
throw new ErrorCodeException(ErrorCode.ITEM_DECOMPOSE_NO_EQUIP); throw new ErrorCodeException(ErrorCode.ITEM_DECOMPOSE_NO_EQUIP);
} }
PropertyItem propertyItem = equipMap.get(jewelId); PropertyItem propertyItem = equipMap.get(jewelId);
if (!StringUtil.isEmpty(propertyItem.getHeroId())&&user.getHeroManager().getHero(propertyItem.getHeroId())!=null) { if (!StringUtil.isEmpty(propertyItem.getHeroId())) {
throw new ErrorCodeException(ErrorCode.ITEM_DECOMPOSE_SOULE_CANT); Hero hero = user.getHeroManager().getHero(propertyItem.getHeroId());
if (hero != null && hero.getJewelInfo().contains(jewelId)) {
throw new ErrorCodeException(ErrorCode.ITEM_DECOMPOSE_SOULE_CANT);
}
} }
Jewel jewel = (Jewel) propertyItem; Jewel jewel = (Jewel) propertyItem;
SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(propertyItem.getEquipId()); SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(propertyItem.getEquipId());
@ -781,18 +784,27 @@ public class ItemLogic {
} }
public static TreeSet<String> getJewelEquipWithLeve(User user, int type, int rance, int leve) { public static TreeSet<String> getJewelEquipWithLeve(User user, int type, int rance, int leve) {
return user.getEquipManager().getEquipMap().entrySet().stream().filter(stringEquipEntry -> TreeSet<String> strings = new TreeSet<>();
StringUtil.isEmpty(stringEquipEntry.getValue().getHeroId()) for (Map.Entry<String, PropertyItem> stringPropertyItemEntry : user.getEquipManager().getEquipMap().entrySet()) {
).filter(stringPropertyItemEntry -> stringPropertyItemEntry.getValue() instanceof Jewel).filter(stringPropertyItemEntry -> {
if (((Jewel) stringPropertyItemEntry.getValue()).getBuildLevel() != 0 || stringPropertyItemEntry.getValue().getLevel() != 0) {
return false;
}
SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(stringPropertyItemEntry.getValue().getEquipId()); SJewelConfig config = STableManager.getConfig(SJewelConfig.class).get(stringPropertyItemEntry.getValue().getEquipId());
if (config == null) { if (config == null) {
return false; continue;
} }
return config.getLocation() == type && config.getRace() == rance && config.getLevel() == leve; if (config.getLocation() != type || config.getRace() != rance || config.getLevel() != leve) {
}).map(Map.Entry::getKey).collect(Collectors.toCollection(TreeSet::new)); continue;
}
if (!StringUtil.isEmpty(stringPropertyItemEntry.getValue().getHeroId())) {
Hero hero = user.getHeroManager().getHero(stringPropertyItemEntry.getValue().getHeroId());
if (hero != null && hero.getJewelInfo().contains(stringPropertyItemEntry.getKey())) {
continue;
}
}
if (((Jewel) stringPropertyItemEntry.getValue()).getBuildLevel() != 0 || stringPropertyItemEntry.getValue().getLevel() != 0) {
continue;
}
strings.add(stringPropertyItemEntry.getValue().getId());
}
return strings;
} }
/** /**

View File

@ -1739,7 +1739,8 @@ public class PlayerLogic {
return null; return null;
} }
} }
if (userStr == null) { if (userStr == null || userStr.isEmpty()) {
LOGGER.error("getUserByRpc userStr == null uid={}", uid);
return null; return null;
} }
Gson gson = RedisUtil.getInstence().getGson(); Gson gson = RedisUtil.getInstence().getGson();

View File

@ -389,7 +389,7 @@ public class BuyGoodsNewLogic {
ExpeditionLogic.sendTreasureRewardUpdate(session,user.getExpeditionManager().getWorldTreasureReward().getScore(), ExpeditionLogic.sendTreasureRewardUpdate(session,user.getExpeditionManager().getWorldTreasureReward().getScore(),
rewardStatusMap,user.getExpeditionManager().getWorldTreasureReward().getCreateTime(),1); rewardStatusMap,user.getExpeditionManager().getWorldTreasureReward().getCreateTime(),1);
} }
if(type == GiftGoodsType.SUN_LONG){ if(type == GiftGoodsType.SUN_LONG){
PlayerManager playerManager = user.getPlayerInfoManager(); PlayerManager playerManager = user.getPlayerInfoManager();
playerManager.setHadBuyTreasure(1); playerManager.setHadBuyTreasure(1);
playerManager.setTreasureLevel(playerManager.getTreasureLevel()+15); playerManager.setTreasureLevel(playerManager.getTreasureLevel()+15);
@ -786,7 +786,12 @@ public class BuyGoodsNewLogic {
}else{ }else{
builder.setDynamicBuyTimes(bag.getLimit() - bag.getBuyTimes()); builder.setDynamicBuyTimes(bag.getLimit() - bag.getBuyTimes());
} }
// 礼包类型特殊处理使用bought字段验证是否购买
if(bag.getType() == RechargeType.receive.getType()){
ReceiveWelfareBag receiveBag = (ReceiveWelfareBag) bag;
int bought = receiveBag.isBought()?1:0;
builder.setIsBought(bought);
}
return builder.build(); return builder.build();
} }

View File

@ -58,23 +58,20 @@ public class ReceiveWelfareBag extends AbstractWelfareBag {
@Override @Override
public boolean buy() { public boolean buy() {
if(super.buy()){ if (bought) {
if(bought){ LOGGER.error("礼包:{}已经购买", getModId());
LOGGER.error("礼包:{}已经购买",getModId()); return false;
return false; } else {
}else { setBought(true);
setBought(true); setStartTime(TimeUtils.getTodayZero());
setStartTime(TimeUtils.getTodayZero()); if (getDailyUpdate() > 0) {
if(getDailyUpdate()>0){ setRefreshTime(getStartTime() + getDailyUpdate() * TimeUtils.DAY);
setRefreshTime(getStartTime() + getDailyUpdate() * TimeUtils.DAY);
}
if(getEndTime()!=0){
setEndTime(TimeUtils.getTodayZero() + getContinueDays() * TimeUtils.DAY);
}
return true;
} }
if (getEndTime() != 0) {
setEndTime(TimeUtils.getTodayZero() + getContinueDays() * TimeUtils.DAY);
}
return true;
} }
return false;
} }
@Override @Override

View File

@ -113,7 +113,7 @@ public class ThreadManager implements IManager {
LOGGER.info("delayForMinute---->>>>{}" ,delayForMinute); LOGGER.info("delayForMinute---->>>>{}" ,delayForMinute);
scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new MinuteTask(), delayForMinute, 60, TimeUnit.SECONDS)); scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new MinuteTask(), delayForMinute, 60, TimeUnit.SECONDS));
scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new SecondsTask(), 0, 1, TimeUnit.SECONDS)); scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new SecondsTask(), delayForMinute + 10, 1, TimeUnit.SECONDS));
// scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new FetchBloodyEndDataThread(), 0, 1, TimeUnit.SECONDS)); // scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new FetchBloodyEndDataThread(), 0, 1, TimeUnit.SECONDS));
scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new Thread(){ scheduledFutureSets.add( scheduledExecutor.scheduleAtFixedRate(new Thread(){
public void run () { public void run () {