Cloud - stingray.Cloud namespace reference - Stingray Lua API Reference
The interface to the load and save functionality on the Windows platform.
As the object is a singleton (there is only one Cloud), you do not need to pass any Cloud object to
the functions. All the functions operate on the Cloud singleton.
Cloud provides easy and transparent remote file storage for your game. Files are written to disk
while the game is running and are replicated to the Steam back-end after the game exits. If the user
changes computers, the files are downloaded to the new computer before the game launches.
The namespace for filenames is flat; no directories are used or created. If a folder structure is
needed, you can solve this by prefixing filenames. All filenames are case insensitive.
Asynchronous operations return a token object that is used to fetch progress during the operation.
This object must be closed to free the information that is used during the load/save operation.
Otherwise, the game eventually runs out of memory.
You can save the following data types:
|
Loads data previously saved to the specified file on the cloud, and returns a token that can be queried for progress and results.
|
Parameters filename : | string | The name of the file to load. |
Returns
You must call stingray.Cloud.close() on the token returned to release the memory (after you
have checked the progress of the operation). Failure to do so results in memory leaks.
|
auto_save ( filename, data ) : stingray.CloudToken
Saves the specified data to the specified file on the cloud, and returns a token that can be queried for progress.
|
Parameters filename : | string | The name of the file in which to store the data. |
data : | any | The data to store. |
Returns
You must call stingray.Cloud.close() on the token returned to release the memory (after you have checked the progress of
the operation). Failure to do so results in memory leaks.
|
Frees the memory used by the engine to monitor the cloud operation request that corresponds to the specified token.
|
Parameters Returns | This function does not return any values. |
|
delete ( filename ) : stingray.CloudToken
Deletes the specified filename from the cloud.
|
Parameters filename : | string | The name of the file to delete. |
Returns
Use delete() when users explicitly delete files in
your application's interface.
|
Indicates whether or not the Steam cloud is enabled for the game.
|
Parameters | This function does not accept any parameters. |
Returns boolean |
Returns true if the Steam cloud is enabled for the game.
|
You can set this up
in the 'Game Admin' page on Steamworks.
Note: If Cloud is not enabled, load and save operations will not work.
|
forget ( filename ) : stingray.CloudToken
Forgets the specified filename.
|
Parameters filename : | string | The name of the file to forget. |
Returns
Use forget() when you want to automatically delete old files in order to
free up memory on the cloud service. Do not use forget() when users explicitly delete files.
|
Retrieves information about the current state of the save or load operation identified by the specified token.
|
Parameters token : | stingray.CloudToken | The cloud token that provides access to the status of the asynchronous operation. |
Returns table |
A table that contains information about the save or load operation.
|