Sign In Register

How can we help you today?

Start a new topic
Answered

Can system collections be manipulated via REST api?

Doesn't seem to a be a mechanism for denoting system collections in the docs.

We routinely manipulate the system.player collection to deal with player device id changes on IOS (when using only device authentication) caused by player uninstalling/reinstalling.


Currently manually manipulating with NOSQL Explorer - and it is prone to manual mistakes.


Best Answer

You should never be manipulating the system collections in general. Read-only is fine, but if you want to modify data, use the Spark API or if it must be NoSQL, create a duplication of the system collection.


Answer

You should never be manipulating the system collections in general. Read-only is fine, but if you want to modify data, use the Spark API or if it must be NoSQL, create a duplication of the system collection.

Christopher
     The Spark API does not allow write access to the system collections - and yes, I know the dangers of such manipulation, however there is no other way to ensure current device id being used by a player marries up with the correct account on the platform...

Not sure what you mean, are you trying to authenticate a device (DeviceAuthentication) and map it to a registered user ?

1.  IOS Player device authenticates - a new system player collection entry is made.
2.  The 'userName' of that player document contains their unique IOS device ID (in this case - as provided by Unity)
3.  Every time player uses the game/app - their device ID is sent to GS and the correct 'player' document is found by virtue of that device id in the userName field.
4.  Player uninstalls the app -  and then re-installs - which in IOS/Unity land, this means that their device ID changes (if the player has no other apps from that publisher/company installed).
5.  Player uses the game/app and they end up creating a NEW player and the old is lost.

Our remedy to that is to tweak the userName field of the player documents so that when the player authenticates again with that new device id - it connects them to the old/lost account

Gamesparks has a ChangeUserDetailsRequest call that can be used to help here - but a forced lower-casing of the userName property prevents setting the value to match the actual player device id.

How would you know their old device ID if their current device ID is different ? Serious question, curious to know if there's a solution I overlooked.

To answer your question, yes. REST can call a LogEventRequest, and the LER can run the Spark.runtimeCollection(). Side note: I do not know if runtimeCollection() will allow you to edit, haven't tried.

Easy enough - players can change their player name (which we store in our own collection) which we can easily reference back to system player collection.


This topic can be closed as I have found a way to do what I need

Login to post a comment