Commit d80340d
fix: distributed authority client synchronization issues (#3350)
This PR resolves two client synchronization related issues:
- When using a distributed authority network topology the session owner
can max-out the reliable in-flight messages allowed and start dropping
packets when many clients attempt to connect simultaneously.
- When scene management was disabled, any client attempting to spawn
objects during the initial synchronization would not be allowed to due
to the `NetworkManager.IsConnectedClient` not being set until after the
client had finished synchronizing (i.e. all objects synchronized had run
through the spawn process).
fix: #3280
close: #3280
## Changelog
- Fixed: Issue when using a distributed authority network topology and
many clients attempt to connect simultaneously the session owner could
max-out the maximum in-flight reliable messages allowed, start dropping
packets, and some of the connecting clients would fail to fully
synchronize.
- Fixed: Issue when using a distributed authority network topology and
scene management was disabled clients would not be able to spawn any new
network prefab instances until synchronization was complete.
## Testing and Documentation
- No test has been added for session owner reaching maximum in-flight
reliable messages (requires manual CCU stress test).
- Includes the `SpawnDuringSynchronizationTests` integration test.
- No documentation changes or additions were necessary.
<!-- Uncomment and mark items off with a * if this PR deprecates any
API:
### Deprecated API
- [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter
yyyy-mm-dd)` entry.
- [ ] An [api updater] was added.
- [ ] Deprecation of the API is explained in the CHANGELOG.
- [ ] The users can understand why this API was removed and what they
should use instead.
-->
---------
Co-authored-by: Emma <[email protected]>1 parent cab4d78 commit d80340d
File tree
7 files changed
+241
-18
lines changed- com.unity.netcode.gameobjects
- Runtime
- Messaging/Messages
- SceneManagement
- Spawning
- Tests/Runtime/DistributedAuthority
7 files changed
+241
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
273 | 280 | | |
274 | 281 | | |
275 | 282 | | |
| |||
292 | 299 | | |
293 | 300 | | |
294 | 301 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | 302 | | |
299 | 303 | | |
300 | 304 | | |
| |||
315 | 319 | | |
316 | 320 | | |
317 | 321 | | |
318 | | - | |
| 322 | + | |
319 | 323 | | |
320 | 324 | | |
321 | 325 | | |
322 | 326 | | |
323 | 327 | | |
324 | 328 | | |
325 | | - | |
| 329 | + | |
326 | 330 | | |
327 | 331 | | |
328 | 332 | | |
| |||
334 | 338 | | |
335 | 339 | | |
336 | 340 | | |
337 | | - | |
| 341 | + | |
338 | 342 | | |
339 | | - | |
| 343 | + | |
340 | 344 | | |
341 | 345 | | |
342 | 346 | | |
| |||
Lines changed: 69 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1986 | 1986 | | |
1987 | 1987 | | |
1988 | 1988 | | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
| 1992 | + | |
| 1993 | + | |
| 1994 | + | |
| 1995 | + | |
| 1996 | + | |
1989 | 1997 | | |
1990 | 1998 | | |
1991 | 1999 | | |
| |||
1994 | 2002 | | |
1995 | 2003 | | |
1996 | 2004 | | |
1997 | | - | |
| 2005 | + | |
| 2006 | + | |
1998 | 2007 | | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
| 2011 | + | |
| 2012 | + | |
| 2013 | + | |
| 2014 | + | |
| 2015 | + | |
| 2016 | + | |
| 2017 | + | |
| 2018 | + | |
| 2019 | + | |
| 2020 | + | |
| 2021 | + | |
| 2022 | + | |
| 2023 | + | |
| 2024 | + | |
| 2025 | + | |
| 2026 | + | |
| 2027 | + | |
| 2028 | + | |
1999 | 2029 | | |
2000 | 2030 | | |
2001 | 2031 | | |
| |||
2623 | 2653 | | |
2624 | 2654 | | |
2625 | 2655 | | |
| 2656 | + | |
| 2657 | + | |
| 2658 | + | |
| 2659 | + | |
| 2660 | + | |
| 2661 | + | |
| 2662 | + | |
| 2663 | + | |
| 2664 | + | |
| 2665 | + | |
| 2666 | + | |
| 2667 | + | |
| 2668 | + | |
| 2669 | + | |
| 2670 | + | |
| 2671 | + | |
| 2672 | + | |
| 2673 | + | |
| 2674 | + | |
| 2675 | + | |
| 2676 | + | |
| 2677 | + | |
| 2678 | + | |
| 2679 | + | |
| 2680 | + | |
| 2681 | + | |
| 2682 | + | |
| 2683 | + | |
| 2684 | + | |
| 2685 | + | |
| 2686 | + | |
| 2687 | + | |
| 2688 | + | |
| 2689 | + | |
| 2690 | + | |
| 2691 | + | |
| 2692 | + | |
| 2693 | + | |
2626 | 2694 | | |
2627 | 2695 | | |
2628 | 2696 | | |
| |||
Lines changed: 8 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1815 | 1815 | | |
1816 | 1816 | | |
1817 | 1817 | | |
1818 | | - | |
| 1818 | + | |
1819 | 1819 | | |
1820 | 1820 | | |
1821 | 1821 | | |
| |||
1844 | 1844 | | |
1845 | 1845 | | |
1846 | 1846 | | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
1847 | 1852 | | |
1848 | 1853 | | |
1849 | 1854 | | |
| |||
1913 | 1918 | | |
1914 | 1919 | | |
1915 | 1920 | | |
1916 | | - | |
| 1921 | + | |
1917 | 1922 | | |
1918 | 1923 | | |
1919 | 1924 | | |
| |||
1951 | 1956 | | |
1952 | 1957 | | |
1953 | 1958 | | |
1954 | | - | |
1955 | 1959 | | |
1956 | 1960 | | |
1957 | 1961 | | |
| |||
1964 | 1968 | | |
1965 | 1969 | | |
1966 | 1970 | | |
1967 | | - | |
1968 | | - | |
1969 | | - | |
1970 | | - | |
1971 | | - | |
1972 | 1971 | | |
1973 | 1972 | | |
1974 | 1973 | | |
| |||
2011 | 2010 | | |
2012 | 2011 | | |
2013 | 2012 | | |
2014 | | - | |
| 2013 | + | |
2015 | 2014 | | |
2016 | 2015 | | |
2017 | 2016 | | |
| |||
2026 | 2025 | | |
2027 | 2026 | | |
2028 | 2027 | | |
2029 | | - | |
2030 | 2028 | | |
2031 | 2029 | | |
2032 | 2030 | | |
| |||
0 commit comments