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

Description

Represents a key/value system, also known as virtual file system, to be used for game properties. This class is scoped by domain, meaning that you can call .Domain("yourdomain") and perform additional calls that are scoped.

Public Member Functions

GameVfs Domain (string domain)
 Sets the domain affected by this object. You should typically use it this way: gamer.GamerVfs.Domain("private").SetKey(...); More...
 
Promise< BundleGetAll ()
 Retrieves all keys from the key/value system for the current domain. More...
 
Promise< BundleGetKey (string key)
 Retrieves an individual key from the key/value system. More...
 
Promise< BundleGetValue (string key=null)
 Retrieves an individual key or all keys from the key/value system. More...
 
Promise< byte[]> GetBinary (string key)
 Retrieves the binary data of game key from the key/value system. More...
 

Member Function Documentation

◆ Domain()

GameVfs CotcSdk.GameVfs.Domain ( string  domain)

Sets the domain affected by this object. You should typically use it this way: gamer.GamerVfs.Domain("private").SetKey(...);

Parameters
domainDomain on which to scope the VFS. Defaults to private if not specified.
Returns
This object, so you can chain operations

◆ GetAll()

Promise<Bundle> CotcSdk.GameVfs.GetAll ( )

Retrieves all keys from the key/value system for the current domain.

Returns
Promise resolved when the operation has completed. The attached bundle contains the keys along with their values. If you would like to fetch the value of a given key and you expect it to be a string, you may simply do string value = result.Value["key"];.

This method is obsolete, use GetValue instead.

◆ GetBinary()

Promise<byte[]> CotcSdk.GameVfs.GetBinary ( string  key)

Retrieves the binary data of game key from the key/value system.

Returns
Promise resolved when the operation has completed. The binary data is attached as the value of the result. Please ensure that the key was set with binary data before, or this call will fail with a network error.
Parameters
keyThe name of the key to be fetched.

◆ GetKey()

Promise<Bundle> CotcSdk.GameVfs.GetKey ( string  key)

Retrieves an individual key from the key/value system.

Returns
Promise resolved when the operation has completed. The attached bundle contains the fetched property. As usual with bundles, it can be casted to the proper type you are expecting. If the property doesn't exist, the call is marked as failed with a 404 status.
Parameters
keyThe name of the key to be fetched.

This method is obsolete, use GetValue instead.

◆ GetValue()

Promise<Bundle> CotcSdk.GameVfs.GetValue ( string  key = null)

Retrieves an individual key or all keys from the key/value system.

Returns
Promise resolved when the operation has completed. The attached bundle contains the fetched property(ies). As usual with bundles, it can be casted to the proper type you are expecting. If the property doesn't exist, the call is marked as failed with a 404 status.
Parameters
keyThe name of the key to be fetched.