Skip to content

Commit

Permalink
✨ Add configurable option to allow multiple scores per player
Browse files Browse the repository at this point in the history
Add configurable option wether to allow or not multiple scores per player
  • Loading branch information
GabrielePicco committed Dec 28, 2023
1 parent f8d94d3 commit 5cdc9b0
Show file tree
Hide file tree
Showing 10 changed files with 2,836 additions and 2,896 deletions.
4,646 changes: 2,210 additions & 2,436 deletions client/sdk/src/idl/soar.ts

Large diffs are not rendered by default.

580 changes: 278 additions & 302 deletions client/sdk/src/idl/tens.ts

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion client/sdk/src/instructions/rawInstructions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,13 @@ export const updateLeaderBoardInstruction = async (
pre?: TransactionInstruction[]
): Promise<TransactionInstruction> => {
return program.methods
.updateLeaderboard(args.newDescription, args.newNftMeta)
.updateLeaderboard(
args.newDescription,
args.newNftMeta,
args.newMinScore,
args.newMaxScore,
args.newAllowMultipleScores
)
.accounts(accounts)
.preInstructions(pre ?? [])
.instruction();
Expand Down
8 changes: 7 additions & 1 deletion client/sdk/src/soar.program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,10 @@ export class SoarProgram {
authority: PublicKey,
leaderboard: PublicKey,
newDescription?: string,
newNftMeta?: PublicKey
newNftMeta?: PublicKey,
newMinScore?: BN,
newMaxScore?: BN,
newAllowMultipleScores?: boolean
): Promise<InstructionResult.UpdateLeaderboard> {
this.builder.clean();
if (newDescription === undefined && newNftMeta === undefined) {
Expand All @@ -282,6 +285,9 @@ export class SoarProgram {
{
newDescription: newDescription ?? null,
newNftMeta: newNftMeta ?? null,
newMinScore: newMinScore ?? null,
newMaxScore: newMaxScore ?? null,
newAllowMultipleScores: newAllowMultipleScores ?? null,
},
authority,
leaderboard
Expand Down
3 changes: 3 additions & 0 deletions client/sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ export interface UpdateGameArgs {
export interface UpdateLeaderboardArgs {
newDescription: string | null;
newNftMeta: PublicKey | null;
newMinScore: BN | null;
newMaxScore: BN | null;
newAllowMultipleScores: boolean | null;
}
export interface UpdatePlayerArgs {
newUsername: string | null;
Expand Down
Loading

0 comments on commit 5cdc9b0

Please sign in to comment.