Skip to content

Add Steam Leaderboards bindings#208

Open
DavidBCD wants to merge 1 commit into
ceifa:mainfrom
DavidBCD:feat/leaderboards
Open

Add Steam Leaderboards bindings#208
DavidBCD wants to merge 1 commit into
ceifa:mainfrom
DavidBCD:feat/leaderboards

Conversation

@DavidBCD
Copy link
Copy Markdown

@DavidBCD DavidBCD commented May 4, 2026

Wraps the upstream steamworks-rs leaderboard API as a new leaderboards namespace. JS callers operate by leaderboard name; an internal cache keeps the resolved Steam handles so subsequent calls skip the find round-trip.

Adds the leaderboards subsystem — currently the only major Steamworks API not surfaced by this library. Useful for indie games doing time-attack / score-attack loops.

AttachLeaderboardUGC (for ghost replays / file attachments per score entry) isn't included — steamworks-rs doesn't expose it yet. Happy to follow up with PRs in both repos once that lands upstream.

Functions:

  • findOrCreateLeaderboard(name, sortMethod, displayType) -> bool
  • findLeaderboard(name) -> bool
  • uploadLeaderboardScore(name, sortMethod, displayType, method, score, details?) -> LeaderboardScoreUploaded
  • downloadLeaderboardEntries(name, request, rangeStart, rangeEnd, maxDetails?) -> LeaderboardEntry[]
  • getLeaderboardEntryCount(name) -> number

Enums: LeaderboardSortMethod, LeaderboardDisplayType, LeaderboardDataRequest, UploadScoreMethod.

Async via tokio::oneshot, matching the existing workshop module pattern.
Verified end-to-end against App ID 480 (Spacewar): findOrCreate ->
upload -> count -> download all return live results from the Steam client.

Wraps the upstream steamworks-rs leaderboard API as a new `leaderboards`
namespace. JS callers operate by leaderboard name; an internal cache
keeps the resolved Steam handles so subsequent calls skip the find round-trip.

Functions:
- findOrCreateLeaderboard(name, sortMethod, displayType) -> bool
- findLeaderboard(name) -> bool
- uploadLeaderboardScore(name, sortMethod, displayType, method, score, details?) -> LeaderboardScoreUploaded
- downloadLeaderboardEntries(name, request, rangeStart, rangeEnd, maxDetails?) -> LeaderboardEntry[]
- getLeaderboardEntryCount(name) -> number

Enums: LeaderboardSortMethod, LeaderboardDisplayType,
LeaderboardDataRequest, UploadScoreMethod.

Async via tokio::oneshot, matching the existing workshop module pattern.
Verified end-to-end against App ID 480 (Spacewar): findOrCreate ->
upload -> count -> download all return live results from the Steam client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant