Trigger API Reference DCEI Functions Service1 - funovus/editor-wiki GitHub Wiki
Table of Contents
- [Trigger API Reference\DCEI Functions\Service (2/2)](#trigger-api-referencedcei-functionsservice-22)
* [void PostLeaderBoardScore(string type, double score, string payload, int spentGems, TypedCallback callback)](#void-postleaderboardscorestring-type-double-score-string-payload-int-spentgems-typedcallbackobject-callback)
* [void SetUserName(string name, TypedCallback callback)](#void-setusernamestring-name-typedcallbackint-callback)
|
Trigger API Reference\DCEI Functions\Service (2/2) {Trigger-API-ReferenceDCEI-FunctionsService-22}
void PostLeaderBoardScore(string type, double score, string payload, int spentGems, TypedCallback<object> callback) {void-PostLeaderBoardScorestring-type-double-score-string-payload-int-spentGems-TypedCallbackobject-callback}
void PostLeaderBoardScore(string type, double score, string payload, int spentGems, TypedCallback<object> callback)
Attempts to post the player's score to the given leaderboard.
-
string
type
the leaderboard to post to. -
double
score
the score to post. -
string
payload
any additional information. -
int
spentGems
the amount of gems spent as part of an anti-cheat measure. -
object
callback
the callback function that handles a return. Passes the user's leaderboard score as per GetLeaderBoardScore() as a parameter.
local my_score = math.random(1, 100)
local my_record
DCEI.PostLeaderBoardScore("type1", my_score, "I'm here", 0, function(result)
my_record = result
end)
void SetUserName(string name, TypedCallback<int> callback) {void-SetUserNamestring-name-TypedCallbackint-callback}
void SetUserName(string name, TypedCallback<int> callback)
Attempts to set a player's username.
-
string
name
the new username to assign to the player. -
object
callback
the callback function that is run after the name is changed. Passes the number of times the player has changed their username as a parameter.
function OnMapStart()
DCEI.SetUserName("Username", function(result)
local user_name = DCEI.GetUserName()
DCEI.LogMessage(user_name)
DCEI.LogMessage(result)
end)
end