Skip to content

Commit

Permalink
add PartyMember#island getter
Browse files Browse the repository at this point in the history
  • Loading branch information
tnfAngel committed Dec 6, 2023
1 parent 84280e6 commit e80221d
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
5 changes: 3 additions & 2 deletions resources/defaultPartyMemberMeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
"Default:PlatformData_j": "{\"PlatformData\":{\"platform\":{\"platformDescription\":{\"name\":\"\",\"platformType\":\"DESKTOP\",\"onlineSubsystem\":\"None\",\"sessionType\":\"\",\"externalAccountType\":\"\",\"crossplayPool\":\"DESKTOP\"}},\"uniqueId\":\"INVALID\",\"sessionId\":\"\"}}",
"Default:SharedQuests_j": "{\"SharedQuests\":{\"bcktMap\":{},\"pndQst\":\"\"}}",
"Default:SpectateInfo_j": "{\"SpectateInfo\":{\"gameSessionId\":\"\",\"gameSessionKey\":\"\"}}",
"Default:UtcTimeStartedMatchAthena_s": "0001-01-01T00:00:00.000Z"
}
"Default:UtcTimeStartedMatchAthena_s": "0001-01-01T00:00:00.000Z",
"Default:CurrentIsland_j": "{}"
}
12 changes: 12 additions & 0 deletions resources/structs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,18 @@ export interface Playlist {
};
}

export interface Island {
linkId?: {
mnemonic?: string;
version?: number;
};
sessionId?: string;
joinInfo?: {
islandJoinability?: string;
sessionKey?: string;
};
}

export interface CosmeticVariant {
channel: string;
variant: string;
Expand Down
7 changes: 7 additions & 0 deletions src/structures/party/PartyMember.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,13 @@ class PartyMember extends User {
return this.meta.match;
}

/**
* The member's current island
*/
public get island() {
return this.meta.island;
}

/**
* Whether a marker has been set
*/
Expand Down
9 changes: 8 additions & 1 deletion src/structures/party/PartyMemberMeta.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Meta from '../../util/Meta';
import type {
BannerMeta, BattlePassMeta, CosmeticsVariantMeta, MatchMeta, PartyMemberSchema, Platform,
BannerMeta, BattlePassMeta, CosmeticsVariantMeta, Island, MatchMeta, PartyMemberSchema, Platform,
} from '../../../resources/structs';

/**
Expand Down Expand Up @@ -118,6 +118,13 @@ class PartyMemberMeta extends Meta<PartyMemberSchema> {
};
}

/**
* The current island info
*/
public get island(): Island {
return this.get('Default:CurrentIsland_j')?.SelectedIsland;
}

/**
* Whether a marker has been set
*/
Expand Down

0 comments on commit e80221d

Please sign in to comment.