Improve accuracy of view profile
This commit is contained in:
parent
62dec539db
commit
4e21239de3
@ -141,7 +141,7 @@ export class DialogueController
|
|||||||
|
|
||||||
dialog.Users.push({
|
dialog.Users.push({
|
||||||
_id: profile.characters.pmc.sessionId,
|
_id: profile.characters.pmc.sessionId,
|
||||||
info: {
|
Info: {
|
||||||
Level: profile.characters.pmc.Info.Level,
|
Level: profile.characters.pmc.Info.Level,
|
||||||
Nickname: profile.characters.pmc.Info.Nickname,
|
Nickname: profile.characters.pmc.Info.Nickname,
|
||||||
Side: profile.characters.pmc.Info.Side,
|
Side: profile.characters.pmc.Info.Side,
|
||||||
@ -235,7 +235,7 @@ export class DialogueController
|
|||||||
const pmcProfile = fullProfile.characters.pmc;
|
const pmcProfile = fullProfile.characters.pmc;
|
||||||
result.push({
|
result.push({
|
||||||
_id: fullProfile.info.id,
|
_id: fullProfile.info.id,
|
||||||
info: {
|
Info: {
|
||||||
Nickname: pmcProfile.Info.Nickname,
|
Nickname: pmcProfile.Info.Nickname,
|
||||||
Side: pmcProfile.Info.Side,
|
Side: pmcProfile.Info.Side,
|
||||||
Level: pmcProfile.Info.Level,
|
Level: pmcProfile.Info.Level,
|
||||||
|
@ -21,6 +21,7 @@ import { IProfileCreateRequestData } from "@spt-aki/models/eft/profile/IProfileC
|
|||||||
import { ISearchFriendRequestData } from "@spt-aki/models/eft/profile/ISearchFriendRequestData";
|
import { ISearchFriendRequestData } from "@spt-aki/models/eft/profile/ISearchFriendRequestData";
|
||||||
import { ISearchFriendResponse } from "@spt-aki/models/eft/profile/ISearchFriendResponse";
|
import { ISearchFriendResponse } from "@spt-aki/models/eft/profile/ISearchFriendResponse";
|
||||||
import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData";
|
import { IValidateNicknameRequestData } from "@spt-aki/models/eft/profile/IValidateNicknameRequestData";
|
||||||
|
import { MemberCategory } from "@spt-aki/models/enums/MemberCategory";
|
||||||
import { MessageType } from "@spt-aki/models/enums/MessageType";
|
import { MessageType } from "@spt-aki/models/enums/MessageType";
|
||||||
import { QuestStatus } from "@spt-aki/models/enums/QuestStatus";
|
import { QuestStatus } from "@spt-aki/models/enums/QuestStatus";
|
||||||
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
import { ILogger } from "@spt-aki/models/spt/utils/ILogger";
|
||||||
@ -399,14 +400,41 @@ export class ProfileController
|
|||||||
return {
|
return {
|
||||||
id: playerPmc._id,
|
id: playerPmc._id,
|
||||||
aid: playerPmc.aid,
|
aid: playerPmc.aid,
|
||||||
info: playerPmc.Info,
|
info: {
|
||||||
customization: playerPmc.Customization,
|
nickname: playerPmc.Info.Nickname,
|
||||||
|
side: playerPmc.Info.Side,
|
||||||
|
experience: playerPmc.Info.Experience,
|
||||||
|
memberCategory: playerPmc.Info.MemberCategory,
|
||||||
|
bannedState: playerPmc.Info.BannedState,
|
||||||
|
bannedUntil: playerPmc.Info.BannedUntil,
|
||||||
|
registrationDate: playerPmc.Info.RegistrationDate
|
||||||
|
},
|
||||||
|
customization: {
|
||||||
|
head: playerPmc.Customization.Head,
|
||||||
|
body: playerPmc.Customization.Body,
|
||||||
|
feet: playerPmc.Customization.Feet,
|
||||||
|
hands: playerPmc.Customization.Hands
|
||||||
|
},
|
||||||
skills: playerPmc.Skills,
|
skills: playerPmc.Skills,
|
||||||
equipment: playerPmc.Inventory,
|
equipment: {
|
||||||
|
// Default inventory tpl
|
||||||
|
Id: playerPmc.Inventory.items.find(x => x._tpl === "55d7217a4bdc2d86028b456d")._id,
|
||||||
|
Items: playerPmc.Inventory.items
|
||||||
|
},
|
||||||
achievements: playerPmc.Achievements,
|
achievements: playerPmc.Achievements,
|
||||||
favoriteItems: playerPmc.Inventory.favoriteItems,
|
favoriteItems: playerPmc.Inventory.favoriteItems,
|
||||||
pmcStats: playerPmc.Stats,
|
pmcStats: {
|
||||||
scavStats: player.characters.scav.Stats
|
eft: {
|
||||||
|
totalInGameTime: playerPmc.Stats.Eft.TotalInGameTime,
|
||||||
|
overAllCounters: playerPmc.Stats.Eft.OverallCounters
|
||||||
|
}
|
||||||
|
},
|
||||||
|
scavStats: {
|
||||||
|
eft: {
|
||||||
|
totalInGameTime: player.characters.scav.Stats.Eft.TotalInGameTime,
|
||||||
|
overAllCounters: player.characters.scav.Stats.Eft.OverallCounters
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,7 +34,7 @@ export class CommandoDialogueChatBot implements IDialogueChatBot
|
|||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
_id: "sptCommando",
|
_id: "sptCommando",
|
||||||
info: { Level: 1, MemberCategory: MemberCategory.DEVELOPER, Nickname: "Commando", Side: "Usec" },
|
Info: { Level: 1, MemberCategory: MemberCategory.DEVELOPER, Nickname: "Commando", Side: "Usec" },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ export class SptDialogueChatBot implements IDialogueChatBot
|
|||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
_id: "sptFriend",
|
_id: "sptFriend",
|
||||||
info: {
|
Info: {
|
||||||
Level: 1,
|
Level: 1,
|
||||||
MemberCategory: MemberCategory.DEVELOPER,
|
MemberCategory: MemberCategory.DEVELOPER,
|
||||||
Nickname: this.coreConfig.sptFriendNickname,
|
Nickname: this.coreConfig.sptFriendNickname,
|
||||||
|
@ -85,9 +85,9 @@ export class NotificationSendHelper
|
|||||||
protected getDialog(sessionId: string, messageType: MessageType, senderDetails: IUserDialogInfo): Dialogue
|
protected getDialog(sessionId: string, messageType: MessageType, senderDetails: IUserDialogInfo): Dialogue
|
||||||
{
|
{
|
||||||
// Use trader id if sender is trader, otherwise use nickname
|
// Use trader id if sender is trader, otherwise use nickname
|
||||||
const key = (senderDetails.info.MemberCategory === MemberCategory.TRADER)
|
const key = (senderDetails.Info.MemberCategory === MemberCategory.TRADER)
|
||||||
? senderDetails._id
|
? senderDetails._id
|
||||||
: senderDetails.info.Nickname;
|
: senderDetails.Info.Nickname;
|
||||||
const dialogueData = this.saveServer.getProfile(sessionId).dialogues;
|
const dialogueData = this.saveServer.getProfile(sessionId).dialogues;
|
||||||
const isNewDialogue = !(key in dialogueData);
|
const isNewDialogue = !(key in dialogueData);
|
||||||
let dialogue: Dialogue = dialogueData[key];
|
let dialogue: Dialogue = dialogueData[key];
|
||||||
@ -102,7 +102,7 @@ export class NotificationSendHelper
|
|||||||
pinned: false,
|
pinned: false,
|
||||||
new: 0,
|
new: 0,
|
||||||
attachmentsNew: 0,
|
attachmentsNew: 0,
|
||||||
Users: (senderDetails.info.MemberCategory === MemberCategory.TRADER) ? undefined : [senderDetails],
|
Users: (senderDetails.Info.MemberCategory === MemberCategory.TRADER) ? undefined : [senderDetails],
|
||||||
};
|
};
|
||||||
|
|
||||||
dialogueData[key] = dialogue;
|
dialogueData[key] = dialogue;
|
||||||
|
@ -113,7 +113,7 @@ export interface Dialogue
|
|||||||
export interface IUserDialogInfo
|
export interface IUserDialogInfo
|
||||||
{
|
{
|
||||||
_id: string;
|
_id: string;
|
||||||
info: IUserDialogDetails;
|
Info: IUserDialogDetails;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IUserDialogDetails
|
export interface IUserDialogDetails
|
||||||
|
@ -1,17 +1,54 @@
|
|||||||
|
|
||||||
import { Customization, Inventory, Skills, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"
|
import { Customization, Inventory, OverallCounters, Skills, Stats } from "@spt-aki/models/eft/common/tables/IBotBase"
|
||||||
import { Info } from "types/models/eft/common/tables/IBotBase"
|
import { Info } from "types/models/eft/common/tables/IBotBase"
|
||||||
|
import { Item } from "../common/tables/IItem"
|
||||||
|
|
||||||
export interface IGetOtherProfileResponse
|
export interface IGetOtherProfileResponse
|
||||||
{
|
{
|
||||||
id: string
|
id: string
|
||||||
aid: number
|
aid: number
|
||||||
info: Info
|
info: IOtherProfileInfo
|
||||||
customization: Customization
|
customization: IOtherProfileCustomization
|
||||||
skills: Skills
|
skills: Skills
|
||||||
equipment: Inventory
|
equipment: IOtherProfileEquipment
|
||||||
achievements: Record<string, number>
|
achievements: Record<string, number>
|
||||||
favoriteItems: string[]
|
favoriteItems: string[]
|
||||||
pmcStats: Stats
|
pmcStats: IOtherProfileStats
|
||||||
scavStats: Stats
|
scavStats: IOtherProfileStats
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IOtherProfileInfo
|
||||||
|
{
|
||||||
|
nickname: string
|
||||||
|
side: string
|
||||||
|
experience: number
|
||||||
|
memberCategory: number
|
||||||
|
bannedState: boolean
|
||||||
|
bannedUntil: number
|
||||||
|
registrationDate: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IOtherProfileCustomization
|
||||||
|
{
|
||||||
|
head: string;
|
||||||
|
body: string;
|
||||||
|
feet: string;
|
||||||
|
hands: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IOtherProfileEquipment
|
||||||
|
{
|
||||||
|
Id: string;
|
||||||
|
Items: Item[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IOtherProfileStats
|
||||||
|
{
|
||||||
|
eft: IOtherProfileSubStats;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface IOtherProfileSubStats
|
||||||
|
{
|
||||||
|
totalInGameTime: number
|
||||||
|
overAllCounters: OverallCounters
|
||||||
}
|
}
|
@ -134,7 +134,7 @@ export class GiftService
|
|||||||
const details: ISendMessageDetails = {
|
const details: ISendMessageDetails = {
|
||||||
recipientId: playerId,
|
recipientId: playerId,
|
||||||
sender: this.getMessageType(giftData),
|
sender: this.getMessageType(giftData),
|
||||||
senderDetails: { _id: this.getSenderId(giftData), info: null },
|
senderDetails: { _id: this.getSenderId(giftData), Info: null },
|
||||||
messageText: giftData.messageText,
|
messageText: giftData.messageText,
|
||||||
items: giftData.items,
|
items: giftData.items,
|
||||||
itemsMaxStorageLifetimeSeconds: this.timeUtil.getHoursAsSeconds(giftData.collectionTimeHours),
|
itemsMaxStorageLifetimeSeconds: this.timeUtil.getHoursAsSeconds(giftData.collectionTimeHours),
|
||||||
|
@ -95,7 +95,7 @@ export class PmcChatResponseService
|
|||||||
|
|
||||||
const killerDetails: IUserDialogInfo = {
|
const killerDetails: IUserDialogInfo = {
|
||||||
_id: killerDetailsInCache._id,
|
_id: killerDetailsInCache._id,
|
||||||
info: {
|
Info: {
|
||||||
Nickname: killerDetailsInCache.Info.Nickname,
|
Nickname: killerDetailsInCache.Info.Nickname,
|
||||||
Side: killerDetailsInCache.Info.Side,
|
Side: killerDetailsInCache.Info.Side,
|
||||||
Level: killerDetailsInCache.Info.Level,
|
Level: killerDetailsInCache.Info.Level,
|
||||||
@ -273,7 +273,7 @@ export class PmcChatResponseService
|
|||||||
];
|
];
|
||||||
return {
|
return {
|
||||||
_id: pmcVictim.Name,
|
_id: pmcVictim.Name,
|
||||||
info: {
|
Info: {
|
||||||
Nickname: pmcVictim.Name,
|
Nickname: pmcVictim.Name,
|
||||||
Level: pmcVictim.Level,
|
Level: pmcVictim.Level,
|
||||||
Side: pmcVictim.Side,
|
Side: pmcVictim.Side,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user