XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

feat: show accolades in profile view (#3211)

Closes #3209 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3211 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>

69a38794
AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
提交于

代码差异

2 个文件 +24 -10
Modified src/controllers/dynamic/getProfileViewingDataController.ts +13 -3
@@ -14,6 +14,7 @@ import type {
14 14 IAlignment,
15 15 IChallengeProgress,
16 16 IDailyAffiliations,
17 IInventoryAccolades,
17 18 IMission,
18 19 IPlayerSkills,
19 20 ITypeXPItem
@@ -39,7 +40,10 @@ const getProfileViewingDataByPlayerIdImpl = async (playerId: string): Promise<IP
39 40 const result: IPlayerProfileViewingDataResult = {
40 41 AccountId: toOid(account._id),
41 42 DisplayName: account.DisplayName,
42 PlayerLevel: inventory.PlayerLevel,
43 PlayerLevel:
44 inventory.spoofMasteryRank !== undefined && inventory.spoofMasteryRank !== -1
45 ? inventory.spoofMasteryRank
46 : inventory.PlayerLevel,
43 47 LoadOutInventory: {
44 48 WeaponSkins: [],
45 49 XPInfo: inventory.XPInfo
@@ -56,7 +60,13 @@ const getProfileViewingDataByPlayerIdImpl = async (playerId: string): Promise<IP
56 60 Affiliations: inventory.Affiliations,
57 61 DailyFocus: inventory.DailyFocus,
58 62 Wishlist: inventory.Wishlist,
59 Alignment: inventory.Alignment
63 Alignment: inventory.Alignment,
64 Staff: inventory.Staff,
65 Founder: inventory.Founder,
66 Guide: inventory.Guide,
67 Moderator: inventory.Moderator,
68 Partner: inventory.Partner,
69 Accolades: inventory.Accolades
60 70 };
61 71 await populateLoadout(inventory, result);
62 72 if (inventory.GuildId) {
@@ -211,7 +221,7 @@ interface IProfileViewingData {
211 221 Stats: FlattenMaps<Partial<TStatsDatabaseDocument>>;
212 222 }
213 223
214 interface IPlayerProfileViewingDataResult extends Partial<IDailyAffiliations> {
224 interface IPlayerProfileViewingDataResult extends Partial<IDailyAffiliations>, IInventoryAccolades {
215 225 AccountId: IOid;
216 226 DisplayName: string;
217 227 PlayerLevel: number;
Modified src/types/inventoryTypes/inventoryTypes.ts +11 -7
@@ -301,7 +301,17 @@ export type InventorySlots = {
301 301 [_ in SlotNames]: ISlots;
302 302 };
303 303
304 export interface IInventoryClient extends IDailyAffiliations, InventoryClientEquipment, InventorySlots {
304 export interface IInventoryAccolades {
305 Staff?: boolean;
306 Founder?: number;
307 Guide?: number;
308 Moderator?: boolean;
309 Partner?: boolean;
310 Accolades?: IAccolades;
311 }
312
313 export interface IInventoryClient
314 extends IDailyAffiliations, IInventoryAccolades, InventoryClientEquipment, InventorySlots {
305 315 AdultOperatorLoadOuts: IOperatorConfigClient[];
306 316 OperatorLoadOuts: IOperatorConfigClient[];
307 317 KahlLoadOuts: IOperatorConfigClient[];
@@ -346,12 +356,6 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
346 356 PendingRecipes: IPendingRecipeClient[];
347 357 TrainingDate: IMongoDate;
348 358 PlayerLevel: number;
349 Staff?: boolean;
350 Founder?: number;
351 Guide?: number;
352 Moderator?: boolean;
353 Partner?: boolean;
354 Accolades?: IAccolades;
355 359 Counselor?: boolean;
356 360 Upgrades: IUpgradeClient[];
357 361 Cards?: IUpgradeClient[]; // U8