Beamable SDK
Public Member Functions | Public Attributes | Protected Member Functions | Properties | List of all members
Beamable.Api.CloudSaving.CloudSavingService Class Reference

This type defines the Client main entry point for the CloudSaving feature. More...

Inheritance diagram for Beamable.Api.CloudSaving.CloudSavingService:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Api.CloudSaving.CloudSavingService:
Collaboration graph
[legend]

Public Member Functions

 CloudSavingService (IPlatformService platform, PlatformRequester requester, CoroutineService coroutineService, IDependencyProvider provider)
 
Promise< UnitInit (int pollingIntervalSecs=10)
 The CloudSavingService must initialize before you should read or write any files from the LocalCloudDataFullPath. This method will start the initialization process. The isInitializing field value will be true when this method is running. More...
 
Promise< UnitReinitializeUserData (int pollingIntervalSecs=10)
 This method will clear all local user data, and re-fetch everything from the Beamable server. The Init method will be called as part of this execution. More...
 
Promise< ManifestResponseEnsureRemoteManifest ()
  You shouldn't need to call this method, because this will be called by the Init method This method will be marked as Obsolete in the future. More...
 
- Public Member Functions inherited from Beamable.Api.PlatformSubscribable< ManifestResponse, ManifestResponse >
PlatformSubscription< Data > Subscribe (Action< Data > callback)
 Subscribe to the callback to receive fresh data when available. More...
 
virtual PlatformSubscription< Data > Subscribe (string scope, Action< Data > callback)
 Subscribe to the callback to receive fresh data when available. More...
 
Promise< UnitRefresh ()
 Manually refresh the available data. More...
 
Data GetLatest ()
 
Data GetLatest (string scope)
 
async Promise< ScopedRsp > Fetch (string scope="")
 Send a request and get the latest state of the subscription. This method will not trigger existing subscriptions More...
 
Promise< Data > GetCurrent (string scope="")
 Manually fetch the available data. If the server hasn't delivered a new update, this method will not return the absolute latest data unless you pass forceRefresh as true. More...
 
void Notify (Data data)
 Manually notify observing scopes regarding the available data. More...
 
void Notify (string scope, Data data)
 Manually notify observing scopes regarding the available data. More...
 

Public Attributes

Action< ManifestResponseUpdateReceived
 An event with a ManifestResponse parameter. This event triggers anytime the player's cloud files are updated by another device, or from the Portal.
 
Action< CloudSavingErrorOnError
 An event with a CloudSavingError parameter. This event triggers anytime there is an error in the CloudSavingService
 
bool isInitializing = false
 The CloudSavingService needs to initialize before you should read or write files from the LocalCloudDataFullPath. This field is a guard that is true when the Init method is running, and false otherwise.
 

Protected Member Functions

override string CreateRefreshUrl (string scope=null)
 
override Promise< ManifestResponseExecuteRequest (IBeamableRequester requester, string url)
 
override void OnRefresh (ManifestResponse data)
 
- Protected Member Functions inherited from Beamable.Api.PlatformSubscribable< ManifestResponse, ManifestResponse >
 PlatformSubscribable (IDependencyProvider provider, string service, BeamableGetApiResource< ScopedRsp > getter=null)
 
virtual void Reset ()
 
Promise< UnitRefresh (string scope)
 Manually refresh the available data. More...
 
virtual Promise OnRefreshScope (string scope)
 
virtual Promise< ScopedRsp > ExecuteRequest (IBeamableRequester requester, string url)
 
virtual void OnRefresh (ScopedRsp data)
 
virtual Promise OnRefresh (ScopedRsp data, string[] scopes)
 
void ScheduleRefresh (long seconds, string scope)
 
void Unsubscribe (string scope, PlatformSubscription< Data > subscription)
 

Properties

string LocalCloudDataFullPath [get]
 The CloudSavingService will keep the files located at this file path backed up on Beamable servers. You should use this path as the base path for all file read and write operations.
 
- Properties inherited from Beamable.Api.PlatformSubscribable< ManifestResponse, ManifestResponse >
bool UsesHierarchyScopes [getprotected set]
 

Additional Inherited Members

- Protected Attributes inherited from Beamable.Api.PlatformSubscribable< ManifestResponse, ManifestResponse >
IBeamableRequester requester
 
IConnectivityService connectivityService
 
INotificationService notificationService
 
CoroutineService coroutineService
 
IUserContext userContext
 
BeamableGetApiResource< ScopedRsp > getter
 
readonly string service
 

Detailed Description

This type defines the Client main entry point for the CloudSaving feature.

Related Links

img beamable-logo

Member Function Documentation

◆ CreateRefreshUrl()

override string Beamable.Api.CloudSaving.CloudSavingService.CreateRefreshUrl ( string  scope = null)
inlineprotectedvirtual

◆ EnsureRemoteManifest()

Promise< ManifestResponse > Beamable.Api.CloudSaving.CloudSavingService.EnsureRemoteManifest ( )
inline

You shouldn't need to call this method, because this will be called by the Init method This method will be marked as Obsolete in the future.

Returns
Exceptions
Exception

◆ Init()

Promise< Unit > Beamable.Api.CloudSaving.CloudSavingService.Init ( int  pollingIntervalSecs = 10)
inline

The CloudSavingService must initialize before you should read or write any files from the LocalCloudDataFullPath. This method will start the initialization process. The isInitializing field value will be true when this method is running.

Parameters
pollingIntervalSecsWhen a file is written to the LocalCloudDataFullPath path, it will be backed up on the Beamable server. The pollingIntervalSecs controls how often Beamable checks for new or updated files on the local device.
Returns
A Promise representing when the initialization has completed.

◆ ReinitializeUserData()

Promise< Unit > Beamable.Api.CloudSaving.CloudSavingService.ReinitializeUserData ( int  pollingIntervalSecs = 10)
inline

This method will clear all local user data, and re-fetch everything from the Beamable server. The Init method will be called as part of this execution.

Parameters
pollingIntervalSecsWhen a file is written to the LocalCloudDataFullPath path, it will be backed up on the Beamable server. The pollingIntervalSecs controls how often Beamable checks for new or updated files on the local device.
Returns
A Promise representing when the reboot completes

The documentation for this class was generated from the following file: