![]() |
CotC C# SDK for Unity
v1.4.0.1
Making social games is easy !
|
Root class of the SDK. It is stateless and allows to perform basic operations with the SDK, such as Ping
.
The CotcSdk.Cloud object may typically be used to log in, which would return a CotcSdk.Gamer object, another very important object from the SDK.
Other objects such as a CotcSdk.CloudIndexing object can also be obtained synchronously in order to perform categorized operations. These objects may not be stateless though, so please refer to their respective documentation.
Properties | |
Game | Game [get] |
Provides an API to manipulate game data, such as key/value or leaderboards. More... | |
Public Member Functions | |
CloudIndexing | Index (string indexName, string domain=Common.PrivateDomain) |
Allows to manipulate an index. Usage: Cloud.Index("matches").IndexObject(...); . More... | |
Promise< Done > | Ping () |
Executes a "ping" request to the server. Allows to know whether the server is currently working as expected. More... | |
Promise< PagedList< UserInfo > > | ListUsers (string filter, int limit=30, int offset=0) |
Method used to check or retrieve users from Clan of the Cloud community. The domain is not taken in account for this search. More... | |
Promise< Gamer > | LoginAnonymously (Bundle additionalOptions=null) |
Logs the current user in anonymously. More... | |
Promise< Gamer > | Login (string network, string networkId, string networkSecret, Bundle additionalOptions=null) |
Logs the current user in, using any supported social network. More... | |
Promise< Gamer > | Login (LoginNetwork network, string networkId, string networkSecret, bool preventRegistration=false, Bundle additionalOptions=null) |
Promise< Gamer > | LoginWithShortcode (string shortcode, Bundle additionalOptions=null) |
Logs in by using a shortcode previously generated through SendResetPasswordEmail. More... | |
Promise< Gamer > | ResumeSession (string gamerId, string gamerSecret, Bundle additionalOptions=null) |
Logs back in with existing credentials. Should be used for users who have already been logged in previously and the application has been quit for instance. More... | |
Promise< Done > | Logout (Gamer gamer) |
Logs out a previously logged in player. More... | |
Promise< Done > | SendResetPasswordEmail (string userEmail, string mailSender, string mailTitle, string mailBody) |
Can be used to send an e-mail to a user registered by 'email' network in order to help him recover his/her password. More... | |
Promise< Done > | UserExists (string network, string networkId) |
Checks that an user exists on a given network. More... | |
Promise< Done > | UserExists (LoginNetwork network, string networkId) |
Public Attributes | |
HttpRequestFailedHandler | HttpRequestFailedHandler |
This handler, when set, is called synchronously whenever an HTTP request fails with a recoverable error. Some errors won't call this handler and will fail directly, such as when providing invalid arguments. This handler rather covers network errors. You need to call one of the methods of the HttpRequestFailedArgs in order to tell what to do next: either retry or abort the request. Changing this value only affects the calls made later on, not the requests currently running. You should set it once at startup. More... | |
const string | SdkVersion = "1.4.2.0" |
|
get |
Provides an API to manipulate game data, such as key/value or leaderboards.
CloudIndexing CotcSdk.Cloud.Index | ( | string | indexName, |
string | domain = Common.PrivateDomain |
||
) |
Allows to manipulate an index. Usage: Cloud.Index("matches").IndexObject(...);
.
indexName | Name of the index; scopes your searches. |
domain | The domain to manipulate the index on. |
Promise<PagedList<UserInfo> > CotcSdk.Cloud.ListUsers | ( | string | filter, |
int | limit = 30 , |
||
int | offset = 0 |
||
) |
Method used to check or retrieve users from Clan of the Cloud community. The domain is not taken in account for this search.
filter | May contain a nickname, a display name or e-mail address. |
limit | The maximum number of results to return per page. |
offset | Number of the first result. |
Promise<Gamer> CotcSdk.Cloud.Login | ( | string | network, |
string | networkId, | ||
string | networkSecret, | ||
Bundle | additionalOptions = null |
||
) |
Logs the current user in, using any supported social network.
network | The network to connect with. If an user is recognized on a given network (same network ID), then it will be signed back in and its user data will be used. |
networkId | The ID on the network. For example, with the facebook network, this would be the User ID. On e-mail accounts e-mail then, this would be the e-mail address. |
networkSecret | The secret for the network. For e-mail accounts, this would be the passord. For facebook or other SNS accounts, this would be the user token. For the LoginNetwork.GameCenter, the password is not used, so you may pass "n/a". |
additionalOptions | Additional options can be passed, such as thenBatch to execute a batch after login or preventRegistration to accept only already created accounts. Pass it as a Bundle with the additional keys. May not override preventRegistration key since it is defined by the parameter of the same name. Example options Bundle's Json: {"preventRegistration": true, "thenBatch": {"domain": "private", "name": "TestBatch", "params": {"test": true}}} |
Logs the current user in anonymously.
additionalOptions | Additional options can be passed, such as thenBatch to execute a batch after login. Pass it as a Bundle with the additional keys. |
Promise<Gamer> CotcSdk.Cloud.LoginWithShortcode | ( | string | shortcode, |
Bundle | additionalOptions = null |
||
) |
Logs in by using a shortcode previously generated through SendResetPasswordEmail.
shortcode | The shortcode received by the user by e-mail. |
additionalOptions | Additional options can be passed, such as thenBatch to execute a batch after login. Pass it as a Bundle with the additional keys |
Logs out a previously logged in player.
gamer | The gamer to log out. |
Executes a "ping" request to the server. Allows to know whether the server is currently working as expected.
Promise<Gamer> CotcSdk.Cloud.ResumeSession | ( | string | gamerId, |
string | gamerSecret, | ||
Bundle | additionalOptions = null |
||
) |
Logs back in with existing credentials. Should be used for users who have already been logged in previously and the application has been quit for instance.
gamerId | Credentials of the previous session (Gamer.GamerId). |
gamerSecret | Credentials of the previous session (Gamer.GamerSecret). |
additionalOptions | Additional options can be passed, such as 'thenBatch' to execute a batch after login. Pass it as a Bundle with the additional keys |
Promise<Done> CotcSdk.Cloud.SendResetPasswordEmail | ( | string | userEmail, |
string | mailSender, | ||
string | mailTitle, | ||
string | mailBody | ||
) |
Can be used to send an e-mail to a user registered by 'email' network in order to help him recover his/her password.
The user will receive an e-mail, containing a short code. This short code can be inputted in the LoginWithShortcode method.
userEmail | The user as identified by his e-mail address. |
mailSender | The sender e-mail address as it will appear on the e-mail. |
mailTitle | The title of the e-mail. |
mailBody | The body of the mail. You should include the string [[SHORTCODE]], which will be replaced by the generated short code. |
Checks that an user exists on a given network.
network | Network used to log in (scoping the networkId). |
networkId | The ID of the user on the network, like the e-mail address. |
HttpRequestFailedHandler CotcSdk.Cloud.HttpRequestFailedHandler |
This handler, when set, is called synchronously whenever an HTTP request fails with a recoverable error. Some errors won't call this handler and will fail directly, such as when providing invalid arguments. This handler rather covers network errors. You need to call one of the methods of the HttpRequestFailedArgs in order to tell what to do next: either retry or abort the request. Changing this value only affects the calls made later on, not the requests currently running. You should set it once at startup.