Beamable SDK
Public Member Functions | Public Attributes | Properties | List of all members
Beamable.Content.ContentService Class Reference

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

Inheritance diagram for Beamable.Content.ContentService:
Inheritance graph
[legend]
Collaboration diagram for Beamable.Content.ContentService:
Collaboration graph
[legend]

Public Member Functions

 ContentService (IDependencyProvider provider, IBeamableFilesystemAccessor filesystemAccessor, ContentParameterProvider config)
 
Promise< IContentObjectGetContent (string contentId, string manifestID="")
 Get the content data for a requested content id. The content is stored on Beamable servers and cached on each player's device. This method will always get the latest version of the content. Each time there is a new version, this method will cause a network call. Once the version has been cached, this method will read from the cache. More...
 
Promise< IContentObjectGetContent (string contentId, Type contentType, string manifestID="")
 Get the content data for a requested content id. The content is stored on Beamable servers and cached on each player's device. This method will always get the latest version of the content. Each time there is a new version, this method will cause a network call. Once the version has been cached, this method will read from the cache. More...
 
Promise< IContentObjectGetContent (IContentRef reference, string manifestID="")
 Get the content data for a requested IContentRef. The content is stored on Beamable servers and cached on each player's device. This method will always get the latest version of the content. Each time there is a new version, this method will cause a network call. Once the version has been cached, this method will read from the cache. More...
 
Promise< TContent > GetContent< TContent > (IContentRef reference, string manifestID="")
 Get the content data for a requested IContentRef. The content is stored on Beamable servers and cached on each player's device. This method will always get the latest version of the content. Each time there is a new version, this method will cause a network call. Once the version has been cached, this method will read from the cache. More...
 
Promise< TContent > GetContent< TContent > (IContentRef< TContent > reference, string manifestID="")
 Get the content data for a requested IContentRef<TContent>. The content is stored on Beamable servers and cached on each player's device. This method will always get the latest version of the content. Each time there is a new version, this method will cause a network call. Once the version has been cached, this method will read from the cache. More...
 
Promise< ClientManifestGetManifest (ContentQuery query)
 
Promise< ClientManifestGetManifestWithID (string manifestID="")
 A ClientManifest describes all the content available in a manifest for a realm. This method will always start a network request to get the manifest from Beamable. More...
 
Promise< ClientManifestGetManifest (string filter="", string manifestID="")
 A ClientManifest describes all the content available in a manifest for a realm. This method will always start a network request to get the manifest from Beamable. More...
 
Promise< ClientManifestGetManifest (ContentQuery query, string manifestID="")
 A ClientManifest describes all the content available in a manifest for a realm. This method will always start a network request to get the manifest from Beamable. More...
 
Promise< ClientManifestGetCurrent (string scope="")
 Get the latest default ClientManifest by asking the Beamable Cloud. More...
 
void SwitchDefaultManifestID (string manifestID)
 It is possible to have more than one ClientManifest providing content data for a game. By default, there is only one manifest with an ID of "global". Every piece of content found using GetContent(string, string) has the opportunity to pass a custom manifestID. However, if no custom manifest ID is given, then the content will be resolved using the default manifest ID, which is configured with this method. After this method runs, all future calls to GetContent(string,string) will default to the new manifest. More...
 
- Public Member Functions inherited from Beamable.Common.Api.ISupportsGet< ClientManifest >
Promise< TData > 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...
 

Public Attributes

Action< string > OnManifestChanged
 An event that triggers when the default manifest has been changed using the SwitchDefaultManifestID method. The event has a string parameter that represents the new manifest ID.
 
ContentDataInfoWrapper ContentDataInfo
 A utility used during Content Baking. This field should not be used in regular use. To resolve content, please use the GetContent(string,string) method.
 

Properties

string CurrentDefaultManifestID = "global" [get]
 The default content manifest ID controls which manifest the ContentService will use. By default, the value will be "global". You can customize the value by using the ContentParameterProvider, or by calling the SwitchDefaultManifestID method.
 
IBeamableFilesystemAccessor FilesystemAccessor [get]
 The IBeamableFilesystemAccessor is used by the ContentSerializer<TContentBase> to handle file read and writes for content disk caches.
 
