Merge branch 'master_prb_gn' into master_test_gn

# Conflicts:
#	serverlogic/src/main/java/com/ljsd/jieling/logic/hero/HeroLogic.java
back_recharge
jiahuiwen 2021-10-31 16:29:34 +08:00
commit b58f222669
7 changed files with 47 additions and 15 deletions

View File

@ -9,6 +9,8 @@ import com.ljsd.jieling.logic.dao.ServerConfig;
import com.ljsd.jieling.logic.dao.root.GlobalSystemControl; import com.ljsd.jieling.logic.dao.root.GlobalSystemControl;
import com.ljsd.jieling.logic.dao.root.GuildInfo; import com.ljsd.jieling.logic.dao.root.GuildInfo;
import com.mongodb.*; import com.mongodb.*;
import config.SMServerArenaSetting;
import manager.STableManager;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
@ -66,10 +68,16 @@ public class LjsdMongoTemplate implements MongoUpdateImp {
} }
} }
} else { } else {
for (MongoTemplate mongoTemplate : MongoUtil.mongoTemplateMap.values()) { MongoTemplate mongoTemplate = MongoUtil.mongoTemplateMap.get(GameApplication.serverId);
if (mongoTemplate != null) {
List<T> all = mongoTemplate.findAll(clazz); List<T> all = mongoTemplate.findAll(clazz);
list.addAll(all); return all;
} }
// for (MongoTemplate mongoTemplate : MongoUtil.mongoTemplateMap.values()) {
// List<T> all = mongoTemplate.findAll(clazz);
// list.addAll(all);
// }
} }
return list; return list;
//return mongoTemplate.findAll(clazz,collectionName); //return mongoTemplate.findAll(clazz,collectionName);
@ -93,6 +101,14 @@ public class LjsdMongoTemplate implements MongoUpdateImp {
} }
} }
} else { } else {
SMServerArenaSetting setting = STableManager.getConfig(SMServerArenaSetting.class).get(1);
int rankEndLine = setting.getWorldLevLimit();
if (query.getLimit() == rankEndLine) {
MongoTemplate mongoTemplate = MongoUtil.mongoTemplateMap.get(GameApplication.serverId);
List<T> all = mongoTemplate.find(query, entityClass);
list.addAll(all);
return list;
}
for (MongoTemplate mongoTemplate : MongoUtil.mongoTemplateMap.values()) { for (MongoTemplate mongoTemplate : MongoUtil.mongoTemplateMap.values()) {
List<T> all = mongoTemplate.find(query, entityClass); List<T> all = mongoTemplate.find(query, entityClass);
list.addAll(all); list.addAll(all);

View File

@ -24,7 +24,6 @@ public class TakeMissionRewardHandler extends BaseHandler<PlayerInfoProto.TakeMi
@Override @Override
public void processWithProto(ISession iSession, PlayerInfoProto.TakeMissionRewardRequest proto) throws Exception { public void processWithProto(ISession iSession, PlayerInfoProto.TakeMissionRewardRequest proto) throws Exception {
MissionLoigc.takeMissionReward(iSession,proto.getType(),proto.getMissionId()); MissionLoigc.takeMissionReward(iSession,proto.getType(),proto.getMissionId());
} }
} }

View File

@ -205,13 +205,14 @@ public class GlobleSystemLogic implements IEventHandler {
} }
private static void setGlobalWorldLevelCache(int globalWorldLevelCache) { private static void setGlobalWorldLevelCache(int globalWorldLevelCache) {
if(globalWorldLevelCache>getGlobalWorldLevelCache()){ // TODO 下次更新前删除 强制设置一次世界等级
// if(globalWorldLevelCache>getGlobalWorldLevelCache()){
GLOABLE_WORLD_LEVE_CACHE = globalWorldLevelCache; GLOABLE_WORLD_LEVE_CACHE = globalWorldLevelCache;
RedisUtil.getInstence().putMapEntry(RedisKey.SERVER_WORLDLEVE_INFO,"",String.valueOf(GameApplication.serverId),globalWorldLevelCache); RedisUtil.getInstence().putMapEntry(RedisKey.SERVER_WORLDLEVE_INFO,"",String.valueOf(GameApplication.serverId),globalWorldLevelCache);
InnerMessageUtil.broadcastWithRandom(user->{ InnerMessageUtil.broadcastWithRandom(user->{
MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()), 1, MessageTypeProto.MessageType.WorldLevelIndication_VALUE, PlayerInfoProto.WorldLevelIndication.newBuilder().setWorldLeve(GlobleSystemLogic.getGlobalWorldLevelCache()).build(), true); MessageUtil.sendIndicationMessage(OnlineUserManager.getSessionByUid(user.getId()), 1, MessageTypeProto.MessageType.WorldLevelIndication_VALUE, PlayerInfoProto.WorldLevelIndication.newBuilder().setWorldLeve(GlobleSystemLogic.getGlobalWorldLevelCache()).build(), true);
}, new LinkedList<>(OnlineUserManager.sessionMap.keySet()),10); }, new LinkedList<>(OnlineUserManager.sessionMap.keySet()),10);
} // }
} }

