Merge branch 'online_1121' of 60.1.1.230:backend/jieling_server into online_1121
commit
199c559446
|
|
@ -139,7 +139,11 @@ public enum ErrorCode implements IErrorCode {
|
|||
MAP_IN(105,"在地图探索中,不可以操作"),
|
||||
HERO_LIVE_AGAIN(106,"英雄{0}秒后复活"),
|
||||
REWARD_COLLECTING(107,"奖励正在积攒中!"),
|
||||
IN_BLACK(108,"对方已被您加入黑名单,无法添加好友")
|
||||
IN_BLACK(108,"对方已被您加入黑名单,无法添加好友"),
|
||||
NULL_NAME(109,"名字不能为空"),
|
||||
NAME_LENGTH_ERROR(110,"公会名长度不符"),
|
||||
EXIST_NAME(111,"此名已存在");
|
||||
|
||||
|
||||
;
|
||||
private static final Set<Integer> CodeSet = new HashSet<>();
|
||||
|
|
|
|||
|
|
@ -87,10 +87,7 @@ public class GuildLogic {
|
|||
int uid = session.getUid();
|
||||
User user = UserManager.getUser(uid);
|
||||
int msgId = MessageTypeProto.MessageType.FAMILY_CREATE_RESPONSE_VALUE;
|
||||
String err = checkForCreateGuild(user, familyName, announce);
|
||||
if(!"".equals(err)){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode(err));
|
||||
}
|
||||
checkForCreateGuild(user, familyName, announce);
|
||||
boolean enough= ItemUtil.itemCost(user, SGuildSetting.sGuildSetting.getCreatCost(), BIReason.CREATE_GUILD_CONSUME, 0);
|
||||
if(!enough){
|
||||
throw new ErrorCodeException(ErrorCode.ITEM_NOT_ENOUGH);
|
||||
|
|
@ -118,31 +115,29 @@ public class GuildLogic {
|
|||
MessageUtil.sendMessage(session,1,msgId,build,true);
|
||||
}
|
||||
|
||||
public static String checkForCreateGuild( User user,String familyName,String announce) throws Exception {
|
||||
public static void checkForCreateGuild( User user,String familyName,String announce) throws Exception {
|
||||
if(!Repot37EventUtil.Report37Chat(user, ChatContentType.FAMILY_NAME.getType(),announce)){
|
||||
return "包含敏感字";
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_IN_SENSITIVE);
|
||||
}
|
||||
if(StringUtil.isEmpty(familyName)){
|
||||
return "名字不能为空";
|
||||
throw new ErrorCodeException(ErrorCode.NULL_NAME);
|
||||
}
|
||||
boolean result = true;
|
||||
if(!StringUtil.isEmpty(announce)){
|
||||
result = ShieldedWordUtils.checkName(user,announce,false,ChatContentType.FAMILY_NAME);
|
||||
if (!result) {
|
||||
return "包含敏感字";
|
||||
throw new ErrorCodeException(ErrorCode.FAMILY_IN_SENSITIVE);
|
||||
}
|
||||
}
|
||||
if(familyName.length()<SGuildSetting.sGuildSetting.getNameSize()[0]||familyName.length()>SGuildSetting.sGuildSetting.getNameSize()[1]){
|
||||
return "公会名长度不符";
|
||||
throw new ErrorCodeException(ErrorCode.NAME_LENGTH_ERROR);
|
||||
}
|
||||
Map<Integer, GuildInfo> guildInfoMap = GuilidManager.guildInfoMap;
|
||||
for(Map.Entry<Integer, GuildInfo> entry:guildInfoMap.entrySet()){
|
||||
if(entry.getValue().getName().equals(familyName)){
|
||||
return "此名已存在";
|
||||
throw new ErrorCodeException(ErrorCode.EXIST_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -687,10 +682,7 @@ public class GuildLogic {
|
|||
if(type==1){
|
||||
guildInfo.setAnnounce(content);
|
||||
}else{
|
||||
String checkResult = checkForCreateGuild(user, content, guildInfo.getAnnounce());
|
||||
if(!"".equals(checkResult)){
|
||||
throw new ErrorCodeException(ErrorCode.newDefineCode(checkResult));
|
||||
}
|
||||
checkForCreateGuild(user, content, guildInfo.getAnnounce());
|
||||
int[][] renameCost = SGuildSetting.sGuildSetting.getRenameCost();
|
||||
boolean b = ItemUtil.itemCost(user, renameCost, BIReason.FAMILY_RENAME, 1);
|
||||
if(!b){
|
||||
|
|
|
|||
|
|
@ -170,17 +170,18 @@ public class BuyGoodsLogic {
|
|||
}
|
||||
if(sRechargeCommodityConfig.getAccumulativeRecharge() == 1){
|
||||
int saveAmt = rechargeInfo.getSaveAmt();
|
||||
|
||||
int[][] costItemArr = StringUtil.parseFiledInt2(rewardStr);
|
||||
for (int i = 0; i <costItemArr.length ; i++) {
|
||||
if(costItemArr[i][0]==Global.SOULCRYSTAL){
|
||||
rechargeInfo.addSoulCrystalAmt(costItemArr[i][1]);
|
||||
if(!StringUtil.isEmpty(rewardStr)){
|
||||
int[][] costItemArr = StringUtil.parseFiledInt2(rewardStr);
|
||||
for (int i = 0; i <costItemArr.length ; i++) {
|
||||
if(costItemArr[i][0]==Global.SOULCRYSTAL){
|
||||
rechargeInfo.addSoulCrystalAmt(costItemArr[i][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
rechargeInfo.setSaveAmt(price+saveAmt);
|
||||
user.getPlayerInfoManager().addRechargedaily(price);
|
||||
//TODO 用事件分发
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RechargeTotal,rechargeInfo.getSaveAmt());
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RechargeTotal,price);
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.LUCKYCAT,price);
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.DAILY_RECHARGE,price);
|
||||
ActivityLogic.getInstance().updateActivityMissionProgress(user, ActivityType.RECHARGE_NUM,price);
|
||||
|
|
|
|||
Loading…
Reference in New Issue