Playmaker Forum

PlayMaker Feedback => Action Requests => Topic started by: Aaddiction on July 24, 2014, 11:06:29 AM

Title: Check internet time?
Post by: Aaddiction on July 24, 2014, 11:06:29 AM
We have an action to check the device time. However, if we want to make a game where the player collects coins on each for example 1 hour, can we check if that time is passed based on a server time, not device time. This way the user would not be able to cheat by forwarding the time and date on the device.

If we check the time from a global server that would be irrelevant and he'll still have to wait for one hour in order to collect the coins. Is such action even possible?
Title: Re: Check internet time?
Post by: jeanfabre on August 08, 2014, 03:13:35 PM
Hi,

 Simply use the current date time using the action "getSystemDateTime", that's enough to be ok with checking elapsed time on a device safely.

so for example, have your game check for the unix time ( 1970/1/1) so that all games use the same base and then you can expect a pretty good synchronization of events if you have a leaderbord or share some common features across users.

If you are concerned about cheating, then you need to go for https access, cause I can sniff your call to your server easily and corrupt the return and cheat this way. So then you would need some more obfuscation and even some data hashing to provide additional layers of security.

the best way could be that you simply pass data to your server and the server simply check the time of the call itself, so your game doesn't need to care about the time locally. Have you experimented with this?
 
Bye,

 Jean

 Bye,

 Jean
Title: Re: Check internet time?
Post by: Aaddiction on August 09, 2014, 07:04:19 AM

the best way could be that you simply pass data to your server and the server simply check the time of the call itself, so your game doesn't need to care about the time locally. Have you experimented with this?


That's was my question actually. How to check server time with Playmaker, or even how to check a global server time like http://www.worldtimeserver.com/current_time_in_UTC.aspx?

Same action as "getSystemDateTime", but to check online server, not the device - "getServerDateTime". To store the time in a variable and to have a success and fail event.
Title: Re: Check internet time?
Post by: jeanfabre on August 11, 2014, 09:40:47 AM
Hi,

 If you do this calculation on the device, then you are open to cheat, that's what I meant, it's your server code that must check it's own computer ( the server OS itself) for the current time, and not your device.

 But if you want still to get the server time, simply create a simple php script that return the time

Code: [Select]
<?php
echo time();

?>



Bye,

 Jean