🐞 fix(任务): 跨服添加好友问题
This commit is contained in:
@@ -261,7 +261,7 @@ export class FriendHandler {
|
|||||||
role = await RoleModel.increaseFriendApplyCnt(roleId, -1 * deleteCount, FRIEND.FRIEND_MANAGE_APPLICATION);
|
role = await RoleModel.increaseFriendApplyCnt(roleId, -1 * deleteCount, FRIEND.FRIEND_MANAGE_APPLICATION);
|
||||||
roles.push(role);
|
roles.push(role);
|
||||||
// 任务
|
// 任务
|
||||||
await checkTaskWithRoles(serverId, roleId, sid, TASK_TYPE.FRIEND_NUM, roles);
|
await checkTaskWithRoles(roleId, sid, TASK_TYPE.FRIEND_NUM, roles);
|
||||||
|
|
||||||
// 特殊处理:如果他点一键同意,有很多人,这个单独的人就不做这个额外的提示,直接把他好友申请删掉就好
|
// 特殊处理:如果他点一键同意,有很多人,这个单独的人就不做这个额外的提示,直接把他好友申请删掉就好
|
||||||
if (str == getResStr(STATUS.FRIEND_HAS_ADD) && resultApplyCodeList.length > 1) str = '';
|
if (str == getResStr(STATUS.FRIEND_HAS_ADD) && resultApplyCodeList.length > 1) str = '';
|
||||||
@@ -449,7 +449,7 @@ export class FriendHandler {
|
|||||||
let { friendCnt = 0, blockCnt = 0 } = role;
|
let { friendCnt = 0, blockCnt = 0 } = role;
|
||||||
|
|
||||||
// 任务
|
// 任务
|
||||||
await checkTaskWithRoles(serverId, roleId, sid, TASK_TYPE.FRIEND_NUM, [role, friend]);
|
await checkTaskWithRoles(roleId, sid, TASK_TYPE.FRIEND_NUM, [role, friend]);
|
||||||
return resResult(STATUS.SUCCESS, {
|
return resResult(STATUS.SUCCESS, {
|
||||||
frdRoleIds, blackRoleIds,
|
frdRoleIds, blackRoleIds,
|
||||||
isSuccess: str == '',
|
isSuccess: str == '',
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ import { getGoldId } from '../role/rewardService';
|
|||||||
import { GachaResultIndb } from '../../domain/activityField/gachaField';
|
import { GachaResultIndb } from '../../domain/activityField/gachaField';
|
||||||
import { ActivityPopUpShopRecModel } from '../../db/ActivityPopUpShopRec';
|
import { ActivityPopUpShopRecModel } from '../../db/ActivityPopUpShopRec';
|
||||||
|
|
||||||
export async function checkTaskWithRoles(serverId: number, roleId: string, sid: string, taskType: TASK_TYPE, roles: RoleType[]) {
|
export async function checkTaskWithRoles(roleId: string, sid: string, taskType: TASK_TYPE, roles: RoleType[]) {
|
||||||
for (let role of roles) {
|
for (let role of roles) {
|
||||||
if (role) {
|
if (role) {
|
||||||
await checkTaskWithRole(serverId, role.roleId, role.roleId == roleId ? sid : null, taskType, role);
|
await checkTaskWithRole(role.serverId, role.roleId, role.roleId == roleId ? sid : null, taskType, role);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user