Combu Server
3.1.1
PHP API Documentation
|
Public Member Functions | |
__construct ($src=null, $stripSlashes=false) | |
ExistsCode () | |
Save () | |
Delete () | |
LoadHighscore ($timeInterval, $userScope, $groupPlayer=FALSE, $sumPlayer=FALSE, $limit=NULL, $offset=NULL, &$count=NULL) | |
GetOrderBy (&$order, &$field) | |
LoadHighscoreForAccount ($timeInterval, $groupPlayer, $sumPlayer, $idAccount) | |
PostScore ($account, $scoreValue) | |
Public Member Functions inherited from DataClass | |
Save () | |
Delete () | |
ToJson () | |
ToArray () | |
Static Public Member Functions | |
static | GetScoreTypes () |
static | Load ($idApp=0, $limit=null, $offset=null, &$count=null, $returnArray=false) |
static | Prune () |
Static Public Member Functions inherited from DataClass | |
static | GetTableName ($class) |
static | LoadRecords ($query, $returnedClass="") |
static | CountRecords ($tableName, $filter=null) |
static | TruncateTable ($tableName) |
static | TruncateClass ($class) |
Data Fields | |
const | TABLE_NAME = "LeaderBoard" |
const | VALUE_INT = 0 |
const | VALUE_FLOAT = 1 |
const | ORDER_DESC = 0 |
const | ORDER_ASC = 1 |
const | SCORE_UNIQUE_NONE = 0 |
const | SCORE_UNIQUE_INCREASE = 1 |
const | SCORE_UNIQUE_REPLACE_HIGHER = 2 |
const | SCORE_UNIQUE_REPLACE_ANY = 3 |
const | HIGHSCORE_TOTAL = 0 |
const | HIGHSCORE_MONTH = 1 |
const | HIGHSCORE_WEEK = 2 |
const | HIGHSCORE_TODAY = 3 |
const | USERSCOPE_GLOBAL = 0 |
const | USERSCOPE_FRIENDS = 1 |
$Id = 0 | |
$IdApp = 0 | |
$Code = "" | |
$Title = "" | |
$Description = "" | |
$UniqueRecords = self::SCORE_UNIQUE_INCREASE | |
$ValueType = self::VALUE_INT | |
$OrderType = self::ORDER_DESC | |
$AllowAnonymous = 0 | |
Additional Inherited Members | |
Protected Member Functions inherited from DataClass | |
_loadFilter ($tableName, $filter) | |
_loadByRow ($row, $stripSlashes=false, $callbackOnExists=false) | |
_Delete ($tableName, $filter=null) | |
Static Protected Member Functions inherited from DataClass | |
static | _count ($tableName, $filter=null) |
static | _load ($tableName, $returnedClass="", $where="", $order=null, $limit=null, $offset=null, &$count=null) |
static | _loadEx ($select, $from, $returnedClass="", $where="", $order=null, $limit=null, $offset=null, &$count=null, $debug=false) |
static | _loadQuery ($query, $returnedClass="") |
Class to handle Leaderboards
Definition at line 10 of file LeaderBoard.php.
__construct | ( | $src = null , |
|
$stripSlashes = false |
|||
) |
Contructor
Definition at line 82 of file LeaderBoard.php.
Delete | ( | ) |
Delete the record from the database
Definition at line 197 of file LeaderBoard.php.
ExistsCode | ( | ) |
Check if the current Code already exists
Definition at line 106 of file LeaderBoard.php.
GetOrderBy | ( | & | $order, |
& | $field | ||
) |
Definition at line 307 of file LeaderBoard.php.
|
static |
Get all the available score types of Leaderboards
Definition at line 127 of file LeaderBoard.php.
|
static |
Get the registered leaderboards
string | $idApp | Filter IdApp |
int | $limit | Max number of results (for paged results) |
int | $offset | Offset number of results (for paged results) |
int | $count | Will be set to the total count of results |
boolean | $returnArray | If TRUE then it will return associative arrays else objects |
Definition at line 146 of file LeaderBoard.php.
LoadHighscore | ( | $timeInterval, | |
$userScope, | |||
$groupPlayer = FALSE , |
|||
$sumPlayer = FALSE , |
|||
$limit = NULL , |
|||
$offset = NULL , |
|||
& | $count = NULL |
||
) |
Load high scores list with rank, value and user data Account $LoggedAccount
int | $timeInterval | Specify the interval type, can be: self::HIGHSCORE_TOTAL, self::HIGHSCORE_WEEK, self::HIGHSCORE_TODAY |
int[] | $userScope Specify the interval type, can be: self::HIGHSCORE_TOTAL, self::HIGHSCORE_WEEK, self::HIGHSCORE_TODAY | |
boolean | $groupPlayer | Returns only the highest scores per players (only for non UniqueRecords leaderboards) |
boolean | $sumPlayer | Returns the sum of scores per players (only for non UniqueRecords leaderboards) |
int | $limit | Number of records to fetch |
int | $offset | Offset limit to fetch |
int | $count | It will contain the total number of records, counted without LIMIT clause |
Definition at line 228 of file LeaderBoard.php.
LoadHighscoreForAccount | ( | $timeInterval, | |
$groupPlayer, | |||
$sumPlayer, | |||
$idAccount | |||
) |
Definition at line 326 of file LeaderBoard.php.
PostScore | ( | $account, | |
$scoreValue | |||
) |
Post a score in the leaderboard from a user
Account | $account | Account who scored |
mixed | $scoreValue | Value to save (can actually be int or float) |
Definition at line 400 of file LeaderBoard.php.
|
static |
Delete all records associated to this class
Definition at line 211 of file LeaderBoard.php.
Save | ( | ) |
Save the record in the database
Definition at line 159 of file LeaderBoard.php.
$AllowAnonymous = 0 |
Definition at line 77 of file LeaderBoard.php.
$Code = "" |
Definition at line 71 of file LeaderBoard.php.
$Description = "" |
Definition at line 73 of file LeaderBoard.php.
$Id = 0 |
Definition at line 69 of file LeaderBoard.php.
$IdApp = 0 |
Definition at line 70 of file LeaderBoard.php.
$OrderType = self::ORDER_DESC |
Definition at line 76 of file LeaderBoard.php.
$Title = "" |
Definition at line 72 of file LeaderBoard.php.
$UniqueRecords = self::SCORE_UNIQUE_INCREASE |
Definition at line 74 of file LeaderBoard.php.
$ValueType = self::VALUE_INT |
Definition at line 75 of file LeaderBoard.php.
const HIGHSCORE_MONTH = 1 |
Retrieves the highscore of current month
Definition at line 56 of file LeaderBoard.php.
const HIGHSCORE_TODAY = 3 |
Retrieves the highscore of today
Definition at line 64 of file LeaderBoard.php.
const HIGHSCORE_TOTAL = 0 |
Retrieves the highscore of all time
Definition at line 52 of file LeaderBoard.php.
const HIGHSCORE_WEEK = 2 |
Retrieves the highscore of last 7 days
Definition at line 60 of file LeaderBoard.php.
const ORDER_ASC = 1 |
Scores are sorted by ascendant order
Definition at line 30 of file LeaderBoard.php.
const ORDER_DESC = 0 |
Scores are sorted by descendant order
Definition at line 26 of file LeaderBoard.php.
const SCORE_UNIQUE_INCREASE = 1 |
The score of a player is a unique record and is increased by every value received
Definition at line 39 of file LeaderBoard.php.
const SCORE_UNIQUE_NONE = 0 |
Each score of a player is stored as separate records
Definition at line 35 of file LeaderBoard.php.
const SCORE_UNIQUE_REPLACE_ANY = 3 |
The score of a player is a unique record and is replaced with the latest value received
Definition at line 47 of file LeaderBoard.php.
const SCORE_UNIQUE_REPLACE_HIGHER = 2 |
The score of a player is a unique record and is replaced with the highest value received
Definition at line 43 of file LeaderBoard.php.
const TABLE_NAME = "LeaderBoard" |
Definition at line 12 of file LeaderBoard.php.
const USERSCOPE_FRIENDS = 1 |
Definition at line 67 of file LeaderBoard.php.
const USERSCOPE_GLOBAL = 0 |
Definition at line 66 of file LeaderBoard.php.
const VALUE_FLOAT = 1 |
Score is a float
Definition at line 21 of file LeaderBoard.php.
const VALUE_INT = 0 |
Score is an integer
Definition at line 17 of file LeaderBoard.php.