diff --git a/game-server/app/servers/role/handler/friendHandler.ts b/game-server/app/servers/role/handler/friendHandler.ts index 7e16e4523..3d3e4d28a 100644 --- a/game-server/app/servers/role/handler/friendHandler.ts +++ b/game-server/app/servers/role/handler/friendHandler.ts @@ -148,18 +148,21 @@ export class FriendHandler { } else if (type == FRIEND_RELATION_TYPE.MYSELF) { str = getResStr(STATUS.FRIEND_YOURSELF); continue; } - - let incResult = await RoleModel.increaseFriendApplyCnt(hisRoleId, 1, FRIEND.FRIEND_MANAGE_APPLICATION); - if (!incResult) { - str = getResStr(STATUS.FRIEND_HIS_APPLY_MAX); continue; - } - - let apply = await FriendApplyModel.createApply(hisRoleId, role); - resultRoleIds.push(hisRoleId); - let hisOnlineInfo = await getRoleOnlineInfo(hisRoleId); - if (hisOnlineInfo.isOnline) { - let myApply = await getMyApplyParam(apply.applyCode, role); - sendMessageToUserWithSuc(hisRoleId, 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) { + str = getResStr(STATUS.FRIEND_HIS_APPLY_MAX); continue; + } + + let apply = await FriendApplyModel.createApply(hisRoleId, role); + resultRoleIds.push(hisRoleId); + let hisOnlineInfo = await getRoleOnlineInfo(hisRoleId); + if (hisOnlineInfo.isOnline) { + let myApply = await getMyApplyParam(apply.applyCode, role); + sendMessageToUserWithSuc(hisRoleId, PUSH_ROUTE.FRIEND_APPLY, { apply: myApply }, hisOnlineInfo.sid); + } } }