Hello everyone,
I want to implement a logic where the players can interact with once every 5 minutes. To be able to that, I'm using read only data. (I will store the current time of the server when the API is called). My questions are:
- How can get the current time of the server in cloudscript?
- How can check the time difference between the read only data and the current time of the server?
Here's the code I've written.
//... var value = lastTimeResult.Data["StreetRace"].Value; if(value != "Now") { var lastTime = new Date(value); var now = new Date().getTime(); var difference = (now - lastTime) / 1000; if(difference < 60) { return { "SecondsLeft" : difference } } } //... the rest of the code