Skip to content

Commit 22482e9

Browse files
Merge branch 'develop' into codecov-integration-develop
2 parents 1f3a652 + 4836328 commit 22482e9

33 files changed

+682
-487
lines changed

.yamato/wrench/api-validation-jobs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ api_validation_-_netcode_gameobjects_-_2021_3_-_windows:
2020
- command: npm install upm-ci-utils@stable -g --registry https://artifactory.prd.cds.internal.unity3d.com/artifactory/api/npm/upm-npm
2121
timeout: 20
2222
retries: 10
23-
- command: unity-downloader-cli -u 2021.3/staging -c Editor --fast
23+
- command: unity-downloader-cli -u 2021.3/staging -c editor --path .Editor --fast
2424
timeout: 10
2525
retries: 3
2626
- command: python PythonScripts/PackageJsonCondersor.py
@@ -51,8 +51,8 @@ api_validation_-_netcode_gameobjects_-_2021_3_-_windows:
5151
dependencies:
5252
- path: .yamato/wrench/package-pack-jobs.yml#package_pack_-_netcode_gameobjects
5353
variables:
54-
UPMPVP_CONTEXT_WRENCH: 0.11.3.0
54+
UPMPVP_CONTEXT_WRENCH: 0.12.1.0
5555
metadata:
5656
Job Maintainers: '#rm-packageworks'
57-
Wrench: 0.11.3.0
57+
Wrench: 0.12.1.0
5858

.yamato/wrench/package-pack-jobs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ package_pack_-_netcode_gameobjects:
2424
UPMCI_ACK_LARGE_PACKAGE: 1
2525
metadata:
2626
Job Maintainers: '#rm-packageworks'
27-
Wrench: 0.11.3.0
27+
Wrench: 0.12.1.0
2828

.yamato/wrench/preview-a-p-v.yml

Lines changed: 55 additions & 55 deletions
Large diffs are not rendered by default.

.yamato/wrench/promotion-jobs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,10 @@ publish_dry_run_netcode_gameobjects:
208208
ignore_artifact: true
209209
variables:
210210
UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1
211-
UPMPVP_CONTEXT_WRENCH: 0.11.3.0
211+
UPMPVP_CONTEXT_WRENCH: 0.12.1.0
212212
metadata:
213213
Job Maintainers: '#rm-packageworks'
214-
Wrench: 0.11.3.0
214+
Wrench: 0.12.1.0
215215

216216
# Publish for netcode.gameobjects to https://artifactory-slo.bf.unity3d.com/artifactory/api/npm/upm-npm
217217
publish_netcode_gameobjects:
@@ -420,8 +420,8 @@ publish_netcode_gameobjects:
420420
ignore_artifact: true
421421
variables:
422422
UPMPVP_ACK_UPMPVP_DOES_NO_API_VALIDATION: 1
423-
UPMPVP_CONTEXT_WRENCH: 0.11.3.0
423+
UPMPVP_CONTEXT_WRENCH: 0.12.1.0
424424
metadata:
425425
Job Maintainers: '#rm-packageworks'
426-
Wrench: 0.11.3.0
426+
Wrench: 0.12.1.0
427427

.yamato/wrench/recipe-regeneration.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ test_-_wrench_jobs_up_to_date:
99
type: Unity::VM
1010
flavor: b1.large
1111
commands:
12-
- command: dotnet run --project Tools\CI\NGO.Cookbook.csproj
12+
- command: dotnet run --project Tools/CI/NGO.Cookbook.csproj
1313
- command: |-
1414
if [ -n "$(git status --porcelain -- .yamato/wrench)" ]; then
1515
git status
1616
echo "Your repo is not clean - diff output:"
1717
git diff
1818
echo "You must run recipe generation after updating recipes to update the generated YAML!"
19-
echo "Run 'dotnet run --project Tools\CI\NGO.Cookbook.csproj' from the root of your repository to regenerate all job definitions created by wrench."
19+
echo "Run 'dotnet run --project Tools/CI/NGO.Cookbook.csproj' from the root of your repository to regenerate all job definitions created by wrench."
2020
exit 1
2121
fi
2222
variables:
@@ -26,5 +26,5 @@ test_-_wrench_jobs_up_to_date:
2626
cancel_old_ci: true
2727
metadata:
2828
Job Maintainers: '#rm-packageworks'
29-
Wrench: 0.11.3.0
29+
Wrench: 0.12.1.0
3030

