Right date and time for everyone

Yes, it’s not strictly related to NAKAMA but I use it in combination…

I want to make a multiplayer game where each player can perform an action and, after a certain period of time, this action becomes something else.

The mechanism is the same as in Hay Day, Clash of Clans, Clash Royale, etc …

I want to prevent the user from being smart and changing the time of their device whether it is a computer or a smartphone.

How can I get the current date time (of the server?) Without having to keep requesting the date from the server?

I am aware that it is possible to create a simple PHP function but I am afraid of overloading the server with thousands of requests per second.

thank you

Have you try getting UTC time using gmdate

gmdate by PHP script you mean? The problem is to avoid too many calls to server.
I need to understand the smartest way to do this

try this maybe? I’m not working on PHP so I’m sorry if didn’t help

Could you share more about where these rotating action types are occurring? Is it in the context of a match or is it more of a metagame system?

Hi @lugehorsam ,

The contest is a match: we are talking about users in the same match.

The mechanism is simple: the first user who arrives can click on the cell he prefers and has 15 seconds to press a button.
At the end of 15 seconds the cell is free again (white color) and another player can reserve it.

My concern is that the player can change the date and time of the PC / smartphone by deceiving.

In attachment a short video.
thank you

Thanks for the clarification. I think the best approach here is to notify the server whenever a cell or button is clicked. That way, it has the authority to accept or reject submissions (e.g., claiming a cell) from each user. At the end of the day, if the user finds a way to trick the client into thinking the time has elapsed or that they own a cell, once they submit to the server, it will reject their submission and potentially mark them as a cheater. But keep in mind that you’d have this problem if a user lost connectivity, so they aren’t necessarily a cheater. But you can shutdown the game at least.