Plugin : Leader board

Author:Rex.Rainbow

Download

Properties

Class name

  • Class name for storing leaderboard structure.

ID

  • ID of leader board.

Lines

  • Line count of each page.

Order

  • Ranking order.
    • Options : ["Small to large","Large to small"]

Write permission

  • All user or only owner could write the save slot.
    • Options : ["All users","Owner"]

Read permission

  • All user or only owner could read the save slot.
    • Options : ["All users","Owner"]

User class name

  • Class name of user. "" would ignore this feature.

Actions

Initial

Action:Initial table

  • Initial table.

Leaderboard

Action:Set leaderboard ID

  • Set leaderboard ID and clean all.
    • Leaderboard ID ( string ) : ID of leader board.

Ranking

Action:Get ranking

  • Get ranking.
    • UserID ( string ) : UserID from authentication.

Request

Action:Request in a range

  • Request in a range.
    • Start ( number ) : Start index, 0-based.
    • Lines ( number ) : Count of lines

Request - page

Action:Turn to page

  • Turn to page.
    • Index ( number ) : Page index, 0-based.

Action:Update current page

  • Update current page.

Action:Turn to next page

  • Update turn to next page.

Action:Turn to previous page

  • Update turn to previous page.

Score

Action:Post score

  • Post score by user ID.
    • UserID ( string ) : UserID from authentication.
    • Name ( string ) : (Optional) Player name.
    • Score ( number or string ) : Player Score
    • Extra ( number or string ) : (Optional) Extra data, could be number or (JSON) string.
    • Post condition ( Combo ) : Post if score is greater or less then saved score.
      • Options : ["","if greater","if less"]

Action:Add to score

  • Add score by user ID.
    • UserID ( string ) : UserID from authentication.
    • Name ( string ) : (Optional) Player name.
    • Add ( number or string ) : Add score
    • Extra ( number or string ) : (Optional) Extra data, could be number or (JSON) string.

Action:Get score

  • Get score.
    • UserID ( string ) : UserID from authentication.

Users count

Action:Get users count

  • Get users count. Maximum of 160 requests per minute.

Expressions

Error

Expression:ErrorCode

  • Error code.

Expression:ErrorMessage

  • Error message.

Load - for each

Expression:CurPlayerName

  • Get the current player name in a For Each loop.

Expression:CurPlayerScore

  • Get the current player score in a For Each loop.

Expression:CurUserID

  • Get the current user id in a For Each loop.

Expression:CurExtraData

  • Get the current extra data in a For Each loop.

Expression:CurUserObject

  • Get value of current user object in a For Each loop.

Load - for each - index

Expression:CurPlayerRank

  • Get the current player rank (0-based) in a For Each loop.

Expression:CurStartIndex

  • Get start index in current received page.

Expression:LoopIndex

  • Get loop index in current received page.

Page

Expression:PageIndex

  • Get current page index. (0-based)

Post

Expression:PostPlayerName

  • Get posted player name under "condition:On post complete".

Expression:PostPlayerScore

  • Get posted current player score under "condition:On post complete".

Expression:PostPlayerUserID

  • Get posted current user id under "condition:On post complete".

Expression:PostExtraData

  • Get posted current extra data under "condition:On post complete".

Rank

Expression:UserID2Rank

  • Get rank by user ID. Return (-1) if not found.
    • UserID ( string ) : UserID from authentication.

Rank index

Expression:Rank2PlayerName

  • Get player name by rank index. Add default value at 2nd parameter.
    • Rank ( number ) : Rank index (0-based).

Expression:Rank2PlayerScore

  • Get player score by rank index. Add default value at 2nd parameter.
    • Rank ( number ) : Rank index (0-based).

Expression:Rank2ExtraData

  • Get extra data by rank index. Add default value at 2nd parameter.
    • Rank ( number ) : Rank index (0-based).

Expression:Rank2PlayerUserID

  • Get userID by rank index. Add default value at 2nd parameter.
    • Rank ( number ) : Rank index (0-based).

Expression:Rank2PlayerObject

  • Get player object by rank index. Add default value at 2nd parameter.

Ranking

Expression:LastRanking

  • Get ranking of userID (0-based) under "Condition:On get ranking". Return (-1) if invalided.

Expression:LastUserID

  • Get requested userID under "Condition:On get ranking". Return "" if invalided.

Expression:LastScore

  • Get requested score under "Condition:On get score". Return "" if invalided.

Received - for each

Expression:CurRankingCount

  • Get ranking count in current received page.

Users count

Expression:LastUsersCount

  • Get users count under "Condition: On get users count".

Conditions

Load

Condition:On receive

  • Triggered when receive updated.

Condition:On receive error

  • Triggered when receive ranks error.

Condition:For each rank in a range

  • Repeat the event for each rank in a range.
    • Start ( number ) : Start from rank index (0-based).
    • End ( number ) : End to rank index (0-based). This value should larger than Start.

Condition:Last page

  • Return true if current page is the last page.

Load - for each

Condition:For each rank

  • Repeat the event for each rank.

Ranking

Condition:On get ranking

  • Triggered when get ranking.

Condition:On get ranking error

  • Triggered when get ranking error.

Score - get

Condition:On get score

  • Triggered when get score.

Condition:On get score error

  • Triggered when get score error.

Score - post

Condition:On post complete

  • Triggered when post complete.

Condition:On post error

  • Triggered when post error.

Users count

Condition:On get users count

  • Triggered when get messages count.

Condition:On get users count error

  • Triggered when get users count error.