ManifestSubscription Subscribable [get]
 The ManifestSubscription will be notified when there are content updates from the Beamable Cloud. This field should not be used, and will be deprecated in a future release.
 
Dictionary< string, ManifestSubscriptionSubscribables [get]
 A dictionary from manifest ID to ManifestSubscription that the game client is currently observing. This field should not be used, and will be deprecated in a future release.
 
IBeamableRequester Requester [get]
 This field is obsolete, please do not use.
 
- Properties inherited from Beamable.Api.IHasPlatformSubscriber< ManifestSubscription, ClientManifest, ClientManifest >
TPlatformSubscriber Subscribable [get]
 Allows scopes to consume fresh data when available.
 
- Properties inherited from Beamable.Api.IHasPlatformSubscribers< ManifestSubscription, ClientManifest, ClientManifest >
Dictionary< string, TPlatformSubscriber > Subscribables [get]
 Allows scopes to consume fresh data when available.
 

Detailed Description

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

Related Links

See Beamable.API script reference img beamable-logo

Member Function Documentation

◆ GetContent() [1/3]

Promise< IContentObject > Beamable.Content.ContentService.GetContent ( IContentRef  reference,
string  manifestID = "" 
)
inline

Get the content data for a requested IContentRef. The content is stored on Beamable servers and cached on each player's device. This method will always get the latest version of the content. Each time there is a new version, this method will cause a network call. Once the version has been cached, this method will read from the cache.

Parameters
referenceA IContentRef that contains a fully qualified content id.
manifestIDBy default, use the "global" manifest. A realm can have multiple groupings of content, where each group has its own manifest. If you haven't published multiple manifests, you should not use this field.
Returns
A Promise<IContentObject> that returns a IContentObject for the given content reference

Implements Beamable.Common.Api.Content.IContentApi.

◆ GetContent() [2/3]

Promise< IContentObject > Beamable.Content.ContentService.GetContent ( string  contentId,
string  manifestID = "" 
)
inline

Get the content data for a requested content id. The content is stored on Beamable servers and cached on each player's device. This method will always get the latest version of the content. Each time there is a new version, this method will cause a network call. Once the version has been cached, this method will read from the cache.

Parameters
contentIdA content id should be a dot separated string, with at least 1 dot. The right-most clause represents the content's name, and everything else represents the content's type.
manifestIDBy default, use the "global" manifest. A realm can have multiple groupings of content, where each group has its own manifest. If you haven't published multiple manifests, you should not use this field.
Returns
A Promise<IContentObject> that returns a IContentObject for the given content id.

Implements Beamable.Common.Api.Content.IContentApi.

◆ GetContent() [3/3]

Promise< IContentObject > Beamable.Content.ContentService.GetContent ( string  contentId,
Type  contentType,
string  manifestID = "" 
)
inline

Get the content data for a requested content id. The content is stored on Beamable servers and cached on each player's device. This method will always get the latest version of the content. Each time there is a new version, this method will cause a network call. Once the version has been cached, this method will read from the cache.

Parameters
contentIdA content id should be a dot separated string, with at least 1 dot. The right-most clause represents the content's name, and everything else represents the content's type.
contentTypeIf you know the type of the content, you can pass it so that the resulting IContentObject will be castable to the given contentType
manifestIDBy default, use the "global" manifest. A realm can have multiple groupings of content, where each group has its own manifest. If you haven't published multiple manifests, you should not use this field.
Returns
A Promise<IContentObject> that returns a IContentObject for the given content id

Implements Beamable.Common.Api.Content.IContentApi.

◆ GetContent< TContent >() [1/2]

Promise< TContent > Beamable.Content.ContentService.GetContent< TContent > ( IContentRef  reference,
string  manifestID = "" 
)
inline

Get the content data for a requested IContentRef. The content is stored on Beamable servers and cached on each player's device. This method will always get the latest version of the content. Each time there is a new version, this method will cause a network call. Once the version has been cached, this method will read from the cache.

