Add various missing types

This commit is contained in:
Dev 2023-12-20 00:17:27 +00:00
parent cf782a8fcb
commit 6930267d8b
7 changed files with 46 additions and 7 deletions

View File

@ -11,6 +11,7 @@ import { ICancelGroupInviteRequest } from "@spt-aki/models/eft/match/ICancelGrou
import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData";
import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData";
import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse";
import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData";
import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData";
@ -159,12 +160,13 @@ export class MatchCallbacks
* @returns
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<any>
public getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<IGetGroupStatusResponse>
{
return this.httpResponse.getBody(this.matchController.getGroupStatus(info));
}
/** Handle client/match/group/create */
// TODO: may have been removed from client
public createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any>
{
return this.httpResponse.getBody(this.matchController.createGroup(sessionID, info));

View File

@ -7,6 +7,7 @@ import { IGetBodyResponseData } from "@spt-aki/models/eft/httpResponse/IGetBodyR
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
import { IGetMiniProfileRequestData } from "@spt-aki/models/eft/launcher/IGetMiniProfileRequestData";
import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData";
import { ICreateProfileResponse } from "@spt-aki/models/eft/profile/ICreateProfileResponse";
import { IGetProfileSettingsRequest } from "@spt-aki/models/eft/profile/IGetProfileSettingsRequest";
import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData";
import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData";
@ -31,10 +32,11 @@ export class ProfileCallbacks
/**
* Handle client/game/profile/create
*/
public createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<any>
public createProfile(url: string, info: IProfileCreateRequestData, sessionID: string): IGetBodyResponseData<ICreateProfileResponse>
{
this.profileController.createProfile(info, sessionID);
return this.httpResponse.getBody({ uid: `pmc${sessionID}` });
const id = this.profileController.createProfile(info, sessionID);
return this.httpResponse.getBody({ uid: id });
}
/**

View File

@ -10,6 +10,7 @@ import { Item } from "@spt-aki/models/eft/common/tables/IItem";
import { ICreateGroupRequestData } from "@spt-aki/models/eft/match/ICreateGroupRequestData";
import { IEndOfflineRaidRequestData } from "@spt-aki/models/eft/match/IEndOfflineRaidRequestData";
import { IGetGroupStatusRequestData } from "@spt-aki/models/eft/match/IGetGroupStatusRequestData";
import { IGetGroupStatusResponse } from "@spt-aki/models/eft/match/IGetGroupStatusResponse";
import { IGetProfileRequestData } from "@spt-aki/models/eft/match/IGetProfileRequestData";
import { IGetRaidConfigurationRequestData } from "@spt-aki/models/eft/match/IGetRaidConfigurationRequestData";
import { IJoinMatchRequestData } from "@spt-aki/models/eft/match/IJoinMatchRequestData";
@ -126,7 +127,7 @@ export class MatchController
/** Handle client/match/group/status */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getGroupStatus(info: IGetGroupStatusRequestData): any
public getGroupStatus(info: IGetGroupStatusRequestData): IGetGroupStatusResponse
{
return { players: [], maxPveCountExceeded: false };
}

View File

@ -118,8 +118,11 @@ export class ProfileController
/**
* Handle client/game/profile/create
* @param info Client reqeust object
* @param sessionID Player id
* @returns Profiles _id value
*/
public createProfile(info: IProfileCreateRequestData, sessionID: string): void
public createProfile(info: IProfileCreateRequestData, sessionID: string): string
{
const account = this.saveServer.getProfile(sessionID).info;
const profile: TemplateSide =
@ -212,6 +215,8 @@ export class ProfileController
// Completed account creation
this.saveServer.getProfile(sessionID).info.wipe = false;
this.saveServer.saveProfile(sessionID);
return pmcData._id;
}
/**

View File

@ -2,7 +2,7 @@ import { MemberCategory } from "@spt-aki/models/enums/MemberCategory";
export interface ICurrentGroupResponse
{
squad: any[];
squad: ICurrentGroupSquadMember[];
}
export interface ICurrentGroupSquadMember

View File

@ -0,0 +1,25 @@
import { MemberCategory } from "@spt-aki/models/enums/MemberCategory"
export interface IGetGroupStatusResponse
{
players: IPlayer[]
maxPveCountExceeded: boolean
}
export interface IPlayer
{
aid: string
_id: string
lookingGroup: boolean
IsLeader: boolean
IsReady: boolean
Info: ICurrentGroupMemberInfo
}
export interface ICurrentGroupMemberInfo
{
Nickname: string;
Side: string;
Level: string;
MemberCategory: MemberCategory;
}

View File

@ -0,0 +1,4 @@
export interface ICreateProfileResponse
{
uid: string
}