How to force refresh a page after a certain time, even when user is on a different page

111
December 01, 2019, at 05:40 AM

After some years playing around with CSS and HTML, some Javascript, I decided that I couldn't play the ostrich and pretend that PHP didn't exist. To make my learning path more enjoyable, I decided I would build a web browser game (see OGame, Travian etc...), and although my understanding of PHP is still very limited, I'm actively working and practicing it.

I obviously have checked multiple websites/games to see how they do their business, and one of the things I noticed is that upon construction of a new building, OGame makes the entire session refresh. By that, I mean that when a user has finished building a new mine, factory etc..., the entire website refresh, even if this user is not on the building page anymore.

I have an idea about how to refresh the page after a certain time (comparing timestamp and everything) if the user stays on the same page. - The user click on Build - The page compare the current timestamp with the time required to have the building done (basic math) and use it to find when the page is going to be refreshed - upon refreshing, the page update the database with the new building.

It may not be the perfect way to do and I will most likely think about an other way, but to get back to myinitial question, how could I make the entire website refresh, regardless of where the user is?

If you have an idea (or know) how to do it, I'd appreciate not having any code written in this thread as I would like to "find it" myself :) Thanks

Rent Charter Buses Company
READ ALSO
Column not found: 1054 Champ 'posts.categorie_id' inconnu

Column not found: 1054 Champ 'posts.categorie_id' inconnu

I want to get POSTS from the CATEGORIE i do the relationship HasMany/belongsTo but it gives me error

114
Laravel, how to use Heartland payment system

Laravel, how to use Heartland payment system

Im using stripe in my laravel application but the owner needs to integrate heartland payment system, I tried to find guide of how to install it into laravel but didn't found I installed the package by editing composorjson and followed the tutorial here https://github

108