question

Fabrizio Antonioli avatar image
Fabrizio Antonioli asked

Shared server ,Long countdown timer,

Hello, I basically need this: https://community.playfab.com/questions/8921/best-way-to-create-items-with-timers.html

My question: what's the most reliable way to get the time stamp? I need to make timed events which more players can start together, so it's important that the server time saved in UserInternalData is the same for every player.

For this purpose, would it be good to have one 'master' player request the time via CloudScript, and then assign it to other participants? Completion of the event would then be checked via CloudScript on each player.

(I am taking into account your answer here too https://community.playfab.com/questions/573/207825207-How-to-get-the-current-timestamp-of-the-Playfab-server-.html)

,

Hello, I basically need this: https://community.playfab.com/questions/8921/best-way-to-create-items-with-timers.html

My question: what's the most reliable way to get the time stamp? I need to make timed events which more players can start together, so it's important that the server time saved in UserInternalData is the same for every player.

For this purpose, would it be good to have one 'master' player request the time via CloudScript, and then assign it to other participants? Completion of the event would then be checked via CloudScript on each player.

,

Player DataCloudScript
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

Can you describe the gameplay feature you're trying to enable? The details of that would help considerably in making sure you have the best solution.

When it comes to timestamps, it's about both the computed time when you set the "start" as well as the computed time when you're checking the delta from that time. Those operations aren't likely to take place on the same server, unless you're in a session where player are connected to a specific game hosting server.

Now, all the servers running the API calls for PlayFab are sync'ed on time so that they're within about a second of each other. So in general, you can just use that time, with each player checking it. If you are starting some multiplayer activity with a small group of players and want to make sure they're ask closely in sync as possible - and assuming you're not using a hosting server for the session - then having one designated "leader" set the time for everyone would be a good approach. But if you need extremely high accuracy timing between players (where sub-second measures are critical to your gameplay), you're really going to need to use connected sessions with a hosted game server.

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.

Fabrizio Antonioli avatar image Fabrizio Antonioli commented ·

Sorry for the messed up question, I don't know how that happened.

I definitely do not a hosted game server.

The feature would be: 2-3 players in a party decide to start an 'exploration'. This would be a very simple and static feature, as they will just see a countdown for the exploration completion and, every say 20 minutes, a new message is logged to all players (eg.: player a kille 4 monsters, player b found 5 gold, with calculations based on players' data).

I think this is (relatively) easy because only the party members are aware of the event.

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.