What I'm trying to accomplish is thus; when a player finishes gameplay, I analyze his play results via cloud script and then if granted, they will be given a chest that has a timer on it.
I figured the best way to approach this would be to save a multidimensional array into their internalData, [timeStamp_endDur, chestTier] and to then return this data for UI visuals on client.
The client would then have a cloudScript where it would get an array return from the server for their chest results and parse that into a UI visual for the timer counting down (i'll use a client counter and just use the server return as a check on its accuracy, rather than using it to adjust the timer because of server delay).
On timer being finished (in server check), their data will be moved from internal to their playerData.
When the chest is clicked, it will be the arrayValue in their playerData that is checked if it can be opened.
My question is, as I've been doing some research on this topic before diving right in is:
1) Has playfab created a built in method that can do as I have mentioned? I was looking into Item/containers and am not 100% sure if what I want can be achieved with that; as the chest rewards are RNG in an array of RNG based values.
2) Is the approach I am planning on taking correct? Im still learning Playfab syntax and best practices.
3) What is the best way to get accurate server time?
In one article, https://community.playfab.com/questions/8921/best-way-to-create-items-with-timers.html it's mentioned that you should "put a timestamp on the item instance (and then check it) via Cloud Script when the timer should start" (Brendan). What is the syntax to do this? I can't seem to find documentation on it.
It was also mentioned you could use "context.playStreamEvent.Timestamp", I tried this and got an error: "TypeError: Cannot read property 'Timestamp' of null\n
Or should I use, server.GetTime({}); as this is the only one I can get a proper return result from?
I appreciate any help,
Connor