diff --git a/project/src/callbacks/DialogueCallbacks.ts b/project/src/callbacks/DialogueCallbacks.ts index 9928d800..acae4187 100644 --- a/project/src/callbacks/DialogueCallbacks.ts +++ b/project/src/callbacks/DialogueCallbacks.ts @@ -3,6 +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 { IChatServer } from "../models/eft/dialog/IChatServer"; import { IClearMailMessageRequest } from "../models/eft/dialog/IClearMailMessageRequest"; import { IDeleteFriendRequest } from "../models/eft/dialog/IDeleteFriendRequest"; @@ -151,6 +152,12 @@ export class DialogueCallbacks implements OnUpdate return this.httpResponse.getBody({status: 0, requestid: "12345", retryAfter: 600}); } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public acceptFriendRequest(url: string, request: IAcceptFriendRequestData, 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/callbacks/GameCallbacks.ts b/project/src/callbacks/GameCallbacks.ts index 6df3c3c6..e333a4fc 100644 --- a/project/src/callbacks/GameCallbacks.ts +++ b/project/src/callbacks/GameCallbacks.ts @@ -82,6 +82,7 @@ class GameCallbacks return this.httpResponse.getBody(this.gameController.getServer()); } + // Handle client/match/group/current public getCurrentGroup(url: string, info: IEmptyRequestData, sessionID: string): any { return this.httpResponse.getBody(this.gameController.getCurrentGroup(sessionID)); diff --git a/project/src/callbacks/MatchCallbacks.ts b/project/src/callbacks/MatchCallbacks.ts index 4efd034a..9ef1ffd0 100644 --- a/project/src/callbacks/MatchCallbacks.ts +++ b/project/src/callbacks/MatchCallbacks.ts @@ -20,6 +20,7 @@ import { IJoinMatchResult } from "../models/eft/match/IJoinMatchResult"; import { IPutMetricsRequestData } from "../models/eft/match/IPutMetricsRequestData"; import { IRemovePlayerFromGroupRequest } from "../models/eft/match/IRemovePlayerFromGroupRequest"; import { ISendGroupInviteRequest } from "../models/eft/match/ISendGroupInviteRequest"; +import { ITransferGroupRequest } from "../models/eft/match/ITransferGroupRequest"; import { IUpdatePingRequestData } from "../models/eft/match/IUpdatePingRequestData"; import { DatabaseServer } from "../servers/DatabaseServer"; import { HttpResponseUtil } from "../utils/HttpResponseUtil"; @@ -42,6 +43,7 @@ export class MatchCallbacks return this.httpResponse.nullResponse(); } + // Handle client/match/exit // eslint-disable-next-line @typescript-eslint/no-unused-vars public exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData { @@ -88,6 +90,12 @@ export class MatchCallbacks { return this.httpResponse.getBody(true); } + /** Handle client/match/group/transfer */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public transferGroup(url: string, info: ITransferGroupRequest, sessionID: string): IGetBodyResponseData + { + return this.httpResponse.getBody(true); + } // eslint-disable-next-line @typescript-eslint/no-unused-vars public cancelAllGroupInvite(url: string, info: any, sessionID: string): INullResponseData @@ -107,8 +115,9 @@ export class MatchCallbacks return this.httpResponse.getBody(this.matchController.getProfile(info)); } + // Handle client/match/available // eslint-disable-next-line @typescript-eslint/no-unused-vars - public serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData | IGetBodyResponseData + public serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData { const output = this.matchController.getEnabled(); @@ -120,7 +129,8 @@ export class MatchCallbacks return this.httpResponse.getBody(output); } - public joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData + // Handle match/group/start_game + public joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData { return this.httpResponse.getBody(this.matchController.joinMatch(info, sessionID)); } @@ -153,6 +163,13 @@ export class MatchCallbacks return this.httpResponse.nullResponse(); } + // Handle client/match/group/leave + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData + { + return this.httpResponse.getBody(true); + } + // eslint-disable-next-line @typescript-eslint/no-unused-vars public removePlayerFromGroup(url: string, info: IRemovePlayerFromGroupRequest, sessionID: string): INullResponseData { diff --git a/project/src/controllers/GameController.ts b/project/src/controllers/GameController.ts index c99e1e65..bd571776 100644 --- a/project/src/controllers/GameController.ts +++ b/project/src/controllers/GameController.ts @@ -10,6 +10,7 @@ import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IPmcData } from "../models/eft/common/IPmcData"; import { BodyPartHealth } from "../models/eft/common/tables/IBotBase"; import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; +import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IServerDetails } from "../models/eft/game/IServerDetails"; import { IAkiProfile } from "../models/eft/profile/IAkiProfile"; @@ -498,11 +499,11 @@ export class GameController ]; } - public getCurrentGroup(sessionId: any): any + // eslint-disable-next-line @typescript-eslint/no-unused-vars + public getCurrentGroup(sessionId: string): ICurrentGroupResponse { return { - squad: [], - raidSettings: {} + squad: [] }; } diff --git a/project/src/controllers/MatchController.ts b/project/src/controllers/MatchController.ts index 8d8d42b7..686c951f 100644 --- a/project/src/controllers/MatchController.ts +++ b/project/src/controllers/MatchController.ts @@ -82,54 +82,39 @@ export class MatchController this.matchLocationService.deleteGroup(info); } - public joinMatch(info: IJoinMatchRequestData, sessionID: string): IJoinMatchResult[] + public joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult { - const match = this.getMatch(info.location); - const output: IJoinMatchResult[] = []; - - // --- LOOP (DO THIS FOR EVERY PLAYER IN GROUP) - // get player profile - const account = this.saveServer.getProfile(sessionID).info; - const profileID = info.savage - ? `scav${account.id}` - : `pmc${account.id}`; + const output: IJoinMatchResult = { + maxPveCountExceeded: false, + profiles: [] + }; // get list of players joining into the match - output.push({ - "profileid": profileID, - "status": "busy", + output.profiles.push({ + "profileid": "TODO", + profileToken: "TODO", + "status": "MatchWait", "sid": "", - "ip": match.ip, - "port": match.port, + "ip": "", + "port": 0, "version": "live", - "location": info.location, + "location": "TODO get location", raidMode: "Online", "mode": "deathmatch", - "shortid": match.id, + "shortid": null, // eslint-disable-next-line @typescript-eslint/naming-convention - additional_info: undefined + additional_info: null }); return output; } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - protected getMatch(location: string): any - { - return { - "id": "TEST", - "ip": "127.0.0.1", - "port": 9909 - }; - } - // eslint-disable-next-line @typescript-eslint/no-unused-vars public getGroupStatus(info: IGetGroupStatusRequestData): any { return { "players": [], - "invite": [], - "group": [] + maxPveCountExceeded: false }; } diff --git a/project/src/models/eft/common/tables/IBotBase.ts b/project/src/models/eft/common/tables/IBotBase.ts index 8e8d2ea9..23448a96 100644 --- a/project/src/models/eft/common/tables/IBotBase.ts +++ b/project/src/models/eft/common/tables/IBotBase.ts @@ -328,7 +328,7 @@ export interface LastPlayerStateInfo Nickname: string Side: string Level: number - MemberCategory: string + MemberCategory: MemberCategory } export interface BackendCounter diff --git a/project/src/models/eft/dialog/IAcceptFriendRequestData.ts b/project/src/models/eft/dialog/IAcceptFriendRequestData.ts new file mode 100644 index 00000000..cd81ddb0 --- /dev/null +++ b/project/src/models/eft/dialog/IAcceptFriendRequestData.ts @@ -0,0 +1,5 @@ +export interface IAcceptFriendRequestData +{ + // eslint-disable-next-line @typescript-eslint/naming-convention + request_id: string +} \ No newline at end of file diff --git a/project/src/models/eft/game/ICurrentGroupResponse.ts b/project/src/models/eft/game/ICurrentGroupResponse.ts new file mode 100644 index 00000000..e5a96056 --- /dev/null +++ b/project/src/models/eft/game/ICurrentGroupResponse.ts @@ -0,0 +1,23 @@ +import { MemberCategory } from "../../../models/enums/MemberCategory"; + +export interface ICurrentGroupResponse +{ + squad: any[] +} + +export interface ICurrentGroupSquadMember +{ + _id: string + aid: string + info: ICurrentGroupMemberInfo + isLeader: boolean + isReady: boolean +} + +export interface ICurrentGroupMemberInfo +{ + Nickname: string + Side: string + Level: string + MemberCategory: MemberCategory +} \ No newline at end of file diff --git a/project/src/models/eft/match/IGetGroupStatusRequestData.ts b/project/src/models/eft/match/IGetGroupStatusRequestData.ts index a8ab5f15..1ae6568e 100644 --- a/project/src/models/eft/match/IGetGroupStatusRequestData.ts +++ b/project/src/models/eft/match/IGetGroupStatusRequestData.ts @@ -7,5 +7,5 @@ export interface IGetGroupStatusRequestData dt: string keyId: string raidMode: RaidMode - startInGroup: boolean + spawnPlace: string } \ No newline at end of file diff --git a/project/src/models/eft/match/IJoinMatchRequestData.ts b/project/src/models/eft/match/IJoinMatchRequestData.ts index 171f308b..a937e870 100644 --- a/project/src/models/eft/match/IJoinMatchRequestData.ts +++ b/project/src/models/eft/match/IJoinMatchRequestData.ts @@ -1,10 +1,7 @@ export interface IJoinMatchRequestData { - location: string - savage: boolean - dt: string + groupid: string servers: Server[] - keyId: string } export interface Server diff --git a/project/src/models/eft/match/IJoinMatchResult.ts b/project/src/models/eft/match/IJoinMatchResult.ts index c5db3db1..916c9822 100644 --- a/project/src/models/eft/match/IJoinMatchResult.ts +++ b/project/src/models/eft/match/IJoinMatchResult.ts @@ -1,6 +1,13 @@ export interface IJoinMatchResult +{ + maxPveCountExceeded: boolean + profiles: IJoinMatchPlayerProfile[] +} + +export interface IJoinMatchPlayerProfile { profileid: string + profileToken: string status: string sid: string ip: string diff --git a/project/src/models/eft/match/ITransferGroupRequest.ts b/project/src/models/eft/match/ITransferGroupRequest.ts new file mode 100644 index 00000000..ed80a208 --- /dev/null +++ b/project/src/models/eft/match/ITransferGroupRequest.ts @@ -0,0 +1,4 @@ +export interface ITransferGroupRequest +{ + aidToChange: string +} \ No newline at end of file diff --git a/project/src/models/eft/profile/IAkiProfile.ts b/project/src/models/eft/profile/IAkiProfile.ts index 0a70e1d1..7156aa6d 100644 --- a/project/src/models/eft/profile/IAkiProfile.ts +++ b/project/src/models/eft/profile/IAkiProfile.ts @@ -133,7 +133,7 @@ export interface IUpdatableChatMember Nickname: string Side: string Level: number - MemberCategory: string + MemberCategory: MemberCategory Ignored: boolean Banned: boolean } diff --git a/project/src/routers/static/DialogStaticRouter.ts b/project/src/routers/static/DialogStaticRouter.ts index 414834ab..35d7837c 100644 --- a/project/src/routers/static/DialogStaticRouter.ts +++ b/project/src/routers/static/DialogStaticRouter.ts @@ -140,6 +140,14 @@ export class DialogStaticRouter extends StaticRouter return this.dialogueCallbacks.sendFriendRequest(url, info, sessionID); } ), + new RouteAction( + "/client/friend/request/accept", + // eslint-disable-next-line @typescript-eslint/no-unused-vars + (url: string, info: any, sessionID: string, output: string): any => + { + return this.dialogueCallbacks.acceptFriendRequest(url, info, sessionID); + } + ), new RouteAction( "/client/friend/delete", // eslint-disable-next-line @typescript-eslint/no-unused-vars diff --git a/project/src/routers/static/MatchStaticRouter.ts b/project/src/routers/static/MatchStaticRouter.ts index 10f092eb..00e98ca0 100644 --- a/project/src/routers/static/MatchStaticRouter.ts +++ b/project/src/routers/static/MatchStaticRouter.ts @@ -68,6 +68,14 @@ export class MatchStaticRouter extends StaticRouter return this. matchCallbacks.deleteGroup(url, info, sessionID); } ), + new RouteAction( + "/client/match/group/leave", + // eslint-disable-next-line @typescript-eslint/no-unused-vars + (url: string, info: any, sessionID: string, output: string): any => + { + return this. matchCallbacks.leaveGroup(url, info, sessionID); + } + ), new RouteAction( "/client/match/group/status", // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -140,6 +148,14 @@ export class MatchStaticRouter extends StaticRouter return this.matchCallbacks.cancelAllGroupInvite(url, info, sessionID); } ), + new RouteAction( + "/client/match/group/transfer", + // eslint-disable-next-line @typescript-eslint/no-unused-vars + (url: string, info: any, sessionID: string, output: string): any => + { + return this.matchCallbacks.transferGroup(url, info, sessionID); + } + ), new RouteAction( "/client/match/offline/end", // eslint-disable-next-line @typescript-eslint/no-unused-vars