Skip to content

Commit 2f0ade5

Browse files
Merge remote-tracking branch 'origin/feat/hybrid-spawn-analytics' into feat/hybrid-spawn-analytics
2 parents 54c9386 + 3f145d9 commit 2f0ade5

6 files changed

Lines changed: 42 additions & 24 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ preview_apv_-_6000_7_-_macos13arm:
7575
UNITY_LICENSING_SERVER_DELETE_ULF: 0
7676
UNITY_LICENSING_SERVER_TOOLSET: pro
7777
UPMPVP_CONTEXT_WRENCH: 3.11.5.0
78-
WRENCH_LOCALAPV_URL: https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-3-19_94a756eb601d84c127a989866172fdd530ec62aa5d9611a9c9898a625926ec62.zip
78+
WRENCH_LOCALAPV_URL: https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-3-24_1493dea1e0eb932938365a4a53ec2091ec007ceec57eea844d15a058eddedc9f.zip
7979
metadata:
8080
Job Maintainers: '#rm-packageworks'
8181
Wrench: 3.11.5.0
@@ -134,7 +134,7 @@ preview_apv_-_6000_7_-_ubuntu2204:
134134
UNITY_LICENSING_SERVER_DELETE_ULF: 0
135135
UNITY_LICENSING_SERVER_TOOLSET: pro
136136
UPMPVP_CONTEXT_WRENCH: 3.11.5.0
137-
WRENCH_LOCALAPV_URL: https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-3-19_94a756eb601d84c127a989866172fdd530ec62aa5d9611a9c9898a625926ec62.zip
137+
WRENCH_LOCALAPV_URL: https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-3-24_1493dea1e0eb932938365a4a53ec2091ec007ceec57eea844d15a058eddedc9f.zip
138138
metadata:
139139
Job Maintainers: '#rm-packageworks'
140140
Wrench: 3.11.5.0
@@ -194,7 +194,7 @@ preview_apv_-_6000_7_-_win10:
194194
UNITY_LICENSING_SERVER_DELETE_ULF: 0
195195
UNITY_LICENSING_SERVER_TOOLSET: pro
196196
UPMPVP_CONTEXT_WRENCH: 3.11.5.0
197-
WRENCH_LOCALAPV_URL: https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-3-19_94a756eb601d84c127a989866172fdd530ec62aa5d9611a9c9898a625926ec62.zip
197+
WRENCH_LOCALAPV_URL: https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-3-24_1493dea1e0eb932938365a4a53ec2091ec007ceec57eea844d15a058eddedc9f.zip
198198
metadata:
199199
Job Maintainers: '#rm-packageworks'
200200
Wrench: 3.11.5.0
@@ -254,7 +254,7 @@ preview_apv_-_7000_0_-_macos13arm:
254254
UNITY_LICENSING_SERVER_DELETE_ULF: 0
255255
UNITY_LICENSING_SERVER_TOOLSET: pro
256256
UPMPVP_CONTEXT_WRENCH: 3.11.5.0
257-
WRENCH_LOCALAPV_URL: https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-3-19_94a756eb601d84c127a989866172fdd530ec62aa5d9611a9c9898a625926ec62.zip
257+
WRENCH_LOCALAPV_URL: https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-3-24_1493dea1e0eb932938365a4a53ec2091ec007ceec57eea844d15a058eddedc9f.zip
258258
metadata:
259259
Job Maintainers: '#rm-packageworks'
260260
Wrench: 3.11.5.0
@@ -313,7 +313,7 @@ preview_apv_-_7000_0_-_ubuntu2204:
313313
UNITY_LICENSING_SERVER_DELETE_ULF: 0
314314
UNITY_LICENSING_SERVER_TOOLSET: pro
315315
UPMPVP_CONTEXT_WRENCH: 3.11.5.0
316-
WRENCH_LOCALAPV_URL: https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-3-19_94a756eb601d84c127a989866172fdd530ec62aa5d9611a9c9898a625926ec62.zip
316+
WRENCH_LOCALAPV_URL: https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-3-24_1493dea1e0eb932938365a4a53ec2091ec007ceec57eea844d15a058eddedc9f.zip
317317
metadata:
318318
Job Maintainers: '#rm-packageworks'
319319
Wrench: 3.11.5.0
@@ -373,7 +373,7 @@ preview_apv_-_7000_0_-_win10:
373373
UNITY_LICENSING_SERVER_DELETE_ULF: 0
374374
UNITY_LICENSING_SERVER_TOOLSET: pro
375375
UPMPVP_CONTEXT_WRENCH: 3.11.5.0
376-
WRENCH_LOCALAPV_URL: https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-3-19_94a756eb601d84c127a989866172fdd530ec62aa5d9611a9c9898a625926ec62.zip
376+
WRENCH_LOCALAPV_URL: https://artifactory.prd.it.unity3d.com/artifactory/stevedore-unity-internal/wrench-localapv/1-3-24_1493dea1e0eb932938365a4a53ec2091ec007ceec57eea844d15a058eddedc9f.zip
377377
metadata:
378378
Job Maintainers: '#rm-packageworks'
379379
Wrench: 3.11.5.0

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ internal class UnifiedBootstrap : ClientServerBootstrap
2929

