Fix Player Loading Being Blocked #227
Merged
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.
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 toISerializable
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.