.yamato/wrench/validation-jobs.yml

Lines changed: 162 additions & 162 deletions
Large diffs are not rendered by default.

.yamato/wrench/wrench_config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"publishing_job": ".yamato/wrench/promotion-jobs.yml#publish_netcode_gameobjects",
3333
"branch_pattern": "ReleaseSlash",
34-
"wrench_version": "0.11.3.0",
34+
"wrench_version": "0.12.1.0",
3535
"pvp_exemption_path": ".yamato/wrench/pvp-exemptions.json",
36-
"cs_project_path": "Tools\\CI\\NGO.Cookbook.csproj"
36+
"cs_project_path": "Tools/CI/NGO.Cookbook.csproj"
3737
}

Tools/CI/NGO.Cookbook.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="RecipeEngine.Modules.Wrench" Version="0.11.3" />
11+
<PackageReference Include="RecipeEngine.Modules.Wrench" Version="0.12.1" />
1212
</ItemGroup>
1313

1414
</Project>

Tools/CI/Settings/NGOSettings.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,22 @@ public class NGOSettings : AnnotatedSettingsBase
99
// Path from the root of the repository where packages are located.
1010
readonly string[] packagesRootPaths = {"."};
1111

12+
static ValidationOptions validationOptions = new ValidationOptions()
13+
{
14+
ProjectPath = "testproject",
15+
UtrTestingYamatoTimeout = 40
16+
};
17+
1218
// update this to list all packages in this repo that you want to release.
1319
Dictionary<string, PackageOptions> PackageOptions = new()
1420
{
1521
{
1622
"com.unity.netcode.gameobjects",
17-
new PackageOptions() { ReleaseOptions = new ReleaseOptions() { IsReleasing = true } }
23+
new PackageOptions()
24+
{
25+
ReleaseOptions = new ReleaseOptions() { IsReleasing = true },
26+
ValidationOptions = validationOptions
27+
}
1828
}
1929
};
2030

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
1515

1616
### Fixed
1717

