friend limit

back_recharge
wangyuan 2019-09-11 14:27:58 +08:00
parent c032ea2eaa
commit 001477cbb6
2 changed files with 6 additions and 3 deletions

View File

@ -24,6 +24,8 @@ public class SSpecialConfig implements BaseConfig {
public static final String ADVENTURE_RANKINGSHOWNUM = "Adventure_RankingShowNum";//外敌入侵排行榜上榜显示排名
public static final String COMBAT_RANKINGSHOWNUM = "Combat_RankingShowNum";//战力排行榜上榜显示排名
public static final String EQUIPSIGN_LIMIT = "EquipSign_limit";//仓库中的魂印上限
public static final String FRIENDAMOUNT_LIMIT = "FriendAmount_limit";//好友上限
public static final String FRIENDAPPLYAMOUNT_LIMIT = "FriendApplyAmount_limit";//好友申请上限
@Override

View File

@ -1,6 +1,7 @@
package com.ljsd.jieling.logic.friend;
import com.ljsd.jieling.config.SGameSetting;
import com.ljsd.jieling.config.SSpecialConfig;
import com.ljsd.jieling.core.HandlerLogicThread;
import com.ljsd.jieling.db.mongo.MongoUtil;
import com.ljsd.jieling.db.redis.RedisKey;
@ -203,8 +204,8 @@ public class FriendLogic {
}
User user = UserManager.getUser(uid);
List<Integer> friends = user.getFriendManager().getFriends();
int maxFriends = 200;
int maxApplyFriends = 10;
int maxFriends = SSpecialConfig.getIntegerValue(SSpecialConfig.FRIENDAMOUNT_LIMIT);
int maxApplyFriends = SSpecialConfig.getIntegerValue(SSpecialConfig.FRIENDAPPLYAMOUNT_LIMIT);
if (friends.size() >= maxFriends){
MessageUtil.sendErrorResponse(iSession,0,msgId,"好友已达上限");
return;
@ -278,7 +279,7 @@ public class FriendLogic {
FriendManager friendManager = user.getFriendManager();
List<Integer> friends = friendManager.getFriends();
List<Integer> applyFriends = friendManager.getApplyFriends();
int maxFriends = 200;
int maxFriends = SSpecialConfig.getIntegerValue(SSpecialConfig.FRIENDAMOUNT_LIMIT);
User friendUser;
List<Integer> friendFriendList;
switch (type){