好友:fix 推荐列表数量少时无法获取
This commit is contained in:
@@ -49,6 +49,7 @@ export class FriendHandler {
|
||||
let otherServerList = new Array<FriendRecommendParams>();
|
||||
for(let role of allList) {
|
||||
let type = getRecommendType(myFriendRelation, roleId, role.roleId);
|
||||
console.log('****', type, roleId, role.roleId)
|
||||
if(type == FRIEND_RELATION_TYPE.NORMAL) {
|
||||
let param = new FriendRecommendParams(role);
|
||||
param.setType(type);
|
||||
@@ -74,7 +75,11 @@ export class FriendHandler {
|
||||
let list2:FriendRecommendParams[] = getRandEelm(otherServerList, otherServerLen);
|
||||
|
||||
if(list2.length < FRIEND.FRIEND_RECONMMEND_NUM - myServerLen) {
|
||||
list1 = getRandEelm(myServerList, FRIEND.FRIEND_RECONMMEND_NUM - list2.length);
|
||||
if(myServerList.length <= FRIEND.FRIEND_RECONMMEND_NUM - list2.length) {
|
||||
list1 = myServerList;
|
||||
} else {
|
||||
list1 = getRandEelm(myServerList, FRIEND.FRIEND_RECONMMEND_NUM - list2.length);
|
||||
}
|
||||
}
|
||||
|
||||
let list = list1.concat(list2);
|
||||
|
||||
@@ -28,7 +28,7 @@ import { DATA_NAME } from '../consts/dataName';
|
||||
export async function checkAuth(func: number, roleId: string, code?: string, userGuild?: UserGuildType) {
|
||||
const auth = await UserGuildModel.getMyAuth(roleId, code, userGuild);
|
||||
const dicGuildAuth = gameData.guildAuth.get(func);
|
||||
// console.log(auth, dicGuildAuth)
|
||||
console.log('*checkAuth*', auth, dicGuildAuth)
|
||||
if(!dicGuildAuth) return false;
|
||||
|
||||
return dicGuildAuth.includes(auth);
|
||||
|
||||
Reference in New Issue
Block a user