Skip to content

fix: Added clear to dictionary OverrideToNetworkPrefab in NetworkManager Initialize #1419

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

Conversation

jordruss
Copy link

Added clear to dictionary OverrideToNetworkPrefab in NetworkManager Initialize. This should be cleared with NetworkPrefabOverrideLinks to rebuild on each connect.

Network prefabs are added to OverrideToNetworkPrefab with each connection. From the rest of the logic presented OverrideToNetworkPrefab should be cleared in Initialize before the override dictionaries are built. Without this change on second connections onwards errors trigger indicating a Network Prefab has been added multiple times and Network Prefabs with overrides do not spawn on clients.

To replicate add an override to a NetworkPrefab in NetworkManager and attempt multiple connections.

…nitialize. This should be cleared with NetworkPrefabOverrideLinks to rebuild on each connect
@unity-cla-assistant
Copy link

unity-cla-assistant commented Nov 12, 2021

CLA assistant check
All committers have signed the CLA.

@LukeStampfli
Copy link
Contributor

The CLA assistant is not passing here because you made a commit from an email which is not linked to a Github account. You'd have to amend the commit and change the author email.

Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

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

This is a good addition.

@NoelStephensUnity NoelStephensUnity changed the title Added clear to dictionary OverrideToNetworkPrefab in NetworkManager Initialize fix: Added clear to dictionary OverrideToNetworkPrefab in NetworkManager Initialize Dec 6, 2021
@NoelStephensUnity
Copy link
Collaborator

Hi @jordanvr,
This was a good catch and will be updated in the next patch.
The fix is implemented in PR-1508.
Thank you for your submission!

@0xFA11
Copy link
Contributor

0xFA11 commented Dec 7, 2021

thanks for the review Noel
we should pull author's branch and push it to our repo to give them credit in the git history/commits.
I'll take care of that, until then, I'll reopen this PR and assign it to myself.

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.

5 participants