back_recharge
zhangshanxue 2019-09-23 18:51:35 +08:00
commit f28972f9d3
18 changed files with 412 additions and 165 deletions

View File

@ -11,9 +11,11 @@ import com.ljsd.jieling.db.redis.RedisKey;
import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.dao.FriendManager;
import com.ljsd.jieling.logic.dao.GuilidManager;
import com.ljsd.jieling.logic.dao.PlayerManager;
import com.ljsd.jieling.logic.dao.UserManager;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.family.GuildLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.ChatProto;
import com.ljsd.jieling.protocols.MessageTypeProto;
@ -53,9 +55,6 @@ public class ChatLogic {
case 1: //世界
chatInfoList = MessageCache.worldMsg.getObjs(messageId);
break;
case 2: //公会
chatInfoList = MessageCache.guildMsg.getObjs(messageId);
break;
case 3: //好友
Map<Object, Object> hmget = RedisUtil.getInstence().hmget(GameApplication.serverId + RedisKey.CUser_Chat + uid);
if (hmget != null && hmget.size() != 0){
@ -142,9 +141,16 @@ public class ChatLogic {
MessageCache.addWordMsg(chatInfo,messageId);
break;
case 2: //公会
messageId = RedisUtil.getInstence().increment(GameApplication.serverId + RedisKey.CHAT_GUILD_MSG_ID+ GameApplication.serverId);
chatInfo = CBean2Proto.getChatInfoBuilder(user,message,nowTime,messageId);
MessageCache.addGuildMsg(chatInfo,messageId);
int guildId = user.getPlayerInfoManager().getGuildId();
if(guildId==0){
MessageUtil.sendErrorResponse(iSession,0, msgId, "未加入公会");
return;
}
chatInfo = CBean2Proto.getChatInfoBuilder(user,message,nowTime,0);
ChatProto.SendChatInfoIndication sendChatInfoIndication = ChatProto.SendChatInfoIndication.newBuilder()
.setChatInfo(chatInfo)
.build();
GuildLogic.sendIndicationToMember(GuilidManager.guildInfoMap.get(guildId),MessageTypeProto.MessageType.SEND_CHAT_INFO_INDICATION,sendChatInfoIndication);
break;
case 3: //好友
List<Integer> friends = friendManager.getFriends();
@ -156,7 +162,7 @@ public class ChatLogic {
if (OnlineUserManager.checkUidOnline(friendId)){
ISession sessionByUid = OnlineUserManager.getSessionByUid(friendId);
chatInfo = CBean2Proto.getChatInfoBuilder(user,message,nowTime,0);
ChatProto.SendChatInfoIndication sendChatInfoIndication = ChatProto.SendChatInfoIndication.newBuilder()
sendChatInfoIndication = ChatProto.SendChatInfoIndication.newBuilder()
.setChatInfo(chatInfo)
.build();
assert sessionByUid != null;

View File

@ -9,7 +9,6 @@ public class MessageCache {
public static LoopQueue worldMsg = new LoopQueue(capuatiy,perCaught,msgInterval);
public static LoopQueue sysMsg = new LoopQueue(capuatiy,perCaught,msgInterval);
public static LoopQueue guildMsg = new LoopQueue(capuatiy,perCaught,msgInterval);
public static void addWordMsg(ChatProto.ChatInfo chatInfo,long messageId){
@ -20,7 +19,4 @@ public class MessageCache {
sysMsg.push(chatInfo,messageId);
}
public static void addGuildMsg(ChatProto.ChatInfo chatInfo,long messageId ){
guildMsg.push(chatInfo,messageId);
}
}

View File

@ -0,0 +1,78 @@
package com.ljsd.jieling.config;
import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.logic.STableManager;
import com.ljsd.jieling.logic.Table;
import java.util.HashMap;
import java.util.Map;
@Table(name="EndlessDifficulty")
public class SEndlessDifficulty implements BaseConfig{
private int id;
private int[] worldLevel;
private int[] monsterId;
private int[] rewardId;
public static Map<Integer,SEndlessDifficulty> difficultyMap;
public static Map<Integer,Integer> difficultyMonster;
public static Map<Integer,Integer> difficultyReward;
@Override
public void init() throws Exception {
difficultyMap = STableManager.getConfig(SEndlessDifficulty.class);
setDifficult();
}
public static void setDifficult() throws Exception {
SEndlessDifficulty baseDiff = difficultyMap.get(1);
difficultyMonster = new HashMap<>();
difficultyReward = new HashMap<>();
ServerConfig serverConfigTmp = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
if(serverConfigTmp.getWorldLevel()==0){
for(int i = 0 ;i<baseDiff.getMonsterId().length;i++){
difficultyMonster.put(baseDiff.getMonsterId()[i],baseDiff.getMonsterId()[i]);
}
for(int i = 0 ;i<baseDiff.getRewardId().length;i++){
difficultyReward.put(baseDiff.getRewardId()[i],baseDiff.getRewardId()[i]);
}
}else{
for(Map.Entry<Integer,SEndlessDifficulty> entry:difficultyMap.entrySet()) {
if (serverConfigTmp.getWorldLevel() <= entry.getValue().getWorldLevel()[0] || serverConfigTmp.getWorldLevel() > entry.getValue().getWorldLevel()[1]) {
continue;
}
for(int i = 0 ;i<baseDiff.getMonsterId().length;i++){
difficultyMonster.put(baseDiff.getMonsterId()[i],entry.getValue().getMonsterId()[i]);
}
for(int i = 0 ;i<baseDiff.getRewardId().length;i++){
difficultyReward.put(baseDiff.getRewardId()[i],entry.getValue().getRewardId()[i]);
}
break;
}
}
}
public int getId() {
return id;
}
public int[] getWorldLevel() {
return worldLevel;
}
public int[] getMonsterId() {
return monsterId;
}
public int[] getRewardId() {
return rewardId;
}
}

View File

@ -126,6 +126,8 @@ public class RedisKey {
public static final String FAMILY_JOIN = "FAMILY_JOIN";
public static final String FAMILY_INFO = "FAMILY_INFO";
public static final String FAMILY_FIGHT = "FAMILY_FIGHT" ;
public static final String FAMILY_ATTACK_BLOOD = "FAMILY_ATTACK_BLOOD";
public static final String FAMILY_FIGHT_RANK = "FAMILY_FIGHT_RANK";
@ -194,6 +196,7 @@ public class RedisKey {
familyKey.add(FAMILY_FIGHT_ATTACK_COUNT);
familyKey.add(FAMILY_FIGHT_TOTAL_STAR);
familyKey.add(FAMILY_FIGHT_TOTAL_EXP);
familyKey.add(FAMILY_INFO);
}
public static String getKey(String type, String key, boolean withoutServerId) {
if(RedisKey.TOKEN.equals(type)||RedisKey.USER_SERVER_INFO.equals(type)||familyKey.contains(type)){

View File

@ -20,6 +20,6 @@ public class FamilyDefendDetailInfoHandler extends BaseHandler {
byte[] bytes = netData.parseClientProtoNetData();
Family.FamilyDefendDetailViewRequest request = Family.FamilyDefendDetailViewRequest.parseFrom(bytes);
GuildFightLogic.viewDefendDetailInfo(iSession,request.getPlayerId(), MessageTypeProto.MessageType.FAMILY_VIEW_DEFEND_DETAIL_RESPONSE);
GuildFightLogic.viewDefendDetailInfo(iSession,request.getPlayerId(),request.getGid(), MessageTypeProto.MessageType.FAMILY_VIEW_DEFEND_DETAIL_RESPONSE);
}
}

View File

@ -258,7 +258,7 @@ public class MapLogic {
mapEnterResponse.setLeftTime(getLeftTime(user, true));
for (Map.Entry<Integer, Integer> buffEntry : mapManager.getFoodBufferMap().entrySet()) {
if (buffEntry.getValue()==0) {
if (buffEntry.getValue()==0||buffEntry.getValue()==-1) {
continue;
}
CommonProto.FoodBuffer foodBuffer = CBean2Proto.getFoodBuffer(buffEntry.getKey(), buffEntry.getValue());
@ -1021,6 +1021,7 @@ public class MapLogic {
MapManager mapManager = user.getMapManager();
SChallengeConfig challengeConfig = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId());
if(mapManager.getCurMapId()==0){
mapManager.setCurXY(0);
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
return;
}
@ -1224,6 +1225,9 @@ public class MapLogic {
return;
}
int groupId = option[0];
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
groupId =SEndlessDifficulty.difficultyMonster.get(groupId);
}
int destoryXY = mapManager.getTriggerXY();
CommonProto.FightTeamInfo fightTeamInfo = BehaviorUtil.getFightTeamInfo(user, mapManager.getTeamId(), true);
Map<Integer, List<CommonProto.FightUnitInfo>> monsterByGroup = MonsterUtil.getMonsterByGroup(groupId);
@ -1262,8 +1266,14 @@ public class MapLogic {
mapManager.updateEndlessFightCount(1+mapManager.getEndlessMapInfo().getFightCount());
}
if (resultCode == 0) {
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4){
//无尽副本复活消耗
reviveConsumeExecution(user);
for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){
mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0);
mapManager.updateEndlessHeroHp(entry.getKey(),0);
}
}else {
// 失败需要等待n秒后复活所有英雄
int dieCount = user.getMapManager().getDieCount();
dieCount++;
@ -1276,17 +1286,18 @@ public class MapLogic {
if (leftTime <= (int) (time / 1000)) {
resetMapInfo(user, false);
} else {
initTeamInfo(mapManager.getTeamId(), uid, user, mapManager,2);
initTeamInfo(mapManager.getTeamId(), uid, user, mapManager, 2);
List<TeamPosHeroInfo> teamPosHeroInfos = user.getTeamPosManager().getTeamPosForHero().get(mapManager.getTeamId());
for (TeamPosHeroInfo heroInfo : teamPosHeroInfos) {
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
if (hero == null) {
continue;
}
Map<Integer, Integer> heroAttributeMap = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero,false,teamId);
Map<Integer, Integer> heroAttributeMap = HeroLogic.getInstance().calHeroNotBufferAttribute(user, hero, false, teamId);
remainHp.add(heroAttributeMap.get(HeroAttributeEnum.CurHP.getPropertyId()));
}
}
}
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
FightInfoProto.FastFightResponse build = FightInfoProto.FastFightResponse
.newBuilder()
@ -1299,6 +1310,7 @@ public class MapLogic {
mapManager.setCurXY(mapManager.getLastXY());
MessageUtil.sendMessage(session, 1, messageType.getNumber(), build, true);
return;
}
List<TeamPosHeroInfo> team = user.getTeamPosManager().getTeamPosForHero().get(teamId);
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4&&teamId==401){
@ -1401,6 +1413,9 @@ public class MapLogic {
String[] split = fightReady.split("#");
RedisUtil.getInstence().del(fightReadyKey);
groupId = Integer.parseInt(split[0]);
if(SEndlessDifficulty.difficultyMonster.containsKey(groupId)){
groupId = SEndlessDifficulty.difficultyMonster.get(groupId);
}
if (split.length > 1) {
pointId = split[1];
}
@ -1412,6 +1427,9 @@ public class MapLogic {
return;
}
groupId = option[0];
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4) {
groupId =SEndlessDifficulty.difficultyMonster.get(groupId);
}
}
FightInfoProto.FightStartResponse.Builder fightStartResponse = FightInfoProto.FightStartResponse.newBuilder();
SChallengeConfig sChallengeConfig = SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId());
@ -1483,8 +1501,14 @@ public class MapLogic {
mapManager.setLastFightResult(resultCode);
if (resultCode == 0 || dropout == 1) {
if(SChallengeConfig.sChallengeConfigs.get(mapManager.getCurMapId()).getType()==4){
//无尽副本复活消耗
reviveConsumeExecution(user);
for(Map.Entry<String, Map<Integer, Integer>> entry: mapManager.getHeroAllAttributeMap().entrySet()){
mapManager.updateHeroOneAttribute(entry.getKey(),HeroAttributeEnum.CurHP.getPropertyId(),0);
mapManager.updateEndlessHeroHp(entry.getKey(),0);
}
}else{
// 失败需要等待n秒后复活所有英雄
int dieCount = user.getMapManager().getDieCount();
dieCount++;
@ -1508,6 +1532,7 @@ public class MapLogic {
remainHp.add(heroAllAttributeMap.get(hero.getId()).get(HeroAttributeEnum.CurHP.getPropertyId()));
}
}
}
CommonProto.Drop.Builder dropBuilder = CommonProto.Drop.newBuilder();
FightInfoProto.FightEndResponse.Builder fightEndResponse = FightInfoProto.FightEndResponse
.newBuilder();

View File

@ -2,6 +2,7 @@ package com.ljsd.jieling.logic;
import com.ljsd.GameApplication;
import com.ljsd.jieling.config.SDailyTasksConfig;
import com.ljsd.jieling.config.SEndlessDifficulty;
import com.ljsd.jieling.config.SGlobalSystemConfig;
import com.ljsd.jieling.config.ServerConfig;
import com.ljsd.jieling.config.json.KTSDKConstans;
@ -167,6 +168,7 @@ public class GlobalDataManaager {
case Endless:
MapLogic.getInstance().updateEndlessSeason(timeControllerOfFunction.getTimes());
serverConfigTmp.setWorldLevel(calWorldLevel());
SEndlessDifficulty.setDifficult();
MongoUtil.getLjsdMongoTemplate().save(serverConfigTmp);
MapLogic.getInstance().setEndlessMapId(getEndleeMapIdByLevel());
break;
@ -373,7 +375,7 @@ public class GlobalDataManaager {
}
private static int getEndleeMapIdByLevel() throws Exception {
ServerConfig config = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
int mapId = config.getWorldLevel() * 0 + 4001;
int mapId = config.getWorldLevel() * 0 + 4002;
return mapId;
}
}

View File

@ -8,6 +8,7 @@ public class FamilyFightInfo {
private int familyId;
private int buildId;
private int starCount;
private int force;
public Map<String, FamilyHeroInfo> getHeroAttribute() {
return heroAttribute;
@ -48,4 +49,12 @@ public class FamilyFightInfo {
public void setStarCount(int starCount) {
this.starCount = starCount;
}
public int getForce() {
return force;
}
public void setForce(int force) {
this.force = force;
}
}

View File

@ -6,6 +6,7 @@ public class PlayerInfoCache {
private String head;
private int headFrame;
private int level;
private int guildPosition;
public String getName() {
@ -47,4 +48,12 @@ public class PlayerInfoCache {
public void setLevel(int level) {
this.level = level;
}
public int getGuildPosition() {
return guildPosition;
}
public void setGuildPosition(int guildPosition) {
this.guildPosition = guildPosition;
}
}

View File

@ -63,6 +63,7 @@ public class TeamPosManager extends MongoBase {
teamPosForHero.put(1,teamPosHeroInfoList);
teamPosForHero.put(2,new ArrayList<>(1));
teamPosForHero.put(3,new ArrayList<>(1));
teamPosForHero.put(501,new ArrayList<>(1));
updateString("teamPosForHero",teamPosForHero);
}

View File

@ -0,0 +1,51 @@
package com.ljsd.jieling.logic.dao.root;
public class GuildCache {
private int serverId;
private int icon;
private int level;
private String name;
public int getServerId() {
return serverId;
}
public void setServerId(int serverId) {
this.serverId = serverId;
}
public int getIcon() {
return icon;
}
public void setIcon(int icon) {
this.icon = icon;
}
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public GuildCache(int serverId, int icon, int level, String name) {
this.serverId = serverId;
this.icon = icon;
this.level = level;
this.name = name;
}
}

View File

@ -1,5 +1,6 @@
package com.ljsd.jieling.logic.family;
import com.ljsd.GameApplication;
import com.ljsd.jieling.config.SArenaSetting;
import com.ljsd.jieling.config.SGuildLevelConfig;
import com.ljsd.jieling.config.SGuildScoreConfig;
@ -10,6 +11,7 @@ import com.ljsd.jieling.db.redis.RedisUtil;
import com.ljsd.jieling.handler.map.behavior.BehaviorUtil;
import com.ljsd.jieling.logic.blood.BloodLogic;
import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.GuildCache;
import com.ljsd.jieling.logic.dao.root.GuildInfo;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.fight.CheckFight;
@ -93,11 +95,9 @@ public class GuildFightLogic {
* @throws Exception
*/
public static void viewDefendDetailInfo(ISession session, int uid, MessageTypeProto.MessageType messageType) throws Exception {
User user = UserManager.getUser(uid);
int guildId = user.getPlayerInfoManager().getGuildId();
FamilyFightInfo fightInfo = RedisUtil.getInstence().getMapEntry(RedisKey.FAMILY_FIGHT, String.valueOf(guildId), String.valueOf(uid), FamilyFightInfo.class);
TeamPosManager teamPosManager = user.getTeamPosManager();
public static void viewDefendDetailInfo(ISession session, int uid,int gid ,MessageTypeProto.MessageType messageType) throws Exception {
FamilyFightInfo fightInfo = RedisUtil.getInstence().getMapEntry(RedisKey.FAMILY_FIGHT, String.valueOf(gid), String.valueOf(uid), FamilyFightInfo.class);
CommonProto.Team.Builder team = CommonProto.Team.newBuilder();
CommonProto.TeamOneTeamInfo.Builder oneInfo = CommonProto.TeamOneTeamInfo.newBuilder();
if(fightInfo!=null){
@ -111,7 +111,10 @@ public class GuildFightLogic {
oneInfo.addRemainHp(remainHp);
}
}
oneInfo.setTotalForce(fightInfo.getForce());
}else{
User user = UserManager.getUser(uid);
TeamPosManager teamPosManager = user.getTeamPosManager();
List<TeamPosHeroInfo> teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(501);
if(teamPosHeroInfos==null){
teamPosHeroInfos = teamPosManager.getTeamPosForHero().get(1);
@ -119,8 +122,6 @@ public class GuildFightLogic {
for(TeamPosHeroInfo heroInfo:teamPosHeroInfos){
team.addHeroTid(user.getHeroManager().getHero(heroInfo.getHeroId()).getTemplateId());
}
}
oneInfo.setTeam(team);
int force = HeroLogic.getInstance().calTeamTotalForce(user, 501, false);
if(force==0){
force = HeroLogic.getInstance().calTeamTotalForce(user, 1, false);
@ -131,6 +132,8 @@ public class GuildFightLogic {
oneInfo.addPokemonInfos(posForPokenInfo.getPokenId());
}
}
}
oneInfo.setTeam(team);
Family.FamilyDefendDetailViewResponse.Builder response = Family.FamilyDefendDetailViewResponse.newBuilder();
response.setTeamInfo(oneInfo);
MessageUtil.sendMessage(session, 1, messageType.getNumber(), response.build(), true);
@ -168,8 +171,10 @@ public class GuildFightLogic {
private static Family.FamilyFightInfo familyFightDetailInfo(int guildId) throws Exception {
RedisUtil redisUtil = RedisUtil.getInstence();
Map<String, int[]> buffCache = redisUtil.getMapValues(RedisKey.FAMILY_FIGHT_BUFF, String.valueOf(guildId), String.class, int[].class);
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
Map<Integer, Integer> defendInfo = guildInfo.getDefendInfo();
// GuildInfo guildInfo = GuilidManager.guildInfoMap.get(guildId);
// Map<Integer, Integer> defendInfo = guildInfo.getDefendInfo();
GuildCache mapEntry = RedisUtil.getInstence().getMapEntry(RedisKey.FAMILY_INFO, "", String.valueOf(guildId), GuildCache.class);
// RedisUtil.getInstence().getMapValues(RedisKey.FAMILY_FIGHT,String.valueOf(guildId),Integer.class,FamilyFightInfo.class)
Map<Integer, FamilyFightInfo> fightValues = RedisUtil.getInstence().getMapValues(RedisKey.FAMILY_FIGHT, String.valueOf(guildId), Integer.class, FamilyFightInfo.class);
Family.FamilyFightInfo.Builder fightInfo = Family.FamilyFightInfo.newBuilder();
fightInfo.setGid(guildId);
@ -182,23 +187,20 @@ public class GuildFightLogic {
}
fightInfo.addBuildBuff(buffInfo);
}
for (Map.Entry<Integer, Integer> entry : defendInfo.entrySet()) {
int force = HeroLogic.getInstance().calTeamTotalForce(UserManager.getUser(entry.getKey()), 501, false);
if(force==0){
force = HeroLogic.getInstance().calTeamTotalForce(UserManager.getUser(entry.getKey()), 1, false);
}
for (Map.Entry<Integer, FamilyFightInfo> entry : fightValues.entrySet()) {
Family.FamilyFightPlayerInfo.Builder playerInfo = Family.FamilyFightPlayerInfo.newBuilder();
playerInfo.setBuildId(entry.getValue());
playerInfo.setBuildId(entry.getValue().getBuildId());
playerInfo.setStarCount(fightValues.get(entry.getKey()).getStarCount());
PlayerManager playerManager = UserManager.getUser(entry.getKey()).getPlayerInfoManager();
PlayerInfoCache player = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(entry.getKey()), PlayerInfoCache.class);
FamilyFightInfo forceInfo = RedisUtil.getInstence().getMapEntry(RedisKey.FAMILY_FIGHT, String.valueOf(guildId), String.valueOf(entry.getKey()), FamilyFightInfo.class);
Family.FamilyUserInfo.Builder userInfo = Family.FamilyUserInfo.newBuilder()
.setRoleUid(entry.getKey())
.setUserName(playerManager.getNickName())
.setUserLevel(playerManager.getLevel())
.setPosition(GuildLogic.getMemberType(entry.getKey(),GuilidManager.guildInfoMap.get(guildId).getMembers()))
.setSoulForce(force)
.setHead(playerManager.getHead())
.setFrame(playerManager.getHeadFrame())
.setUserName(player.getName())
.setUserLevel(player.getLevel())
.setPosition(player.getGuildPosition())
.setSoulForce(forceInfo.getForce())
.setHead(player.getHead())
.setFrame(player.getHeadFrame())
.setContribute(0);
playerInfo.setUserInfo(userInfo.build());
fightInfo.addUser(playerInfo);
@ -238,6 +240,9 @@ public class GuildFightLogic {
String key = RedisKey.getKey(RedisKey.FAMILY_FIGHT_RANK, "", false);
SGuildSetting guildSetting = sGuildSetting;
for (Integer gid : guildIds) {
if(redisUtil.getZSetScore(RedisUtil.getInstence().getKey("guild-release", ""),"",String.valueOf(gid))>0){
continue;
}
Map<Integer, SGuildLevelConfig> configMap = SGuildLevelConfig.sGuildLevelConfigMap;
//匹配处理
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(gid);
@ -287,10 +292,17 @@ public class GuildFightLogic {
int[] buffInfo = redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_BUFF, gid.toString(), entry.getValue().toString(), int[].class);
FamilyFightInfo fightInfo = new FamilyFightInfo();
//血量处理buff处理
int force = HeroLogic.getInstance().calTeamTotalForce(user, 501, false);
if(force==0){
force = HeroLogic.getInstance().calTeamTotalForce(user, 1, false);
}
Map<String, FamilyHeroInfo> heroAllAttribute = BloodLogic.getInstance().battleRecord(user, 501, buffInfo);
fightInfo.setHeroAttribute(heroAllAttribute);
fightInfo.setBuildId(entry.getValue());
fightInfo.setStarCount(guildSetting.getStarNum()[memberType-1]);
fightInfo.setForce(force);
redisUtil.putMapEntry(RedisKey.FAMILY_FIGHT, String.valueOf(guildInfo.getId()), String.valueOf(entry.getKey()), fightInfo);
familyTotalStar+=fightInfo.getStarCount();
}
@ -306,11 +318,12 @@ public class GuildFightLogic {
if (enemyFamily == -1) {
continue;
}
GuildInfo enemyInfo = GuilidManager.guildInfoMap.get(enemyFamily);
Family.EnemyFamily familyInfo = Family.EnemyFamily.newBuilder().setId(enemyInfo.getId())
GuildCache enemyInfo = RedisUtil.getInstence().getMapEntry(RedisKey.FAMILY_INFO, "", String.valueOf(enemyFamily), GuildCache.class);
// GuildInfo enemyInfo = GuilidManager.guildInfoMap.get(enemyFamily);
Family.EnemyFamily familyInfo = Family.EnemyFamily.newBuilder().setId(enemyFamily)
.setLevel(enemyInfo.getLevel())
.setName(enemyInfo.getName())
.setPictureId(1)
.setPictureId(enemyInfo.getIcon())
.setTotalStar(redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_TOTAL_STAR,"",String.valueOf(enemyFamily),Integer.class))
.setMyTotalStar(redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_TOTAL_STAR,"",String.valueOf(guildInfo.getId()),Integer.class))
.build();
@ -490,7 +503,8 @@ public class GuildFightLogic {
*/
public static void getFamilyFightRoundInfo(ISession session, MessageTypeProto.MessageType messageType) throws Exception {
RedisUtil redisUtil = RedisUtil.getInstence();
int enemyFamily = getEnemyFamily(UserManager.getUser(session.getUid()).getPlayerInfoManager().getGuildId());
int guildId = UserManager.getUser(session.getUid()).getPlayerInfoManager().getGuildId();
int enemyFamily = getEnemyFamily(guildId);
Integer attackCount = redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_ATTACK_COUNT,"",String.valueOf(session.getUid()),Integer.class);
if(attackCount==null){
attackCount = 0;
@ -503,16 +517,19 @@ public class GuildFightLogic {
.setAttackCount(attackCount)
.setJoinType(1);
if (enemyFamily != -1) {
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(enemyFamily);
GuildCache enemyInfo = RedisUtil.getInstence().getMapEntry(RedisKey.FAMILY_INFO, "", String.valueOf(enemyFamily), GuildCache.class);
// GuildInfo guildInfo = GuilidManager.guildInfoMap.get(enemyFamily);
if(enemyInfo!=null){
Family.EnemyFamily familyInfo = Family.EnemyFamily.newBuilder()
.setId(guildInfo.getId())
.setLevel(guildInfo.getLevel())
.setName(guildInfo.getName())
.setPictureId(1)
.setId(enemyFamily)
.setLevel(enemyInfo.getLevel())
.setName(enemyInfo.getName())
.setPictureId(enemyInfo.getIcon())
.setTotalStar(redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_TOTAL_STAR,"",String.valueOf(enemyFamily),Integer.class))
.setMyTotalStar(redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_TOTAL_STAR,"",String.valueOf(guildInfo.getId()),Integer.class))
.setMyTotalStar(redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT_TOTAL_STAR,"",String.valueOf(guildId),Integer.class))
.build();
response.setEnemy(familyInfo);
}
}else{
if(status!=0&&status!=1){
if(!startMatching){
@ -643,11 +660,11 @@ public class GuildFightLogic {
continue;
}
LOGGER.info("{}公会结算",str);
Map<Integer, Integer> enemyDefendInfo = GuilidManager.guildInfoMap.get(enemyFamily).getDefendInfo();
for(Map.Entry<Integer, Integer> defend:enemyDefendInfo.entrySet()){
FamilyFightInfo mapEntry = redisUtil.getMapEntry(RedisKey.FAMILY_FIGHT, String.valueOf(enemyFamily), String.valueOf(defend.getKey()), FamilyFightInfo.class);
if(mapEntry!=null){
buildStar[defend.getValue()-1] = buildStar[defend.getValue()-1]+mapEntry.getStarCount();
// Map<Integer, Integer> enemyDefendInfo = GuilidManager.guildInfoMap.get(enemyFamily).getDefendInfo();
Map<Integer, FamilyFightInfo> fightInfo = redisUtil.getMapValues(RedisKey.FAMILY_FIGHT, "", Integer.class, FamilyFightInfo.class);
for(Map.Entry<Integer, FamilyFightInfo> defend:fightInfo.entrySet()){
if(defend!=null){
buildStar[defend.getValue().getBuildId()-1] = buildStar[defend.getValue().getBuildId()-1]+defend.getValue().getStarCount();
}
}
for(int i = 0 ; i < buildStar.length;i++){
@ -674,6 +691,9 @@ public class GuildFightLogic {
int getStar = getTotalStar(Integer.parseInt(str));
int loseStar = getTotalStar(enemyFamily);
GuildInfo guildInfo = GuilidManager.guildInfoMap.get(Integer.parseInt(str));
if(guildInfo==null){
continue;
}
LOGGER.info("公会{}获得星数:{},失去星数{}",str,getStar,loseStar);
//战绩结算
int getExp = 0;
@ -721,9 +741,18 @@ public class GuildFightLogic {
if(guildInfo.getExp()+getExp>=levelConfigMap.get(guildInfo.getLevel()).getExp()){
guildInfo.updateExp(guildInfo.getExp()+getExp-levelConfigMap.get(guildInfo.getLevel()).getExp());
guildInfo.updateLevel(guildInfo.getLevel()+1);
RedisUtil.getInstence().putMapEntry(RedisKey.FAMILY_INFO,"", String.valueOf(guildInfo.getId()),new GuildCache(GameApplication.serverId,guildInfo.getIcon(),guildInfo.getLevel(),guildInfo.getName()));
}else{
guildInfo.updateExp(guildInfo.getExp()+getExp);
}
//个人奖励
// Set<ZSetOperations.TypedTuple<String>> zsetreverseRangeWithScores = RedisUtil.getInstence().getZsetreverseRangeWithScores(RedisKey.FAMILY_FIGHT_STAR_RANK, String.valueOf(guildId), 0, 20);
// Iterator<ZSetOperations.TypedTuple<String>> it = zsetreverseRangeWithScores.iterator();
// int rank = 1;
// Family.PersonalFightResultResponse.Builder response = Family.PersonalFightResultResponse.newBuilder();
// while (it.hasNext()){
// rank++;
// }
}
MongoUtil.getLjsdMongoTemplate().lastUpdate();
}
@ -746,15 +775,16 @@ public class GuildFightLogic {
while (it.hasNext()){
ZSetOperations.TypedTuple<String> personal = it.next();
int uid = Integer.parseInt(personal.getValue());
PlayerManager playerInfoManager = UserManager.getUser(uid).getPlayerInfoManager();
PlayerInfoCache playerInfo = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(uid), PlayerInfoCache.class);
// PlayerManager playerInfoManager = UserManager.getUser(uid).getPlayerInfoManager();
Family.PersonalFightResult.Builder fightResult = Family.PersonalFightResult.newBuilder()
.setRank(rank)
.setAttackCount(RedisUtil.getInstence().getMapEntry(RedisKey.FAMILY_FIGHT_ATTACK_COUNT,"",String.valueOf(uid),Integer.class))
.setUid(uid)
.setHead(1)
.setHeadFrame(playerInfoManager.getHeadFrame())
.setPosition(GuildLogic.getMemberType(Integer.parseInt(personal.getValue()),GuilidManager.guildInfoMap.get(playerInfoManager.getGuildId()).getMembers()))
.setName(playerInfoManager.getNickName())
.setHeadFrame(playerInfo.getHeadFrame())
.setPosition(playerInfo.getGuildPosition())
.setName(playerInfo.getName())
.setStarCount(personal.getScore().intValue());
response.addResult(fightResult.build());
rank++;

View File

@ -1,7 +1,9 @@
package com.ljsd.jieling.logic.family;
import com.google.protobuf.GeneratedMessage;
import com.ljsd.GameApplication;
import com.ljsd.jieling.config.SErrorCodeEerverConfig;
import com.ljsd.jieling.config.SGuildLevelConfig;
import com.ljsd.jieling.config.SGuildSetting;
import com.ljsd.jieling.core.GlobalsDef;
import com.ljsd.jieling.dataReport.reportBeans_37.ChatContentType;
@ -13,10 +15,7 @@ import com.ljsd.jieling.globals.BIReason;
import com.ljsd.jieling.globals.Global;
import com.ljsd.jieling.logic.OnlineUserManager;
import com.ljsd.jieling.logic.dao.*;
import com.ljsd.jieling.logic.dao.root.GuildApply;
import com.ljsd.jieling.logic.dao.root.GuildInfo;
import com.ljsd.jieling.logic.dao.root.GuildLog;
import com.ljsd.jieling.logic.dao.root.User;
import com.ljsd.jieling.logic.dao.root.*;
import com.ljsd.jieling.logic.mail.MailLogic;
import com.ljsd.jieling.network.session.ISession;
import com.ljsd.jieling.protocols.CommonProto;
@ -92,6 +91,10 @@ public class GuildLogic {
GuilidManager.addGuildInfo(guildInfo);
user.getPlayerInfoManager().setGuildId(guildInfo.getId());
addGuildLog(guildInfo.getId(),GuildDef.Log.CREATE,user.getPlayerInfoManager().getNickName());
RedisUtil.getInstence().putMapEntry(RedisKey.FAMILY_INFO,"",String.valueOf(guildInfo.getId()),new GuildCache(GameApplication.serverId,guildInfo.getIcon(),guildInfo.getLevel(),guildInfo.getName()));
PlayerInfoCache cache = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(uid), PlayerInfoCache.class);
cache.setGuildPosition(GlobalsDef.CHAIRMAN);
RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(uid),cache);
Family.FamilyCreateResponse build = Family.FamilyCreateResponse.newBuilder()
.setFamilyBaseInfo(CBean2Proto.getFamilyBaseInfo(guildInfo))
.setFamilyUserInfo(CBean2Proto.getFamilyUserInfo(user,GlobalsDef.CHAIRMAN))
@ -193,7 +196,7 @@ public class GuildLogic {
Map<Integer, GuildApply> applyGuildPersonInfos = GuilidManager.getApplyGuildInfos(session.getUid(), 1);
SGuildSetting guildSetting = SGuildSetting.sGuildSetting;
if(applyGuildPersonInfos.size()>=guildSetting.getApplyLimit()){
MessageUtil.sendErrorResponse(session,0,msgId,"已达申请上线,无法继续申请");
MessageUtil.sendErrorResponse(session,0,msgId,"您当前申请上线,无法继续申请");
return;
}
for(Integer applyGuildId : applyGuilds){
@ -232,6 +235,9 @@ public class GuildLogic {
return;
}
//todo 判读人数是否已达上限
if(guildInfo.getTotalMembers()>=SGuildLevelConfig.sGuildLevelConfigMap.get(guildInfo.getLevel()).getNum()){
MessageUtil.sendErrorResponse(session,0,msgId,"该工会人数已达上限");
}
boolean isSuccess = RedisUtil.getInstence().tryGetDistributedLock(RedisKey.OPERATE_FAMILY, Integer.toString(guildId), Integer.toString(uid), 500);
if(!isSuccess){
MessageUtil.sendErrorResponse(session,0, msgId,"请稍后重试");
@ -246,6 +252,9 @@ public class GuildLogic {
}
RedisUtil.getInstence().expire(RedisKey.getKey(RedisKey.FAMILY_JOIN,String.valueOf(uid),false),TimeUtils.DAY);
addGuildLog(guildInfo.getId(),GuildDef.Log.JOIN,user.getPlayerInfoManager().getNickName());
PlayerInfoCache cache = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(uid), PlayerInfoCache.class);
cache.setGuildPosition(GlobalsDef.MEMBER);
RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(uid),cache);
Family.FamilyJoinIndicaion build = Family.FamilyJoinIndicaion.newBuilder().setFamilyBaseInfo(CBean2Proto.getFamilyBaseInfo(guildInfo)).setFamilyUserInfo(CBean2Proto.getFamilyUserInfo(user, GlobalsDef.MEMBER)).build();
Family.FamilyJoinResponse response = Family.FamilyJoinResponse.newBuilder().setFamilyJoinIndicaion(build).build();
MessageUtil.sendMessage(session,1,msgId,response,true);
@ -362,6 +371,7 @@ public class GuildLogic {
int msgId = MessageTypeProto.MessageType.FAMILY_OPERATION_APPLY_LIST_RESPONSE_VALUE;
if(getMemberType(uid,guildInfo.getMembers())>=GlobalsDef.MEMBER) {
MessageUtil.sendErrorResponse(session,0,msgId,"你无权操作申请");
return;
}
if(guildId == 0){
MessageUtil.sendErrorResponse(session,0,msgId,"未加入公会");
@ -372,6 +382,10 @@ public class GuildLogic {
MessageUtil.sendErrorResponse(session,0, msgId,"请稍后重试");
return;
}
if(GuildFightLogic.getStatus()!=0&&(type==1||type==3)){
MessageUtil.sendErrorResponse(session,0, msgId,"公会战期间不允许加入成员");
return;
}
try {
Map<Integer, GuildApply> applyGuild = GuilidManager.getApplyGuildInfos(guildId, 0);
switch (type){
@ -381,6 +395,10 @@ public class GuildLogic {
for(Set<Integer> memberOfType : members.values()){
count+=memberOfType.size();
}
if(guildInfo.getTotalMembers()+applyGuild.size()>SGuildLevelConfig.sGuildLevelConfigMap.get(guildInfo.getLevel()).getNum()){
MessageUtil.sendErrorResponse(session,0,msgId,"全部同意后公会人数将大于最大人数,请单个同意");
return;
}
for(Integer addUid : applyGuild.keySet()){
if(30-count<=0){
break;
@ -402,6 +420,10 @@ public class GuildLogic {
}
break;
case 3: //同意一个
if(guildInfo.getTotalMembers()>=SGuildLevelConfig.sGuildLevelConfigMap.get(guildInfo.getLevel()).getNum()){
MessageUtil.sendErrorResponse(session,0,msgId,"公会人数已满,无法加入");
return;
}
applyToJoin(guildInfo,applyId,true);
Map<Integer, GuildApply> applyPersonal = GuilidManager.getApplyGuildInfos(applyId, 1);
for(Map.Entry<Integer, GuildApply> personalEntry:applyPersonal.entrySet()) {
@ -482,6 +504,10 @@ public class GuildLogic {
MessageUtil.sendErrorResponse(session,0,msgId,"该人已被踢出");
return;
}
if(GuildFightLogic.getStatus()!=0){
MessageUtil.sendErrorResponse(session,0, msgId,"公会战期间不允许踢出成员");
return;
}
//如果有防守信息则删除
if(guildInfo.getDefendInfo().containsKey((targetUid))){
guildInfo.removeDefendInfo(targetUid);
@ -520,8 +546,20 @@ public class GuildLogic {
MessageUtil.sendErrorResponse(session,0,msgId,"无权操作");
return;
}
if(GuildFightLogic.getStatus()!=0){
MessageUtil.sendErrorResponse(session,0, msgId,"公会战期间不允许任命");
return;
}
if(guildInfo.getMembers().get(2)!=null&&guildInfo.getMembers().get(2).size()>=SGuildLevelConfig.sGuildLevelConfigMap.get(guildInfo.getLevel()).getOfficalNum()){
MessageUtil.sendErrorResponse(session,0,msgId,"官员人数已上限");
return;
}
guildInfo.removeMember(targetType,targetUid);
guildInfo.addMembers(position,targetUid);
PlayerInfoCache cache = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(uid), PlayerInfoCache.class);
cache.setGuildPosition(position);
RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(uid),cache);
sendPositionChange(targetUid,position);
User targetUser = UserManager.getUser(targetUid);
if(position == GlobalsDef.CHAIRMAN){
@ -716,6 +754,9 @@ public class GuildLogic {
if(guildInfo.getDefendInfo().containsKey((uid))){
guildInfo.removeDefendInfo(uid);
}
PlayerInfoCache cache = RedisUtil.getInstence().getMapEntry(RedisKey.PLAYER_INFO_CACHE, "", String.valueOf(uid), PlayerInfoCache.class);
cache.setGuildPosition(0);
RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(uid),cache);
guildInfo.removeMember(uidType,uid);
user.getPlayerInfoManager().setGuildId(0);
user.getGuildMyInfo().clearOfLevelGuild();
@ -857,14 +898,16 @@ public class GuildLogic {
public static void changeFamilyIcon(ISession session, int iconId, MessageTypeProto.MessageType messageType) throws Exception {
User user = UserManager.getUser(session.getUid());
PlayerManager playerInfoManager = user.getPlayerInfoManager();
GuilidManager.guildInfoMap.get(playerInfoManager.getGuildId()).updateIcon(iconId);
int[] cost = SGuildSetting.sGuildSetting.getTotemCost();
int[][] cost1 = new int[1][];
cost1[0] = cost;
boolean b = ItemUtil.itemCost(user, cost1, BIReason.FAMILY_SET_ICON, 1);
if (!b){
MessageUtil.sendErrorResponse(session,0,messageType.getNumber(),"消耗物品不足");
return;
}
GuilidManager.guildInfoMap.get(playerInfoManager.getGuildId()).updateIcon(iconId);
RedisUtil.getInstence().putMapEntry(RedisKey.FAMILY_INFO,"", String.valueOf(playerInfoManager.getGuildId()),new GuildCache(GameApplication.serverId,iconId,GuilidManager.guildInfoMap.get(playerInfoManager.getGuildId()).getLevel(),GuilidManager.guildInfoMap.get(playerInfoManager.getGuildId()).getName()));
MessageUtil.sendMessage(session,1,messageType.getNumber(),null,true);
}
}

View File

@ -129,25 +129,25 @@ public class CombatLogic {
int contiue = sFoodsConfig.getContiue();
if(contiue==0){
contiue=-1;
// int teamId = mapManager.getTeamId();
// List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(teamId);
// Map<Integer,Integer> foodAddMap = new HashMap<>();
// getFoodAttributeAdd(GlobalsDef.FOOD_ADDITION_BATTLE_TYPE, GlobalsDef.FOOD_EAT_AFFECT_PERSON, foodAddMap, sFoodsConfig);
// for (TeamPosHeroInfo heroInfo : teamPosHeroInfoList) {
// Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
// if (hero == null) {
// continue;
// }
// Map<Integer, Integer> heroAllAttribute = user.getMapManager().getHeroAllAttributeByHeroId(hero.getId());
// if(heroAllAttribute == null || heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId()) <= 0){
// continue;
// }
//
// HeroLogic.getInstance().combinedAttribute(foodAddMap,heroAllAttribute);
// HeroLogic.getInstance().calInteractAdd(heroAllAttribute);
// heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
// }
// mapManager.setHeroAllAttributeMap(heroAllAttributeMap);
int teamId = mapManager.getTeamId();
List<TeamPosHeroInfo> teamPosHeroInfoList = user.getTeamPosManager().getTeamPosForHero().get(teamId);
Map<Integer,Integer> foodAddMap = new HashMap<>();
getFoodAttributeAdd(GlobalsDef.FOOD_ADDITION_BATTLE_TYPE, GlobalsDef.FOOD_EAT_AFFECT_PERSON, foodAddMap, sFoodsConfig);
for (TeamPosHeroInfo heroInfo : teamPosHeroInfoList) {
Hero hero = user.getHeroManager().getHero(heroInfo.getHeroId());
if (hero == null) {
continue;
}
Map<Integer, Integer> heroAllAttribute = user.getMapManager().getHeroAllAttributeByHeroId(hero.getId());
if(heroAllAttribute == null || heroAllAttribute.get(HeroAttributeEnum.CurHP.getPropertyId()) <= 0){
continue;
}
HeroLogic.getInstance().combinedAttribute(foodAddMap,heroAllAttribute);
HeroLogic.getInstance().calInteractAdd(heroAllAttribute);
heroAllAttributeMap.put(hero.getId(), heroAllAttribute);
}
mapManager.setHeroAllAttributeMap(heroAllAttributeMap);
}
mapManager.eatFood(foodIdOrEventId,contiue);
}

View File

@ -523,6 +523,7 @@ public class PlayerLogic {
cache.setName(playerInfoManager.getNickName());
cache.setLevel(playerInfoManager.getLevel());
cache.setServerId(GameApplication.serverId);
cache.setGuildPosition(0);
RedisUtil.getInstence().putMapEntry(RedisKey.PLAYER_INFO_CACHE,"",String.valueOf(user.getId()),cache);
}
}

View File

@ -70,21 +70,6 @@ public class MinuteTask extends Thread {
CoreLogic.getInstance().checkCoreCdk();
BuyGoodsLogic.minuteCheckReharge();
RedisUtil.getInstence().set(RedisKey.ONLINE_NUM+RedisKey.Delimiter_colon+GameApplication.serverId, String.valueOf(OnlineUserManager.sessionMap.entrySet().size()));
ServerConfig serverConfigTmp = MongoUtil.getInstence().getMyMongoTemplate().findById(1, ServerConfig.class);
if(serverConfigTmp.getWorldLevel()==1){
Query query = new Query();
query.with(new Sort(Sort.Direction.DESC,"playerManager.level"));
query.fields().include("playerManager.level");
List<User> users = MongoUtil.getLjsdMongoTemplate().findAllByCondition(query, User.class);
int size = (int)(users.size()*0.85);
int level = 0;
for(int i = 0 ; i <size;i++){
level+=users.get(i).getPlayerInfoManager().getLevel();
}
LOGGER.info("计算世界等级为{}",level/size);
serverConfigTmp.setWorldLevel(level/size);
MongoUtil.getLjsdMongoTemplate().save(serverConfigTmp);
}
LOGGER.info("MinuteTask end...");
} catch (Exception e) {
LOGGER.error("e",e);

View File

@ -139,6 +139,9 @@ public class ItemUtil {
private static void combineRewardDropGroup(User user, int[] dropGroupIds, float dropRatio, Map<Integer, Integer> itemMap, Map<Integer, Integer> cardMap, Map<Integer, Integer> equipMap, Map<Integer, Integer> randomMap) {
for (int dropGroupId : dropGroupIds) {
if(SEndlessDifficulty.difficultyReward.containsKey(dropGroupId)){
dropGroupId = SEndlessDifficulty.difficultyReward.get(dropGroupId);
}
SRewardGroup sRewardGroup = SRewardGroup.getsRewardItemMap().get(dropGroupId);
if (sRewardGroup == null) {
continue;

View File

@ -1,7 +1,9 @@
package com.ljsd.jieling.util;
import com.ljsd.jieling.config.SEndlessDifficulty;
import com.ljsd.jieling.config.SMonsterConfig;
import com.ljsd.jieling.config.SMonsterGroup;
import com.ljsd.jieling.handler.map.MapLogic;
import com.ljsd.jieling.protocols.CommonProto;
import java.util.ArrayList;
@ -77,6 +79,9 @@ public class MonsterUtil {
Map<Integer, SMonsterConfig> integerSMonsterConfigMap = SMonsterConfig.getsMonsterConfigMap();
int maxForce = 0;
for(int i = 0 ; i < groupIds.length;i++){
if(SEndlessDifficulty.difficultyMonster.containsKey(groupIds[i])){
groupIds[i]= SEndlessDifficulty.difficultyMonster.get(groupIds[i]);
}
SMonsterGroup sMonsterGroup = integerSMonsterGroupMap.get(groupIds[i]);
int[][] contents = sMonsterGroup.getContents();
int totalMonsterForce = 0;