Private
serverSend a notification that the game is finish
If you want to send a game finish notification to the user with id 123
app.game.finishGame('123')
Error message
specifies the id of the user who received the notification
If it is successfully sent to the server, it will return true
. Otherwise it will return an error message
Initialize the game and create game-related listeners. Please consult the vland staff for the official game.
If you wanna initialize a official race game.
Error message
game config, contains {name, describe, icon, listener}. listener
is a custom function.
If it is successfully sent to the server, it will return true
. Otherwise it will return an error message
Send a notification that the game is ready to start
If the game if ready.
app.game.readyGame(code: 200, "Race game is ready!")
If the game is not ready due to some bug.
app.game.readyGame(code: 400, "Race game is not ready!")
Error message
status of readiness
text message of current status
If it is successfully sent to the server, it will return true
. Otherwise it will return an error message
Send a notification that the game is stop
If you want to send a game stop notification to the all users
app.game.stopGame()
Error message
If it is successfully sent to the server, it will return true
. Otherwise it will return an error message
Push updated leaderboard information
If you wanna update the leaderboard.
app.game.updateRankList([{pid: '123', time: 99999}])
Error message
leaderboard information list, item contains {pid, time}. time
is milliseconds.
custom leaderboard type, such as race, ox, etc.
If it is successfully sent to the server, it will return true
. Otherwise it will return an error message
Generated using TypeDoc
Pop up the countdown component, ready to start the game
Example
If the game needs a 5s countdown
Throws
Error message