From 1bdb24793ff8002e02f66b58b0a5c83bdf4a78de Mon Sep 17 00:00:00 2001 From: tnfAngel <57068341+tnfAngel@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:00:24 +0000 Subject: [PATCH] add Party#island getter --- resources/defaultPartyMeta.json | 3 ++- src/structures/party/Party.ts | 7 +++++++ src/structures/party/PartyMeta.ts | 9 ++++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/resources/defaultPartyMeta.json b/resources/defaultPartyMeta.json index 85f30a2d..85caf9d5 100644 --- a/resources/defaultPartyMeta.json +++ b/resources/defaultPartyMeta.json @@ -33,5 +33,6 @@ "urn:epic:cfg:join-request-action_s": "Manual", "urn:epic:cfg:party-type-id_s": "default", "urn:epic:cfg:presence-perm_s": "Anyone", - "VoiceChat:implementation_s": "VivoxVoiceChat" + "VoiceChat:implementation_s": "VivoxVoiceChat", + "Default:SelectedIsland_j": "{}" } diff --git a/src/structures/party/Party.ts b/src/structures/party/Party.ts index 1057560f..90d76795 100644 --- a/src/structures/party/Party.ts +++ b/src/structures/party/Party.ts @@ -95,6 +95,13 @@ class Party extends Base { return this.meta.playlist; } + /** + * The currently selected island + */ + public get island() { + return this.meta.island; + } + /** * The custom matchmaking key */ diff --git a/src/structures/party/PartyMeta.ts b/src/structures/party/PartyMeta.ts index ff177ac6..d399b08a 100644 --- a/src/structures/party/PartyMeta.ts +++ b/src/structures/party/PartyMeta.ts @@ -1,5 +1,5 @@ import Meta from '../../util/Meta'; -import type { PartySchema, Playlist } from '../../../resources/structs'; +import type { Island, PartySchema, Playlist } from '../../../resources/structs'; /** * Represents a party's meta @@ -12,6 +12,13 @@ class PartyMeta extends Meta { return this.get('Default:PlaylistData_j')?.PlaylistData; } + /** + * The currently selected island + */ + public get island(): Island | undefined { + return this.get('Default:SelectedIsland_j')?.SelectedIsland; + } + /** * The region ID (EU, NAE, NAW, etc.) */