From 17ab945464b01cc5f8aa6b8727b30c6840ed4f1e Mon Sep 17 00:00:00 2001 From: ThisNils <59409978+ThisNils@users.noreply.github.com> Date: Sun, 3 Nov 2024 12:00:09 +0100 Subject: [PATCH 1/3] slight refactor --- resources/defaultPartyMeta.json | 2 +- src/structures/party/ClientPartyMeta.ts | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/resources/defaultPartyMeta.json b/resources/defaultPartyMeta.json index fa28484d..0c6a8fe2 100644 --- a/resources/defaultPartyMeta.json +++ b/resources/defaultPartyMeta.json @@ -21,7 +21,7 @@ "Default:PlaylistData_j": "{\"PlaylistData\":{\"playlistName\":\"Playlist_DefaultSquad\",\"tournamentId\":\"\",\"eventWindowId\":\"\",\"linkId\":{\"mnemonic\":\"playlist_defaultsquad\",\"version\":-1},\"bGracefullyUpgraded\":false,\"matchmakingRulePreset\":\"RespectParties\"}}", "Default:PrimaryGameSessionId_s": "", "Default:PrivacySettings_j": "{\"PrivacySettings\":{\"partyType\":\"Public\",\"partyInviteRestriction\":\"AnyMember\",\"bOnlyLeaderFriendsCanJoin\":false}}", - "Default:SquadInformation_j": "{\"SquadInformation\":{}}", + "Default:SquadInformation_j": "{\"SquadInformation\":{\"rawSquadAssignments\":[],\"squadData\":[{\"jamTempo\":0,\"jamKey\":0,\"jamMode\":0}]}}", "Default:RegionId_s": "EU", "Default:SelectedIsland_j": "{\"SelectedIsland\":{\"linkId\":{\"mnemonic\":\"playlist_defaultsquad\",\"version\":-1},\"worldId\":{\"iD\":\"\",\"ownerId\":\"INVALID\",\"name\":\"\"},\"sessionId\":\"\",\"joinInfo\":{\"islandJoinability\":\"CanNotBeJoinedOrWatched\",\"bIsWorldJoinable\":false,\"sessionKey\":\"\"}}}", "Default:TileStates_j": "{\"TileStates\":[]}", diff --git a/src/structures/party/ClientPartyMeta.ts b/src/structures/party/ClientPartyMeta.ts index 3647edff..348846d6 100644 --- a/src/structures/party/ClientPartyMeta.ts +++ b/src/structures/party/ClientPartyMeta.ts @@ -51,17 +51,14 @@ class ClientPartyMeta extends PartyMeta { i += 1; } }); - const squadData = [ - { - "jamTempo": 0, - "jamKey": 0, - "jamMode": 0 - } - ] + + const squadInformation = this.get('Default:SquadInformation_j'); + return this.set('Default:SquadInformation_j', { + ...squadInformation, SquadInformation: { - "rawSquadAssignments": assignments, - "squadData": squadData + ...squadInformation.SquadInformation, + rawSquadAssignments: assignments, }, }); } From c059b4f1ad428efa346fcfcd223507606afa2a8f Mon Sep 17 00:00:00 2001 From: Kye Date: Sat, 23 Nov 2024 09:27:56 +1100 Subject: [PATCH 2/3] Added shoes --- resources/defaultPartyMemberMeta.json | 2 +- src/structures/party/ClientPartyMember.ts | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/resources/defaultPartyMemberMeta.json b/resources/defaultPartyMemberMeta.json index df555c95..f546e94f 100644 --- a/resources/defaultPartyMemberMeta.json +++ b/resources/defaultPartyMemberMeta.json @@ -3,7 +3,7 @@ "Default:ArbitraryCustomDataStore_j": "{\"ArbitraryCustomDataStore\":[]}", "Default:AthenaBannerInfo_j": "{\"AthenaBannerInfo\":{\"bannerIconId\":\"standardbanner15\",\"bannerColorId\":\"defaultcolor15\",\"seasonLevel\":1}}", "Default:AthenaCosmeticLoadoutVariants_j": "{\"AthenaCosmeticLoadoutVariants\":{\"vL\":{},\"fT\":false}}", - "Default:AthenaCosmeticLoadout_j": "{\"AthenaCosmeticLoadout\":{\"characterPrimaryAssetId\":\"\",\"characterEKey\":\"\",\"backpackDef\":\"None\",\"backpackEKey\":\"\",\"pickaxeDef\":\"/Game/Athena/Items/Cosmetics/Pickaxes/DefaultPickaxe.DefaultPickaxe\",\"pickaxeEKey\":\"\",\"contrailDef\":\"/Game/Athena/Items/Cosmetics/Contrails/DefaultContrail.DefaultContrail\",\"contrailEKey\":\"\",\"scratchpad\":[],\"cosmeticStats\":[{\"statName\":\"HabaneroProgression\",\"statValue\":0},{\"statName\":\"TotalVictoryCrowns\",\"statValue\":0},{\"statName\":\"TotalRoyalRoyales\",\"statValue\":0},{\"statName\":\"HasCrown\",\"statValue\":0}]}}", + "Default:AthenaCosmeticLoadout_j": "{\"AthenaCosmeticLoadout\":{\"characterPrimaryAssetId\":\"\",\"characterEKey\":\"\",\"backpackDef\":\"None\",\"backpackEKey\":\"\",\"pickaxeDef\":\"/Game/Athena/Items/Cosmetics/Pickaxes/DefaultPickaxe.DefaultPickaxe\",\"pickaxeEKey\":\"\",\"contrailDef\":\"/Game/Athena/Items/Cosmetics/Contrails/DefaultContrail.DefaultContrail\",\"contrailEKey\":\"\",\"shoesDef\":\"None\",\"shoesEKey\":\"\",\"scratchpad\":[],\"cosmeticStats\":[{\"statName\":\"HabaneroProgression\",\"statValue\":0},{\"statName\":\"TotalVictoryCrowns\",\"statValue\":0},{\"statName\":\"TotalRoyalRoyales\",\"statValue\":0},{\"statName\":\"HasCrown\",\"statValue\":0}]}}", "Default:BattlePassInfo_j": "{\"BattlePassInfo\":{\"bHasPurchasedPass\":false,\"passLevel\":1,\"selfBoostXp\":0,\"friendBoostXp\":0}}", "Default:bIsPartyUsingPartySignal_b": "false", "Default:CampaignHero_j": "{\"CampaignHero\":{\"heroItemInstanceId\":\"\",\"heroType\":\"\"}}", diff --git a/src/structures/party/ClientPartyMember.ts b/src/structures/party/ClientPartyMember.ts index 031e3a1d..f7b6fa3b 100644 --- a/src/structures/party/ClientPartyMember.ts +++ b/src/structures/party/ClientPartyMember.ts @@ -356,6 +356,27 @@ class ClientPartyMember extends PartyMember { await this.sendPatch(patches); } + /** + * Updates the client party member's shoes + * @param id The shoes's ID + * @throws {EpicgamesAPIError} + */ + public async setShoes(id: string) { + let data = this.meta.get('Default:AthenaCosmeticLoadout_j'); + + data = this.meta.set('Default:AthenaCosmeticLoadout_j', { + ...data, + AthenaCosmeticLoadout: { + ...data.AthenaCosmeticLoadout, + shoesDef: `/CosmeticShoes/Assets/Items/Cosmetics/${id}.${id}`, + }, + }); + + await this.sendPatch({ + 'Default:AthenaCosmeticLoadout_j': data, + }); + } + /** * Updates the client party member's emote * @param id The emote's ID From 4f95e75c7489c04a7982b171ae9c57c15562d7a0 Mon Sep 17 00:00:00 2001 From: Kye Date: Sat, 23 Nov 2024 09:42:12 +1100 Subject: [PATCH 3/3] get shoes --- src/structures/party/PartyMember.ts | 7 +++++++ src/structures/party/PartyMemberMeta.ts | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/structures/party/PartyMember.ts b/src/structures/party/PartyMember.ts index 9b32b029..8782c404 100644 --- a/src/structures/party/PartyMember.ts +++ b/src/structures/party/PartyMember.ts @@ -93,6 +93,13 @@ class PartyMember extends User { return this.meta.backpack; } + /** + * The member's currently equipped shoes + */ + public get shoes() { + return this.meta.shoes; + } + /** * Whether the member is ready */ diff --git a/src/structures/party/PartyMemberMeta.ts b/src/structures/party/PartyMemberMeta.ts index b5dcd06e..7f9f56a7 100644 --- a/src/structures/party/PartyMemberMeta.ts +++ b/src/structures/party/PartyMemberMeta.ts @@ -37,6 +37,13 @@ class PartyMemberMeta extends Meta { return (this.get('Default:AthenaCosmeticLoadout_j')?.AthenaCosmeticLoadout?.backpackDef as string)?.match(/(?<=\w*\.)\w*/)?.shift(); } + /** + * The currently equipped shoes + */ + public get shoes(): string | undefined { + return (this.get('Default:AthenaCosmeticLoadout_j')?.AthenaCosmeticLoadout?.shoesDef as string)?.match(/(?<=\w*\.)\w*/)?.shift(); + } + /** * Whether the member is ready */