18+
- Fixed `NullReferenceException` on `NetworkList` when used without a NetworkManager in scene. (#3502)
1819
- Fixed inconsistencies in the `OnSceneEvent` callback. (#3487)
1920
- Fixed issue where `NetworkClient` could persist some settings if re-using the same `NetworkManager` instance. (#3494)
2021
- Fixed issue where a pooled `NetworkObject` was not resetting the internal latest parent property when despawned. (#3494)

com.unity.netcode.gameobjects/Runtime/Configuration/NetworkConfig.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public class NetworkConfig
3131
[Tooltip("When set, NetworkManager will automatically create and spawn the assigned player prefab. This can be overridden by adding it to the NetworkPrefabs list and selecting override.")]
3232
public GameObject PlayerPrefab;
3333

34+
/// <summary>
35+
/// The collection of network prefabs available for spawning across the network.
36+
/// </summary>
3437
[SerializeField]
3538
public NetworkPrefabs Prefabs = new NetworkPrefabs();
3639

com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefab.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ public class NetworkPrefab
5757
/// </summary>
5858
public GameObject OverridingTargetPrefab;
5959

60+
/// <summary>
61+
/// Compares this NetworkPrefab with another to determine equality.
62+
/// </summary>
63+
/// <param name="other">The NetworkPrefab to compare against.</param>
64+
/// <returns>True if all fields match between the two NetworkPrefabs, false otherwise.</returns>
6065
public bool Equals(NetworkPrefab other)
6166
{
6267
return Override == other.Override &&
@@ -66,6 +71,12 @@ public bool Equals(NetworkPrefab other)
6671
OverridingTargetPrefab == other.OverridingTargetPrefab;
6772
}
6873

74+
/// <summary>
75+
/// Gets the GlobalObjectIdHash of the source prefab based on the current override settings.
76+
/// </summary>
77+
/// <value>The hash value identifying the source prefab.</value>
78+
/// <exception cref="InvalidOperationException">Thrown when required prefab references are missing or invalid.</exception>
79+
/// <exception cref="ArgumentOutOfRangeException">Thrown when Override has an invalid value.</exception>
6980
public uint SourcePrefabGlobalObjectIdHash
7081
{
7182
get
@@ -98,6 +109,12 @@ public uint SourcePrefabGlobalObjectIdHash
98109
}
99110
}
100111

112+
/// <summary>
113+
/// Gets the GlobalObjectIdHash of the target prefab when using prefab overrides.
114+
/// </summary>
115+
/// <value>The hash value identifying the target prefab, or 0 if no override is set.</value>
116+
/// <exception cref="InvalidOperationException">Thrown when required prefab references are missing or invalid.</exception>
117+
/// <exception cref="ArgumentOutOfRangeException">Thrown when Override has an invalid value.</exception>
101118
public uint TargetPrefabGlobalObjectIdHash
102119
{
103120
get
@@ -122,6 +139,11 @@ public uint TargetPrefabGlobalObjectIdHash
122139
}
123140
}
124141

142+
/// <summary>
143+
/// Validates the NetworkPrefab configuration to ensure all required fields are properly set.
144+
/// </summary>
145+
/// <param name="index">Optional index used for error reporting when validating lists of prefabs.</param>
146+
/// <returns>True if the NetworkPrefab is valid and ready for use, false otherwise.</returns>
125147
public bool Validate(int index = -1)
126148
{
127149
NetworkObject networkObject;
@@ -224,6 +246,10 @@ public bool Validate(int index = -1)
224246
return true;
225247
}
226248

249+
/// <summary>
250+
/// Returns a string representation of this NetworkPrefab's source and target hash values.
251+
/// </summary>
252+
/// <returns>A string containing the source and target hash values.</returns>
227253
public override string ToString()
228254
{
229255
return $"{{SourceHash: {SourceHashToOverride}, TargetHash: {TargetPrefabGlobalObjectIdHash}}}";

com.unity.netcode.gameobjects/Runtime/Configuration/NetworkPrefabs.cs

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ public class NetworkPrefabs
3434
/// This is used for the legacy way of spawning NetworkPrefabs with an override when manually instantiating and spawning.
3535
/// To handle multiple source NetworkPrefab overrides that all point to the same target NetworkPrefab use
3636
/// <see cref="NetworkSpawnManager.InstantiateAndSpawn(NetworkObject, ulong, bool, bool, bool, Vector3, Quaternion)"/>
37-
/// or <see cref="NetworkObject.InstantiateAndSpawn(NetworkManager, ulong, bool, bool, bool, Vector3, Quaternion)"/>
37+
/// or <see cref="NetworkObject.InstantiateAndSpawn(NetworkManager, ulong, bool, bool, bool, Vector3, Quaternion)"/>.
3838
/// </summary>
3939
[NonSerialized]
4040
public Dictionary<uint, uint> OverrideToNetworkPrefab = new Dictionary<uint, uint>();
4141

42+
/// <summary>
43+
/// Gets the read-only list of all registered network prefabs.
44+
/// </summary>
4245
public IReadOnlyList<NetworkPrefab> Prefabs => m_Prefabs;
4346

4447
[NonSerialized]
@@ -62,14 +65,16 @@ private void RemoveTriggeredByNetworkPrefabList(NetworkPrefab networkPrefab)
6265
m_Prefabs.Remove(networkPrefab);
6366
}
6467

68+
/// <summary>
69+
/// Destructor that cleans up network prefab resources.
70+
/// </summary>
6571
~NetworkPrefabs()
6672
{
6773
Shutdown();
6874
}
6975

7076
/// <summary>
71-
/// Deregister from add and remove events
72-
/// Clear the list
77+
/// Deregister from add and remove events and clear the events.
7378
/// </summary>
7479
internal void Shutdown()
7580
{
@@ -84,6 +89,7 @@ internal void Shutdown()
8489
/// Processes the <see cref="NetworkPrefabsList"/> if one is present for use during runtime execution,
8590
/// else processes <see cref="Prefabs"/>.
8691
/// </summary>
92+
/// <param name="warnInvalid">When true, logs warnings about invalid prefabs that are removed during initialization.</param>
8793
public void Initialize(bool warnInvalid = true)
8894
{
8995
m_Prefabs.Clear();
@@ -154,11 +160,12 @@ public void Initialize(bool warnInvalid = true)
154160
}
155161

156162
/// <summary>
157-
/// Add a new NetworkPrefab instance to the list
163+
/// Add a new NetworkPrefab instance to the list.
158164
/// </summary>
165+
/// <param name="networkPrefab">The <see cref="NetworkPrefab"/> to add.</param>
166+
/// <returns>True if the prefab was successfully added, false if it was invalid or already registered</returns>
159167
/// <remarks>
160-
/// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.
161-
///
168+
/// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.<br />
162169
/// Any modifications made here are not persisted. Permanent configuration changes should be done
163170
/// through the <see cref="NetworkPrefabsList"/> scriptable object property.
164171
/// </remarks>
@@ -175,11 +182,11 @@ public bool Add(NetworkPrefab networkPrefab)
175182
}
176183

177184
/// <summary>
178-
/// Remove a NetworkPrefab instance from the list
185+
/// Remove a NetworkPrefab instance from the list.
179186
/// </summary>
187+
/// <param name="prefab">The <see cref="NetworkPrefab"/> to remove.</param>
180188
/// <remarks>
181-
/// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.
182-
///
189+
/// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.<br />
183190
/// Any modifications made here are not persisted. Permanent configuration changes should be done
184191
/// through the <see cref="NetworkPrefabsList"/> scriptable object property.
185192
/// </remarks>
@@ -197,11 +204,11 @@ public void Remove(NetworkPrefab prefab)
197204
}
198205

199206
/// <summary>
200-
/// Remove a NetworkPrefab instance with matching <see cref="NetworkPrefab.Prefab"/> from the list
207+
/// Remove a NetworkPrefab instance with matching <see cref="NetworkPrefab.Prefab"/> from the list.
201208
/// </summary>
209+
/// <param name="prefab">The <see cref="GameObject"/> to match against for removal.</param>
202210
/// <remarks>
203-
/// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.
204-
///
211+
/// The framework does not synchronize this list between clients. Any runtime changes must be handled manually.<br />
205212
/// Any modifications made here are not persisted. Permanent configuration changes should be done
206213
/// through the <see cref="NetworkPrefabsList"/> scriptable object property.
207214
/// </remarks>
@@ -232,10 +239,10 @@ public void Remove(GameObject prefab)
232239
}
233240

