Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,16 @@

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

Check warning on line 32 in com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedBootstrap.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

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

Added line #L32 was not covered by tests

private static void RegisterCreatedWorlds()
{
for (int i = s_CreatedWorlds.Count - 1; i >= 0; i--)
for (int i = k_CreatedWorlds.Count - 1; i >= 0; i--)

Check warning on line 36 in com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedBootstrap.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

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

Added line #L36 was not covered by tests
{
var world = s_CreatedWorlds[i];
var world = k_CreatedWorlds[i];

Check warning on line 38 in com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedBootstrap.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

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

Added line #L38 was not covered by tests
if (!world.IsCreated)
{
s_CreatedWorlds.RemoveAt(i);
k_CreatedWorlds.RemoveAt(i);

Check warning on line 41 in com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedBootstrap.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

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

Added line #L41 was not covered by tests
continue;
}
// A single world host is registered as both a server and a client world, the same as N4E does.
Expand Down Expand Up @@ -94,7 +94,7 @@
}

networkManager.NetcodeWorld = (NetcodeWorld)world;
s_CreatedWorlds.Add(networkManager.NetcodeWorld);
k_CreatedWorlds.Add(networkManager.NetcodeWorld);

Check warning on line 97 in com.unity.netcode.gameobjects/Runtime/Components/Helpers/UnifiedBootstrap.cs

View check run for this annotation

Codecov GitHub.com / codecov/patch

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

Added line #L97 was not covered by tests
}
else
{
Expand Down
7 changes: 7 additions & 0 deletions dotnet-tools/netcode.standards/ExcludeGenerators.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project>
<!-- dotnet format: skip Entities / Netcode for Entities source generators (slow, and they can't resolve the Unity project path outside the Editor) -->
<ItemGroup>
<Analyzer Remove="$(MSBuildProjectDirectory)/Library/PackageCache/com.unity.netcode@*/**/*.dll" />
<Analyzer Remove="$(MSBuildProjectDirectory)/Library/PackageCache/com.unity.entities@*/**/*.dll" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions dotnet-tools/netcode.standards/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ private static int Main(
foreach (var file in Directory.GetFiles(project, pattern))
{
var procInfo = new ProcessStartInfo("dotnet");
procInfo.Environment["CustomAfterMicrosoftCommonTargets"] = Path.Combine(AppContext.BaseDirectory, "ExcludeGenerators.targets");

procInfo.Arguments = check
? $"format whitespace {file} --no-restore --verify-no-changes --verbosity {verbosity}"
Expand Down
6 changes: 5 additions & 1 deletion dotnet-tools/netcode.standards/netcode.standards.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@
<PackageReference Include="System.CommandLine.DragonFruit" Version="0.3.0-alpha.21216.1" />
</ItemGroup>

</Project>
<ItemGroup>
<None Include="ExcludeGenerators.targets" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

</Project>
Loading