Merge branch 'master_test_gn' into dev_equip
# Conflicts: # serverlogic/src/main/java/com/ljsd/jieling/globals/BIReason.java # serverlogic/src/main/java/com/ljsd/jieling/handler/GetPlayerInfoHandler.javaback_recharge
commit
609bdac818
|
@ -411,5 +411,6 @@ public interface BIReason {
|
|||
int COMPARENUM_TOTAL_REWARD = 1307; // 比数字小游戏章节累计奖励
|
||||
|
||||
int ZHAIXINGGE_BAKCUP_ITEM = 1308;//摘星阁装备强化调整返还道具
|
||||
int MAXESPECIALEQUIPHANDLE = 1309; //法宝最高上限回滚处理
|
||||
|
||||
}
|
|
@ -3,28 +3,27 @@ package com.ljsd.jieling.handler;
|
|||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.logic.GlobleSystemLogic;
|
||||
import com.ljsd.jieling.netty.cocdex.PacketNetData;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.Family;
|
||||
import rpc.protocols.MessageTypeProto;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.Set;
|
||||
|
||||
public class GetCarGrapRecordHandler extends BaseHandler{
|
||||
public class GetCarGrapRecordHandler extends BaseHandler<Family.CarGrapRecordRequest>{
|
||||
@Override
|
||||
public MessageTypeProto.MessageType getMessageCode() {
|
||||
return MessageTypeProto.MessageType.GET_CAR_GRAP_RECORD_REQUEST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(ISession iSession, PacketNetData netData) throws Exception {
|
||||
public void processWithProto(ISession iSession, Family.CarGrapRecordRequest carGrapRecordRequest) throws Exception {
|
||||
Calendar instance = Calendar.getInstance();
|
||||
instance.setTimeInMillis(System.currentTimeMillis()-2*TimeUtils.ONE_DAY);
|
||||
instance.setTimeInMillis(System.currentTimeMillis());
|
||||
instance.set(Calendar.HOUR_OF_DAY,0);
|
||||
instance.set(Calendar.MINUTE,0);
|
||||
instance.set(Calendar.SECOND,0);
|
||||
|
@ -43,6 +42,9 @@ public class GetCarGrapRecordHandler extends BaseHandler{
|
|||
Family.CarGrapRecordResponse.Builder builder = Family.CarGrapRecordResponse.newBuilder();
|
||||
for(ZSetOperations.TypedTuple<String> item : zsetreverseRangeWithScores ){
|
||||
int time = item.getScore().intValue();
|
||||
if (time < leatestTime){
|
||||
continue;
|
||||
}
|
||||
String value = item.getValue();
|
||||
String[] split = value.split("\\|");
|
||||
int last = value.lastIndexOf('|');
|
||||
|
|
|
@ -256,18 +256,8 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
wishOldUserRandomNumInit(user);
|
||||
// 摘星阁装备强化调整后返还玩家强化道具
|
||||
calEquipStrongData(user);
|
||||
|
||||
//hotfix 月卡
|
||||
// PlayerLogic.getInstance().getMonthCardInfo(user);
|
||||
// int monthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.MONTHCARDID).getPrice();
|
||||
// int lmonthline = STableManager.getConfig(SMonthcardConfig.class).get(Global.LMONTHCARDID).getPrice();
|
||||
// if(newRechargeInfo.getMonthRr()>=monthline&&playerInfoManager.getMonthCard().getOrDefault(1,0)==0){
|
||||
// user.getPlayerInfoManager().getMonthCard().put(Global.MONTHCARDID, (int) (System.currentTimeMillis() / 1000));
|
||||
// }
|
||||
// if(newRechargeInfo.getsMonthRr()>=lmonthline&&playerInfoManager.getMonthCard().getOrDefault(2,0)==0){
|
||||
// user.getPlayerInfoManager().getMonthCard().put(Global.LMONTHCARDID, (int) (System.currentTimeMillis() / 1000));
|
||||
// Poster.getPoster().dispatchEvent(new NewWelfareEvent(user, NewWelfareTypeEnum.RECHARGE_BUY.getType(),Global.LMONTHCARDID));
|
||||
// }
|
||||
// 法宝最高等级处理
|
||||
maxEspecialEquipHandle(user);
|
||||
|
||||
// 四灵试炼初始化
|
||||
FourChallengeLogic.getInstance().firstGetTimes(user);
|
||||
|
@ -565,6 +555,50 @@ public class GetPlayerInfoHandler extends BaseHandler{
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 法宝最高等级处理
|
||||
* @param user
|
||||
* @throws Exception
|
||||
*/
|
||||
private void maxEspecialEquipHandle(User user) throws Exception {
|
||||
// 公用数据
|
||||
List<Hero> heroList = user.getHeroManager().getHeroMap().values().stream().collect(Collectors.toList());
|
||||
Map<Integer, SCHero> heroMap = SCHero.getsCHero();
|
||||
Map<Integer, Map<Integer, SEquipTalismana>> talismanaStarMap = SEquipTalismana.equipTalismanaStarMap;
|
||||
int maxLimit = SSpecialConfig.getIntegerValue(SSpecialConfig.EquipTalismanaUpperLimit);
|
||||
ArrayList<int[][]> itemList = new ArrayList<>();
|
||||
|
||||
for (Hero hero : heroList) {
|
||||
// 获取英雄的法宝信息
|
||||
int[] equipTalismana = heroMap.get(hero.getTemplateId()).getEquipTalismana();
|
||||
if (equipTalismana == null || equipTalismana.length < 2) {
|
||||
continue;
|
||||
}
|
||||
// 验证最高等级是否满足
|
||||
int level = hero.getOriginalEspecialEquipLevel();
|
||||
if (level <= maxLimit){
|
||||
continue;
|
||||
}
|
||||
// 获得道具
|
||||
TreeMap<Integer, SEquipTalismana> talismanaTreeMap = new TreeMap<>(talismanaStarMap.get(equipTalismana[1]));
|
||||
Map<Integer, SEquipTalismana> subMap = talismanaTreeMap.subMap(maxLimit, level);
|
||||
for (SEquipTalismana talismana : subMap.values()) {
|
||||
itemList.add(talismana.getRankupBasicMaterial());
|
||||
}
|
||||
// 设置等级到最高
|
||||
hero.updateEspecial(maxLimit);
|
||||
// 更新战力
|
||||
Poster.getPoster().dispatchEvent(new SaveHeroForceEvent(user.getId(),hero.getId()));
|
||||
LOGGER.info("===========法宝最高等级处理道具返还,玩家id:{},法宝:{},原始等级:{},当前等级:{},返还道具:{}",user.getId(),equipTalismana[1],level,maxLimit,JSON.toJSONString(itemList));
|
||||
}
|
||||
// 道具进入背包
|
||||
ItemUtil.drop(user,itemList, BIReason.MAXESPECIALEQUIPHANDLE);
|
||||
// 邮件提醒
|
||||
String title = SErrorCodeEerverConfig.getI18NMessage("fabao_mail_title");
|
||||
String content = SErrorCodeEerverConfig.getI18NMessage("fabao_mail_txt");
|
||||
MailLogic.getInstance().sendMail(user.getId(),title,content,"",TimeUtils.nowInt(),Global.MAIL_EFFECTIVE_TIME);
|
||||
}
|
||||
|
||||
/**
|
||||
* 摘星阁装备强化调整后返还玩家强化道具
|
||||
* @param user
|
||||
|
|
|
@ -3184,18 +3184,24 @@ public class MapLogic {
|
|||
}
|
||||
|
||||
// 怪物
|
||||
int killNum = 0;//杀敌数量
|
||||
List<Integer> monsterCell = eventMap.getOrDefault(4, new ArrayList<>());
|
||||
for (Integer key : monsterCell) {
|
||||
Cell cell = mapInfo.get(key);
|
||||
if (cell == null || cell.getEventId() == -1){
|
||||
continue;
|
||||
}
|
||||
manager.updateTrialKillCount(trialInfo.getKillCount()+1);
|
||||
killNum++;
|
||||
SEventPointConfig point = eventPointConfig.get(cell.getEventId());
|
||||
SMonsterGroup monsterGroup = SMonsterGroup.getsMonsterGroupMap().get(point.getOption()[0]);
|
||||
ItemUtil.drop(user, monsterGroup.getRewardgroup(), drop, 1, 0, BIReason.MAP_FAST_FIGHT_REWARD);
|
||||
BehaviorUtil.destoryApointXY(user, cell.getCellId());
|
||||
}
|
||||
// 扫荡,boss,增加杀敌数量
|
||||
if (manager.getTrialInfo().getEnergy() != -2){
|
||||
killNum++;
|
||||
}
|
||||
manager.updateTrialKillCount(trialInfo.getKillCount()+killNum);
|
||||
|
||||
// 宝箱
|
||||
List<Integer> boxCell = eventMap.getOrDefault(5, new ArrayList<>());
|
||||
|
|
|
@ -12,7 +12,11 @@ import java.util.*;
|
|||
public class TrialInfo extends MongoBase {
|
||||
//默认一层
|
||||
private int floor = 1;
|
||||
|
||||
/**
|
||||
* 0:闯关
|
||||
* -1:boss
|
||||
* -2:传送门
|
||||
*/
|
||||
private int energy;
|
||||
//进入副本英雄信息
|
||||
private Map<String,TrailHero> heroInfo = new HashMap<>(5);
|
||||
|
|
|
@ -355,17 +355,18 @@ public class TowerMap extends AbstractMap {
|
|||
eventMap.put(4,new ArrayList<>(cellMap4.keySet()));//怪物
|
||||
eventMap.put(5,list);//宝箱
|
||||
|
||||
mapManager.setTrialEnergy(0);
|
||||
//大于10000要生成传送门
|
||||
if(floor>10000){
|
||||
Cell transport = createTransport(floor);
|
||||
newMap.put(transport.getCellId(),transport);
|
||||
mapManager.setTrialEnergy(-2);
|
||||
}
|
||||
|
||||
SChallengeMapConfig challengeMapConfig = STableManager.getConfig(SChallengeMapConfig.class).get(sTrialConfig.getMapId());
|
||||
int xy = CellUtil.xy2Pos(challengeMapConfig.getPosition()[0], challengeMapConfig.getPosition()[1]);
|
||||
mapManager.setCurXY(xy);
|
||||
mapManager.setMapInfo(newMap);
|
||||
mapManager.setTrialEnergy(0);
|
||||
mapManager.setCurMapId(sTrialConfig.getMapId());
|
||||
mapManager.updateEventMap(eventMap);
|
||||
if(mapManager.getTowerUnusedBuffer()==null){
|
||||
|
|
|
@ -63,7 +63,7 @@ public class TransformationUpGradeHandler extends BaseHandler<HeroInfoProto.Tran
|
|||
}
|
||||
int[][] costItem = {{curConfig.getExp()[0], curConfig.getExp()[1]}};
|
||||
if (!ItemUtil.itemCost(user, costItem, BIReason.TRANSFORMATION_CARD_LEVEL_COST, 1)) {
|
||||
return;
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
info.setLevel(info.getLevel() + 1);
|
||||
user.getHeroManager().putTransformationList(info);
|
||||
|
@ -89,21 +89,17 @@ public class TransformationUpGradeHandler extends BaseHandler<HeroInfoProto.Tran
|
|||
num = changingCard.getStarUpCost()[info.getStar()][1];
|
||||
quantity = changingCard.getStarUpCost()[info.getStar()][0];
|
||||
}
|
||||
for(Object itemId:costMap.keySet().toArray()){
|
||||
int itemid = (int)itemId;
|
||||
SItem sItem = SItem.getsItemMap().get(itemid);
|
||||
for (Integer itemId : costMap.keySet()) {
|
||||
SItem sItem = SItem.getsItemMap().get(itemId);
|
||||
if(sItem == null || sItem.getQuantity() != quantity){
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.TransformationUpGradeResponse.getNumber(), builder.build(), true);
|
||||
return;
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
}
|
||||
if(costMap.values().stream().mapToInt(Integer::intValue).sum() != num ){
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.TransformationUpGradeResponse.getNumber(), builder.build(), true);
|
||||
return;
|
||||
if(costMap.values().size() < num){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
if (!ItemUtil.itemCost(user, costMap, BIReason.TRANSFORMATION_CARD_STAR_COST, 1)) {
|
||||
MessageUtil.sendMessage(iSession, 1, MessageTypeProto.MessageType.TransformationUpGradeResponse.getNumber(), builder.build(), true);
|
||||
return;
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
}
|
||||
if (info != null) {
|
||||
info.setStar(info.getStar() + 1);
|
||||
|
|
|
@ -69,23 +69,23 @@ public class UpOrDownTransformationHandler extends BaseHandler<HeroInfoProto.UpO
|
|||
info.setIndex(index);
|
||||
}
|
||||
else {
|
||||
// 激活变身卡需要消耗道具
|
||||
// 激活变身卡
|
||||
if (info == null){
|
||||
int[][] costItem = {{changingCard.getCardId(),1}};
|
||||
ItemUtil.itemCost(user,costItem, BIReason.TRANSFORMATION_CARD_COST,1);
|
||||
}
|
||||
// 激活或者卸下变身卡
|
||||
if(info == null){
|
||||
boolean cost = ItemUtil.itemCost(user, costItem, BIReason.TRANSFORMATION_CARD_COST, 1);
|
||||
if (!cost){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH,"激活变身卡道具不足");
|
||||
}
|
||||
info = new TransformationInfo(id, 0, 0);
|
||||
info.setLevel(1);
|
||||
info.setStar(0);
|
||||
//激活给变身之力
|
||||
CommonProto.Drop.Builder drop = CommonProto.Drop.newBuilder();
|
||||
int[][] dropItem = {changingCard.getExp()};
|
||||
|
||||
ItemUtil.drop(user, dropItem, drop, BIReason.TRANSFORMATION_CARD_ACTIVATION);
|
||||
CommonProto.Drop.Builder drop = ItemUtil.drop(user, dropItem, BIReason.TRANSFORMATION_CARD_ACTIVATION);
|
||||
builder.setDrop(drop);
|
||||
}else {
|
||||
}
|
||||
// 卸下变身卡
|
||||
else {
|
||||
info.setStatus(0);
|
||||
info.setIndex(0);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
package com.ljsd.jieling.kefu;
|
||||
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.SaveHeroForceEvent;
|
||||
import com.ljsd.jieling.logic.dao.Hero;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import config.SCHero;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @Author hj
|
||||
* @Date 2021/10/28 17:35:00
|
||||
* @Description: 英雄法宝 命令: \\fabaolv 角色id 英雄名#法宝等级
|
||||
* @Version 1.0
|
||||
*/
|
||||
public class Cmd_fabaolv extends GmRoleAbstract {
|
||||
@Override
|
||||
public boolean exec(String[] args) throws Exception {
|
||||
String[] split = args[0].split("#");
|
||||
if (split.length < 2){
|
||||
return false;
|
||||
}
|
||||
User user = getUser();
|
||||
Map<String, Hero> heroMap = user.getHeroManager().getHeroMap();
|
||||
for (Hero hero : heroMap.values()) {
|
||||
SCHero scHero = SCHero.getsCHero().get(hero.getTemplateId());
|
||||
if (scHero.getReadingName().equals(split[0])){
|
||||
hero.updateEspecial(Integer.parseInt(split[1]));
|
||||
// 更新战力
|
||||
Poster.getPoster().dispatchEvent(new SaveHeroForceEvent(user.getId(),hero.getId()));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -1,31 +1,17 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.core.VipPrivilegeType;
|
||||
import com.ljsd.jieling.db.redis.RedisKey;
|
||||
import com.ljsd.jieling.db.redis.RedisUtil;
|
||||
import com.ljsd.jieling.globals.Global;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.RandomCardEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.logic.mail.MailLogic;
|
||||
import com.ljsd.jieling.logic.rank.RankContext;
|
||||
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.ItemUtil;
|
||||
import config.*;
|
||||
import config.SLotterySetting;
|
||||
import config.SLotterySpecialConfig;
|
||||
import manager.STableManager;
|
||||
import org.springframework.data.redis.core.ZSetOperations;
|
||||
import util.TimeUtils;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* @author lvxinran
|
||||
|
|
|
@ -1,18 +1,9 @@
|
|||
package com.ljsd.jieling.logic.activity;
|
||||
|
||||
import com.ljsd.jieling.exception.ErrorCode;
|
||||
import com.ljsd.jieling.exception.ErrorCodeException;
|
||||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SActivityRewardConfig;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
|
|
|
@ -5,21 +5,22 @@ import com.ljsd.jieling.exception.ErrorCodeException;
|
|||
import com.ljsd.jieling.globals.BIReason;
|
||||
import com.ljsd.jieling.jbean.ActivityMission;
|
||||
import com.ljsd.jieling.jbean.ActivityProgressInfo;
|
||||
import com.ljsd.jieling.logic.activity.event.IEvent;
|
||||
import com.ljsd.jieling.logic.activity.event.Poster;
|
||||
import com.ljsd.jieling.logic.activity.event.RandomCardEvent;
|
||||
import com.ljsd.jieling.logic.dao.UserManager;
|
||||
import com.ljsd.jieling.logic.dao.root.User;
|
||||
import com.ljsd.jieling.network.session.ISession;
|
||||
import com.ljsd.jieling.util.ItemUtil;
|
||||
import com.ljsd.jieling.util.MessageUtil;
|
||||
import config.SActivityRewardConfig;
|
||||
import config.SLotterySpecialConfig;
|
||||
import config.SSpiritAnimalSummon;
|
||||
import manager.STableManager;
|
||||
import rpc.protocols.CommonProto;
|
||||
import rpc.protocols.PlayerInfoProto;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
|
@ -431,20 +431,25 @@ public class Hero extends MongoBase implements Comparable<Hero>,Cloneable {
|
|||
}
|
||||
|
||||
public int getEspecialEquipLevel() {
|
||||
int max = SSpecialConfig.getIntegerValue(SSpecialConfig.EquipTalismanaUpperLimit);
|
||||
return especialEquipLevel>max ? max : especialEquipLevel;
|
||||
}
|
||||
|
||||
public int getOriginalEspecialEquipLevel() {
|
||||
return especialEquipLevel;
|
||||
}
|
||||
|
||||
public int getEspecialEquipLevelByHongmeng(HeroManager heroManager, String heroId) {
|
||||
// 英雄在共鳴池中
|
||||
if (heroManager.getResonances().values().contains(heroId)) {
|
||||
// 法宝
|
||||
HongMengAddAttribute hongMengAddAttribute = heroManager.getResonanceAddition().get(HongMengAttributeEnum.MAGIC_WEAPON);
|
||||
if (hongMengAddAttribute != null) {
|
||||
// 对比本身和共鸣等级,选高的
|
||||
return especialEquipLevel >= hongMengAddAttribute.value ? especialEquipLevel : hongMengAddAttribute.value;
|
||||
}
|
||||
}
|
||||
return especialEquipLevel;
|
||||
// if (heroManager.getResonances().values().contains(heroId)) {
|
||||
// // 法宝
|
||||
// HongMengAddAttribute hongMengAddAttribute = heroManager.getResonanceAddition().get(HongMengAttributeEnum.MAGIC_WEAPON);
|
||||
// if (hongMengAddAttribute != null) {
|
||||
// // 对比本身和共鸣等级,选高的
|
||||
// return especialEquipLevel >= hongMengAddAttribute.value ? especialEquipLevel : hongMengAddAttribute.value;
|
||||
// }
|
||||
// }
|
||||
return getEspecialEquipLevel();
|
||||
}
|
||||
|
||||
public Set<String> getJewelInfo() {
|
||||
|
|
|
@ -5466,12 +5466,6 @@ public class HeroLogic {
|
|||
MessageUtil.sendIndicationMessage(session, 1, MessageTypeProto.MessageType.HONGMENG_STELE_NEW_HAND_INDICATION.getNumber(), builder.build(), true);
|
||||
}
|
||||
}
|
||||
|
||||
// 不够6个无法开启鸿蒙阵
|
||||
/*if (hongmengs.size() < Integer.parseInt(openLevel[0])) {
|
||||
return;
|
||||
}*/
|
||||
|
||||
// 守卫/使者英雄池
|
||||
Map<Integer, String> guards = heroManager.getHongmengGuards();
|
||||
// 英雄装备
|
||||
|
@ -5485,7 +5479,6 @@ public class HeroLogic {
|
|||
hongMengAddAttributeEquip = new HongMengAddAttribute(0, defaultValue);
|
||||
soulEquip = new HongMengAddAttribute(0, defaultValue);
|
||||
spiritEquip = new HongMengAddAttribute(0, defaultValue);
|
||||
especialEquipLevel = new HongMengAddAttribute(0, defaultValue);
|
||||
break;
|
||||
}
|
||||
// 装备
|
||||
|
@ -5493,8 +5486,6 @@ public class HeroLogic {
|
|||
// 魂宝 灵宝
|
||||
soulOrSpirit(soulEquip, 1, equipMap, hero);
|
||||
soulOrSpirit(spiritEquip, 2, equipMap, hero);
|
||||
// 法宝
|
||||
especialAdd(especialEquipLevel, hero);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5520,7 +5511,6 @@ public class HeroLogic {
|
|||
resonanceAddition.put(HongMengAttributeEnum.EQUIP, hongMengAddAttributeEquip);
|
||||
resonanceAddition.put(HongMengAttributeEnum.SOUL_EQUIP, soulEquip);
|
||||
resonanceAddition.put(HongMengAttributeEnum.SPIRIT_EQUIP, spiritEquip);
|
||||
resonanceAddition.put(HongMengAttributeEnum.MAGIC_WEAPON, especialEquipLevel);
|
||||
heroManager.setResonanceAddition(resonanceAddition);
|
||||
|
||||
/*** ============================= 开始组装鸿蒙阵信息 ==================================== **/
|
||||
|
|
|
@ -704,6 +704,10 @@ public class ItemLogic {
|
|||
}
|
||||
|
||||
int especialEquipId = scHero.getEquipTalismana()[1];
|
||||
int maxLimit = SSpecialConfig.getIntegerValue(SSpecialConfig.EquipTalismanaUpperLimit);
|
||||
if (hero.getEspecialEquipLevel() >= maxLimit){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("法宝已最大限制等级"));
|
||||
}
|
||||
SEquipTalismana sEquipTalismana = SEquipTalismana.equipTalismanaStarMap.get(especialEquipId).get(hero.getEspecialEquipLevel());
|
||||
if (sEquipTalismana == null || sEquipTalismana.getRankupBasicMaterial() == null|| sEquipTalismana.getRankupBasicMaterial().length==0) {
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode("法宝已最大等级"));
|
||||
|
|
|
@ -128,10 +128,18 @@ public class PlayerLogic {
|
|||
String name = "";
|
||||
Map<Integer, String> surnameMap = SRandomName.getSurnameMap();
|
||||
Map<Integer, String> nameMap = SRandomName.getNameMap();
|
||||
int max = surnameMap.size() * nameMap.size();
|
||||
int i = 0;
|
||||
boolean result;
|
||||
do {
|
||||
name = surnameMap.get(MathUtils.random(1, surnameMap.size())) + nameMap.get(MathUtils.random(1, nameMap.size()));
|
||||
result = SensitivewordFilter.isContaintSensitiveWord(name,1);
|
||||
i++;
|
||||
}
|
||||
while (result && i < max);
|
||||
if (result){
|
||||
throw new ErrorCodeException("随机名称失败,一直包含有违禁字符,最后一次名字:"+name);
|
||||
}
|
||||
while (checkNameShield(name));
|
||||
return name;
|
||||
}
|
||||
public String getRandomName2WithOutVerify() {
|
||||
|
@ -144,25 +152,30 @@ public class PlayerLogic {
|
|||
}
|
||||
|
||||
public String[] getRandomNameWithPreAndPost() throws Exception {
|
||||
String name ;
|
||||
String name;
|
||||
Map<Integer, String> surnameMap = SRandomName.getSurnameMap();
|
||||
Map<Integer, String> nameMap = SRandomName.getNameMap();
|
||||
String pre ;
|
||||
String post ;
|
||||
String pre;
|
||||
String post;
|
||||
// 加入
|
||||
int max = surnameMap.size() * nameMap.size();
|
||||
int i = 0;
|
||||
boolean result;
|
||||
do {
|
||||
pre = surnameMap.get(MathUtils.random(1, surnameMap.size()));
|
||||
post = nameMap.get(MathUtils.random(1, nameMap.size()));
|
||||
name = pre + post;
|
||||
|
||||
result = SensitivewordFilter.isContaintSensitiveWord(name,1);
|
||||
i++;
|
||||
}
|
||||
while (result && i<max);
|
||||
if (result){
|
||||
throw new ErrorCodeException("随机名称失败2,一直包含有违禁字符,最后一次名字:"+name);
|
||||
}
|
||||
while (checkNameShield(name));
|
||||
return new String[]{name,pre,post};
|
||||
}
|
||||
|
||||
private boolean checkNameShield(String name) throws Exception {
|
||||
return SensitivewordFilter.isContaintSensitiveWord(name, 1);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 起名字
|
||||
* @param name
|
||||
|
@ -174,15 +187,12 @@ public class PlayerLogic {
|
|||
User user = UserManager.getUser(uid);
|
||||
PlayerManager playerInfoManager = user.getPlayerInfoManager();
|
||||
TeamPosManager teamPosManager = user.getTeamPosManager();
|
||||
|
||||
if (checkName(iSession, name, msgId)){
|
||||
return;
|
||||
}
|
||||
if (type == 1||type == 3) {
|
||||
// 检查名字是否被占用
|
||||
if (PlayerLogic.getInstance().isExistName(name)) {
|
||||
// MessageUtil.sendErrorResponse(iSession, 0, msgId, SErrorCodeEerverConfig.getI18NMessage("name_repeat_txt"));
|
||||
// return;
|
||||
throw new ErrorCodeException(name,ErrorCode.NAME_USE);
|
||||
}
|
||||
if (!playerInfoManager.getNickName().equals(String.valueOf(uid))){
|
||||
|
@ -231,18 +241,13 @@ public class PlayerLogic {
|
|||
}
|
||||
|
||||
private boolean checkName(ISession iSession, String name, int msgId) throws Exception {
|
||||
// if(!Repot37EventUtil.Report37Chat(UserManager.getUser(iSession.getUid()), ChatContentType.ROLE_NAME,name)){
|
||||
// throw new ErrorCodeException(ErrorCode.NAME_ILLEGAL);
|
||||
// }
|
||||
int length = getStrLength(name);
|
||||
if (length == -1) {
|
||||
throw new ErrorCodeException(ErrorCode.NAME_ILLEGAL);
|
||||
}
|
||||
// STableManager.getFigureConfig(CommonStaticConfig.class).getGameSetting().getMaxNameLength()
|
||||
if (length > 18 || length < 1) {
|
||||
throw new ErrorCodeException(ErrorCode.NAME_LENTH);
|
||||
}
|
||||
;
|
||||
boolean result = ShieldedWordUtils.checkName(UserManager.getUser(iSession.getUid()),name,true,ChatContentType.ROLE_NAME);
|
||||
if (!result) {
|
||||
throw new ErrorCodeException(ErrorCode.NAME_ILLEGAL);
|
||||
|
|
|
@ -35,8 +35,7 @@ public class SensitivewordFilter {
|
|||
* @version 1.0
|
||||
*/
|
||||
public static boolean isContaintSensitiveWord(String txt, int matchType) throws Exception {
|
||||
boolean hasDirtyWords = isContaintSensitiveWordThrift(txt, matchType);
|
||||
return hasDirtyWords;
|
||||
return isContaintSensitiveWordThrift(txt, matchType);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -17,25 +17,22 @@ public class ShieldedWordUtils {
|
|||
return checkName(user,name,validateSpecStr,chatContentType);
|
||||
|
||||
}
|
||||
public static boolean checkName(User user , String name,boolean validateSpecStr,ChatContentType chatContentType){
|
||||
boolean result;
|
||||
public static boolean checkName(User user,String name,boolean validateSpecStr,ChatContentType chatContentType){
|
||||
boolean result = true;
|
||||
// 校验特殊符号
|
||||
if(validateSpecStr){
|
||||
result = validateUserName(name);
|
||||
if(!result){
|
||||
return false;
|
||||
}
|
||||
// 校验违禁字符
|
||||
if (result == true){
|
||||
try {
|
||||
result = !SensitivewordFilter.isContaintSensitiveWord(name,1);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("检查名称,报错:"+e.getMessage());
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
result = isContaintSensitiveWord(name);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("检查名称,报错:"+e.getMessage());
|
||||
return false;
|
||||
}
|
||||
if(result){
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
@ -57,11 +54,6 @@ public class ShieldedWordUtils {
|
|||
return matcher.matches();
|
||||
}
|
||||
|
||||
public static boolean isContaintSensitiveWord(String userName) throws Exception{
|
||||
boolean hasDirtyWords = SensitivewordFilter.isContaintSensitiveWord(userName, 1);
|
||||
return hasDirtyWords;
|
||||
}
|
||||
|
||||
public static String replaceUnword(String content) {
|
||||
// 只允许字母和数字
|
||||
// String regEx = "[^a-zA-Z0-9]";
|
||||
|
|
|
@ -132,6 +132,7 @@ public class SSpecialConfig implements BaseConfig {
|
|||
public static final String CHANGE_CAMP_COST = "ChangeCampCost";//神转换阵营消耗
|
||||
public static final String GodSignOpenStar = "GodSignOpenStar";//神印格子开启所需神将星级
|
||||
public static final String ChangingPosUnlock = "ChangingPosUnlock";//3个变身卡化身位解锁所需的化身之力等级
|
||||
public static final String EquipTalismanaUpperLimit = "EquipTalismanaUpperLimit ";//法宝等级上限
|
||||
|
||||
@Override
|
||||
public void init() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue