Hi i need an event that runs daily and checks if a user logged in that day. But i need to consider players local time zone while doing that. will "new Date().getDate() " returns the date of server's locale or or player's locale? if it returns server's how can i correct it?
how does every day / ever hour thing works? does it executed with players time? or server time? and when "every day" resets? 00:00 UTC? if so, according to server time or player time?
makes sense but still as far as i understood that only makes me able to reach server time. I'm not sure how am i gonna distinguish a player (let's say @gmt+3) with an other (@gmt+1).
even through i try to get Date().Today() it will still give me day according to server time right? how am i gonna compansate for it?
So you can pass the time zone info in an event and then the server can adjust the UTC last logged in time based on the time zone, to determine if the the day was today or not.
If you're using C#, here's how you might go about that: https://msdn.microsoft.com/en-us/library/system.timezone.currenttimezone(v=vs.110).aspx
Just know a user could modify the time on their device so they might game the system. In your case it seems that wouldn't be disastrous though.
I think you are misunderstanding what he wants (though I could be wrong).
He's interested in finding out if the player has logged in between 12:00AM-11:59PM according the their local time. And for that, he would need to deal with timezone offsets.
For instance, it's 9pm in Istanbul and the player logs in. Then when they log in at 7am the next day, they should get the reward even though it's not been 24 hours since.
@ryan yes, you are right. i'm intrested in finding players logged in between 12:00AM-11:59PM according to their local time
@sean That is a solution but then players can login 36 hours apart (assuming you are checking their current - last login time is >24 and <48) and they would make them loose opportunities. if i make it >20h and <44h then same problem occurs if they login every 21hour. this is why i need to check restrictively "first login of the day".
Can i get an insight about everyday script? how does it works? It looks like i can't get any help off setting time zones. so if i know how "every..." scripts works i can try to find a solution to my problem.