Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Runtime/Scripts/Core/Room.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public Proto.RoomOptions ToProto()
proto.AdaptiveStream = AdaptiveStream;
proto.JoinRetries = JoinRetries;
proto.RtcConfig = RtcConfig?.ToProto();
#pragma warning disable CS0612 // Type or member is obsolete
proto.E2Ee = E2EE?.ToProto();

return proto;
Expand Down
16 changes: 8 additions & 8 deletions Tests/PlayMode/RpcTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ public IEnumerator RegisterRpcMethod_AndPerformRpc_ReturnsResponse()
yield return context.ConnectAll();
Assert.IsNull(context.ConnectionError, context.ConnectionError);

context.Rooms[1].LocalParticipant.RegisterRpcMethod("echo", async (data) =>
context.Rooms[1].LocalParticipant.RegisterRpcMethod("echo", (data) =>
{
return $"echo:{data.Payload}";
return Task.FromResult($"echo:{data.Payload}");
});

var rpcInstruction = context.Rooms[0].LocalParticipant.PerformRpc(new PerformRpcParams
Expand Down Expand Up @@ -58,9 +58,9 @@ public IEnumerator PerformRpc_HandlerThrowsRpcError_PropagatesError()
yield return context.ConnectAll();
Assert.IsNull(context.ConnectionError, context.ConnectionError);

context.Rooms[1].LocalParticipant.RegisterRpcMethod("throw-rpc", async (data) =>
context.Rooms[1].LocalParticipant.RegisterRpcMethod("throw-rpc", (data) =>
{
throw new RpcError(42, "custom error", "custom data");
return Task.FromException<string>(new RpcError(42, "custom error", "custom data"));
});

var rpcInstruction = context.Rooms[0].LocalParticipant.PerformRpc(new PerformRpcParams
Expand Down Expand Up @@ -90,9 +90,9 @@ public IEnumerator PerformRpc_HandlerThrowsGenericException_ReturnsApplicationEr
yield return context.ConnectAll();
Assert.IsNull(context.ConnectionError, context.ConnectionError);

context.Rooms[1].LocalParticipant.RegisterRpcMethod("throw-generic", async (data) =>
context.Rooms[1].LocalParticipant.RegisterRpcMethod("throw-generic", (data) =>
{
throw new InvalidOperationException("something went wrong");
return Task.FromException<string>(new InvalidOperationException("something went wrong"));
});

var rpcInstruction = context.Rooms[0].LocalParticipant.PerformRpc(new PerformRpcParams
Expand Down Expand Up @@ -147,9 +147,9 @@ public IEnumerator UnregisterRpcMethod_ThenPerformRpc_ReturnsUnsupportedMethod()
yield return context.ConnectAll();
Assert.IsNull(context.ConnectionError, context.ConnectionError);

context.Rooms[1].LocalParticipant.RegisterRpcMethod("unreg-test", async (data) =>
context.Rooms[1].LocalParticipant.RegisterRpcMethod("unreg-test", (data) =>
{
return "should not reach here";
return Task.FromResult("should not reach here");
});
context.Rooms[1].LocalParticipant.UnregisterRpcMethod("unreg-test");

Expand Down
Loading