Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for backgrounding the tab by responding to pings #39

Open
cfoust opened this issue Feb 3, 2023 · 0 comments
Open

Allow for backgrounding the tab by responding to pings #39

cfoust opened this issue Feb 3, 2023 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed web Features or fixes for the web client.

Comments

@cfoust
Copy link
Owner

cfoust commented Feb 3, 2023

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 the LAG 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.

@cfoust cfoust added enhancement New feature or request help wanted Extra attention is needed web Features or fixes for the web client. labels Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed web Features or fixes for the web client.
Projects
None yet
Development

No branches or pull requests

1 participant