diff --git a/project/src/callbacks/DialogueCallbacks.ts b/project/src/callbacks/DialogueCallbacks.ts index acae4187..f5f42f46 100644 --- a/project/src/callbacks/DialogueCallbacks.ts +++ b/project/src/callbacks/DialogueCallbacks.ts @@ -3,7 +3,7 @@ import { inject, injectable } from "tsyringe"; import { DialogueController } from "../controllers/DialogueController"; import { OnUpdate } from "../di/OnUpdate"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; -import { IAcceptFriendRequestData } from "../models/eft/dialog/IAcceptFriendRequestData"; +import { IAcceptFriendRequestData, ICancelFriendRequestData } from "../models/eft/dialog/IAcceptFriendRequestData"; import { IChatServer } from "../models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "../models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "../models/eft/dialog/IDeleteFriendRequest"; @@ -140,24 +140,42 @@ export class DialogueCallbacks implements OnUpdate return this.httpResponse.getBody([]); } + /** + * Handle client/friend/request/list/inbox + */ // eslint-disable-next-line @typescript-eslint/no-unused-vars public listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData { return this.httpResponse.getBody([]); } + /** + * Handle client/friend/request/send + */ // eslint-disable-next-line @typescript-eslint/no-unused-vars public sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData { return this.httpResponse.getBody({status: 0, requestid: "12345", retryAfter: 600}); } + /** + * Handle client/friend/request/accept + */ // eslint-disable-next-line @typescript-eslint/no-unused-vars public acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData { return this.httpResponse.getBody(true); } + /** + * Handle client/friend/request/cancel + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public cancelFriendRequest(url: string, request: ICancelFriendRequestData, sessionID: string): IGetBodyResponseData + { + return this.httpResponse.getBody(true); + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars public deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData { diff --git a/project/src/models/eft/dialog/IAcceptFriendRequestData.ts b/project/src/models/eft/dialog/IAcceptFriendRequestData.ts index cd81ddb0..f6c811d5 100644 --- a/project/src/models/eft/dialog/IAcceptFriendRequestData.ts +++ b/project/src/models/eft/dialog/IAcceptFriendRequestData.ts @@ -1,4 +1,16 @@ -export interface IAcceptFriendRequestData +// rome-ignore lint/suspicious/noEmptyInterface: +export interface IAcceptFriendRequestData extends IBaseFriendRequest +{ + +} + +// rome-ignore lint/suspicious/noEmptyInterface: +export interface ICancelFriendRequestData extends IBaseFriendRequest +{ + +} + +export interface IBaseFriendRequest { // eslint-disable-next-line @typescript-eslint/naming-convention request_id: string diff --git a/project/src/routers/static/DialogStaticRouter.ts b/project/src/routers/static/DialogStaticRouter.ts index 35d7837c..623810e0 100644 --- a/project/src/routers/static/DialogStaticRouter.ts +++ b/project/src/routers/static/DialogStaticRouter.ts @@ -148,6 +148,14 @@ export class DialogStaticRouter extends StaticRouter return this.dialogueCallbacks.acceptFriendRequest(url, info, sessionID); } ), + new RouteAction( + "/client/friend/request/cancel", + // eslint-disable-next-line @typescript-eslint/no-unused-vars + (url: string, info: any, sessionID: string, output: string): any => + { + return this.dialogueCallbacks.cancelFriendRequest(url, info, sessionID); + } + ), new RouteAction( "/client/friend/delete", // eslint-disable-next-line @typescript-eslint/no-unused-vars