leaderboard - TogetherGames/Public-Unity-CSharp GitHub Wiki

Leaderboard

Together::Leaderboard

Overview

The Leaderboard class represents a together Leaderboard.


Members

long LeaderboardID

The ID of the Leaderboard.

long CreatorUserID

The ID of the User that created the GameInstance the Leaderboard is based on.

long RoomID

The ID of the Room the original GameInstance.

int SecondsSinceStart

The number of seconds since the original GameInstance was started.

int SecondsSinceFinish

The number of seconds since the original GameInstance was finished.

int MaxUsers

The max number of users in the original GameInstance.

int TurnIndex

The index of whose turn it last was.

long WinningUserID

The ID of the User that won the original GameInstance.

List<LeaderboardUser> LeaderboardUsers

Contains all the LeaderboardUsers that were playing the original GameInstance.


Methods


FindLeaderboardUserByUserID()

Finds the LeaderboardUser with the specified UserID if it exists, otherwise returns null.

Syntax
Leaderboard.FindLeaderboardUserByUserID( userID )
Parameters

long userID

The ID of the User to find.

--------------------------------------------------------------------------------

FindLeaderboardUserByLeaderboardUserID()

Finds the LeaderboardUser with the specified LeaderboardUserID if it exists, otherwise returns null.

Syntax
Leaderboard.FindLeaderboardUserByLeaderboardUserID( leaderboardUserID )
Parameters

long leaderboardUserID

The ID of the LeaderboardUser to find

--------------------------------------------------------------------------------

GetLeaderboardUserCount()

Gets the number of LeaderboardUsers currently managed internally.

Returns int
Syntax
Leaderboard.GetLeaderboardUserCount(  )

GetLeaderboardUser()

Gets the LeaderboardUser at the specified index if it exists, otherwise returns null.

Syntax
Leaderboard.GetLeaderboardUser( index )
Parameters

int index

The index of the LeaderboardUser to find

--------------------------------------------------------------------------------

IndexOfLeaderboardUser()

Returns the index of the specified LeaderboardUser if it exists, otherwise returns -1.

Returns int
Syntax
Leaderboard.IndexOfLeaderboardUser( leaderboardUser )
Parameters

LeaderboardUser leaderboardUser

Instance of the LeaderboardUser to find the index of

--------------------------------------------------------------------------------

IndexOfLeaderboardUserByUserID()

Returns the index of the LeaderboardUser with the specified UserID if it exists, otherwise returns -1.

Returns int
Syntax
Leaderboard.IndexOfLeaderboardUserByUserID( userID )
Parameters

long userID

The ID of the User to find the index of

--------------------------------------------------------------------------------

IndexOfLeaderboardUserByLeaderboardUserID()

Returns the index of the Leaderboard with the specified LeaderboardID if it exists, otherwise returns -1.

Returns int
Syntax
Leaderboard.IndexOfLeaderboardUserByLeaderboardUserID( leaderboardUserID )
Parameters

long leaderboardUserID

The ID of the LeaderboardUser to find the index of

--------------------------------------------------------------------------------

RemoveLeaderboardUser()

Removes a LeaderboardUser from the internally managed list. This does not remove the user from the Leaderboard persistently.

Note
This method is deprecated

Returns void
Syntax
Leaderboard.RemoveLeaderboardUser( index )
Parameters

int index

The index of the LeaderboardUser to remove

--------------------------------------------------------------------------------

GetDetails()

Gets the Leaderboard's details.

Returns void
Syntax
Leaderboard.GetDetails( friendsOnly, callbackFunc )
Parameters

bool friendsOnly

A boolean indicating whether only Together friend Users should be retrieve.

[OnCompleteHandler](./oncompletehandler) callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------
⚠️ **GitHub.com Fallback** ⚠️