I'm trying to redirect all users at the same time to the game page but I didn't succeed in doing that. How can I synchronize them?
I've tried using eventSource from JAVASCRIPT but still can't get them all into the game. Only one is redirected at a time. Is there any function, framework or something else that could be useful to redirect all the players at the same time?
<script>
if(typeof(EventSource) !== "undefined") {
var source = new EventSource("demo_sse.php");
source.onmessage = function(event) {
document.getElementById("result").innerHTML += " <?php startGame(); ? >";
}
} else {
document.getElementById("result").innerHTML = "Sorry, your browser does not support server-sent events...";
}
</script>