Hive Data Store uses NoSQL Cloud Database to synchronize and store the data for use on the client, such as the components of the game and the settings information. Using this service is a good solution for the games based on the client or if it needs real-time updates between clients.

Hive Data Store has the following features:

  • The data is stored in the storage separately of each game.
  • All data is encrypted and delivered safely.
  • Unlike SQL database, NoSQL Cloud Database has no tables and rows, and the data is stored in documents consisting of collections.
  • Stores and documented data as keyvalue pairs.
  • Optimizes for storing the collection that consists of multiple documents.
  • For the precautions of designing keyvalue, see the Operation > Game Data Store guide from Hive Developers.

 


Add Data

You can add data to the Data Store in one pair of a keyvalue or multiple pairs of map format at once. After a request, true or false is returned.

The followings are sample codes to add data of a keyvalue pair.

Unity®

API Reference: DataStore .set

C++

API Reference: DataStore ::set

Kotlin

API Reference: DataStore.set

Java

API Reference: DataStore.INSTANCE .set

Swift

API Reference: DataStoreInterface.set

Objective-C

API Reference: HIVEDataStore set

The followings are sample codes to add data of Map formatted.

Unity®

API Reference: DataStore .set

C++

API Reference: DataStore ::set

Kotlin

API Reference: DataStore.set

Java

API Reference: DataStore.INSTANCE .set

Swift

API Reference: DataStoreInterface.set

Objective-C

API Reference: HIVEDataStore set

Get Data

There are two ways to get your data one or all at once, and you also can get all user data corresponding to a key you requested. The three ways of getting data are as follows:

    • Get one of my data
    • Get all my data
    • Get all data using key

Check out the following sample codes for each way.

The followings are sample codes to get one of my data.

Unity®

API Reference: DataStore .get

C++

API Reference: DataStore ::get

Kotlin

API Reference: DataStore.get

Java

API Reference: DataStore.INSTANCE .get

Swift

API Reference: DataStoreInterface.get

Objective-C

API Reference: HIVEDataStore get

The followings are sample codes to get all my data.

Unity®

API Reference: DataStore .getMyData

C++

API Reference: DataStore .getMyData

Kotlin

API Reference: DataStore.getMyData

Java

API Reference: DataStore.INSTANCE .getMyData

Swift

API Reference: DataStoreInterface .getMyData

Objective-C

API Reference: HIVEDataStore getMyData

The followings are sample codes to get all data using key.

Unity®

API Reference: DataStore .getUsersData

C++

API Reference: DataStore ::getUsersData

Kotlin

API Reference: DataStore.getUsersData

Java

API Reference: DataStore.INSTANCE .getUsersData

Swift

API Reference: DataStoreInterface.getUsersData

Objective-C

API Reference: HIVEDataStore getUsersData

Error Code

Error Code Message Description
RESPONSE_FAIL DataStoreNotExistKey Not exist the key on the server
RESPONSE_FAIL DataStoreNotExistColumn Not exist Column Family(table) on the server
RESPONSE_FAIL DataStoreGameIsBeingInspected Datastore of the game is under maintenance
DEVELOPER_ERROR DataStoreNotExistPublicKey Not exist the puclic key. Need to check the settings on Hive console.
NEED_INITIALIZE DataStoreNotInitialized Not done for SDK setup (AuthV4.setup)
INVALID_SESSION DataStoreNeedSignIn Not signed in. Need to sign in.
DEVELOPER_ERROR DataStoreDisabled Set Data Store to Not Used. Need to check the settings on Hive console.
RESPONSE_FAIL DataStoreResponseError Success connection to the server but error returned. Need to check the error message.
INVALID_PARAM DataStoreInvalidParam Failed to call the set() API because of the invalid parameter