Commit 88eaa08
authored
fix: distributed authority spawning prefab overrides (#3160)
* fix
All clients in distributed authority should invoke CheckForGlobalObjectIdHashOverride when spawning a NetworkPrefab since each client has the authority to spawn (i.e. each should be treated like a host/server in regards to spawning and prefab overrides).
* update
adding changelog entry.
* update
adding changelog PR number.
* test
updating existing test to run through with distributed authority and client-server network topologies.
(still need one more integration test to validate the final spawned object on the non-authority sides)
* style
removing whitespace
* fix
Fixed issue with server only NetworkManager instance spawning the network prefab itself as opposed to creating an instance.
Extracted the instantiation portion of a network prefab into an internal method that can be used for integration testing prefab instantiation and potentially other edge case scenarios.
* test
Migrated all runtime network prefab related tests into a Prefabs subfolder.
Added new NetworkPrefabOverrideTests to validate the actual spawned instances on all clients using both client-server and distributed authority network topologies.
Added helper method `NettcodeIntegrationTestHelpers.CreateNetworkObject`.
* style
correcting some typos in comments1 parent f170341 commit 88eaa08
File tree
11 files changed
+351
-19
lines changed- com.unity.netcode.gameobjects
- Runtime
- Core
- Spawning
- TestHelpers/Runtime
- Tests/Runtime
- Prefabs
11 files changed
+351
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3246 | 3246 | | |
3247 | 3247 | | |
3248 | 3248 | | |
3249 | | - | |
| 3249 | + | |
| 3250 | + | |
3250 | 3251 | | |
3251 | 3252 | | |
3252 | 3253 | | |
3253 | 3254 | | |
3254 | 3255 | | |
3255 | 3256 | | |
3256 | | - | |
| 3257 | + | |
3257 | 3258 | | |
3258 | 3259 | | |
3259 | 3260 | | |
| |||
Lines changed: 37 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
736 | 736 | | |
737 | 737 | | |
738 | 738 | | |
739 | | - | |
740 | | - | |
741 | | - | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
742 | 745 | | |
743 | 746 | | |
744 | 747 | | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
745 | 753 | | |
746 | 754 | | |
747 | 755 | | |
| |||
824 | 832 | | |
825 | 833 | | |
826 | 834 | | |
827 | | - | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
| 835 | + | |
832 | 836 | | |
833 | 837 | | |
834 | 838 | | |
835 | 839 | | |
836 | 840 | | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
837 | 866 | | |
838 | 867 | | |
839 | 868 | | |
| |||
Lines changed: 24 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
562 | 585 | | |
563 | 586 | | |
564 | 587 | | |
| |||
570 | 593 | | |
571 | 594 | | |
572 | 595 | | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
| 596 | + | |
580 | 597 | | |
581 | 598 | | |
582 | 599 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
91 | 96 | | |
92 | 97 | | |
93 | 98 | | |
| |||
0 commit comments