From 212a68c307cb266ec0c495ac0581150490eb6b4b Mon Sep 17 00:00:00 2001 From: luying Date: Mon, 20 Jun 2022 17:57:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A5=BD=E5=8F=8B=EF=BC=9A=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E9=BB=91=E5=90=8D=E5=8D=95=E6=97=B6=E6=B7=BB=E5=8A=A0=E5=A5=BD?= =?UTF-8?q?=E5=8F=8B=E6=97=B6=EF=BC=8C=E8=8B=A5=E4=B9=9F=E5=9C=A8=E5=AF=B9?= =?UTF-8?q?=E6=96=B9=E9=BB=91=E5=90=8D=E5=8D=95=E6=97=B6=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=8F=91=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/servers/role/handler/friendHandler.ts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/game-server/app/servers/role/handler/friendHandler.ts b/game-server/app/servers/role/handler/friendHandler.ts index 3d3e4d28a..062f9cae4 100644 --- a/game-server/app/servers/role/handler/friendHandler.ts +++ b/game-server/app/servers/role/handler/friendHandler.ts @@ -420,11 +420,18 @@ export class FriendHandler { if (!friend) { str = getResStr(STATUS.FRIEND_HIS_APPLY_MAX); } else { - let apply = await FriendApplyModel.createApply(hisRoleId, role); - let hisOnlineInfo = await getRoleOnlineInfo(hisRoleId); - if(hisOnlineInfo) { - let myApply = await getMyApplyParam(apply.applyCode, role); - sendMessageToUserWithSuc(friend.roleId, PUSH_ROUTE.FRIEND_APPLY, { apply: myApply }, hisOnlineInfo.sid); + let hisRelation = await FriendRelationModel.findFriendByRole(hisRoleId, POPULATE_TYPE.NOT); + let hisType = getRecommendType(hisRelation, hisRoleId, roleId); + if(hisType == FRIEND_RELATION_TYPE.NORMAL) { + let incResult = await RoleModel.increaseFriendApplyCnt(hisRoleId, 1, FRIEND.FRIEND_MANAGE_APPLICATION); + if (incResult) { + let apply = await FriendApplyModel.createApply(hisRoleId, role); + let hisOnlineInfo = await getRoleOnlineInfo(hisRoleId); + if(hisOnlineInfo) { + let myApply = await getMyApplyParam(apply.applyCode, role); + sendMessageToUserWithSuc(friend.roleId, PUSH_ROUTE.FRIEND_APPLY, { apply: myApply }, hisOnlineInfo.sid); + } + } } } }