3030
// Every ClientServerBootstrap constructor clears N4E's ServerWorlds and ClientWorlds, and each NetworkManager
3131
// creates its own bootstrap, so the worlds created for other NetworkManagers are registered again.
32-
private static readonly List<NetcodeWorld> s_CreatedWorlds = new List<NetcodeWorld>();
32+
private static readonly List<NetcodeWorld> k_CreatedWorlds = new List<NetcodeWorld>();
3333

3434
private static void RegisterCreatedWorlds()
3535
{
36-
for (int i = s_CreatedWorlds.Count - 1; i >= 0; i--)
36+
for (int i = k_CreatedWorlds.Count - 1; i >= 0; i--)
3737
{
38-
var world = s_CreatedWorlds[i];
38+
var world = k_CreatedWorlds[i];
3939
if (!world.IsCreated)
4040
{
41-
s_CreatedWorlds.RemoveAt(i);
41+
k_CreatedWorlds.RemoveAt(i);
4242
continue;
4343
}
4444
// A single world host is registered as both a server and a client world, the same as N4E does.
@@ -94,7 +94,7 @@ public override bool Initialize(string defaultWorldName)
9494
}
9595

9696
networkManager.NetcodeWorld = (NetcodeWorld)world;
97-
s_CreatedWorlds.Add(networkManager.NetcodeWorld);
97+
k_CreatedWorlds.Add(networkManager.NetcodeWorld);
9898
}
9999
else
100100
{

‎com.unity.netcode.gameobjects/Tests/Runtime/Rpc/UniversalRpcTests.cs‎

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -528,6 +528,12 @@ public void SelfRecursiveRpc()
528528
}
529529
}
530530

531+
internal static class ClientIdArrayExtensions
532+
{
533+
// Not named Contains: from C# 14, ids.Contains(id) on an array is ambiguous between span extension methods.
534+
public static bool ContainsId(this ulong[] ids, ulong id) => Array.IndexOf(ids, id) >= 0;
535+
}
536+
531537
internal class UniversalRpcTestsBase : NetcodeIntegrationTest
532538
{
533539
public static int YieldCheck = 0;
@@ -1557,12 +1563,12 @@ private void SendingWithGroupOverride(SendTo defaultSendTo, ulong[] recipient, u
15571563
var sendMethod = senderObject.GetType().GetMethod(sendMethodName);
15581564
sendMethod.Invoke(senderObject, new object[] { (RpcParams)target });
15591565

1560-
VerifyRemoteReceived(objectOwner, sender, sendMethodName, s_ClientIds.Where(c => recipient.Contains(c)).ToArray(), false);
1561-
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => !recipient.Contains(c)).ToArray());
1566+
VerifyRemoteReceived(objectOwner, sender, sendMethodName, s_ClientIds.Where(c => recipient.ContainsId(c)).ToArray(), false);
1567+
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => !recipient.ContainsId(c)).ToArray());
15621568

15631569
// Pass some time to make sure that no other client ever receives this
15641570
TimeTravel(1f, 30);
1565-
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => !recipient.Contains(c)).ToArray());
1571+
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => !recipient.ContainsId(c)).ToArray());
15661572
}
15671573

