Repository navigation
Commit 6752d38
authored
chore: enable unified netcode from N4E 7.2.0, only for hybrid prefab sessions (#4186)
* chore: drop N4E experimental bridge define and OUT_OF_BAND_RPC
N4E is removing NETCODE_GAMEOBJECT_BRIDGE_EXPERIMENTAL and making its GameObject layer public,
so UNIFIED_NETCODE is now the only define the unified path needs. testproject takes N4E from
unity/unity trunk until that change ships in a package, which makes manifest-unified.json redundant.
* Enable the unified path from N4E 7.2.0 and only for hybrid prefab sessions
UNIFIED_NETCODE is now an asmdef versionDefine on com.unity.netcode 7.2.0, the release that makes the
GameObject layer public, so no project define is needed. UNIFIED_NETCODE_7_0_0 is gone since every
supported N4E uses the new namespace.
UnifiedBootstrap is marked DisableBootstrapOverrides and created by NetworkManager only when the session
has hybrid prefabs, so projects without them keep N4E's own startup bootstrap. A hybrid prefab added
after a session started without one is rejected.
testproject takes N4E from the remove-experimental-define branch until that PR merges.
* Register the player prefab before the session decides hybrid mode
A hybrid PlayerPrefab outside the prefab lists was registered after the transport choice and the
session-start rejection, so it was rejected. It now registers with the prefab lists before start, and
distributed authority rejects it like any other hybrid prefab.
* style: format unified netcode code now that UNIFIED_NETCODE compiles in testproject
UNIFIED_NETCODE is now defined automatically from N4E 7.2.0, so the Standards check formats code behind it
for the first time.
* style: format the hybrid code merged from develop-3.x.x
Keeps an implicit bool check where null propagation would call into a destroyed NetworkBehaviour.
* chore: stop tracking the NetcodeConfig assets in testproject and minimalproject
NGO now applies the NetcodeConfig values it needs at session start, so nothing in either asset is required.
Netcode for Entities creates the asset and its project settings entry on first open. The settings file is
removed too, since keeping it tracked would make every fresh checkout rewrite it.
* chore: ignore the NetcodeConfig assets Netcode for Entities creates on first open
The assets are no longer tracked, so the files N4E writes when a project opens would otherwise show up
as untracked changes and could be committed back.
* fix: keep Unity's destroyed-object check where the formatter used null propagation
Implicit bool checks instead of ?. on NetworkTransform and NetworkManager, which the Standards formatter
does not rewrite.
* fix: keep UnifiedBootstrap as the Entities startup bootstrap
[DisableBootstrapOverrides] let Netcode for Entities' own bootstrap run at
startup. Without a NetcodeConfig that disables automatic bootstrapping, it
creates a host world listening on port 7979, so a hybrid host could not bind
the port and the unified tests failed. As the startup bootstrap,
UnifiedBootstrap only creates a local world, which is how #4144 resolved this.
* chore: point the Netcode for Entities git dependency at trunk
The GameObject layer change has merged to trunk, so testproject follows trunk instead of the pull request
branch, and minimalproject gets the same entry so both compile against N4E 7.2.0. These switch to the
published 7.2.0 package once it is available.1 parent f9d4fa8 commit 6752d38
35 files changed
Lines changed: 132 additions & 421 deletions
File tree
- .yamato
- com.unity.netcode.gameobjects
- Editor
- Runtime
- Components
- Helpers
- Configuration
- Core
- NetworkVariable
- Spawning
- Transports/Unified
- Tests
- Editor
- Runtime
- NetworkObject
- TestHelpers
- minimalproject
- Assets
- Packages
- ProjectSettings
- testproject
- Assets
- Tests/Runtime
- Packages
- ProjectSettings
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | 37 | | |
43 | 38 | | |
44 | 39 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | 4 | | |
10 | 5 | | |
11 | 6 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
27 | | - | |
| 26 | + | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Lines changed: 1 addition & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | 3 | | |
7 | 4 | | |
8 | 5 | | |
| |||
126 | 123 | | |
127 | 124 | | |
128 | 125 | | |
129 | | - | |
130 | 126 | | |
131 | 127 | | |
132 | 128 | | |
133 | | - | |
| 129 | + | |
134 | 130 | | |
135 | 131 | | |
136 | 132 | | |
| |||
164 | 160 | | |
165 | 161 | | |
166 | 162 | | |
167 | | - | |
168 | 163 | | |
169 | 164 | | |
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | 1 | | |
5 | 2 | | |
6 | 3 | | |
7 | 4 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 5 | | |
12 | 6 | | |
13 | 7 | | |
| |||
17 | 11 | | |
18 | 12 | | |
19 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
292 | | - | |
| 292 | + | |
293 | 293 | | |
294 | 294 | | |
295 | 295 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | 2 | | |
6 | 3 | | |
7 | 4 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
| 407 | + | |
408 | 408 | | |
409 | | - | |
| 409 | + | |
410 | 410 | | |
411 | 411 | | |
| 412 | + | |
| 413 | + | |
412 | 414 | | |
413 | 415 | | |
414 | 416 | | |
| |||
Lines changed: 9 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| 370 | + | |
370 | 371 | | |
371 | 372 | | |
372 | 373 | | |
373 | | - | |
374 | | - | |
| 374 | + | |
| 375 | + | |
375 | 376 | | |
376 | 377 | | |
377 | | - | |
| 378 | + | |
| 379 | + | |
378 | 380 | | |
379 | 381 | | |
380 | 382 | | |
381 | | - | |
| 383 | + | |
382 | 384 | | |
383 | 385 | | |
384 | 386 | | |
| |||
426 | 428 | | |
427 | 429 | | |
428 | 430 | | |
429 | | - | |
| 431 | + | |
430 | 432 | | |
431 | | - | |
| 433 | + | |
432 | 434 | | |
433 | 435 | | |
434 | 436 | | |
| |||
0 commit comments