diff --git a/Basis/Packages/com.basis.framework/Networking/BasisNetworkManagement.cs b/Basis/Packages/com.basis.framework/Networking/BasisNetworkManagement.cs index b7cdf419..66217480 100644 --- a/Basis/Packages/com.basis.framework/Networking/BasisNetworkManagement.cs +++ b/Basis/Packages/com.basis.framework/Networking/BasisNetworkManagement.cs @@ -210,18 +210,9 @@ public void LateUpdate() // Complete tasks and apply results for (int Index = 0; Index < ReceiverCount; Index++) { - try - { - if (ReceiverArray[Index] != null) - { - ReceiverArray[Index].Apply(TimeAsDouble, deltaTime); - } - } - catch (Exception ex) + if (ReceiverArray[Index] != null) { - // Log the error and continue with the next iteration - //muting the error for now - //BasisDebug.LogError($"Error in Apply at index {Index}: {ex.Message} {ex.StackTrace}"); + ReceiverArray[Index].Apply(TimeAsDouble, deltaTime); } } } diff --git a/Basis/Packages/com.basis.framework/Networking/Recievers/BasisNetworkReceiver.cs b/Basis/Packages/com.basis.framework/Networking/Recievers/BasisNetworkReceiver.cs index f6b0c6e1..cbf2b48a 100644 --- a/Basis/Packages/com.basis.framework/Networking/Recievers/BasisNetworkReceiver.cs +++ b/Basis/Packages/com.basis.framework/Networking/Recievers/BasisNetworkReceiver.cs @@ -79,29 +79,46 @@ public void Apply(double TimeAsDouble, float DeltaTime) { if (PoseHandler != null) { - if (HasAvatarInitalized) + try { - OutputRotation = math.slerp(First.rotation, Last.rotation, interpolationTime); - // Complete the jobs and apply the results - musclesHandle.Complete(); + if (HasAvatarInitalized) + { + OutputRotation = math.slerp(First.rotation, Last.rotation, interpolationTime); + // Complete the jobs and apply the results + musclesHandle.Complete(); + + ApplyPoseData(NetworkedPlayer.Player.BasisAvatar.Animator, OuputVectors[1], OuputVectors[0], OutputRotation, muscles); + PoseHandler.SetHumanPose(ref HumanPose); - ApplyPoseData(NetworkedPlayer.Player.BasisAvatar.Animator, OuputVectors[1], OuputVectors[0], OutputRotation, muscles); - PoseHandler.SetHumanPose(ref HumanPose); + RemotePlayer.RemoteBoneDriver.SimulateAndApply(TimeAsDouble, DeltaTime); - RemotePlayer.RemoteBoneDriver.SimulateAndApply(TimeAsDouble, DeltaTime); + //come back to this later! RemotePlayer.Avatar.FaceVisemeMesh.transform.position = RemotePlayer.MouthControl.OutgoingWorldData.position; + } + if (interpolationTime >= 1 && PayloadQueue.TryDequeue(out AvatarBuffer result)) + { + First = Last; + Last = result; - //come back to this later! RemotePlayer.Avatar.FaceVisemeMesh.transform.position = RemotePlayer.MouthControl.OutgoingWorldData.position; + TimeBeforeCompletion = Last.SecondsInterval; + TimeInThePast = TimeAsDouble; + } } - if (interpolationTime >= 1 && PayloadQueue.TryDequeue(out AvatarBuffer result)) + catch (Exception ex) { - First = Last; - Last = result; - - TimeBeforeCompletion = Last.SecondsInterval; - TimeInThePast = TimeAsDouble; + if (LogFirstError == false) + { + // Log the error and continue with the next iteration + //muting the error for now + BasisDebug.LogError($"Error in Apply : {ex.Message} {ex.StackTrace}"); + } + else + { + LogFirstError = true; + } } } } + public bool LogFirstError = false; public void EnQueueAvatarBuffer(ref AvatarBuffer avatarBuffer) { if(avatarBuffer == null)