UI / LeaderboardModuleBaseS
LeaderboardModuleBaseS<T> Class
Ranking module - Server
Type parameters
T | extends LeaderboardModuleTypeC |
---|
Hierarchy
ModuleS
<T
,any
>↳
LeaderboardModuleBaseS
Table of contents
Accessors
click
Accessors
currentData(): S |
---|
DataOwner of the Player who calls the call method |
currentPlayer(): Player other |
Players who call server methods |
currentPlayerId(): number other |
Get the player ID that calls the server method |
Methods
addPlayer(player : number Player , data : Object ): boolean other |
---|
Add a player to the leaderboard |
clear(): void other |
Clear the leaderboard |
removePlayer(player : number Player ): boolean other |
Remove a player from the leaderboard |
setPlayerValue(player : number Player , fieldId : number , value : string number ): void other |
Set a field value of Player |
click
Methods
getAllClient(): T other |
---|
Get the 'All Clients' calling object |
getClient(player : number Player ): T other |
Obtain the "single client" calling object based on the player |
getPlayerData(player : string number Player ): S other |
Get the data of this module of the designated Player |
onAwake(): void other |
Life cycle method - call when create module |
onDestroy(): void other |
Life cycle method - Destroy Module call |
onExecute(type : number , ...params : any []): void other |
External call an operation of this module |
onPlayerEnterGame(player : Player ): void other |
Life cycle method - Player enters the game (client is ready, data is ready, and front and rear ends can communicate normally) |
onPlayerJoined(player : Player ): void other |
Life cycle method - Player enters the room (Player has just connected to the server, and data and front and rear communication are not ready) |
onPlayerLeft(player : Player ): void other |
Lifecycle Method - Player Leaving Room |
onStart(): void other |
Life cycle method - call when starting the module |
onUpdate(dt : number ): void other |
Life cycle method - Refresh Module call |
Accessors
Methods
addPlayer
• Protected
addPlayer(player
, data
): boolean
other
Add a player to the leaderboard
Parameters
player number Player | Player object Player id |
---|---|
data Object | Player data |
Returns
boolean | Whether successful |
---|
clear
• Protected
clear(): void
other
Clear the leaderboard
removePlayer
• Protected
removePlayer(player
): boolean
other
Remove a player from the leaderboard
Parameters
player number Player | Player object Player id |
---|
Returns
boolean | Whether successful |
---|
setPlayerValue
• Protected
setPlayerValue(player
, fieldId
, value
): void
other
Set a field value of Player
Parameters
player number Player | Player Object Player ID range: determined by ID length |
---|---|
fieldId number | Field ID range: determined by ID length type: integer |
value string number | Field value range: unlimited, one Player, one data type: integer |