question

oliviermarchand-lemire avatar image
oliviermarchand-lemire asked

SetTitleData not working after Play

In Unity, I am making a small tool to upload our current local configurations in the editor to PlayFab using a SetTitleData request and it's working great until I hit Play and then stop the game. At this point, the requests never complete (neither result nor error) until, it seems, the assembly is reloaded since when I recompile it works once again, whatever the changes. It also always works while in Play mode.

Also, I don't know if it can be related, but when in Play mode the requests complete way faster than when they are done while not playing (if it works at all that is).

Title Data
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Well, first things first, SetTitleData should never be used from a game, since it requires the Secret Key - the security info you use to make Server and Admin API calls. If you were to ship a game containing that key, you would effectively give hackers the ability to do anything they want to your game, including deleting all data and players. I'm guessing you're just referring to an internal build that has enhanced features for your team, but I do need to call this out for anyone coming across this post later, to help make sure they have clear guidance on this.

For the issue you're seeing, that's correct - we have a game object and co-routines in the scene, which are what drive the logic of calling our Web API methods and processing the responses. Since they're not running when you're not in Play mode, I would expect that those calls would not be made, or complete. Basically, if the game isn't running, the calls can't be processed.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

oliviermarchand-lemire avatar image oliviermarchand-lemire commented ·

Indeed this is only within the editor. Considering your answer I'll make it work in Play mode only, but the fact that it actually works when not in Play mode if you've got a freshly reloaded assembly led me to believe it was supposed to work. Anyway, thank you for your answer.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.