DataStoreService
DataStoreService : Instance
Overview
The DataStoreService class is a server-side service that allows developers to store and retrieve persistent data for their games. This data can include player stats, inventory, game progress, or any other information that needs to persist across game sessions. The service provides a robust framework for managing data through various types of data stores, such as GlobalDataStore and OrderedDataStore. It is an essential tool for creating dynamic and personalized experiences in OVERDARE UGC.
Description
The DataStoreService class provides methods to create and manage data stores, which act as containers for saving and retrieving key-value pairs. These data stores are shared across all places within the same game universe, enabling seamless data access across different game environments.
Properties
Methods
GetDataStore
The GetDataStore
method retrieves a data store object that developers can use to store and manage key-value pairs. The InName
parameter specifies the name of the data store, while the InScope
parameter determines the scope for the data store. This method is commonly utilized when working with specific categories or subsets of data within a game. The returned data store allows for persistent and structured handling of data across game sessions.
Parameters
string
InName
string
InScope
Return
GlobalDataStore
Code Samples
GetGlobalDataStore
The GetGlobalDataStore
method retrieves the default global data store associated with the game universe. This method does not require specifying a name or scope and is suitable for storing and retrieving common or shared data across the entire game. It is a straightforward way to handle universal data that applies to all players or components within the game.
Parameters
Return
GlobalDataStore
Code Samples
GetOrderedDataStore
The GetOrderedDataStore
method retrieves an ordered data store object that maintains the keys in a specific order based on their values. This method is particularly useful for scenarios where ranking or sorted data is required, such as leaderboards or score tables. By specifying the InName
and optional InScope
parameters, developers can define a specific ordered data store to interact with. This tool simplifies managing and accessing ordered collections of data across game sessions.
Parameters
string
InName
string
InScope
Return
OrderedDataStore
Code Samples
ListDataStoresAsync
The ListDataStoresAsync
method retrieves an object representing a paginated list of data stores within a game universe. This is particularly useful for retrieving metadata or identifying different data stores created in the game. By specifying the optional parameters such as InPrefix
(to filter by prefix), InPageSize
(to limit the number of results returned per page), and InCursor
(to navigate to a specific page of results), developers can effectively manage and explore their data stores.
Parameters
string
InPrefix
number
InPageSize
string
InCursor
Return
DataStoreListingPages