From 9b1fa777cdfc7c5d652b3a63227ca2e62c9c1033 Mon Sep 17 00:00:00 2001 From: luying Date: Mon, 22 Feb 2021 12:35:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=BD=E5=8F=8B=EF=BC=9Afix=20=E6=8E=A8?= =?UTF-8?q?=E8=8D=90=E5=88=97=E8=A1=A8=E6=95=B0=E9=87=8F=E5=B0=91=E6=97=B6?= =?UTF-8?q?=E6=97=A0=E6=B3=95=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- game-server/app/servers/role/handler/friendHandler.ts | 7 ++++++- game-server/app/services/guildService.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/game-server/app/servers/role/handler/friendHandler.ts b/game-server/app/servers/role/handler/friendHandler.ts index 66dc17996..888786d28 100644 --- a/game-server/app/servers/role/handler/friendHandler.ts +++ b/game-server/app/servers/role/handler/friendHandler.ts @@ -49,6 +49,7 @@ export class FriendHandler { let otherServerList = new Array(); 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); diff --git a/game-server/app/services/guildService.ts b/game-server/app/services/guildService.ts index aeea3df0b..1b1a008c7 100644 --- a/game-server/app/services/guildService.ts +++ b/game-server/app/services/guildService.ts @@ -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);