I’m doing a browser game project with WAMP, using HTML CSS PHP SQL. The game needs to display resources every second, because there is a production rate.
I won’t show any code, it’s a design problem.
I know basics of PHP, I can load/store data from DB, show it in html tags. I know Javascript/Ajax too.
But here is my problem : let’s say I use Javascript to update the resources: it works well until I refresh. The scripts relaunch after every refresh, I don’t know how to fix that.
Some people use cookies to synchronise, but then I would need to crypt them to prevent cheating with editing cookies, is that a good solution ?
I also stumbled upon websockets and server-sent event, but I’m not sure how it applies here.
Any help about using realtime features will be appreciated, thanks !
I just need to know the proper technology, so I can learn it then.