Skip to content

Commit

Permalink
fix: change to reliable packets only temporarily until we upgrade liv…
Browse files Browse the repository at this point in the history
…ekit (#1674)
  • Loading branch information
m3taphysics authored Aug 7, 2024
1 parent 067cdaa commit 331a6c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using DCL.Multiplayer.Connections.Messaging.Pipe;
using DCL.Multiplayer.Profiles.Tables;
using Decentraland.Kernel.Comms.Rfc4;
using LiveKit.Proto;
using System;
using System.Threading;
using UnityEngine;
Expand Down Expand Up @@ -64,7 +65,7 @@ private void WriteAndSend(NetworkMovementMessage message, IMessagePipe messagePi
{
var messageWrap = messagePipe.NewMessage<Decentraland.Kernel.Comms.Rfc4.Movement>();
WriteToProto(message, messageWrap.Payload);
messageWrap.SendAndDisposeAsync(cancellationTokenSource.Token).Forget();
messageWrap.SendAndDisposeAsync(cancellationTokenSource.Token, DataPacketKind.KindReliable).Forget();
}

private static void WriteToProto(NetworkMovementMessage message, Decentraland.Kernel.Comms.Rfc4.Movement movement)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using DCL.Profiles;
using DCL.Profiles.Self;
using Decentraland.Kernel.Comms.Rfc4;
using LiveKit.Proto;
using System.Threading;

namespace DCL.Multiplayer.Profiles.BroadcastProfiles
Expand Down Expand Up @@ -42,7 +43,7 @@ async UniTaskVoid GetProfileVersionThenSendAsync(CancellationToken ct)
Profile? profile = await selfProfile.ProfileAsync(ct);
MessageWrap<AnnounceProfileVersion> message = messagePipe.NewMessage<AnnounceProfileVersion>();
message.Payload.ProfileVersion = (uint)(profile?.Version ?? CURRENT_PROFILE_VERSION);
message.SendAndDisposeAsync(ct).Forget();
message.SendAndDisposeAsync(ct, DataPacketKind.KindReliable).Forget();
}

GetProfileVersionThenSendAsync(cancellationTokenSource.Token).Forget();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using DCL.Multiplayer.Connections.Messaging.Pipe;
using Decentraland.Kernel.Comms.Rfc4;
using Google.Protobuf;
using LiveKit.Proto;
using System;
using System.Threading;

Expand Down Expand Up @@ -44,7 +45,7 @@ public void SendMessage(ReadOnlySpan<byte> message, string sceneId, Cancellation
MessageWrap<Scene> sceneMessage = messagePipe.NewMessage<Scene>();
sceneMessage.Payload.Data = ByteString.CopyFrom(message);
sceneMessage.Payload.SceneId = sceneId;
sceneMessage.SendAndDisposeAsync(ct).Forget();
sceneMessage.SendAndDisposeAsync(ct, DataPacketKind.KindReliable).Forget();
}
}
}

0 comments on commit 331a6c2

Please sign in to comment.