In the documentation when reading about scriptData and privateData there is mentions that we should only use this storage for a small amount of data.
"These two mechanisms are perfect for when you have a small amount of data that is associated with a player:"
so what is a small amount of data? And is the impact the same for scriptData as for privateData?
Right now we have not used these two types and instead are only using custom runtime collections for our playerdata. But i see that we can simplify things if we could move to only using privateData and or scriptData.
Some clarification in this mather would be good.
Thanks,
Kristofer
Best Answer
C
Customer Support
said
over 3 years ago
Hi Kristofer,
It depends on what kind of data you need to store. ScriptData and PrivateData are stored on the player object and accessed through SparkPlayer calls. ScriptData will be viewable in certain responses. For example the GetTeamRequest and ListGameFriendsRequest. Both of these requests return info about the players team mates and game friends respectively. Any scriptData stored on those players will be included in these responses. PrivateData will never be displayed unless it is explicitly called in a script. So for example if you wanted to store an email for a player you may want to store it in privateData so it's never exposed to other players.
If you're storing large amounts of data for players it would be better to use a runtime collection and use mongo operations to make updates to these documents. We have some documentation on this here. Data stored in collections will be easier to query in your scripts. So if you have a collection that contained a "playerLevel" value for each player it would be much easier to run a query against that value to find players above a certain level. If you have any further questions just let us know.
It depends on what kind of data you need to store. ScriptData and PrivateData are stored on the player object and accessed through SparkPlayer calls. ScriptData will be viewable in certain responses. For example the GetTeamRequest and ListGameFriendsRequest. Both of these requests return info about the players team mates and game friends respectively. Any scriptData stored on those players will be included in these responses. PrivateData will never be displayed unless it is explicitly called in a script. So for example if you wanted to store an email for a player you may want to store it in privateData so it's never exposed to other players.
If you're storing large amounts of data for players it would be better to use a runtime collection and use mongo operations to make updates to these documents. We have some documentation on this here. Data stored in collections will be easier to query in your scripts. So if you have a collection that contained a "playerLevel" value for each player it would be much easier to run a query against that value to find players above a certain level. If you have any further questions just let us know.
Regards,
Liam
K
Kristofer Boman
said
over 3 years ago
Thanks Liam, we will continue using runtime collection for our playerdata.
Kristofer Boman
Hi,
In the documentation when reading about scriptData and privateData there is mentions that we should only use this storage for a small amount of data.
"These two mechanisms are perfect for when you have a small amount of data that is associated with a player:"
so what is a small amount of data? And is the impact the same for scriptData as for privateData?
Right now we have not used these two types and instead are only using custom runtime collections for our playerdata. But i see that we can simplify things if we could move to only using privateData and or scriptData.
Some clarification in this mather would be good.
Thanks,
Kristofer
Hi Kristofer,
It depends on what kind of data you need to store. ScriptData and PrivateData are stored on the player object and accessed through SparkPlayer calls. ScriptData will be viewable in certain responses. For example the GetTeamRequest and ListGameFriendsRequest. Both of these requests return info about the players team mates and game friends respectively. Any scriptData stored on those players will be included in these responses. PrivateData will never be displayed unless it is explicitly called in a script. So for example if you wanted to store an email for a player you may want to store it in privateData so it's never exposed to other players.
If you're storing large amounts of data for players it would be better to use a runtime collection and use mongo operations to make updates to these documents. We have some documentation on this here. Data stored in collections will be easier to query in your scripts. So if you have a collection that contained a "playerLevel" value for each player it would be much easier to run a query against that value to find players above a certain level. If you have any further questions just let us know.
Regards,
Liam
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Kristofer,
It depends on what kind of data you need to store. ScriptData and PrivateData are stored on the player object and accessed through SparkPlayer calls. ScriptData will be viewable in certain responses. For example the GetTeamRequest and ListGameFriendsRequest. Both of these requests return info about the players team mates and game friends respectively. Any scriptData stored on those players will be included in these responses. PrivateData will never be displayed unless it is explicitly called in a script. So for example if you wanted to store an email for a player you may want to store it in privateData so it's never exposed to other players.
If you're storing large amounts of data for players it would be better to use a runtime collection and use mongo operations to make updates to these documents. We have some documentation on this here. Data stored in collections will be easier to query in your scripts. So if you have a collection that contained a "playerLevel" value for each player it would be much easier to run a query against that value to find players above a certain level. If you have any further questions just let us know.
Regards,
Liam
Kristofer Boman
Regards,
Kristofer
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2485 topics