forked from WorldStarHipHopX/playforia
-
-
Notifications
You must be signed in to change notification settings - Fork 31
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
Fix client connection retries, lobby resizing, and lobby joining delays #109
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mostly code in AdCanvas, IPanel and LoadingPanel to understand what AApplet is doing.
PhilippvK
reviewed
May 27, 2024
PhilippvK
reviewed
May 27, 2024
StenAL
changed the title
Features
Fix client connection retries, lobby resizing, and lobby joining delays
May 27, 2024
These were helpful in tracking down the layout shift bug fixed in LobbyPanel in the next commit.
Resizing the applet caused the lobby screen to do a new layout and since it was using the default LayoutManager (FlowLayout), the panels were being placed in unintended places. Most other classes explicitly set the layout manager to null to avoid this, however, looks like this was overlooked in LobbyPanel.
Previously, this tried to open a new page in the browser, however, in our environment, appletContext was null and was throwing an exception. This was fixed by destroying the game applet and reinitializing it when the retry button is clicked. Reinitalizing the applet caused its size to get re-measured which was leading to layout bugs after retries, this was fixed by hardcoding the applet width and height in AApplet. Since the whole game is hardcoded for this size, this does not result in any problems elsewhere.
This revealed artificial delays in joining lobbies, probably as a means of flood protection. This can be verified by going into a single player lobby and clicking "Multiplayer", then "Single player" again rapidly and seeing a blank screen stuck on the sleep timer.
Previously the delay was a ladder of 3 -> 7 -> 15 seconds and switching between lobbies was annoying. Now it's faster and the change does not seem to cause any issues. I still opted to keep a one second delay in case removing the delay would break something.
very nice changes and thanks for the before/after clips! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR includes the following fixes/features:
resize-old.mp4
resize-new.webm
reconnect.webm
lobby-switch-old.webm
lobby-switch-new2.webm