15681574
private void SendingWithGroupNotOverride(SendTo defaultSendTo, ulong[] recipient, ulong objectOwner, ulong sender, AllocationType allocationType)
@@ -1600,12 +1606,12 @@ private void SendingWithGroupNotOverride(SendTo defaultSendTo, ulong[] recipient
16001606
var sendMethod = senderObject.GetType().GetMethod(sendMethodName);
16011607
sendMethod.Invoke(senderObject, new object[] { (RpcParams)target });
16021608

1603-
VerifyRemoteReceived(objectOwner, sender, sendMethodName, s_ClientIds.Where(c => !recipient.Contains(c)).ToArray(), false);
1604-
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => recipient.Contains(c)).ToArray());
1609+
VerifyRemoteReceived(objectOwner, sender, sendMethodName, s_ClientIds.Where(c => !recipient.ContainsId(c)).ToArray(), false);
1610+
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => recipient.ContainsId(c)).ToArray());
16051611

16061612
// Pass some time to make sure that no other client ever receives this
16071613
TimeTravel(1f, 30);
1608-
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => recipient.Contains(c)).ToArray());
1614+
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => recipient.ContainsId(c)).ToArray());
16091615
}
16101616
#endregion
16111617

@@ -2028,12 +2034,12 @@ [Values] AllocationType allocationType
20282034
var sendMethod = senderObject.GetType().GetMethod(sendMethodName);
20292035
sendMethod.Invoke(senderObject, new object[] { (RpcParams)target });
20302036

2031-
VerifyRemoteReceived(objectOwner, sender, sendMethodName, s_ClientIds.Where(c => recipient.Contains(c)).ToArray(), false);
2032-
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => !recipient.Contains(c)).ToArray());
2037+
VerifyRemoteReceived(objectOwner, sender, sendMethodName, s_ClientIds.Where(c => recipient.ContainsId(c)).ToArray(), false);
2038+
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => !recipient.ContainsId(c)).ToArray());
20332039

20342040
// Pass some time to make sure that no other client ever receives this
20352041
TimeTravel(1f, 30);
2036-
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => !recipient.Contains(c)).ToArray());
2042+
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => !recipient.ContainsId(c)).ToArray());
20372043
}
20382044

20392045
}
@@ -2105,12 +2111,12 @@ [Values] AllocationType allocationType
21052111
var sendMethod = senderObject.GetType().GetMethod(sendMethodName);
21062112
sendMethod.Invoke(senderObject, new object[] { (RpcParams)target });
21072113

2108-
VerifyRemoteReceived(objectOwner, sender, sendMethodName, s_ClientIds.Where(c => !recipient.Contains(c)).ToArray(), false);
2109-
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => recipient.Contains(c)).ToArray());
2114+
VerifyRemoteReceived(objectOwner, sender, sendMethodName, s_ClientIds.Where(c => !recipient.ContainsId(c)).ToArray(), false);
2115+
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => recipient.ContainsId(c)).ToArray());
21102116

21112117
// Pass some time to make sure that no other client ever receives this
21122118
TimeTravel(1f, 30);
2113-
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => recipient.Contains(c)).ToArray());
2119+
VerifyNotReceived(objectOwner, s_ClientIds.Where(c => recipient.ContainsId(c)).ToArray());
21142120
}
21152121

21162122
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project>
2+
<!-- dotnet format: skip Entities / Netcode for Entities source generators (slow, and they can't resolve the Unity project path outside the Editor) -->
3+
<ItemGroup>
4+
<Analyzer Remove="$(MSBuildProjectDirectory)/Library/PackageCache/com.unity.netcode@*/**/*.dll" />
5+
<Analyzer Remove="$(MSBuildProjectDirectory)/Library/PackageCache/com.unity.entities@*/**/*.dll" />
6+
</ItemGroup>
7+
</Project>

‎dotnet-tools/netcode.standards/Program.cs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ private static int Main(
3333
foreach (var file in Directory.GetFiles(project, pattern))
3434
{
3535
var procInfo = new ProcessStartInfo("dotnet");
36+
procInfo.Environment["CustomAfterMicrosoftCommonTargets"] = Path.Combine(AppContext.BaseDirectory, "ExcludeGenerators.targets");
3637

3738
procInfo.Arguments = check
3839
? $"format whitespace {file} --no-restore --verify-no-changes --verbosity {verbosity}"

‎dotnet-tools/netcode.standards/netcode.standards.csproj‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@
1212
<PackageReference Include="System.CommandLine.DragonFruit" Version="0.3.0-alpha.21216.1" />
1313
</ItemGroup>
1414

15-
</Project>
15+
<ItemGroup>
16+
<None Include="ExcludeGenerators.targets" CopyToOutputDirectory="PreserveNewest" />
17+
</ItemGroup>
18+
19+
</Project>

0 commit comments

Comments
 (0)