View File

@ -400,6 +400,23 @@ public class ActivityLogic implements IEventHandler{
} }
} }
} }
// TODO 修复每周任务和万象活动 11月3日删除
// 1635696000000L = 2021-11-01 00:00:00
if (now < 1635696000000L) {
if(sGlobalActivity.getId() == 40000 && !TimeUtils.isSameWeek(now, user.getUserMissionManager().getJadeDynastyMissionType().getWeekRefresh())) {
LOGGER.info("checkActivityOfUser uid={} fix JADE_DYNASTY_WEEK_REFRESH", user.getId());
user.getUserMissionManager().onGameEvent(user, GameEvent.JADE_DYNASTY_WEEK_REFRESH, sGlobalActivity.getId());
}
if (sGlobalActivity.getShopId() != null && sGlobalActivity.getShopId().length > 0) {
for (int shopId : sGlobalActivity.getShopId()) {
if (shopId != 0 && !user.getStoreManager().getStoreInfoMap().containsKey(shopId)) {
LOGGER.info("checkActivityOfUser uid={} fix sGlobalActivity shop", user.getId());
Poster.getPoster().dispatchEvent(new ActivityStateChangeEvent(user.getId(), sGlobalActivity.getId(), 1));
break;
}
}
}
}
continue; continue;
} }
initAllActivityMission(activityManager.getActivityMissionMap(),openActivityId); initAllActivityMission(activityManager.getActivityMissionMap(),openActivityId);

View File

