Skip to content

Commit

Permalink
feat(server): support party mode
Browse files Browse the repository at this point in the history
Changes leaderboards server SDK method to accept a player id in order to support filtering for
future party mode

BREAKING CHANGE: leaderboards is going from a sync call to an async call
  • Loading branch information
foundrium committed Jul 23, 2022
1 parent 2a0fef1 commit c08009a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/server/src/api/resources/game/gameResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,14 @@ export class GameResource extends BaseResource {
return result;
}

leaderboards() {
return this.details.leaderboards;
async leaderboards(playerId?: string) {
if (!playerId) {
return this.details.leaderboards;
} else {
const path = `/arcades/${this.configuration.arcadeId}/developergames/${this.configuration.gameId}/player/${playerId}`;
const result = await this.get<Game>(path);
return result.leaderboards;
}
}

async leaders(leaderboard: Leaderboard) {
Expand Down

0 comments on commit c08009a

Please sign in to comment.