|
| UnityUserDataCache (string name, long ttlMs, CacheResolver resolver, IDependencyProvider provider) |
|
override Promise< T > | Get (long gamerTag) |
| Get the given player's data. If the data does not exist in the cache yet, the CacheResolver function will be triggered to resolve the data. More...
|
|
override Promise< Dictionary< long, T > > | GetBatch (List< long > gamerTags) |
| Get multiple players' data. If the players do not have the data in the cache yet, the CacheResolver function will be triggered to resolve all the data. More...
|
|
override void | Set (long gamerTag, T data) |
| Manually set the player data More...
|
|
override void | Remove (long gamerTag) |
| Remove a player from the cache. The next time this player's data is requested, the CacheResolver will be used to get the latest data for the player More...
|
|
delegate UserDataCache< T > | FactoryFunction (string name, long ttlMs, CacheResolver resolver, IDependencyProvider provider) |
| A general purpose factory function that returns a new instance of the UserDataCache<T>.
|
|
delegate Promise< Dictionary< long, T > > | CacheResolver (List< long > gamerTags) |
| A UserDataCache<T> has a mapping from player gamertags to some generic type per player. This function takes a set of gamertags, and fetches the latest data for each.
|
|
|
virtual void | Resolve () |
|
void | PerformScheduleResolve () |
|
|
Dictionary< long, UserDataCacheEntry > | cache = new Dictionary<long, UserDataCacheEntry>() |
|
List< long > | gamerTagsPending = new List<long>() |
|
List< long > | gamerTagsInFlight = new List<long>() |
|
Promise< Dictionary< long, T > > | nextPromise = new Promise<Dictionary<long, T>>() |
|
Dictionary< long, T > | result = new Dictionary<long, T>() |
|
◆ Get()
Get the given player's data. If the data does not exist in the cache yet, the CacheResolver function will be triggered to resolve the data.
- Parameters
-
gamerTag | The gamertag for the player to get data for. |
- Returns
- A Promise<T> containing the player data.
Implements Beamable.Common.Api.UserDataCache< T >.
◆ GetBatch()
Get multiple players' data. If the players do not have the data in the cache yet, the CacheResolver function will be triggered to resolve all the data.
- Parameters
-
gamerTags | A set of gamertags |
- Returns
- A Promise<T> containing a dictionary from gamertag to player data
Implements Beamable.Common.Api.UserDataCache< T >.
◆ Remove()
Remove a player from the cache. The next time this player's data is requested, the CacheResolver will be used to get the latest data for the player
- Parameters
-
gamerTag | The gamertag of the player to remove from the cache |
Implements Beamable.Common.Api.UserDataCache< T >.
◆ Set()
Manually set the player data
- Parameters
-
gamerTag | The gamertag of the player to set data for |
data | The player's new data, which will overwrite the old data. |
Implements Beamable.Common.Api.UserDataCache< T >.
The documentation for this class was generated from the following file:
- com.beamable/Runtime/Core/Platform/SDK/UnityUserDataCache.cs