How do I Continuous Timer -or- Get Signal Server Timestamp

Get help using Construct 2

Post » Sun Mar 30, 2014 6:41 am

I was wondering how to make the timer to go on even if the app is closed. I'm not making any games out of this yet, I just want to grasp the concept, so there's no capx or anything.

What I need is a method to get timestamps from some server somewhere (probably the signalling server). The idea behind getting the server timestamps is to avoid confusion of let say people chatting from across the world with different timestamps on their computer or phone. From what I understand this is also the basis of preventing people from cheat in time-based-building game, like Clash of Clan, Travian or anything similar.

I need a method simple enough for non-coder to understand and accuracy what not is not necessary.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Sun Mar 30, 2014 12:05 pm

Use this Date Plugin from the plugin master - rexrainbow. This will return the current time in unix time stamp format - perfect for helping you figure out who pushed the 'fire' button first...
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,245
Reputation: 46,464

Post » Sun Mar 30, 2014 1:14 pm

@Colludium I'm aware of that plugin. In fact I have search the forum for my specific requirement. What I understand from the plugin is it uses local machine timestamps, the timestamps I want to use is from external ie server.
B
28
S
8
G
4
Posts: 553
Reputation: 4,924

Post » Sun Mar 30, 2014 2:07 pm

OK - just a couple of ideas, although admittedly this isn't my area of expertise.

If you're looking for a way to check if a player is cheating (by changing their clock time) you could you ask for a check and have C2 reply with a unix timestamp from the other player's computer. If the reply time stamp was dated before the request check ping was sent, or if the time difference is too great between the computers, then there's something fishy going on... If you're concerned about general clock and time differences due to normal system errors in hardware then could you synchronize the games' timers when they start to play - like having a game time stamp that runs independently of the system the game is being played on.

Sorry - I don't know how to help with using an external server to gain the data.
A big fan of JavaScript.
B
76
S
20
G
74
Posts: 2,245
Reputation: 46,464


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 44 guests