Plugin : Leaderboard

Author:Rex.Rainbow

Download

Properties

Class

  • Class of the table.

Class name

  • Class name for storing leaderboard structure.

Primary keys

  • Primary keys for indexing.

ID

  • ID of leader board.

Tag

  • A tag that can be used to filter scores. Set "" to ignore this feature.

Page

  • Paging for reading.

Lines

  • Line count of each page for loading scores.

Order

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

Period

  • The time-frame to pull scores from.
    • Options : ["Current day","Current week","Current month","Current year","All-time"]

Linked tables

  • Linked tables.

Owner class name

  • Class name of owner data structure. Set "" to ignore owner data.

Actions

Configuration

Action:Set board ID

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

Action:Set tag

  • Set filter tag.
    • Tag ( string ) : A tag that can be used to filter scores. Set "" to ignore this feature.

Action:Set period

  • Set period.
    • Period ( Combo ) : The time-frame to pull scores from.
      • Options : ["Current day","Current week","Current month","Current year","All-time"]

Action:Set date time

  • Set date time for querying.
    • Timestamp ( number ) : Datetime in timestamp.

Initial

Action:Initial table

  • Initial table.

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.
    • Score ( number or string ) : User Score
    • Post condition ( Combo ) : Post if score is greater or less then saved score.
      • Options : ["","if greater","if less"]

Action:Get score

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

Expressions

Configuration

Expression:BoardID

  • Get board ID.

Expression:Tag

  • Get tag.

Error

Expression:ErrorCode

  • Error code.

Expression:ErrorMessage

  • Error message.

Load - for each

Expression:CurScore

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

Expression:CurUserID

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

Expression:CurUserData

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

Load - for each - index

Expression:CurUserRank

  • Get the current user 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:PostScore

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

Expression:PostUserID

  • Get posted current user id 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:Rank2Score

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

Expression:Rank2UserID

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

Expression:Rank2UserData

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

Received - for each

Expression:CurRankingCount

  • Get ranking count in current received page.

Request

Expression:LastRanking

  • Get ranking of userID (0-based). Return (-1) if invalided.

Expression:LastUserID

  • Get requested userID. Return "" if invalided.

Expression:LastScore

  • Get requested score. Return "" if invalided.

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

  • Triggered when post complete.

Condition:On post error

  • Triggered when post error.