Fix host spawning. - #161
Merged
Merged
Conversation
What I thought was going to be a quick 10-minute change is going to become a week-long escapade to fix a race condition. Player controllers are now a spawnable. Added "CollisionShape3D" and "RayCast3D" as spawnable nodes for the player controller. Changed player position sender to use spawnable native transform calls. Major refactor in spawnable_manger to help address race condition, and lots of comments for my sanity. Player database is now synced as well when joining a server. Player auto respawning. When a player node is destryoed, it is respawned after a short time.
It was not a race condition, it was me unexpectedly modifying the database_id in the middle of syncing.
This file contains hidden or 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
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.
The player spawning is hard-coded and not using the "spawnable" system, which was designed to handle something like this. This PR changes player spawning to use the spawnable system.