建木神树和四灵试炼,公告添加
parent
987e392ae9
commit
abb94cdfb1
|
@ -1,9 +1,11 @@
|
|||
package com.ljsd.jieling.handler.activity;
|
||||
|
||||
import com.google.protobuf.GeneratedMessage;
|
||||
import com.ljsd.jieling.chat.logic.ChatLogic;
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.handler.BaseHandler;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.UserMainTeamForceEvent;
|
||||
|
@ -11,6 +13,7 @@ import com.ljsd.jieling.logic.dao.UserManager;
|
|||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.item.ItemLogic;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import config.SErrorCodeEerverConfig;
|
||||
import config.SGodHoodTreeLevel;
|
||||
import manager.STableManager;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
@ -51,7 +54,7 @@ public class UpgradeGodTreeHandler extends BaseHandler<ActivityProto.UpgradeGodT
|
|||
|
||||
// 等级不存在或已满级
|
||||
if (sGodHoodTreeLevel == null || sGodHoodTreeLevel.getLvupCost().length <= 0){
|
||||
throw new ErrorCodeException(ErrorCode.HAS_AWAKE);
|
||||
throw new ErrorCodeException(ErrorCode.HAS_AWAKE,"建木神树已满级");
|
||||
}
|
||||
|
||||
int[][] items = new int[1][];
|
||||
|
@ -69,6 +72,12 @@ public class UpgradeGodTreeHandler extends BaseHandler<ActivityProto.UpgradeGodT
|
|||
// 阵容战力改变
|
||||
Poster.getPoster().dispatchEvent(new UserMainTeamForceEvent(uid));
|
||||
|
||||
// 发送公告
|
||||
if (sGodHoodTreeLevel.getNeedBroadCast() == 1){
|
||||
String message = SErrorCodeEerverConfig.getI18NMessage("JianMuLevel_Hint", new Object[]{user.getPlayerInfoManager().getNickName(), user.getPlayerInfoManager().getTreeLevel()});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message, Global.DILIGENT, "0", 0, 0, 0, 0, 0);
|
||||
}
|
||||
|
||||
return ActivityProto.UpgradeGodTreeResponse.newBuilder().build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package com.ljsd.jieling.logic.activity.fourChallenge;
|
||||
|
||||
import com.ljsd.fight.ArenaRecord;
|
||||
import com.ljsd.jieling.chat.logic.ChatLogic;
|
||||
import com.ljsd.jieling.core.FunctionIdEnum;
|
||||
import com.ljsd.jieling.core.GlobalsDef;
|
||||
import com.ljsd.jieling.core.HandlerLogicThread;
|
||||
|
@ -9,6 +10,7 @@ import com.ljsd.jieling.db.redis.RedisUtil;
|
|||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.logic.OnlineUserManager;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.TeamPosHeroInfo;
|
||||
|
@ -26,10 +28,7 @@ import com.ljsd.jieling.logic.rank.RankEnum;
|
|||
import com.ljsd.jieling.logic.rank.rankImpl.AbstractRank;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.*;
|
||||
import config.SCHero;
|
||||
import config.SCampTowerConfig;
|
||||
import config.SCampTowerSetting;
|
||||
import config.SGlobalSystemConfig;
|
||||
import config.*;
|
||||
import manager.STableManager;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -263,7 +262,11 @@ public class FourChallengeLogic {
|
|||
RedisUtil.getInstence().putMapEntry(RedisKey.FOUR_CHALLENGE, miniSubKey, floorIds, arenaRecord);
|
||||
}
|
||||
}
|
||||
|
||||
// 发送公告
|
||||
if (sCampTowerConfig.getNeedBroadCast() == 1){
|
||||
String message = SErrorCodeEerverConfig.getI18NMessage("SiLingLevel_Hint", new Object[]{user.getPlayerInfoManager().getNickName(), getType(campId), floorId});
|
||||
ChatLogic.getInstance().sendSysChatMessage(message, Global.DILIGENT, "0", 0, 0, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (type == 1) {
|
||||
|
@ -283,6 +286,21 @@ public class FourChallengeLogic {
|
|||
MessageUtil.sendMessage(session, 1, MessageTypeProto.MessageType.FOUR_CHALLENGE_DO_RESPONSE_VALUE, response.build(), true);
|
||||
}
|
||||
|
||||
private String getType(int type){
|
||||
switch (type){
|
||||
case 1:
|
||||
return "人塔";
|
||||
case 2:
|
||||
return "佛塔";
|
||||
case 3:
|
||||
return "妖塔";
|
||||
case 4:
|
||||
return "道塔";
|
||||
default:
|
||||
return "error";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否开启四灵
|
||||
* @param user
|
||||
|
|
|
@ -20,6 +20,7 @@ public class SCampTowerConfig implements BaseConfig {
|
|||
|
||||
private int[][] commonReward;
|
||||
|
||||
private int needBroadCast;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
@ -51,5 +52,7 @@ public class SCampTowerConfig implements BaseConfig {
|
|||
return commonReward;
|
||||
}
|
||||
|
||||
|
||||
public int getNeedBroadCast() {
|
||||
return needBroadCast;
|
||||
}
|
||||
}
|
|
@ -12,7 +12,8 @@ public class SGodHoodTreeLevel implements BaseConfig {
|
|||
|
||||
private int[] lvupCost;
|
||||
|
||||
|
||||
private int needBroadCast;
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
||||
|
@ -27,5 +28,7 @@ public class SGodHoodTreeLevel implements BaseConfig {
|
|||
return lvupCost;
|
||||
}
|
||||
|
||||
|
||||
public int getNeedBroadCast() {
|
||||
return needBroadCast;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue