Skip to content

Commit 0886d47

Browse files
chore: depend on n4e 6.7.0 and compile the unified path against either version
The 7.0.0 dependency could not be satisfied anywhere. Every editor available today - 6000.7.0a6 and current trunk alike - lists com.unity.netcode 6.7.0 as mustBeBundled in its manifest, so UPM drops a 7.0.0 request silently: no assemblies, no packages-lock entry, no warning. upm-pvp then fails hard with "depends on com.unity.netcode, which is not in the lock file", which is what took out Validate on all three platforms and Package Test on both editors. Dependency versions are minimums, so asking for 6.7.0 resolves the bundled package today and picks up 7.0.0 by itself once an editor manifest carries it. The transport bump goes back to 2.6.0: 6.5.0 was never published (the 6.x line is editor-bundled only, latest published is 2.7.4), so it fails PVP-160-1, which the Validate job explicitly requires - and N4E asks for 6.5.0 itself, so resolution is unaffected either way. With the dependency resolving everywhere, nothing needs a trunk editor and validation_editors goes back to what develop had. Since either version can now be what resolves, the unified path compiles against both, gated on a UNIFIED_NETCODE_7_0_0 versionDefine keyed to the resolved package version. The 6.7.0 spellings are aliased to the 7.0.0 names so the use sites read the same either way, except N4E's Netcode class: inside namespace Unity.Netcode that name binds to the enclosing namespace before any file-scope alias is considered, so it is aliased as EntitiesNetcode in both. GhostObjectScaleExtensions is 7.0.0-only, since 6.7.0 still has the method it stands in for. That also makes the dependency real rather than dropped, which has consequences worth knowing: N4E's assemblies now build in every project, its ClientServerBootstrap becomes the Entities bootstrap with a non-zero AutoConnectPort, and it writes a NetcodeConfig into the project when its settings asset does not resolve one - which is why the GlobalNetCodeConfig field goes back to the 6.7.0 spelling here. Verified on 6000.7.0a6 against both versions: shipping (unified off), unified against bundled 6.7.0, and unified against 7.0.0 all compile with zero errors, and the standards check is clean.
1 parent fc2021d commit 0886d47

16 files changed

Lines changed: 74 additions & 26 deletions

.yamato/project.metafile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,9 @@ test_platforms:
175175
# Editors to be used for testing. NGOv3.X official support started from 6000.7 editor
176176
# TODO: When a new editor will be released it should be added to this list
177177

178-
# TEMPORARY: only trunk has dropped Netcode for Entities as a core package, so only there does the
179-
# com.unity.netcode 7.0.0 dependency resolve. A released editor bundles 6.7.0 as a built-in package and
180-
# UPM then drops the 7.0.0 request silently, leaving N4E out of the project entirely - which still
181-
# compiles, since the unified API is opt-in. `default` runs the jobs that should see N4E present.
182-
# `minimal` stays on a released editor: it is what the standards job opens the project with, and trunk
183-
# rewrites ProjectVersion.txt out from under the cleanliness check. Restore `default` once a released
184-
# editor ships without N4E as a core package; `all` is left alone as the reminder.
185178
validation_editors:
186179
default:
187-
- trunk
180+
- 6000.7
188181
all:
189182
- 6000.7.0a6
190183
- 6000.7

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ Additional documentation and release notes are available at [Multiplayer Documen
1010

1111
### Added
1212

13-
- Netcode for Entities (`com.unity.netcode` 7.0.0) is now a dependency, so installing Netcode for GameObjects also brings it, and its own dependencies (Entities, Burst, Collections), into the project.
13+
- Netcode for Entities (`com.unity.netcode` 6.7.0) is now a dependency, so installing Netcode for GameObjects also brings it, and its own dependencies (Entities, Burst, Collections), into the project.
1414

1515
### Changed
1616

17-
- The `com.unity.transport` dependency moved from 2.6.0 to 6.5.0, the version Netcode for Entities 7.0.0 requires.
18-
1917
- Changed `NetworkTransform.UseHalfFloatPrecision` to synchronize position with a resolution of approximately 1mm regardless of how far an object has travelled. Previously the resolution could degrade to approximately 3cm. This does not increase bandwidth, but projects using `NetworkTransform.UseUnreliableDeltas` will send full precision position updates more often. (#4129)
2018

2119
- All editor assembly definitions are renamed with `Unity.Netcode.GameObjects.x` variants

com.unity.netcode.gameobjects/Editor/NetworkObjectEditor.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
using System.Collections.Generic;
22
#if UNIFIED_NETCODE
3+
#if UNIFIED_NETCODE_7_0_0
34
using Unity.Netcode.Editor;
5+
#else
6+
using Unity.NetCode;
7+
using Unity.NetCode.Editor;
8+
#endif
49
#endif
510
using UnityEditor;
611
using UnityEngine;

com.unity.netcode.gameobjects/Editor/Unity.Netcode.Editor.asmdef

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
"autoReferenced": true,
2222
"defineConstraints": [],
2323
"versionDefines": [
24+
{
25+
"name": "com.unity.netcode",
26+
"expression": "7.0.0",
27+
"define": "UNIFIED_NETCODE_7_0_0"
28+
},
2429
{
2530
"name": "com.unity.multiplayer.tools",
2631
"expression": "",

com.unity.netcode.gameobjects/Runtime/Components/Helpers/NetworkObjectBridge.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
#if UNIFIED_NETCODE
22
using Unity.Mathematics;
3+
#if !UNIFIED_NETCODE_7_0_0
4+
using Unity.NetCode;
5+
#endif
36
using Unity.Transforms;
47
using UnityEngine;
58

@@ -87,10 +90,12 @@ internal void ApplyScale(Vector3 scale)
8790
}
8891
}
8992

93+
#if UNIFIED_NETCODE_7_0_0
9094
/// <summary>
91-
/// Stands in for N4E's <c>GhostObject.ApplyPostTransformMatrixScale</c>, removed by the 6.7.0 non-uniform
92-
/// scale rework that gave the GameObject-to-entity transform sync ownership of the
93-
/// <see cref="PostTransformMatrix"/>. Remove this once N4E exposes a supported way to push scale to a ghost.
95+
/// Stands in for N4E's <c>GhostObject.ApplyPostTransformMatrixScale</c>, which 7.0.0 removed along with the
96+
/// non-uniform scale rework that gave the GameObject-to-entity transform sync ownership of the
97+
/// <see cref="PostTransformMatrix"/>. 6.7.0 still has the method, so this is only compiled against 7.0.0.
98+
/// Remove it once N4E exposes a supported way to push scale to a ghost.
9499
/// </summary>
95100
internal static class GhostObjectScaleExtensions
96101
{
@@ -123,5 +128,6 @@ internal static void ApplyPostTransformMatrixScale(this GhostObject ghost, Vecto
123128
entityManager.SetComponentData(entity, localTransform);
124129
}
125130
}
131+
#endif
126132
}
127133
#endif

com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedBootstrap.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
#if UNIFIED_NETCODE
55
using System;
66
using Unity.Entities;
7+
#if !UNIFIED_NETCODE_7_0_0
8+
using Unity.NetCode;
9+
#endif
710
using UnityEngine;
811

912
namespace Unity.Netcode

com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedUpdateConnections.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
using System.Collections.Generic;
33
using Unity.Collections;
44
using Unity.Entities;
5+
#if !UNIFIED_NETCODE_7_0_0
6+
using Unity.NetCode;
7+
#endif
58
using UnityEngine;
69

710
namespace Unity.Netcode.Components

com.unity.netcode.gameobjects/Runtime/Core/NetworkManager.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
using Unity.Collections;
55
#if UNIFIED_NETCODE
66
using Unity.Entities;
7+
// N4E's own Netcode class cannot be aliased as "Netcode": inside namespace Unity.Netcode that name
8+
// resolves to the enclosing Unity.Netcode namespace before any file-scope alias is considered, so it gets
9+
// its own name here. 6.7.0 additionally keeps the config and world types under the older Unity.NetCode
10+
// casing, aliased to the 7.0.0 spellings so the use sites below read the same either way.
11+
#if UNIFIED_NETCODE_7_0_0
12+
using EntitiesNetcode = Unity.Netcode.Netcode;
13+
#else
14+
using EntitiesNetcode = Unity.NetCode.Netcode;
15+
using NetcodeConfig = Unity.NetCode.NetCodeConfig;
16+
using NetcodeWorld = Unity.NetCode.NetcodeWorld;
17+
#endif
718
#endif
819
using Unity.Netcode.Components;
920
using Unity.Netcode.GameObjects.Timing;
@@ -1370,13 +1381,13 @@ internal void InitializeNetcodeWorld()
13701381

13711382
if (this == Singleton)
13721383
{
1373-
if (Netcode.IsActive)
1384+
if (EntitiesNetcode.IsActive)
13741385
{
13751386
Log.Info(new Context(LogLevel.Normal, "Netcode is not active but has an instance at this point."));
13761387
}
13771388
/// !! Important !!
13781389
/// Clear out any pre-existing configuration in the event this applicatioin instance has already been connected to a session.
1379-
Netcode.Reset();
1390+
EntitiesNetcode.Reset();
13801391
}
13811392

13821393
/// !! Initialize worlds here !!

com.unity.netcode.gameobjects/Runtime/Core/NetworkObject.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
using Unity.Netcode.Components;
88
using Unity.Netcode.Logging;
99
using Unity.Netcode.Runtime;
10-
#if UNIFIED_NETCODE
10+
#if UNIFIED_NETCODE && !UNIFIED_NETCODE_7_0_0
11+
using Unity.NetCode;
1112
#endif
1213

1314
#if UNITY_EDITOR

com.unity.netcode.gameobjects/Runtime/Spawning/NetworkPrefabHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Collections.Generic;
3-
#if UNIFIED_NETCODE
3+
#if UNIFIED_NETCODE && !UNIFIED_NETCODE_7_0_0
4+
using Unity.NetCode;
45
#endif
56
using UnityEngine;
67

0 commit comments

Comments
 (0)