private void HandlePayload( NetPeer peer, byte[] buffer, int length) { if (peer.IsConnected == false) { return; } // Read the payload bool success = NetEncoding.ReadPayload( CreateEvent, peer, buffer, length, out ushort payloadSeq, out NetEvent evnt); // Validate if (success == false) { NetDebug.LogError("Error reading payload"); return; } // Enqueue the event for processing if the peer can receive it if (peer.OnReceivePayload(Time, payloadSeq)) { eventOut.Enqueue(evnt); } }