feat: add public leaderboards with opt-out privacy setting

This commit is contained in:
2026-03-07 15:06:42 -08:00
committed by Naomi Carrigan
parent bbdacf272c
commit 3515de62ee
12 changed files with 525 additions and 0 deletions
+3
View File
@@ -38,6 +38,9 @@ export type {
ExploreStartRequest,
ExploreStartResponse,
GiteaRelease,
LeaderboardCategory,
LeaderboardEntry,
LeaderboardResponse,
LoadResponse,
PrestigeRequest,
PrestigeResponse,
+24
View File
@@ -183,6 +183,30 @@ export interface ApiError {
error: string;
}
export type LeaderboardCategory =
| "totalGold"
| "bossesDefeated"
| "questsCompleted"
| "achievementsUnlocked"
| "prestigeCount"
| "transcendenceCount"
| "apotheosisCount";
export interface LeaderboardEntry {
rank: number;
discordId: string;
characterName: string;
username: string;
avatar: string | null;
activeTitle: string;
value: number;
}
export interface LeaderboardResponse {
category: LeaderboardCategory;
entries: LeaderboardEntry[];
}
export interface GiteaRelease {
tag_name: string;
name: string;
@@ -20,6 +20,8 @@ export interface ProfileSettings {
showAdventurersRecruited: boolean;
showAchievementsUnlocked: boolean;
numberFormat: NumberFormat;
/** Whether this player appears on the public leaderboards */
showOnLeaderboards: boolean;
}
export const DEFAULT_PROFILE_SETTINGS: ProfileSettings = {
@@ -40,4 +42,5 @@ export const DEFAULT_PROFILE_SETTINGS: ProfileSettings = {
showAdventurersRecruited: true,
showAchievementsUnlocked: true,
numberFormat: "suffix",
showOnLeaderboards: true,
};