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. This class is scoped by domain, meaning that you can call .Domain("yourdomain") and perform additional calls that are scoped.

Public Member Functions

GamerVfs Domain (string domain)
 Sets the domain affected by this object. You should typically use it this way: gamer.GamerVfs.Domain("private").SetKey(...); 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[]> GetKeyBinary (string key)
 Retrieves the binary data of an individual key from the key/value system. More...
 
Promise< byte[]> GetBinary (string key)
 Retrieves the binary data of an individual key from the key/value system. More...
 
Promise< DoneSetKey (string key, Bundle value)
 Sets the value of a key in the key/value system. More...
 
Promise< DoneSetValue (string key, Bundle value)
 Sets the value of a single key or all keys in the key/value system. More...
 
Promise< DoneSetKeyBinary (string key, byte[] binaryData)
 Sets the value of a key in the key/value system as binary data. More...
 
Promise< DoneSetBinary (string key, byte[] binaryData)
 Sets the value of a key in the key/value system as binary data. More...
 
Promise< DoneRemoveKey (string key)
 Removes a single key from the key/value system. More...
 
Promise< DoneDeleteValue (string key=null)
 Removes a single key or all keys from the key/value system. More...
 

Member Function Documentation

◆ DeleteValue()

Promise<Done> CotcSdk.GamerVfs.DeleteValue ( string  key = null)

Removes a single key or all keys from the key/value system.

Returns
Promise resolved when the operation has completed.
Parameters
keyThe name of the key to remove. Beware, if you don't pass any key at all, then ALL the key/value will be removed. Should be used with care!

◆ Domain()

GamerVfs CotcSdk.GamerVfs.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 for operation chaining.

◆ GetBinary()

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

Retrieves the binary data of an individual 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.GamerVfs.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.

◆ GetKeyBinary()

Promise<byte[]> CotcSdk.GamerVfs.GetKeyBinary ( string  key)

Retrieves the binary data of an individual 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.

This method is obsolete, use GetBinary instead.

◆ GetValue()

Promise<Bundle> CotcSdk.GamerVfs.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) in the "result" key. 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. If you don't pass any key, then all the keys will be returned in a global JSON

◆ RemoveKey()

Promise<Done> CotcSdk.GamerVfs.RemoveKey ( string  key)

Removes a single key from the key/value system.

Returns
Promise resolved when the operation has completed.
Parameters
keyThe name of the key to remove.

This method is obsolete, use DeleteValue instead.

◆ SetBinary()

Promise<Done> CotcSdk.GamerVfs.SetBinary ( string  key,
byte []  binaryData 
)

Sets the value of a key in the key/value system as binary data.

Returns
Promise resolved when the operation has completed.
Parameters
keyThe name of the key to set the value for.
binaryDataThe value to set as binary data.

◆ SetKey()

Promise<Done> CotcSdk.GamerVfs.SetKey ( string  key,
Bundle  value 
)

Sets the value of a key in the key/value system.

Returns
Promise resolved when the operation has completed.
Parameters
keyThe name of the key to set the value for.
valueThe value to set. As usual with bundles, casting is implicitly done, so you may as well call this method passing an integer or string as value for instance.

This method is obsolete, use SetValue instead.

◆ SetKeyBinary()

Promise<Done> CotcSdk.GamerVfs.SetKeyBinary ( string  key,
byte []  binaryData 
)

Sets the value of a key in the key/value system as binary data.

Returns
Promise resolved when the operation has completed.
Parameters
keyThe name of the key to set the value for.
binaryDataThe value to set as binary data.

This method is obsolete, use SetBinary instead.

◆ SetValue()

Promise<Done> CotcSdk.GamerVfs.SetValue ( string  key,
Bundle  value 
)

Sets the value of a single key or all keys in the key/value system.

Returns
Promise resolved when the operation has completed.
Parameters
keyThe name of the key to set the value for.
valueThe value to set. As usual with bundles, casting is implicitly done, so you may as well call this method passing an integer or string as value for instance.