Skip to content

Commit 7fa1241

Browse files
committed
fixes some HVR issues
1 parent 9bf3a10 commit 7fa1241

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Basis/Packages/dev.hai-vr.basis.comms/Scripts/Systems/Runtime/Components/Networking/HVRNetworkingCarrier.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ public void OnHVRAvatarReady(bool isWearer)
4747

4848
public void OnHVRReadyBothAvatarAndNetwork(bool isWearer)
4949
{
50+
if (_comms == null)
51+
{
52+
throw new InvalidOperationException("HVRNetworkingCarrier was marked ready but its Comms component is null; HVR network data for this avatar cannot be processed.");
53+
}
5054
_networkReady = true;
5155
}
5256
}

Basis/Packages/dev.hai-vr.basis.comms/Scripts/Systems/Runtime/Components/Networking/HVRVariableNetworking.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,8 +784,10 @@ public void OnPacketReceived(byte localIdentifier, ArraySegment<byte> data)
784784
if (index < _upgradedToHighFrequencyInOrder.Count)
785785
{
786786
var highFrequency = _upgradedToHighFrequencyInOrder[index];
787-
var addressId = _networkIdToAddressId[highFrequency.networkId];
788-
highFrequencyInterpolatorDict[addressId] = DecodeFloat(packet.values[index], highFrequency);
787+
if (_networkIdToAddressId.TryGetValue(highFrequency.networkId, out var addressId))
788+
{
789+
highFrequencyInterpolatorDict[addressId] = DecodeFloat(packet.values[index], highFrequency);
790+
}
789791
}
790792
}
791793
_highFrequencyInterpolator.Add(new HVRInterpolationSnapshot

0 commit comments

Comments
 (0)