Parameters
referenceA IContentRef that contains a fully qualified content id.
manifestIDBy default, use the "global" manifest. A realm can have multiple groupings of content, where each group has its own manifest. If you haven't published multiple manifests, you should not use this field.
Template Parameters
TContentThe type of the content that the reference refers to.
Returns
A Promise<TContent> that returns a TContent for the given content reference

Implements Beamable.Common.Api.Content.IContentApi.

Type Constraints
TContent :ContentObject 
TContent :new() 

◆ GetContent< TContent >() [2/2]

Promise< TContent > Beamable.Content.ContentService.GetContent< TContent > ( IContentRef< TContent >  reference,
string  manifestID = "" 
)
inline

Get the content data for a requested IContentRef<TContent>. The content is stored on Beamable servers and cached on each player's device. This method will always get the latest version of the content. Each time there is a new version, this method will cause a network call. Once the version has been cached, this method will read from the cache.

Parameters
referenceA IContentRef that contains a fully qualified content id.
manifestIDBy default, use the "global" manifest. A realm can have multiple groupings of content, where each group has its own manifest. If you haven't published multiple manifests, you should not use this field.
Template Parameters
TContentThe type of the content that the reference refers to.
Returns
A Promise<TContent> that returns a TContent for the given content reference

Implements Beamable.Common.Api.Content.IContentApi.

Type Constraints
TContent :ContentObject 
TContent :new() 

◆ GetCurrent()

Promise< ClientManifest > Beamable.Content.ContentService.GetCurrent ( string  scope = "")
inline

Get the latest default ClientManifest by asking the Beamable Cloud.

Parameters
scopeThe scope field should be ignored. Don't pass anything.
Returns
A Promise<ClientManifest> representing the network call.

◆ GetManifest() [1/3]

Promise< ClientManifest > Beamable.Content.ContentService.GetManifest ( ContentQuery  query)
inline

Parameters
queryA ContentQuery that will filter the resulting ClientManifest.entries field.
Returns
A Promise<ClientManifest> representing the network call.

◆ GetManifest() [2/3]

Promise< ClientManifest > Beamable.Content.ContentService.GetManifest ( ContentQuery  query,
string  manifestID = "" 
)
inline

A ClientManifest describes all the content available in a manifest for a realm. This method will always start a network request to get the manifest from Beamable.

Parameters
queryA ContentQuery that will filter the resulting ClientManifest.entries field.
manifestIDA specific manifest ID. By default, this will resolve to the default "global" manifest.
Returns
A Promise<ClientManifest> representing the network call.

Implements Beamable.Common.Api.Content.IContentApi.

◆ GetManifest() [3/3]

Promise< ClientManifest > Beamable.Content.ContentService.GetManifest ( string  filter = "",
string  manifestID = "" 
)
inline

A ClientManifest describes all the content available in a manifest for a realm. This method will always start a network request to get the manifest from Beamable.

Parameters
filterA ContentQuery in string form that will filter the resulting ClientManifest.entries field
manifestIDA specific manifest ID. By default, this will resolve to the default "global" manifest.
Returns
A Promise<ClientManifest> representing the network call.

Implements Beamable.Common.Api.Content.IContentApi.

◆ GetManifestWithID()

Promise< ClientManifest > Beamable.Content.ContentService.GetManifestWithID ( string  manifestID = "")
inline

A ClientManifest describes all the content available in a manifest for a realm. This method will always start a network request to get the manifest from Beamable.

Parameters
manifestIDA specific manifest ID. By default, this will resolve to the default "global" manifest.
Returns
A Promise<ClientManifest> representing the network call.

Implements Beamable.Common.Api.Content.IContentApi.

◆ SwitchDefaultManifestID()

void Beamable.Content.ContentService.SwitchDefaultManifestID ( string  manifestID)
inline

It is possible to have more than one ClientManifest providing content data for a game. By default, there is only one manifest with an ID of "global". Every piece of content found using GetContent(string, string) has the opportunity to pass a custom manifestID. However, if no custom manifest ID is given, then the content will be resolved using the default manifest ID, which is configured with this method. After this method runs, all future calls to GetContent(string,string) will default to the new manifest.

Parameters
manifestIDSome manifest ID

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