Leaderboard Object

Definition

1
public class LeaderboardObject : ScriptableObject
Copied!
Represents a Steam Leaderboard and is used by the Steam Settings object to initalize the Leaderboard system.
You create leaderboard objects through thee Steam Settings object by clicking the + New button in the leaderboards list.
From the Steam Settings you can mark the leaderboard as create if missing by ticking the toggle to the left of the name.
You can specify the number of detail entries the board should handle by entering a number in the Details field
Each board can handle up to 64 details and no more than that
If your marking your board as Create if Missing e.g. you have ticked the box as indiacted above then you should also set the display type and sorting order by selecting the leaderboard in your Steam Settings and editing its values.
None is an available but invalid option for both settings
Why even show it if its invalid, ask Valve, its part of the enums they provide so we expose it.

Fields and Attributes

Type
Name
Comment
bool
createIfMissing
Should the board be created if missing
ELeaderboardSortMethod
sortMethod
If creating a board what sort methhod should be applied
ELeaderboardDisplayType
displayType
If creating a board what display type should it have
string
leaderboardName
The name of the board as defined in the Steam Developer Portal
int
maxDetailEntries
How many detail entries should be allowed on entries from this board
SteamLeaderboard_t
leaderboardId
bool
Valid
is the board found and ready for use
int
EntryCount
number of records on this board

Methods

Get User Entries

1
public void GetUserEntry(Action<LeaderboardEntry, bool> callback)
Copied!
The callback should be in the form of
1
public void Callback(LeaderbaordEntry result, bool IOError);
Copied!
Returns the entry for the local user

Get Entries

1
public void GetEntries(ELeaderboardDataRequest request,
2
int start,
3
int end,
4
Action<LeaderboardEntry[], bool> callback)
Copied!
Get a range of entries matching the request type and range of data
1
public void GetEntries(UserData[] users,
2
Action<LeaderboardEntry[], bool> callback)
Copied!
Get the data for the specific set of users
The callback for both overloads should be in the form of
1
public void Callback(LeaderbaordEntry[] results, bool IOError);
Copied!

Register

1
public void Register();
Copied!
Finds or creates the board according to configuration values. This is handled by the internal system for all boards defined at development time but must be called manually if you define this object at run time.

Upload Score

1
public void UploadScore(int score,
2
ELeaderboardUploadScoreMethod method,
3
Action<LeaderboardScoreUploaded_t, bool> callback = null)
Copied!
1
public void UploadScore(int score,
2
int[] scoreDetails,
3
ELeaderboardUploadScoreMethod method,
4
Action<LeaderboardScoreUploaded_t, bool> callback = null)
Copied!
The callback should be in the form:
1
public void Callback(LeaderboardScoreUploaded_t result, bool IOError);
Copied!
Uploads a given score and optionally includes details, you can optionally provide an array of details.

Attach File

1
public void AttachUGC(fileName, jsonObject, encoding, callback);
Copied!
This will save the provided object to Steam Remote Storage by using JsonUtility to serialize it according to the encoding method.
Once saved to Remote Storage it will be shared yielding a UGC Share File which will be attached to this user's current leaderboard entry.