234241
/// <summary>
235-
/// Check if the given GameObject is present as a prefab within the list
242+
/// Check if the given GameObject is present as a prefab within the list.
236243
/// </summary>
237-
/// <param name="prefab">The prefab to check</param>
238-
/// <returns>Whether or not the prefab exists</returns>
244+
/// <param name="prefab">The prefab to check.</param>
245+
/// <returns>True if the prefab exists or false if it does not.</returns>
239246
public bool Contains(GameObject prefab)
240247
{
241248
for (int i = 0; i < m_Prefabs.Count; i++)
@@ -251,10 +258,10 @@ public bool Contains(GameObject prefab)
251258
}
252259

253260
/// <summary>
254-
/// Check if the given NetworkPrefab is present within the list
261+
/// Check if the given NetworkPrefab is present within the list.
255262
/// </summary>
256-
/// <param name="prefab">The prefab to check</param>
257-
/// <returns>Whether or not the prefab exists</returns>
263+
/// <param name="prefab">The prefab to check.</param>
264+
/// <returns>True if the prefab exists or false if it does not.</returns>
258265
public bool Contains(NetworkPrefab prefab)
259266
{
260267
for (int i = 0; i < m_Prefabs.Count; i++)
@@ -269,7 +276,7 @@ public bool Contains(NetworkPrefab prefab)
269276
}
270277

271278
/// <summary>
272-
/// Configures <see cref="NetworkPrefabOverrideLinks"/> for the given <see cref="NetworkPrefab"/>
279+
/// Configures <see cref="NetworkPrefabOverrideLinks"/> for the given <see cref="NetworkPrefab"/>.
273280
/// </summary>
274281
private bool AddPrefabRegistration(NetworkPrefab networkPrefab)
275282
{

0 commit comments

Comments
 (0)