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

Description

Class allowing to manipulate the transactions and perform tasks related to achievements. This class is scoped by domain, meaning that you can call .Domain("yourdomain") and perform additional calls that are scoped.

Public Member Functions

Promise< BundleBalance ()
 Retrieves the balance of the user. That is, the amount of "items" remaining after the various executed transactions. More...
 
GamerTransactions Domain (string domain)
 Changes the domain affected by the next operations. You should typically use it this way: gamer.Transactions.Domain("private").Post(...); More...
 
Promise< PagedList< Transaction > > History (string unit=null, int limit=30, int offset=0)
 Fetches the history of transactions run for this user. The current balance (resulting values) needs to be queried via a different call (Balance). More...
 
Promise< TransactionResultPost (Bundle transaction, string description=null)
 Executes a transaction on the behalf of the user. More...
 

Member Function Documentation

◆ Balance()

Promise<Bundle> CotcSdk.GamerTransactions.Balance ( )

Retrieves the balance of the user. That is, the amount of "items" remaining after the various executed transactions.

Returns
Promise resolved when the operation has completed. The attached bundle contains the balance. You can query the individual items by doing result.Value["gold"] for instance.

◆ Domain()

GamerTransactions CotcSdk.GamerTransactions.Domain ( string  domain)

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

Parameters
domainDomain on which to scope the transactions. Default to private if unmodified.
Returns
This object for operation chaining.

◆ History()

Promise<PagedList<Transaction> > CotcSdk.GamerTransactions.History ( string  unit = null,
int  limit = 30,
int  offset = 0 
)

Fetches the history of transactions run for this user. The current balance (resulting values) needs to be queried via a different call (Balance).

Returns
Promise resolved when the operation has completed. The result is paginated, for more information see CotcSdk.PagedList.
Parameters
unitIf specified, retrieves only the transactions matching a given unit (e.g. "gold").
limitFor pagination, allows to set a greater or smaller page size than the default 30.
offsetFor pagination, avoid using it explicitly.

◆ Post()

Promise<TransactionResult> CotcSdk.GamerTransactions.Post ( Bundle  transaction,
string  description = null 
)

Executes a transaction on the behalf of the user.

Returns
Promise resolved when the operation has completed. The attached result contains the new balance and the possibly triggered achievements.
Parameters
transactionTransaction to run. Consists of keys and associated integer values. A negative value indicates that the associated balance should be decremented. The special value "-auto" resets the value to zero.
descriptionDescription of the transaction. Will appear in the back office.