Difference between revisions of "Cloud Global"
From Virtual World Web Wiki
(Documentation for the Cloud Global class) |
(Documentation for the Cloud Global class) |
||
Line 1: | Line 1: | ||
+ | The Cloud JavaScript global object is available from server world scripts and is the main entry point for the GameCloud functionality. | ||
+ | |||
* This is a JavaScript visible object | * This is a JavaScript visible object | ||
===Remarks <nowiki>[</nowiki>[{{fullurl:Cloud Global Remarks|action=edit}} edit]<nowiki>]</nowiki>=== | ===Remarks <nowiki>[</nowiki>[{{fullurl:Cloud Global Remarks|action=edit}} edit]<nowiki>]</nowiki>=== | ||
Line 5: | Line 7: | ||
===Methods=== | ===Methods=== | ||
:{{CSharp|bool DataExists(string key)}} | :{{CSharp|bool DataExists(string key)}} | ||
+ | :: | ||
+ | ::Checks if an application scoped data item exists (is set). | ||
:{{CSharp|void DeleteData(string key)}} | :{{CSharp|void DeleteData(string key)}} | ||
+ | :: | ||
+ | ::Deletes the specified application scoped data item. | ||
:{{CSharp|CloudCurrencyExtended GetCurrency(string identifier, bool accountScoped)}} | :{{CSharp|CloudCurrencyExtended GetCurrency(string identifier, bool accountScoped)}} | ||
+ | :: | ||
+ | ::Gets or creates a currency for use in your javascript applications. The returned object can be used to transact in this currency, and get balance of accounts. | ||
:{{CSharp|string GetData(string key)}} | :{{CSharp|string GetData(string key)}} | ||
+ | :: | ||
+ | ::Gets the value of an application scoped data item. | ||
:{{CSharp|IInteractionMappingExtended RegisterInteraction(string selector, string abilityIdentifier, string groupIdentifier)}} | :{{CSharp|IInteractionMappingExtended RegisterInteraction(string selector, string abilityIdentifier, string groupIdentifier)}} | ||
+ | :: | ||
+ | ::Wraps up the ViewInfo’s AddInteractionMapping and AddAbility methods into a single call. The abilityIdentifier is the name of a GameCloud registered ability (created in the admin). The groupIdentifier is the optional name of a GameCloud registered entity group used to filter who gets the interaction, and the selector is a CSS-Style selector which identifies nodes which are eligible targets of the interaction. | ||
:{{CSharp|void SaveData()}} | :{{CSharp|void SaveData()}} | ||
+ | :: | ||
+ | ::Checkpoints your app data. Just in case. | ||
:{{CSharp|void SetApplication(string applicationID)}} | :{{CSharp|void SetApplication(string applicationID)}} | ||
+ | :: | ||
+ | ::Associates this script with an application (scope of data storage). A single call to this function is required before most other GameCloud functions will work. Simply pass a Guid as a string. | ||
:{{CSharp|void SetData(string key, string value)}} | :{{CSharp|void SetData(string key, string value)}} | ||
+ | :: | ||
+ | ::Sets the value of an application-scoped data item. This is basic global application string data storage. | ||
__NOTOC____NOEDITSECTION__ | __NOTOC____NOEDITSECTION__ |
Revision as of 00:45, 23 October 2016
The Cloud JavaScript global object is available from server world scripts and is the main entry point for the GameCloud functionality.
- This is a JavaScript visible object
Remarks [edit]
Methods
- bool DataExists(string key)
- Checks if an application scoped data item exists (is set).
- void DeleteData(string key)
- Deletes the specified application scoped data item.
- CloudCurrencyExtended GetCurrency(string identifier, bool accountScoped)
- Gets or creates a currency for use in your javascript applications. The returned object can be used to transact in this currency, and get balance of accounts.
- string GetData(string key)
- Gets the value of an application scoped data item.
- IInteractionMappingExtended RegisterInteraction(string selector, string abilityIdentifier, string groupIdentifier)
- Wraps up the ViewInfo’s AddInteractionMapping and AddAbility methods into a single call. The abilityIdentifier is the name of a GameCloud registered ability (created in the admin). The groupIdentifier is the optional name of a GameCloud registered entity group used to filter who gets the interaction, and the selector is a CSS-Style selector which identifies nodes which are eligible targets of the interaction.
- void SaveData()
- Checkpoints your app data. Just in case.
- void SetApplication(string applicationID)
- Associates this script with an application (scope of data storage). A single call to this function is required before most other GameCloud functions will work. Simply pass a Guid as a string.
- void SetData(string key, string value)
- Sets the value of an application-scoped data item. This is basic global application string data storage.