Plugin : Leader board

Author:Rex.Rainbow

Download

Properties

Domain

  • The root location of the Firebase data.

ID

  • ID of leader board, i.e. "Sub domain".

Order

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

Update

  • Manual update or auto update.
    • Options : ["Manual","Auto"]

Actions

Domain

Action:Set domain

  • Set domain ref.
    • Domain ( string ) : The root location of the Firebase data.
    • ID ( string ) : ID of leader board, i.e. "Sub domain".

Remove

Action:Remove post

  • Remove post by User ID.
    • UserID ( string ) : UserID from authentication.

Score

Action:Get score

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

Send

Action:Post score

  • Post score by user ID.
    • UserID ( string ) : UserID from authentication.
    • Name ( string ) : Player name.
    • Score ( number or string ) : Player Score
    • Extra ( number or string ) : 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","if not existed"]

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.

Update

Action:Update all

  • Update all ranks.

Action:Update top

  • Update top ranks.
    • Count ( number ) : The count of top ranks.

Action:Stop updating

  • Stop updating ranks.

Expressions

Post

Expression:PostPlayerName

  • The post player name. Uses 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:RankCount

  • Get total rank count.

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.
    • Rank ( number ) : Rank index (0-based).

Expression:Rank2PlayerScore

  • Get player score by rank index.
    • Rank ( number ) : Rank index (0-based).

Expression:Rank2ExtraData

  • Get extra data by rank index.
    • 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).

Request

Expression:LastUserID

  • Get requested userID. Return "" if invalided.

Expression:LastScore

  • Get requested score. Return 0 if invalided.

Expression:LastPlayerName

  • Get requested score. Return "" if invalided.

Update - 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:CurPlayerRank

  • Get the current player rank (0-based) 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.

Conditions

Score - get

Condition:On get score

  • Triggered when get score.

Send

Condition:On post complete

  • Triggered when post complete.

Condition:On post error

  • Triggered when post error.

Update

Condition:On update

  • Triggered when ranks updated.

Update - for each

Condition:For each rank

  • Repeat the event for each rank.

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.