Basic implementation for viewing other profiles
This commit is contained in:
parent
29995cccd8
commit
a194569946
@ -8,6 +8,8 @@ import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullRespons
|
||||
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 { IGetOtherProfileRequest } from "@spt-aki/models/eft/profile/IGetOtherProfileRequest";
|
||||
import { IGetOtherProfileResponse } from "@spt-aki/models/eft/profile/IGetOtherProfileResponse";
|
||||
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";
|
||||
@ -147,11 +149,11 @@ export class ProfileCallbacks
|
||||
*/
|
||||
public getOtherProfile(
|
||||
url: string,
|
||||
info: IEmptyRequestData,
|
||||
request: IGetOtherProfileRequest,
|
||||
sessionID: string,
|
||||
): any
|
||||
): IGetBodyResponseData<IGetOtherProfileResponse>
|
||||
{
|
||||
throw new Error("Not implemented");
|
||||
return this.httpResponse.getBody(this.profileController.getOtherProfile(sessionID, request));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -13,6 +13,8 @@ import { IMiniProfile } from "@spt-aki/models/eft/launcher/IMiniProfile";
|
||||
import { GetProfileStatusResponseData } from "@spt-aki/models/eft/profile/GetProfileStatusResponseData";
|
||||
import { IAkiProfile, Inraid, Vitality } from "@spt-aki/models/eft/profile/IAkiProfile";
|
||||
import { ICompletedAchievementsResponse } from "@spt-aki/models/eft/profile/ICompletedAchievementsResponse";
|
||||
import { IGetOtherProfileRequest } from "@spt-aki/models/eft/profile/IGetOtherProfileRequest";
|
||||
import { IGetOtherProfileResponse } from "@spt-aki/models/eft/profile/IGetOtherProfileResponse";
|
||||
import { IProfileChangeNicknameRequestData } from "@spt-aki/models/eft/profile/IProfileChangeNicknameRequestData";
|
||||
import { IProfileChangeVoiceRequestData } from "@spt-aki/models/eft/profile/IProfileChangeVoiceRequestData";
|
||||
import { IProfileCreateRequestData } from "@spt-aki/models/eft/profile/IProfileCreateRequestData";
|
||||
@ -394,4 +396,24 @@ export class ProfileController
|
||||
|
||||
return {elements: profile.achievements};
|
||||
}
|
||||
|
||||
public getOtherProfile(sessionId: string, request: IGetOtherProfileRequest): IGetOtherProfileResponse
|
||||
{
|
||||
const player = this.profileHelper.getFullProfile(sessionId);
|
||||
const playerPmc = player.characters.pmc;
|
||||
|
||||
// return player for now
|
||||
return {
|
||||
id: playerPmc._id,
|
||||
aid: playerPmc.aid,
|
||||
info: playerPmc.Info,
|
||||
customization: playerPmc.Customization,
|
||||
skills: playerPmc.Skills,
|
||||
equipment: playerPmc.Inventory,
|
||||
achievements: playerPmc.Achievements,
|
||||
favoriteItems: playerPmc.Inventory.favoriteItems,
|
||||
pmcStats: playerPmc.Stats,
|
||||
scavStats: player.characters.scav.Stats
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
export interface IGetOtherProfileRequest
|
||||
{
|
||||
accountId: string;
|
||||
}
|
17
project/src/models/eft/profile/IGetOtherProfileResponse.ts
Normal file
17
project/src/models/eft/profile/IGetOtherProfileResponse.ts
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
import { Customization, Inventory, Skills, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"
|
||||
import { Info } from "types/models/eft/common/tables/IBotBase"
|
||||
|
||||
export interface IGetOtherProfileResponse
|
||||
{
|
||||
id: string
|
||||
aid: number
|
||||
info: Info
|
||||
customization: Customization
|
||||
skills: Skills
|
||||
equipment: Inventory
|
||||
achievements: Record<string, number>
|
||||
favoriteItems: string[]
|
||||
pmcStats: Stats
|
||||
scavStats: Stats
|
||||
}
|
Loading…
Reference in New Issue
Block a user