@ -753,7 +753,7 @@ public class FightUtil {
return CommonProto.FightTeamInfo. return CommonProto.FightTeamInfo.
newBuilder() newBuilder()
.addAllFightUnitList(heroFightInfos) .addAllFightUnitList(heroFightInfos)
.addAllPokemonUnitList(HeroLogic.getInstance().getCrossPokemon(crossArenaManager,csPlayer)) .addAllPokemonUnitList(HeroLogic.getInstance().getCrossPokemon(crossArenaManager))
.setTeamPassiveList("") .setTeamPassiveList("")
.setForceScore(crossArenaManager.getMaxHistoryForce()) .setForceScore(crossArenaManager.getMaxHistoryForce())
.build(); .build();

View File

@ -27,7 +27,6 @@ import com.ljsd.jieling.logic.activity.eventhandler.HeroFiveStarGetEventHandler;
import com.ljsd.jieling.logic.activity.eventhandler.PokemonFiveStarGetEventHandler; import com.ljsd.jieling.logic.activity.eventhandler.PokemonFiveStarGetEventHandler;
import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic; import com.ljsd.jieling.logic.activity.fourChallenge.FourChallengeLogic;
import com.ljsd.jieling.logic.dao.*; import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.cross.CSPlayer;
import com.ljsd.jieling.logic.dao.gm.ArenaOfHero; import com.ljsd.jieling.logic.dao.gm.ArenaOfHero;
import com.ljsd.jieling.logic.dao.gm.ArenaOfUser; import com.ljsd.jieling.logic.dao.gm.ArenaOfUser;
import com.ljsd.jieling.logic.dao.root.User; import com.ljsd.jieling.logic.dao.root.User;
@ -2372,7 +2371,7 @@ public class HeroLogic {
} }
///获取修行技能数据 ///获取修行技能数据
public void getPracticeSkill(List<CommonProto.FightUnitInfo> infoList, Map<Integer, Integer> practiceSkillMap,long maxForce,int sex,int userLv) { public void getPracticeSkill(List<CommonProto.FightUnitInfo> infoList, Map<Integer, Integer> practiceSkillMap,long maxForce) {
if (practiceSkillMap.isEmpty()) { if (practiceSkillMap.isEmpty()) {
return; return;
} }
@ -2391,10 +2390,8 @@ public class HeroLogic {
.setUnitSkillIds(skillStr.toString()) .setUnitSkillIds(skillStr.toString())
.setProperty("0") .setProperty("0")
.setPosition(100) .setPosition(100)
.setStar(userLv)
.setSkinId(0) .setSkinId(0)
.setForceScore(maxForce) .setForceScore(maxForce)
.setPlayerSex(sex)
.build(); .build();
infoList.add(skillInfo); infoList.add(skillInfo);
} }
@ -2434,7 +2431,7 @@ public class HeroLogic {
.build(); .build();
pokemonInfos.add(info); pokemonInfos.add(info);
} }
getPracticeSkill(pokemonInfos, user.getHeroManager().getPracticeSkillMap(),user.getPlayerInfoManager().getMaxForce(),user.getPlayerInfoManager().getSex(),user.getPlayerInfoManager().getLevel()); getPracticeSkill(pokemonInfos, user.getHeroManager().getPracticeSkillMap(),user.getPlayerInfoManager().getMaxForce());
return pokemonInfos; return pokemonInfos;
} }
@ -2462,10 +2459,11 @@ public class HeroLogic {
return pokemonInfos; return pokemonInfos;
} }
public List<CommonProto.FightUnitInfo> getCrossPokemon(CrossArenaManager crossArenaManager, CSPlayer csPlayer) { public List<CommonProto.FightUnitInfo> getCrossPokemon(CrossArenaManager crossArenaManager) {
//todo 灵兽 //todo 灵兽
Map<String, com.ljsd.jieling.thrift.idl.Pokemon> pokemonMap = crossArenaManager.getPokemons(); Map<String, com.ljsd.jieling.thrift.idl.Pokemon> pokemonMap = crossArenaManager.getPokemons();
Map<Integer, String> teamMap = crossArenaManager.getPokemonTeamMap(); Map<Integer, String> teamMap = crossArenaManager.getPokemonTeamMap();
Map<Integer, com.ljsd.jieling.thrift.idl.Pokemon> pokemons = new HashMap<>(); Map<Integer, com.ljsd.jieling.thrift.idl.Pokemon> pokemons = new HashMap<>();
List<CommonProto.FightUnitInfo> pokemonInfos = new ArrayList<>(); List<CommonProto.FightUnitInfo> pokemonInfos = new ArrayList<>();
@ -2489,7 +2487,7 @@ public class HeroLogic {
.setUnitId(String.valueOf(pokemon.getTmpId())).setUnitSkillIds(String.valueOf(sSpiritAnimalSkill.getId())).build(); .setUnitId(String.valueOf(pokemon.getTmpId())).setUnitSkillIds(String.valueOf(sSpiritAnimalSkill.getId())).build();
pokemonInfos.add(info); pokemonInfos.add(info);
} }
getPracticeSkill(pokemonInfos,crossArenaManager.getPracticeSkillMap(),crossArenaManager.getMaxHistoryForce(),csPlayer.getSex(),csPlayer.getLevel()); getPracticeSkill(pokemonInfos,crossArenaManager.getPracticeSkillMap(),crossArenaManager.getMaxHistoryForce());
return pokemonInfos; return pokemonInfos;
} }
@ -2522,7 +2520,7 @@ public class HeroLogic {
.setUnitId(String.valueOf(pokemon.getTmpId())).setUnitSkillIds(String.valueOf(sSpiritAnimalSkill.getId())).build(); .setUnitId(String.valueOf(pokemon.getTmpId())).setUnitSkillIds(String.valueOf(sSpiritAnimalSkill.getId())).build();
pokemonInfos.add(info); pokemonInfos.add(info);
} }
getPracticeSkill(pokemonInfos,user.getHeroManager().getPracticeSkillMap(),user.getPlayerInfoManager().getMaxForce(),user.getPlayerInfoManager().getSex(),user.getPlayerInfoManager().getLevel()); getPracticeSkill(pokemonInfos,user.getHeroManager().getPracticeSkillMap(),user.getPlayerInfoManager().getMaxForce());
return pokemonInfos; return pokemonInfos;
} }

View File

@ -603,7 +603,8 @@ public class ItemUtil {
if (sItem.getItemBaseType()==6){ if (sItem.getItemBaseType()==6){
equipManager.addEquipList(entry.getKey()); equipManager.addEquipList(entry.getKey());
} }
if (sItem.getItemType()==3){ if (sItem.getItemType()==3 && reason != BIReason.EQUIP_UNLOAD_REWARD
&& reason != BIReason.UPHERO_DECOMPOS_HERO_REWARD && reason != BIReason.DECOMPOS_HERO_REWARD){
if (changeEquipList==null) { if (changeEquipList==null) {
changeEquipList=new ArrayList<>(); changeEquipList=new ArrayList<>();
} }