rex_parse_leaderboard
Introduction
Leader board built on parse.
Leader board built on parse.
Usage
Sample capx
Sample capx
Class name
"Class name" in properties table is the "table name" shown at dash board.
"Class name" in properties table is the "table name" shown at dash board.
Authentication (optional)
It is recommend that getting UserID after login in rex_parse_authentication.
It is recommend that getting UserID after login in rex_parse_authentication.
Get score
Call "Action:Get score" to get score.
"Condition:On get score" will be triggered while got score, otherwise "Condition:On get score error" will be triggered.
Get score by "Expression:LastScore" under "Condition:On get score" condition. Return "" if requested userID does not exist.
Call "Action:Get score" to get score.
"Condition:On get score" will be triggered while got score, otherwise "Condition:On get score error" will be triggered.
Get score by "Expression:LastScore" under "Condition:On get score" condition. Return "" if requested userID does not exist.
Post score
Call "Action:Post score" to post score. It will save the score and other information indexed by UserID.
"Condition:On post complete" will be triggered if posting successfully, otherwise "Condition:On post error" will be triggered.
Get posted player name by "Expression:PostPlayerName" under "Condition:On post complete" condition.
Call "Action:Post score" to post score. It will save the score and other information indexed by UserID.
"Condition:On post complete" will be triggered if posting successfully, otherwise "Condition:On post error" will be triggered.
Get posted player name by "Expression:PostPlayerName" under "Condition:On post complete" condition.
Post score if greater/if less
Sample capx
Call "Action:Post score" and set "Post condition" to "if greater", "if less" to post the score only when the new score is greater/less then saved score.
Sample capx
Call "Action:Post score" and set "Post condition" to "if greater", "if less" to post the score only when the new score is greater/less then saved score.
Requesting ranks
Order
Set "Order" to "Large to small" or "Small to large" in properties table, to order these score of players.
It will sort by updated time if the score are the same.
Set "Order" to "Large to small" or "Small to large" in properties table, to order these score of players.
It will sort by updated time if the score are the same.
Pages
Ordered scores would be divided into pages, which started from page 0 (0-based).
Call one of these action to fetch score of players from parse server.
Get ranking count of current page by "Expression:CurRankingCount". "Condition:Last page" will return true if current page is the last page, which the ranking count is less than requested count.
Ordered scores would be divided into pages, which started from page 0 (0-based).
Call one of these action to fetch score of players from parse server.
- Action:Update current page
- Action:Turn to next page
- Action:Turn to previous page
- Action:Turn to page
- Expression:PageIndex, which is 0-based
- Expression:CurPlayerRank , which is 0-based
- Expression:CurPlayerName
- Expression:CurPlayerScore
- Expression:CurExtraData
- Expression:CurUserID
- Expression:LoopIndex, loop index in current for each loop
- Expression:Rank2PlayerName
- Expression:Rank2PlayerScore
- Expression:Rank2ExtraData
Get ranking count of current page by "Expression:CurRankingCount". "Condition:Last page" will return true if current page is the last page, which the ranking count is less than requested count.
Start from any index
Call "Action:Request in a range" to show ranks started from any index. Do not mix this action with pages type request described at previous section.
Other things are the same as "Pages" in previous section.
Call "Action:Request in a range" to show ranks started from any index. Do not mix this action with pages type request described at previous section.
Other things are the same as "Pages" in previous section.
Leader board ID
The plugin could support more then one leader board by changing the ID of leader board to other value. These leader board are put under the same "class name".
The initial ID of leader board is set at "ID" field in properties table. Call "Action:Set leaderboard ID" to change the ID of current leader board. It will also reset the page index to 0, and clean all data.
The plugin could support more then one leader board by changing the ID of leader board to other value. These leader board are put under the same "class name".
The initial ID of leader board is set at "ID" field in properties table. Call "Action:Set leaderboard ID" to change the ID of current leader board. It will also reset the page index to 0, and clean all data.
Get ranking of UserID
Sample capx
Call "Action:Get ranking" to send a request to get ranking of UserID.
"Condition:On get ranking" will triggered while found ranking of UserID, otherwise "Condition:On get ranking error" will be triggered.
Get the result of ranking by "Expression:LastRanking", requested UserID by "Expression:LastUserID" under "Condition:On get ranking". Return (-1) if requested userID does not exist.
Sample capx
Call "Action:Get ranking" to send a request to get ranking of UserID.
"Condition:On get ranking" will triggered while found ranking of UserID, otherwise "Condition:On get ranking error" will be triggered.
Get the result of ranking by "Expression:LastRanking", requested UserID by "Expression:LastUserID" under "Condition:On get ranking". Return (-1) if requested userID does not exist.
Get users count
Call "Action:Get users count" to get total saved users count. The result is put at "Expression:LastUsersCount" under "Condition:On get users count", otherwise "Condition:On get users count error" if requesting failed.
Call "Action:Get users count" to get total saved users count. The result is put at "Expression:LastUsersCount" under "Condition:On get users count", otherwise "Condition:On get users count error" if requesting failed.
Access permission
Sample capx
Set property "Access permission" to "Private" to protect score item only could be wrote by owner after authentication. Raise "Condition:On post error" if item is not allowed to write.
Set "Access permission" to "Public" or authentication fail will not set any access permission. i.e any user could over write all score items.
Sample capx
Set property "Access permission" to "Private" to protect score item only could be wrote by owner after authentication. Raise "Condition:On post error" if item is not allowed to write.
Set "Access permission" to "Public" or authentication fail will not set any access permission. i.e any user could over write all score items.
Compare with rex_firebase_leaderboard plugin
This plugin and rex_firebase_leaderboard plugin both support leader board. This plugin is good at showing ranks in pages, but this plugin could not show top N ranks in real-time.
This plugin and rex_firebase_leaderboard plugin both support leader board. This plugin is good at showing ranks in pages, but this plugin could not show top N ranks in real-time.