Skip to content

Fix Player Loading Being Blocked #227

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

Merged
merged 4 commits into from
Mar 7, 2021
Merged

Conversation

TheNexusAvenger
Copy link
Member

@TheNexusAvenger TheNexusAvenger commented Mar 5, 2021

Closes #67

This pull request attempts to fix the loading getting stuck at 55%. The problem is caused by a race condition where the player disconnects before the player instantiation completes, which results in the disconnection event never firing. This results in players being in the world when they are disconnected. This eventually leads to the problem of other players because of object Construction, Serialization, and Destruction, throwing exceptions due to being unable to send data to the disconnected player, which stops the player connection handling.

The fix involves making it so an exception doesn't stop the replication of packets. There are 2 methods that do this currently, but only 1 catches exceptions, which works by using ISerializable objects, and the other doesn't. The other one is used, so moving to ISerializable components fixes this, and makes the code a bit less repetitive with the copy-and-pasted creation of streams.

This also fixes the launchpads not showing rockets on landing, which was initially thought to be in the same code but isn't actually.

Copy link
Member

@MickVermeulen MickVermeulen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, I hope that this yielded good results on the test server!

Copy link
Member

@enteryournamehere enteryournamehere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! Works perfectly here in local testing at least 😄

@MickVermeulen MickVermeulen merged commit 2e689b6 into dev Mar 7, 2021
@MickVermeulen MickVermeulen deleted the bug/player-loading-blocking branch March 7, 2021 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loading Bar Stuck at 55% at AG
3 participants