Sign In Register

How can we help you today?

Start a new topic

RuntimeCollections disabled

I tried to see infos on my collections and inside thescriptlog it is written: runtimeCollections disabled... what the..??

 


4 people have this question

Hi Marc,


Did you recently create a new game instance ? You can see this page  here for how to create new game instances on the old api. 


Regards,

Liam

Importantly, it _seems_ like new game instances that were created by copying a snapshot to a new game _do_ still work. @Liam: can we, for the near future, count on that staying the same, or do we need to go into full panic mode and rework our existing cloud code, in case a new customer wants a new environment from us?

Hi Rene,


It will be in place for the foreseeable future. For new projects it would be recommended to make use of the new data api where possible.


Regards,

Liam

Well we have a game in development phase. Right now we are in Alpha. And now this mega important stuff is changing. I did not have wrapped my head around this, yet but would it mean that we would have to rewrite all our Cloud Code to accommodate for DataTypes instead of Runtime Collections? How long will be projects with runtime collections supported? Would you advise us to migrate now as we are not live, yet? We want our game to be live for many years to came.

Hi Jan,


As your game is in alpha it would make sense for you to continue on the path you are currently on. Games on the old API will be supported for the foreseeable future.


Regards,

Liam

Glad to hear that! Thanks Liam!

Excuse me.

I also got Runtime collections disabled 

But i can't see how to create game with new api?

The link leads to DataExplorer.


Could you give me right instruction? Thank you!

how do i switch to old api?

Hi Guys,


You can see this page here for how to create new game instances on the old api. If your account was created after the new data api went live you'll only be able to use that going forward. You simply need to create a new game for it to use the new api.


Regards,

Liam


Hi,

I have created a game using runtime collection and did cloud code also using runtime collections. Now our game is live and we want to add new features, for that we make a snapshot for the live game in new game and want to edit cloud code. We are not able to create new runtime collections and use our cloud code in the new game. We can't editcloud code in the live build. Please help us and let us know how can we add and test new features.

And how can i tranpose this to the new feature?



var playerData = Spark.getData().data; // find an modify the doc for this player in the 'playerData' collection using their playerId // // if there is no doc for the player then we use upsert to create one // var doc = Spark.runtimeCollection('playerData').findAndModify({ "playerId" : Spark.getPlayer().getPlayerId() }, null, {}, false, { $set : { 'updated' : new Date(), 'data' : playerData } }, false, true); // <- upsert is the last option in this function, set to 'true' // last, return the player data to prove it was updated // Spark.setScriptData('playerData', doc)




and then:



var playerData = Spark.runtimeCollection('playerData').findOne({ 'playerId' : Spark.getPlayer().getPlayerId() }); if(playerData){ // if we have player data in that collection, return it // Spark.setScriptData('@getPlayerData', playerData.data); }else{ // if no player data exists, return an error // Spark.setScriptError('@getPlayerData', 'no-player-data'); }


Hello????

Hi Mark,


There is no equivalent call for findAndModify in Game Data service. You'll need to get the item with the getItem call, make your changes and then persist them with setData.


Regards,

Liam

Where is equivalent for this tutorial https://docs.gamesparks.com/tutorials/database-access-and-cloud-storage/saving-and-loading-player-inventory-data.html for new api? Why your tutorials use old api?


2 people like this
Login to post a comment