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

fix: character spawner fix #946

Merged
merged 4 commits into from
Sep 25, 2021
Merged

fix: character spawner fix #946

merged 4 commits into from
Sep 25, 2021

Conversation

dragonslaya84
Copy link
Member

character spawner was registering the player prefab in awake an during scene loads this wont ever register again. Need to change it on scene changes.

Fixes #945

Signed-off-by: dragonslaya dragonslaya.ss@gmail.com

… during scene loads this wont ever register again. Need to change it on scene changes.

Signed-off-by: dragonslaya <dragonslaya.ss@gmail.com>
@@ -100,6 +91,15 @@ private void OnServerStarted()
/// <param name="sceneOperation">The type of scene load that happened.</param>
public virtual void OnClientFinishedSceneChange(string scenePath, SceneOperation sceneOperation)
{
if (ClientObjectManager != null)
{
ClientObjectManager.RegisterPrefab(PlayerPrefab);
Copy link
Member

Choose a reason for hiding this comment

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

I think this would register the prefab multiple times, Might be better to register it once when the client starts

Copy link
Member Author

Choose a reason for hiding this comment

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

It currently registers everytime scene changes. Mirage itself calls register prefabs internally in clientobjectmanager. This is why i had to move this here. So we either need to change how mirage registers to once in clientobjectmanager or we need to do this. I trace it and every time player bit join then disconnect and join it called register spawn in that class

Co-authored-by: James Frowen <jamesfrowendev@gmail.com>
@sonarcloud
Copy link

sonarcloud bot commented Sep 25, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

44.4% 44.4% Coverage
0.0% 0.0% Duplication

@dragonslaya84 dragonslaya84 merged commit 7082488 into master Sep 25, 2021
@github-actions
Copy link
Contributor

🎉 This PR is included in version 105.1.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@James-Frowen James-Frowen deleted the CharacterSpawnerFix branch March 8, 2022 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rejoining server causes prefabs to become unregistered
2 participants