SparkLeaderboards

Provides access to the leaderboards for the current game.

var leaderboards = Spark.getLeaderboards();

getLeaderboard

signature getLeaderboard(string shortCode)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a SparkLeaderboard object by its shortCode.

params

shortCode - the shortCode of the leaderboard.

example

var leaderboard = Spark.getLeaderboards().getLeaderboard(shortCode);

getSocialLeaderboard

signature getSocialLeaderboard(string shortCode, string[] friendIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard object by its shortCode, where the social group contains the current player and the players with the given playerIds.

If no playerIds are provided the player's game friends are used.

params

shortCode - the shortCode of the leaderboard.

friendsIds - the ids of the other players to be included in this social leaderboard.

example

var leaderboard = Spark.getLeaderboards().getSocialLeaderboard(shortCode, myplayerids);

getInverseSocialLeaderboard

signature getInverseSocialLeaderboard(string shortCode, string[] friendIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard object by its shortCode for the current player, where the social group excludes the players with the given playerIds.

If no playerIds are provided the player's game friends are used.

params

shortCode - the shortCode of the leaderboard.

friendsIds - the ids of the other players to be excluded from this social leaderboard.

example

var leaderboard = Spark.getLeaderboards().getInverseSocialLeaderboard(shortCode, myplayerids);

getSocialLeaderboardAs

signature getSocialLeaderboardAs(string shortCode, string playerId, string[] friendIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard object by its shortCode, where the social group contains the player with the given playerId and the players with given playerIds.

If no playerIds are provided the player's game friends are used.

params

shortCode - the shortCode of the leaderboard.

playerId - the playerId to load the social leaderboard for.

friendsIds - the ids of the other players to be included in this social leaderboard.

example

var leaderboard = Spark.getLeaderboards().getSocialLeaderboardAs(shortCode, myplayerid, myplayerids);

getInverseSocialLeaderboardAs

signature getInverseSocialLeaderboardAs(string shortCode, string playerId, string[] friendIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard object by its shortCode for the given player, where the social group excludes the players with the given playerIds.

If no playerIds are provided the player's game friends are used.

params

shortCode - the shortCode of the leaderboard.

playerId - the playerId to load the social leaderboard for.

friendsIds - the ids of the other players to be excluded from this social leaderboard.

example

var leaderboard = Spark.getLeaderboards().getInverseSocialLeaderboardAs(shortCode, myplayerid, myplayerids);

getTeamLeaderboard

signature getTeamLeaderboard(string shortCode, string[] teamIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard object by its shortCode, where the social group contains the current player and the players belonging to the teams with the given teamIds

params

shortCode - the shortCode of the leaderboard.

teamids - the ids of the teams to be included in this social leaderboard

example

var leaderboard = Spark.getLeaderboards().getTeamLeaderboard(shortCode, myteamids);

getInverseTeamLeaderboard

signature getInverseTeamLeaderboard(string shortCode, string[] teamIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard object by its shortCode for the current player, where the social group excludes the players belonging to the teams with the given teamIds

params

shortCode - the shortCode of the leaderboard.

teamids - the ids of the teams to be excluded from this social leaderboard

example

var leaderboard = Spark.getLeaderboards().getInverseTeamLeaderboard(shortCode, myteamids);

getTeamLeaderboardAs

signature getTeamLeaderboardAs(string shortCode, string playerId, string[] teamIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard object by its shortCode, where the social group contains the player for the given playerId and the players belonging to the teams with the given teamIds

params

shortCode - the shortCode of the leaderboard.

playerId - the playerId to load the social leaderboard for.

teamids - the ids of the teams to be included in this social leaderboard

example

var leaderboard = Spark.getLeaderboards().getTeamLeaderboard(shortCode, myplayerid, myteamids);

getInverseTeamLeaderboardAs

signature getInverseTeamLeaderboardAs(string shortCode, string playerId, string[] teamIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard object by its shortCode for the given player, where the social group excludes the players belonging to the teams with the given teamIds

params

shortCode - the shortCode of the leaderboard.

playerId - the playerId to load the social leaderboard for.

teamids - the ids of the teams to be excluded from this social leaderboard

example

var leaderboard = Spark.getLeaderboards().getInverseTeamLeaderboard(shortCode, myplayerid, myteamids);

listLeaderboards

signature listLeaderboards()

returns SparkLeaderboard[]

validity All Scripts

Gives access to all leaderboards configured for the game

example

var leaderboards = Spark.getLeaderboards().listLeaderboards();

getChallengeLeaderboard

signature getChallengeLeaderboard(string challengeInstanceId)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a SparkLeaderboard object for a specific challenge by the challengeInstanceId.

params

challengeInstanceId - the id of the challenge instance to load the leaderboard for.

example

var leaderboard = Spark.getLeaderboards().getChallengeLeaderboard(challengeInstanceId);

getSocialChallengeLeaderboard

signature getSocialChallengeLeaderboard(string challengeInstanceId, string[] friendsIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard for a specific challenge, where the social group contains the current player and the given playerIds.

If no playerIds are provided the player's game friends are used.

params

challengeInstanceId - the id of the challenge instance to load the leaderboard for.

friendsIds - the ids of the other players to be included in this social leaderboard.

example

var leaderboard = Spark.getLeaderboards().getSocialChallengeLeaderboard(challengeInstanceId, myplayerids);

union

signature union(SparkLeaderboardOperations lhs, SparkLeaderboardOperations rhs)

returns SparkLeaderboardOperations

validity All Scripts

Performs a union on the set of owners returned as result of evaluating the first operation and the set of owners returned as result of evaluating the second operation.

Returns a SparkLeaderboardOperations object to allow further operations to be chained before evaluation.

To obtain the result of the operation call evaluate() on the SparkLeaderboardOperations returned.

params

lhs - the left-hand side of the operation.

rhs - the the right-hand side of the operation.

example

var inAny = Spark.getLeaderboards().union(lhs, rhs).evaluate();

signature union(SparkLeaderboardOperations lhs, SparkLeaderboard rhs)

returns SparkLeaderboardOperations

validity All Scripts

Performs a union on the set of owners returned as result of evaluating the operation and the owners of entries within the leaderboard.

Returns a SparkLeaderboardOperations object to allow further operations to be chained before evaluation.

To obtain the result of the operation call evaluate() on the SparkLeaderboardOperations returned.

params

lhs - the left-hand side of the operation.

rhs - the the right-hand side of the operation.

example

var inAny = Spark.getLeaderboards().union(lhs, rhs).evaluate();

signature union(SparkLeaderboard lhs, SparkLeaderboardOperations rhs)

returns SparkLeaderboardOperations

validity All Scripts

Performs a union on the set of owners of entries within the leaderboard and the set of owners returned as result of evaluating the operation.

Returns a SparkLeaderboardOperations object to allow further operations to be chained before evaluation.

To obtain the result of the operation call evaluate() on the SparkLeaderboardOperations returned.

params

lhs - the left-hand side of the operation.

rhs - the the right-hand side of the operation.

example

var inAny = Spark.getLeaderboards().union(lhs, rhs).evaluate();

signature union(SparkLeaderboard lhs, SparkLeaderboard rhs)

returns SparkLeaderboardOperations

validity All Scripts

Performs a union on the set of owners of entries within the first leaderboard and the set of owners of entries within the second.

Returns a SparkLeaderboardOperations object to allow further operations to be chained before evaluation.

To obtain the result of the operation call evaluate() on the SparkLeaderboardOperations returned.

params

lhs - the left-hand side of the operation.

rhs - the the right-hand side of the operation.

example

var inAny = Spark.getLeaderboards().union(lhs, rhs).evaluate();

getInverseSocialChallengeLeaderboard

signature getInverseSocialChallengeLeaderboard(string challengeInstanceId, string[] friendsIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard for a specific challenge for the current player, where the social group excludes the players with the given playerIds.

If no playerIds are provided the player's game friends are used.

params

challengeInstanceId - the id of the challenge instance to load the leaderboard for.

friendsIds - the ids of the other players to be excluded from this social leaderboard.

example

var leaderboard = Spark.getLeaderboards().getInverseSocialChallengeLeaderboard(challengeInstanceId, myplayerids);

getSocialChallengeLeaderboardAs

signature getSocialChallengeLeaderboardAs(string challengeInstanceId, string playerId, string[] friendIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard for a specific challenge, where the social group contains the player with the given playerId and the players with given playerIds.

If no playerIds are provided the player's game friends are used.

params

challengeInstanceId - the id of the challenge instance to load the leaderboard for.

playerId - the playerId to load the social leaderboard for.

friendsIds - the ids of the other players to be included in this social leaderboard.

example

var leaderboard = Spark.getLeaderboards().getSocialChallengeLeaderboardAs(challengeInstanceId, myplayerid, myplayerids);

getInverseSocialChallengeLeaderboardAs

signature getInverseSocialChallengeLeaderboardAs(string challengeInstanceId, string playerId, string[] friendIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard for a specific challenge for the current player, where the social group excludes the players with given playerIds.

If no playerIds are provided the player's game friends are used.

params

challengeInstanceId - the id of the challenge instance to load the leaderboard for.

playerId - the playerId to load the social leaderboard for.

friendsIds - the ids of the players to be excluded from this social leaderboard.

example

var leaderboard = Spark.getLeaderboards().getInverseSocialChallengeLeaderboardAs(challengeInstanceId, myplayerid, myplayerids);

getTeamChallengeLeaderboard

signature getTeamChallengeLeaderboard(string challengeInstanceId, string[] teamIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard for a specific challenge, where the social group contains the current player and the players belonging to the teams with the given teamIds.

params

challengeInstanceId - the id of the challenge instance to load the leaderboard for.

teamids - the ids of the teams to be included in this social leaderboard

example

var leaderboard = Spark.getLeaderboards().getTeamChallengeLeaderboard(challengeInstanceId, myteamids);

getInverseTeamChallengeLeaderboard

signature getInverseTeamChallengeLeaderboard(string challengeInstanceId, string[] teamIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard for a specific challenge for the current player, where the social group excludes the players belonging to the teams with the given teamIds.

params

challengeInstanceId - the id of the challenge instance to load the leaderboard for.

teamids - the ids of the teams to be excluded from this social leaderboard

example

var leaderboard = Spark.getLeaderboards().getInverseTeamChallengeLeaderboard(challengeInstanceId, myteamids);

intersection

signature intersection(SparkLeaderboardOperations lhs, SparkLeaderboard rhs)

returns SparkLeaderboardOperations

validity All Scripts

Performs an intersection on the set of owners returned as result of evaluating the operation and the owners of entries within the leaderboard.

Returns a SparkLeaderboardOperations object to allow further operations to be chained before evaluation.

To obtain the result of the operation call evaluate() on the SparkLeaderboardOperations returned.

params

lhs - the left-hand side of the operation.

rhs - the the right-hand side of the operation.

example

var inBoth = Spark.getLeaderboards().intersection(lhs, rhs).evaluate();

signature intersection(SparkLeaderboardOperations lhs, SparkLeaderboardOperations rhs)

returns SparkLeaderboardOperations

validity All Scripts

Performs an intersection on the set of owners returned as result of evaluating the first operation and the set of owners returned as result of evaluating the second operation.

Returns a SparkLeaderboardOperations object to allow further operations to be chained before evaluation.

To obtain the result of the operation call evaluate() on the SparkLeaderboardOperations returned.

params

lhs - the left-hand side of the operation.

rhs - the the right-hand side of the operation.

example

var inBoth = Spark.getLeaderboards().intersection(lhs, rhs).evaluate();

signature intersection(SparkLeaderboard lhs, SparkLeaderboardOperations rhs)

returns SparkLeaderboardOperations

validity All Scripts

Performs an intersection on the set of owners of entries within the leaderboard and the set of owners returned as result of evaluating the operation.

Returns a SparkLeaderboardOperations object to allow further operations to be chained before evaluation.

To obtain the result of the operation call evaluate() on the SparkLeaderboardOperations returned.

params

lhs - the left-hand side of the operation.

rhs - the the right-hand side of the operation.

example

var inBoth = Spark.getLeaderboards().intersection(lhs, rhs).evaluate();

signature intersection(SparkLeaderboard lhs, SparkLeaderboard rhs)

returns SparkLeaderboardOperations

validity All Scripts

Performs an intersection on the set of owners of entries within the first leaderboard and the set of owners of entries within the second.

Returns a SparkLeaderboardOperations object to allow further operations to be chained before evaluation.

To obtain the result of the operation call evaluate() on the SparkLeaderboardOperations returned.

params

lhs - the left-hand side of the operation.

rhs - the the right-hand side of the operation.

example

var inBoth = Spark.getLeaderboards().intersection(lhs, rhs).evaluate();

getTeamChallengeLeaderboardAs

signature getTeamChallengeLeaderboardAs(string challengeInstanceId, string playerId, string[] teamIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard for a specific challenge where the social group contains the player for the given playerId and the players belonging to the teams with the given teamIds.

params

challengeInstanceId - the id of the challenge instance to load the leaderboard for.

playerId - the playerId to load the social leaderboard for.

teamids - the ids of the teams to be included in this social leaderboard

example

var leaderboard = Spark.getLeaderboards().getTeamChallengeLeaderboard(challengeInstanceId, myplayerid, myteamids);

getInverseTeamChallengeLeaderboardAs

signature getInverseTeamChallengeLeaderboardAs(string challengeInstanceId, string playerId, string[] teamIds)

returns SparkLeaderboard

validity All Scripts

Allows a script to load a social SparkLeaderboard for a specific challenge for the given player, where the social group excludes the players belonging to the teams with the given teamIds.

params

challengeInstanceId - the id of the challenge instance to load the leaderboard for.

playerId - the playerId to load the social leaderboard for.

teamids - the ids of the teams to be excluded from this social leaderboard

example

var leaderboard = Spark.getLeaderboards().getInverseTeamChallengeLeaderboard(challengeInstanceId, myplayerid, myteamids);

difference

signature difference(SparkLeaderboardOperations lhs, SparkLeaderboard rhs)

returns SparkLeaderboardOperations

validity All Scripts

Performs a difference on the set of owners returned as result of evaluating the operation and the owners of entries within the leaderboard.

Returns a SparkLeaderboardOperations object to allow further operations to be chained before evaluation.

To obtain the result of the operation call evaluate() on the SparkLeaderboardOperations returned.

params

lhs - the left-hand side of the operation.

rhs - the the right-hand side of the operation.

example

var onlyInFirst = Spark.getLeaderboards().difference(lhs, rhs).evaluate();

signature difference(SparkLeaderboardOperations lhs, SparkLeaderboardOperations rhs)

returns SparkLeaderboardOperations

validity All Scripts

Performs a difference on the set of owners returned as result of evaluating the first operation and the set of owners returned as result of evaluating the second operation.

Returns a SparkLeaderboardOperations object to allow further operations to be chained before evaluation.

To obtain the result of the operation call evaluate() on the SparkLeaderboardOperations returned.

params

lhs - the left-hand side of the operation.

rhs - the the right-hand side of the operation.

example

var onlyInFirst = Spark.getLeaderboards().difference(lhs, rhs).evaluate();

signature difference(SparkLeaderboard lhs, SparkLeaderboardOperations rhs)

returns SparkLeaderboardOperations

validity All Scripts

Performs a difference on the set of owners of entries within the leaderboard and the set of owners returned as result of evaluating the operation.

Returns a SparkLeaderboardOperations object to allow further operations to be chained before evaluation.

To obtain the result of the operation call evaluate() on the SparkLeaderboardOperations returned.

params

lhs - the left-hand side of the operation.

rhs - the the right-hand side of the operation.

example

var onlyInFirst = Spark.getLeaderboards().difference(lhs, rhs).evaluate();

signature difference(SparkLeaderboard lhs, SparkLeaderboard rhs)

returns SparkLeaderboardOperations

validity All Scripts

Performs a difference on the set of owners of entries within the first leaderboard and the set of owners of entries within the second.

Returns a SparkLeaderboardOperations object to allow further operations to be chained before evaluation.

To obtain the result of the operation call evaluate() on the SparkLeaderboardOperations returned.

params

lhs - the left-hand side of the operation.

rhs - the the right-hand side of the operation.

example

var onlyInFirst = Spark.getLeaderboards().difference(lhs, rhs).evaluate();
Did this page help you? Please enter your feedback below. For questions about using this part of the platform, please contact support here