CotC C# SDK for Unity  v1.4.0.1
Making social games is easy !
Properties | Public Member Functions | List of all members

Description

Godfather (code) related functions. You may also want to subscribe to events (see CotcSdk.GamerGodfather.OnGotGodchild).

Properties

Action< GotGodchildEventOnGotGodchild
 Event triggered when someone adds this gamer as a friend or changes his friendship status. More...
 

Public Member Functions

GamerGodfather Domain (string domain)
 Changes the domain affected by the next operations. You should typically use it this way: gamer.Godfather.Domain("private").Associate(...); More...
 
void DiscardEventHandlers ()
 Clears all event handlers subscribed, ensuring that a match object can be dismissed without causing further actions in the background. More...
 
Promise< string > 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. More...
 
Promise< NonpagedList< GamerInfo > > GetGodchildren ()
 This method can be used to retrieve the gamer who have added you as a godfather. More...
 
Promise< GamerInfoGetGodfather ()
 This method can be used to retrieve the godfather of the gamer. More...
 
Promise< DoneUseCode (string code, Bundle rewardTx=null, PushNotification notification=null)
 Call this to attribute a godfather to the currently logged in user. More...
 

Property Documentation

◆ OnGotGodchild

Action<GotGodchildEvent> CotcSdk.GamerGodfather.OnGotGodchild
addremove

Event triggered when someone adds this gamer as a friend or changes his friendship status.

Member Function Documentation

◆ 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()

GamerGodfather CotcSdk.GamerGodfather.Domain ( string  domain)

Changes the domain affected by the next operations. You should typically use it this way: gamer.Godfather.Domain("private").Associate(...);

Parameters
domainDomain 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()

Promise<NonpagedList<GamerInfo> > CotcSdk.GamerGodfather.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()

Promise<GamerInfo> CotcSdk.GamerGodfather.GetGodfather ( )

This method can be used to retrieve the godfather of the gamer.

Returns
Promise resolved when the operation has completed.

◆ UseCode()

Promise<Done> CotcSdk.GamerGodfather.UseCode ( string  code,
Bundle  rewardTx = null,
PushNotification  notification = null 
)

Call this to attribute a godfather to the currently logged in user.

Returns
Promise resolved when the operation has completed.
Parameters
codeIs a string as generated by GenerateCode.
rewardTxA 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.
notificationOptional 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.