Skip to content

Commit 7a6858d

Browse files
author
Unity Technologies
committed
com.unity.netcode@1.0.0-exp.13
## [1.0.0-exp.13] - 2022-10-19 ### Fixed * quaternion cannot be added as field in ICommandData and/or IInputComponentData. A new region has been added to the code-generation templates for handling similar other cases. * Removed the deprecated NativeList to NativeArray implicit cast and use NativeList.AsArray instead. * fixed a NotImplementedException thrown in standalone player client build.
1 parent e24c89b commit 7a6858d

33 files changed

+220
-179
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## [1.0.0-exp.13] - 2022-10-19
4+
5+
### Fixed
6+
7+
* quaternion cannot be added as field in ICommandData and/or IInputComponentData. A new region has been added to the code-generation templates for handling similar other cases.
8+
* Removed the deprecated NativeList to NativeArray implicit cast and use NativeList.AsArray instead.
9+
* fixed a NotImplementedException thrown in standalone player client build.
10+
11+
12+
13+
14+
315
## [1.0.0-exp.8] - 2022-09-21
416

517
### Added

Editor/Authoring/BakedNetCodeComponents.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,20 @@ public ulong VariantHash
7878
}
7979

8080
/// <summary>
81-
/// Checks attributes to denote if users are allowed to create an override of this via a <see cref="GhostAuthoringInspectionComponent"/>.
82-
/// We support prefab overrides "implicitly" if we have multiple variant types.
81+
/// Denotes if this type supports user modification of <see cref="VariantType"/>.
82+
/// We obviously support it "implicitly" if we have multiple variant types.
8383
/// </summary>
84-
public bool DoesAllowModification => !metaData.HasDontSupportPrefabOverridesAttribute && (metaData.HasSupportsPrefabOverridesAttribute || HasMultipleVariants);
84+
public bool DoesAllowVariantModification => !metaData.HasDontSupportPrefabOverridesAttribute && (metaData.HasSupportsPrefabOverridesAttribute || HasMultipleVariants);
85+
86+
/// <summary>
87+
/// Denotes if this type supports user modification of <see cref="SendTypeOptimization"/>.
88+
/// </summary>
89+
public bool DoesAllowSendTypeOptimizationModification => !metaData.HasDontSupportPrefabOverridesAttribute && anyVariantIsSerialized && variant.Source != VariantType.VariantSource.ManualDontSerializeVariant && EntityParent.GoParent.RootAuthoring.SupportsSendTypeOptimization;
90+
91+
/// <summary>
92+
/// Denotes if this type supports user modification of <see cref="GhostAuthoringInspectionComponent.ComponentOverride.PrefabType"/>.
93+
/// </summary>
94+
public bool DoesAllowPrefabTypeModification => !metaData.HasDontSupportPrefabOverridesAttribute && metaData.HasSupportsPrefabOverridesAttribute;
8595

8696
/// <summary>I.e. Implicitly supports prefab overrides.</summary>
8797
internal bool HasMultipleVariants => availableVariants.Length > 1;

Editor/Authoring/GhostAuthoringInspectionComponentEditor.cs

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

