Allow for backgrounding the tab by responding to pings #39
Labels
enhancement
New feature or request
help wanted
Extra attention is needed
web
Features or fixes for the web client.
Right now, when the tab is backgrounded the game is completely suspended, which makes sense because it uses
requestAnimationFrame
. Unfortunately this means the game completely stops responding to pings from the server, meaning that other players see the user go into theLAG
state on the scoreboard and after a few seconds, the server disconnects them (at least on community servers).Theoretically this could be solved by running the game in a Web Worker and or man-in-the-middling communication with the server in the backend and responding to pings on behalf of the user. The former would be ideal, but is extremely complicated from what I can gather. The latter is not ideal because when the user returns to the tab, there will be a significant buildup of server messages that may cause bugs or a temporary slowdown.
The text was updated successfully, but these errors were encountered: