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
1 change: 1 addition & 0 deletions com.unity.netcode.gameobjects/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Additional documentation and release notes are available at [Multiplayer Documen

### Fixed

- Fixed memory leak in `NetworkAnimator` on clients where `RpcTarget` groups were not being properly disposed due to incorrect type casting of `ProxyRpcTargetGroup` to `RpcTargetGroup`.
- Fixed issue when using a client-server topology where a `NetworkList` with owner write permissions was resetting sent time and dirty flags after having been spawned on owning clients that were not the spawn authority. (#3850)
- Fixed an integer overflow that occurred when configuring a large disconnect timeout with Unity Transport. (#3810)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ protected virtual bool OnIsServerAuthoritative()
private static byte[] s_EmptyArray = new byte[] { };
private List<int> m_ParametersToUpdate;
private RpcParams m_RpcParams;
private RpcTargetGroup m_TargetGroup;
private IGroupRpcTarget m_TargetGroup;
private AnimationMessage m_AnimationMessage;
private NetworkAnimatorStateChangeHandler m_NetworkAnimatorStateChangeHandler;

Expand Down Expand Up @@ -762,7 +762,7 @@ public override void OnDestroy()
{
SpawnCleanup();

m_TargetGroup?.Dispose();
m_TargetGroup?.Target?.Dispose();

if (m_CachedAnimatorParameters != null && m_CachedAnimatorParameters.IsCreated)
{
Expand Down Expand Up @@ -928,12 +928,12 @@ public override void OnNetworkSpawn()
NetworkLog.LogWarningServer($"[{gameObject.name}][{nameof(NetworkAnimator)}] {nameof(Animator)} is not assigned! Animation synchronization will not work for this instance!");
}

m_TargetGroup = RpcTarget.Group(new List<ulong>(128), RpcTargetUse.Persistent) as RpcTargetGroup;
m_TargetGroup = RpcTarget.Group(new List<ulong>(128), RpcTargetUse.Persistent) as IGroupRpcTarget;
m_RpcParams = new RpcParams()
{
Send = new RpcSendParams()
{
Target = m_TargetGroup
Target = m_TargetGroup?.Target
}
};

Expand Down Expand Up @@ -1219,7 +1219,7 @@ internal void CheckForAnimatorChanges()
}
m_TargetGroup.Add(clientId);
}
m_RpcParams.Send.Target = m_TargetGroup;
m_RpcParams.Send.Target = m_TargetGroup.Target;
SendClientAnimStateRpc(m_AnimationMessage, m_RpcParams);
}
}
Expand Down Expand Up @@ -1555,7 +1555,7 @@ private unsafe void SendServerParametersUpdateRpc(ParametersUpdateMessage parame
m_TargetGroup.Add(clientId);
}

m_RpcParams.Send.Target = m_TargetGroup;
m_RpcParams.Send.Target = m_TargetGroup.Target;
m_NetworkAnimatorStateChangeHandler.SendParameterUpdate(parametersUpdate, m_RpcParams);
}
}
Expand Down Expand Up @@ -1621,7 +1621,7 @@ private void SendServerAnimStateRpc(AnimationMessage animationMessage, RpcParams
}
m_TargetGroup.Add(clientId);
}
m_RpcParams.Send.Target = m_TargetGroup;
m_RpcParams.Send.Target = m_TargetGroup.Target;
m_NetworkAnimatorStateChangeHandler.SendAnimationUpdate(animationMessage, m_RpcParams);
}
}
Expand Down