Skip to content

Commit

Permalink
add Party#island getter
Browse files Browse the repository at this point in the history
  • Loading branch information
tnfAngel committed Dec 6, 2023
1 parent e80221d commit 1bdb247
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion resources/defaultPartyMeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "{}"
}
7 changes: 7 additions & 0 deletions src/structures/party/Party.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
9 changes: 8 additions & 1 deletion src/structures/party/PartyMeta.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -12,6 +12,13 @@ class PartyMeta extends Meta<PartySchema> {
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.)
*/
Expand Down

0 comments on commit 1bdb247

Please sign in to comment.