Skip to main content

Shared data

In the context of video games, shared data refers to any data that is shared between different players or sessions of the same game. This can include player progress, achievements, scores, leaderboards, in-game items, and other related data.

Shared data allows players to compete against each other, collaborate in multiplayer modes, and share their achievements and progress with other players.

Shared data is an essential component of many modern video games, as it enables social interactions and enhances the overall gaming experience. It also allows developers to analyze player behavior and adjust the game mechanics accordingly, improving the game's balance and overall design.

Create Shared data

Shared data can create only from game scripts, read more here /docs/concepts/game-scripts#share-data

View list shared data

Open Liveops tools and select Shared data on the sidebar shared data.png

Shared data detail

Click Id in the list of shared data to view detail shared data detail

API

only cloud scripts can get/update/query shared data.

An example to use shared data service to create a clan.

/**
* create clan
*/
async function createClan({ info }) {
const clanId = utilsService.genId();
const clan = await shareDataService.update("CLAN", clanId, {
clanId,
name: info.name,
description: info.description,
maxMember: 50,
members: [
{
id: playerService.playerId,
role: "Leader"
}
],
joinCondition: {
requiredLevel: info.requiredLevel
}
})
return clan
}
export {
createClan
}