Godfather (code) related functions. You may also want to subscribe to events (see CotcSdk.GamerGodfather.OnGotGodchild).
◆ OnGotGodchild
Event triggered when someone adds this gamer as a friend or changes his friendship status.
◆ DiscardEventHandlers()
void CotcSdk.GamerGodfather.DiscardEventHandlers |
( |
| ) |
|
Clears all event handlers subscribed, ensuring that a match object can be dismissed without causing further actions in the background.
◆ Domain()
Changes the domain affected by the next operations. You should typically use it this way: gamer.Godfather.Domain("private").Associate(...);
- Parameters
-
domain | Domain on which to scope the next operations. |
- Returns
- This object for operation chaining.
◆ GenerateCode()
Promise<string> CotcSdk.GamerGodfather.GenerateCode |
( |
| ) |
|
Method to call in order to generate a temporary code that can be passed to another gamer so he can add us as a godfather.
The domain as specified by the Domain method is the domain in which the godfather link should be established. "private" means it's local to this game only.
- Returns
- Promise resolved when the operation has completed. The attached string is the generated code.
◆ GetGodchildren()
This method can be used to retrieve the gamer who have added you as a godfather.
- Returns
- Promise resolved when the operation has completed.
◆ GetGodfather()
This method can be used to retrieve the godfather of the gamer.
- Returns
- Promise resolved when the operation has completed.
◆ UseCode()
Call this to attribute a godfather to the currently logged in user.
- Returns
- Promise resolved when the operation has completed.
- Parameters
-
code | Is a string as generated by GenerateCode. |
rewardTx | A transaction Json rewarding the godfather formed as follows: { transaction : { "unit" : amount}, description : "reward transaction", domain : "com.clanoftcloud.text.DOMAIN" } where description and domain are optional. |
notification | Optional OS notification to be sent to the godfather who generated the code. The godfather will reveive an event of type 'godchildren' containing the id of the godchildren and the balance/achievements field if rewarded. |