- Home /
playerprefs save date cheat problem
Hi,
I am developing a game for webplayer and I want to add a bonus based on how long the user was offline. To do that, I am saving the date on playerprefs all the time and comparing with the current date. If the difference is bigger than a certain threshold (for example 5secs) I calculate the bonus to offer.
The problem is, if the user changes the computer date he can easily cheat the game! is there a simple way to prevent this?
I could use a webservice to get the correct utc date but if the player lost his web connection the game progress will be lost :S
Even if there isn't a perfect solution how would you deal with this problem?
If it's an online game, why not just pull the current time from webservice that provides it? I bet there are even countless html copy&paste scripts that are meant to show the time and data on a web page, but you might as well use them for your game to get the time.
The game I'm developing is not using any webservices at all and doesn't need web connection to play! Imagine for example the user hibernates the computer and turns on again, he may not have his internet connection ready to ask a webservice for the real time! what should I do in this situation? I want the players to keep playing even if they dont have internet connection! just trying to protect against cheating by changing computer time ;)
webplayer because I want it to run on browsers that's all
Answer by FortisVenaliter · Jul 03, 2015 at 09:30 PM
If it's not an online game, I would try to check a web service anyway. If the web service fails, then fall back to using the local clock.
Unfortunately, this goes back to DRM practices... always online to (try to) stay secure, or allow offline and the possibility of EULA breakage.
But... my point rests on one premise: If the user goes through the trouble of disconnecting from the internet and changing their system clock to cheat an offline game, is that really such a big problem? I look at it like this: If it's not devaluing other players' copies of the game, then the user is entitled to play the game they bought however they want, including cheating. Not everyone agrees with that sentiment, but it can certainly earn you a few points in some players' minds.
So, really, the question comes down to this: Does allowing this cheat devalue the game? For offline games, that answer is no, so the following question is: Do you want your users to play the game how you want them to play, or do you want them to be able to make their own experiences if they really want to?
thanks that helped me alot deciding what I'm going to do ;)