Editor/Templates/CommandDataSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public void Execute(in ArchetypeChunk chunk, int unfilteredChunkIndex, bool useE
134134
uint changeMask = 0;
135135
var snapshot = curInput;
136136
var baseline = prevInput;
137-
#region __GHOST_CALCULATE_CHANGE_MASK__
137+
#region __GHOST_COMPARE_INPUTS__
138138
#endregion
139139

140140
if (changeMask != 0u)

Editor/Templates/DefaultTypes/GhostSnapshotValueQuaternionUnquantized.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@ public unsafe void RestoreFromBackup(ref IComponentData component, in IComponent
126126
}
127127
public void CalculateChangeMask(ref Snapshot snapshot, ref Snapshot baseline, uint changeMask)
128128
{
129+
#region __GHOST_CALCULATE_INPUT_CHANGE_MASK__
130+
changeMask = (snapshot.__COMMAND_FIELD_NAME__.value.x != baseline.__COMMAND_FIELD_NAME__.value.x ||
131+
snapshot.__COMMAND_FIELD_NAME__.value.y != baseline.__COMMAND_FIELD_NAME__.value.y||
132+
snapshot.__COMMAND_FIELD_NAME__.value.z != baseline.__COMMAND_FIELD_NAME__.value.z ||
133+
snapshot.__COMMAND_FIELD_NAME__.value.w != baseline.__COMMAND_FIELD_NAME__.value.w) ? 1u : 0;
134+
#endregion
129135
#region __GHOST_CALCULATE_CHANGE_MASK_ZERO__
130136
changeMask = (snapshot.__GHOST_FIELD_NAME__X != baseline.__GHOST_FIELD_NAME__X ||
131137
snapshot.__GHOST_FIELD_NAME__Y != baseline.__GHOST_FIELD_NAME__Y ||

Runtime/ClientServerWorld/ClientServerBootstrap.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ public void OnCreate(ref SystemState state)
462462
if (!state.World.IsServer())
463463
throw new InvalidOperationException("Server worlds must be created with the WorldFlags.GameServer flag");
464464
var simulationGroup = state.World.GetExistingSystemManaged<SimulationSystemGroup>();
465-
simulationGroup.RateManager = new NetcodeServerRateManager(simulationGroup);
465+
simulationGroup.SetRateManagerCreateAllocator(new NetcodeServerRateManager(simulationGroup));
466466

467467
var predictionGroup = state.World.GetExistingSystemManaged<PredictedSimulationSystemGroup>();
468468
predictionGroup.RateManager = new NetcodeServerPredictionRateManager(predictionGroup);
@@ -495,7 +495,7 @@ public void OnCreate(ref SystemState state)
495495
simulationGroup.RateManager = new NetcodeClientRateManager(simulationGroup);
496496

497497
var predictionGroup = state.World.GetExistingSystemManaged<PredictedSimulationSystemGroup>();
498-
predictionGroup.RateManager = new NetcodeClientPredictionRateManager(predictionGroup);
498+
predictionGroup.SetRateManagerCreateAllocator(new NetcodeClientPredictionRateManager(predictionGroup));
499499

500500
++ClientServerBootstrap.HasClientWorlds.Data;
501501
if (ClientServerBootstrap.TryFindAutoConnectEndPoint(out var autoConnectEp))

Runtime/ClientServerWorld/ClientServerWorldAllocatorResetSystem.cs

Lines changed: 0 additions & 39 deletions
This file was deleted.

Runtime/ClientServerWorld/ClientServerWorldAllocatorResetSystem.cs.meta

Lines changed: 0 additions & 11 deletions
This file was deleted.

Runtime/ClientServerWorld/ServerSimulationSystemGroup.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
using Unity.Core;
22
using Unity.Entities;
33
using Unity.Profiling;
4+
using Unity.Collections;
45

56
namespace Unity.NetCode
67
{
7-
class NetcodeServerRateManager : IRateManager
8+
unsafe class NetcodeServerRateManager : IRateManager
89
{
910
private EntityQuery m_NetworkTimeQuery;
1011
private EntityQuery m_ClientSeverTickRateQuery;
@@ -14,6 +15,7 @@ class NetcodeServerRateManager : IRateManager
1415
private Count m_UpdateCount;
1516
private int m_CurrentTickAge;
1617
private bool m_DidPushTime;
18+
DoubleRewindableAllocators* m_OldGroupAllocators = null;
1719
private struct Count
1820
{
1921
// The total number of step the simulation should take
@@ -99,6 +101,7 @@ public bool ShouldGroupUpdate(ComponentSystemGroup group)
99101
if (m_DidPushTime)
100102
{
101103
group.World.PopTime();
104+
group.World.RestoreGroupAllocator(m_OldGroupAllocators);
102105
m_fixedUpdateMarker.End();
103106
}
104107
else
@@ -138,6 +141,8 @@ public bool ShouldGroupUpdate(ComponentSystemGroup group)
138141
networkTime.ElapsedNetworkTime += dt;
139142
group.World.PushTime(new TimeData(networkTime.ElapsedNetworkTime, dt));
140143
m_DidPushTime = true;
144+
m_OldGroupAllocators = group.World.CurrentGroupAllocators;
145+
group.World.SetGroupAllocator(group.RateGroupAllocators);
141146
--m_CurrentTickAge;
142147
m_fixedUpdateMarker.Begin();
143148
return true;

Runtime/Command/CommandSendSystem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ public SendJobData InitJobData(ref SystemState state)
452452

453453
var clientNetTime = m_networkTimeQuery.GetSingleton<NetworkTime>();
454454
var targetTick = NetworkTimeHelper.LastFullServerTick(clientNetTime);
455-
var targetEntities = m_autoTargetQuery.ToEntityListAsync(state.WorldUnmanaged.UpdateAllocator.ToAllocator, out var autoHandle);
455+
var targetEntities = m_autoTargetQuery.ToEntityListAsync(state.WorldUpdateAllocator, out var autoHandle);
456456
var sendJob = new SendJobData
457457
{
458458
commmandTargetType = m_CommandTargetComponentHandle,

0 commit comments

Comments
 (0)