Hello! I am still new to multiplayer and Netcode for Gameobject/ Unity Services and ran into something that is stumping me.
I am getting this relay error in the console once every 20 seconds or so in both Host and Client consoles after a client connects via a Lobby. I searched online but cannot find any info regarding it.
Here is the console error:
Received an invalid Relay Received message: Wrong length
0x00007ff7c7dc5e2a (Unity) DefaultBurstRuntimeLogCallback
0x00007ff7c74955fa (Unity) BurstCompilerService_CUSTOM_RuntimeLog
0x00007ffc62cc9c02 (ef999a010cd80055dcb4debcdd1044d) Unity.Networking.Transport.Relay.RelayNetworkProtocol.ProcessRelayData (at F:/Unity Game Projects/Multiplayer Scorching/10-10-24/Library/PackageCache/com.unity.burst@1.8.18/.Runtime/Library/PackageCache/com.unity.transport@1.5.0/Runtime/Relay/RelayNetworkProtocol.cs:427)
0x00007ffc62cca560 (ef999a010cd80055dcb4debcdd1044d) Unity.Networking.Transport.Relay.RelayNetworkProtocol.ProcessReceive(System.IntPtr stream, ref Unity.Networking.Transport.NetworkInterfaceEndPoint endpoint, int size, ref Unity.Networking.Transport.NetworkSendInterface sendInterface, ref Unity.Networking.Transport.NetworkSendQueueHandle queueHandle, System.IntPtr userData, ref Unity.Networking.Transport.ProcessPacketCommand command) -> void_4a8673ec5b25397f38b5c69063b85440 from Unity.Networking.Transport, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null (at F:/Unity Game Projects/Multiplayer Scorching/10-10-24/Library/PackageCache/com.unity.burst@1.8.18/.Runtime/Library/PackageCache/com.unity.transport@1.5.0/Runtime/Relay/RelayNetworkProtocol.cs:400)
0x00007ffc62cc9ae0 (ef999a010cd80055dcb4debcdd1044d) d34ee21f050e397b38df84c4fa2b361d
0x00007ffc62caea5f (ef999a010cd80055dcb4debcdd1044d) Unity.Networking.Transport.NetworkDriver.AppendPacket (at F:/Unity Game Projects/Multiplayer Scorching/10-10-24/Library/PackageCache/com.unity.burst@1.8.18/.Runtime/Library/PackageCache/com.unity.transport@1.5.0/Runtime/NetworkDriver.cs:1543)
0x00007ffc62cd1d08 (ef999a010cd80055dcb4debcdd1044d) Unity.Networking.Transport.NetworkPacketReceiver.AppendPacket (at F:/Unity Game Projects/Multiplayer Scorching/10-10-24/Library/PackageCache/com.unity.burst@1.8.18/.Runtime/Library/PackageCache/com.unity.transport@1.5.0/Runtime/INetworkInterface.cs:60)
0x00007ffc62cd2511 (ef999a010cd80055dcb4debcdd1044d) Unity.Jobs.IJobExtensions.JobStruct`1<Unity.Networking.Transport.BaselibNetworkInterface.ReceiveJob>.Execute(ref Unity.Networking.Transport.BaselibNetworkInterface.ReceiveJob data, System.IntPtr additionalPtr, System.IntPtr bufferRangePatchData, ref Unity.Jobs.LowLevel.Unsafe.JobRanges ranges, int jobIndex) -> void_1a17c9416545ae7079718413b8a5101d from UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null (at F:/Unity Game Projects/Multiplayer Scorching/10-10-24/Library/PackageCache/com.unity.burst@1.8.18/.Runtime/unknown/unknown:0)
0x00007ffc62cd14dd (ef999a010cd80055dcb4debcdd1044d) bf504eda069940d0a0a13ea8363bce1d
0x00007ff7c80b7a22 (Unity) ExecuteJob
0x00007ff7c80b8e0f (Unity) ForwardJobToManaged
0x00007ff7c80b4c3a (Unity) ujob_execute_job
0x00007ff7c80b406d (Unity) lane_guts
0x00007ff7c80b6ca4 (Unity) worker_thread_routine
0x00007ff7c82e468b (Unity) Thread::RunThreadWrapper
0x00007ffcaaac7374 (KERNEL32) BaseThreadInitThunk
0x00007ffcac6bcc91 (ntdll) RtlUserThreadStart
Navigating to the code linked in the error I found this switch statement but I do not really know what to do with it:
case RelayMessageType.Relay:
var relayMessage = *(RelayMessageRelay*)data;
relayMessage.DataLength = RelayNetworkProtocol.SwitchEndianness(relayMessage.DataLength);
if (size < RelayMessageRelay.Length || size != RelayMessageRelay.Length + relayMessage.DataLength)
{
UnityEngine.Debug.LogError($"Received an invalid Relay Received message: Wrong length");
command.Type = ProcessPacketCommandType.Drop;
return true;
}
It seems like the relaymessage.datalength is not matching and maybe the packet is being dropped?
I am using Unity version 2022.3.49f1, Relay 1.1.1, and Lobby 1.2.2.
Any help would be greatly appreciated!
Thank you!