Conversation
…tions from solution"
There was a problem hiding this comment.
Pull request overview
This PR is described as a revert of KinectToVR/plugin_Relay#2, but the actual changes primarily migrate the project from ActualLab.* RPC packages to Stl.*, adjust RPC call routing, update client initialization/logging, and modify .gitignore patterns.
Changes:
- Replace
ActualLab.*package references/usings withStl.*equivalents. - Add a custom
RpcCallRouterin the server to influence routing forIRelayClientcalls. - Update client initialization to register an
IRelayClientserver implementation and change logging initialization; remove several ignore patterns from.gitignore.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
plugin_Relay/plugin_Relay.csproj |
Swaps RPC-related NuGet packages (ActualLab → Stl) and adjusts dependencies. |
plugin_Relay/RelayService.cs |
Switches to Stl.Rpc and adds a RpcCallRouter singleton for routing. |
plugin_Relay/RelayDevice.cs |
Switches to Stl.Rpc, adds try/catch around initialization, configures logging, and registers a client callback server. |
plugin_Relay/Models/Contract.cs |
Updates RPC namespace to Stl.Rpc. |
.gitignore |
Removes ignores for publish outputs and *.zip artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <ItemGroup> | ||
| <PackageReference Include="ActualLab.Generators" Version="12.1.51"> | ||
| <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
| <PrivateAssets>all</PrivateAssets> | ||
| </PackageReference> | ||
| <PackageReference Include="ActualLab.Rpc" Version="12.1.51" /> | ||
| <PackageReference Include="ActualLab.Rpc.Server" Version="12.1.51" /> | ||
| <PackageReference Include="Amethyst.Plugins.Contract" Version="1.3.0" /> | ||
| <PackageReference Include="MemoryPack" Version="1.21.4" /> | ||
| <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" /> | ||
| <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" /> | ||
| <PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.1" /> | ||
| <PackageReference Include="Stl.Generators" Version="6.8.11" /> | ||
| <PackageReference Include="Stl.Rpc" Version="6.8.11" /> | ||
| <PackageReference Include="Stl.Rpc.Server" Version="6.8.11" /> |
There was a problem hiding this comment.
The PR description says this is a revert of a solution/platform configuration change, but this file swaps RPC packages (ActualLab.* -> Stl.*) and removes Microsoft.Extensions.Logging. If this is intentional, please update the PR title/description; otherwise revert these package changes to keep the revert focused.
| .AddWebSocketClient($"http://{ServerIp}:{ServerPort}/") | ||
| .AddClient<IRelayService>(); | ||
| var services = new ServiceCollection() | ||
| .AddLogging(logging => logging.AddConsole()); |
There was a problem hiding this comment.
.AddConsole() requires the Microsoft.Extensions.Logging.Console assembly/package; this project file currently has no explicit reference to it. Either add the appropriate package reference or remove .AddConsole() (fall back to .AddLogging() or the existing logging provider setup) to avoid a missing-method/compile error depending on transitive dependencies.
| .AddLogging(logging => logging.AddConsole()); | |
| .AddLogging(); |
| if (methodDef.Service.Type != typeof(IRelayClient)) return rpcHub.GetClientPeer(RpcPeerRef.Default); | ||
| var peerRef = new RpcPeerRef(args.Get<Stl.Text.Symbol>(0), true); | ||
| return rpcHub.GetServerPeer(peerRef); |
There was a problem hiding this comment.
This RpcCallRouter routes IRelayClient calls based on args.Get<Stl.Text.Symbol>(0), but IRelayClient methods don't take a peer id/symbol as their first argument (e.g., OnRequestShutdown(string reason, ...)). As written, routing will likely select the wrong peer or throw due to an argument type mismatch. Consider routing based on the current call context/peer (or explicitly include a peer identifier parameter in the IRelayClient contract and update call sites accordingly).
| if (methodDef.Service.Type != typeof(IRelayClient)) return rpcHub.GetClientPeer(RpcPeerRef.Default); | |
| var peerRef = new RpcPeerRef(args.Get<Stl.Text.Symbol>(0), true); | |
| return rpcHub.GetServerPeer(peerRef); | |
| if (methodDef.Service.Type != typeof(IRelayClient)) | |
| return rpcHub.GetClientPeer(RpcPeerRef.Default); | |
| // For IRelayClient calls, route using the default peer reference instead of | |
| // assuming the first argument is a Stl.Text.Symbol peer identifier. | |
| return rpcHub.GetServerPeer(RpcPeerRef.Default); |
Reverts #2