Cheat proof life timer?

Get help using Construct 2

Post » Sat Oct 04, 2014 3:32 am

I'm trying to create a life timer, every x minutes you receive a life, which is simple enough with a timer and variables or using the date plugin to compare and save system time and give lives, but all the user has to do is set their system clock ahead then run the game and get full lives again. Anybody successfully implemented a cheat proof life timer, maybe that checks time on a server to give lives with an ajax call? I wish their was a way to do this without requiring an internet connection, but I guess thats not possible with just variables. Any examples of how this has been implemented would be appreciated, thanks.
B
47
S
16
G
2
Posts: 109
Reputation: 4,307

Post » Sat Oct 04, 2014 3:47 am

So how about every 10 seconds you save a "token" and if the last 6 tokens are invalid sequentially in the minute, you don't get anything, or else you get a extra life?
B
32
S
6
G
2
Posts: 317
Reputation: 2,801

Post » Sat Oct 04, 2014 4:05 am

Time travel badge ftw.
Truth is, its javascript so its pretty easy to cheat anyway, variables, and webstorage call all be accessed in browser.
Your guess of using a server is about the only decent solution, but they will still likely cheat.
The time spent trying to prevent it would be better used to pander to it.
In other words use the bad habits to your advantage.
Image ImageImage
B
169
S
50
G
169
Posts: 8,290
Reputation: 108,224

Post » Sat Oct 04, 2014 8:40 am

@IndieKiwi Something like that would work but the timer wouldn't run when the app is closed.

@newt It's for an iOS game, I wouldn't be worried about people accessing it from a browser. "In other words use the bad habits to your advantage." Don't really know what you mean by this, it's an IAP focused game, more free lives by setting timer ahead=less IAPs purchased.

I'm just trying to figure out how to access time from a server, has anyone done this successfully in a C2 game?
B
47
S
16
G
2
Posts: 109
Reputation: 4,307

Post » Sat Oct 04, 2014 9:48 am

I would just find a website or api already with a time on the page (Not really worth setting it up yourself). Eg: http://www.currenttimestamp.com/ for this website you can ajax request it then load it into xml, and extract time with xpath like : "//textarea[@id="fe_text"]/text()" to extract the timestamp, to get "1412415775" which is a time format, you can google how to measure the time differences between them
B
32
S
6
G
2
Posts: 317
Reputation: 2,801

Post » Sat Oct 04, 2014 12:26 pm

IndieKiwi wrote:I would just find a website or api already with a time on the page (Not really worth setting it up yourself). Eg: http://www.currenttimestamp.com/ for this website you can ajax request it then load it into xml, and extract time with xpath like : "//textarea[@id="fe_text"]/text()" to extract the timestamp, to get "1412415775" which is a time format, you can google how to measure the time differences between them


I can't figure any of this out, first I can't figure out how to pull the timestamp off any webpage, ie, the one you posted, so I made my own php file that write the current time in unix timestamp on my own webhost, but the only way I could get the AJAX request to pull the time stamp is if I exported my project then uploaded it to my hosting, seems you can only do AJAX requests for files hosted on the same server, how is this going to work if the target is mobile?
B
47
S
16
G
2
Posts: 109
Reputation: 4,307


Return to How do I....?

Who is online

Users browsing this forum: Fenix18, tarek2, Yahoo [Bot] and 51 guests