Mirror icon indicating copy to clipboard operation
Mirror copied to clipboard

feat: Prevent Nested Network Identities

Open MrGadget1024 opened this issue 4 years ago • 3 comments

See also https://github.com/vis2k/Mirror/pull/2869

Uses OnValidate and Reset to prevent users from adding components that would conflict that Unity can't catch on its own:

  • NetworkIdentity in same object hierarchy as NetworkManager
  • NetworkIdentity in same object hierarchy as another NetworkIdentity (prevents nesting)

MrGadget1024 avatar Aug 06 '21 14:08 MrGadget1024

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 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

sonarqubecloud[bot] avatar Aug 08 '21 13:08 sonarqubecloud[bot]

did a test with benchmark scene and monster prefab. added a child GO with NetworkIdentity. press play, server & play. we already have a check + error: 2021-08-13_11-51-58@2x

miwarnec avatar Aug 13 '21 03:08 miwarnec

The point of this PR and #2869 is to block the user at design time, instead of waiting until play mode / run time.

MrGadget1024 avatar Sep 06 '21 19:09 MrGadget1024