GodotRosettaRpc 0.1.1

dotnet add package GodotRosettaRpc --version 0.1.1
                    
NuGet\Install-Package GodotRosettaRpc -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="GodotRosettaRpc" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="GodotRosettaRpc" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="GodotRosettaRpc" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add GodotRosettaRpc --version 0.1.1
                    
#r "nuget: GodotRosettaRpc, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package GodotRosettaRpc@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=GodotRosettaRpc&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=GodotRosettaRpc&version=0.1.1
                    
Install as a Cake Tool

godot-rosetta-rpc (C# runtime)

The C# runtime for the godot-rosetta-rpc cross-language RPC framework: RpcMethodDescriptor, ServiceRegistry, RpcClient, plus a GodotSupport static class to plug in the rest of the library with Godot. This library never depends on any project-specific generated code.

Installing

<ItemGroup>
  <PackageReference Include="GodotRosettaRpc" Version="0.1.0" />
</ItemGroup>

Project setup

Your project also needs:

  • A .NET-enabled Godot editor/export templates already set up. C# support is built into Godot itself, but since it doesn't yet support GDExtension, it requires a Mono-specific binary.

  • protoc's generated message + RPC glue sources on the compile path. An SDK-style .csproj can glob-include every .cs file under the project directory by default. Simply point protoc --csharp_out=... and --rosetta-rpc_out=lang=csharp:... somewhere under your project root and no further wiring is needed. See example/generate.py for a working configuration.

Implementing an RPC service

Each service Foo {} in your .proto file generates a C# interface IFoo with one method per RPC. Implement it anywhere in your codebase — the generated interface doesn't assume any particular namespace or location:

public class BuzzerImpl : IBuzzer
{
    private readonly GeneratedServiceFactory _factory;

    public BuzzerImpl(GeneratedServiceFactory factory) => _factory = factory;

    public PingResponse Ping(PingRequest request)
    {
        var clock = _factory.Clock();
        var currentTime = clock.CurrentTime(new CurrentTimeRequest());
        return new PingResponse { Message = $"pong: {request.Message} @ {currentTime.Millis}ms" };
    }
}

A method reports failure by throwing an exception (of any type). The exception will be propagated as an RpcException with RpcErrorCode.Application (see Error handling).

Register an RPC service

Every service implemented in C# must be linked through a single public class AppServiceImplementations in namespace RpcImpls, implementing the generated ServiceImplementations interface. That fixed, well-known location is what lets the generated Bootstrap.cs find your implementations without depending on your project's own namespace layout:

namespace RpcImpls;

public class AppServiceImplementations : ServiceImplementations
{
    public IBuzzer? Buzzer(GeneratedServiceFactory factory) => new BuzzerImpl(factory);
}

Only override the services implemented in C# — every other method defaults to returning null, meaning "not implemented in this language."

Call an RPC service

From any Godot Node, build an RpcClient with GodotSupport.MakeRpcClient(this), wrap it in the generated GeneratedServiceFactory, then call through the factory:

[GlobalClass]
public partial class MyNode : Node2D
{
    public override void _Ready()
    {
        var services = new GeneratedServiceFactory(GodotSupport.MakeRpcClient(this));

        // Without error handling.
        var response = services.Buzzer().Ping(new PingRequest { Message = "hello" });
        GD.Print(response.Message);

        // With error handling.
        try
        {
            var response = services.Buzzer().Ping(new PingRequest { Message = "hello" });
            GD.Print(response.Message);
        }
        catch (RpcException e)
        {
            GD.PrintErr($"Ping failed ({e.Code}): {e.Message}");
        }
    }
}

To call one service from another's implementation, reuse the GeneratedServiceFactory passed into your constructor (see above) instead of building a new one.

Error handling

RpcClient.Call throws RpcException when a call fails. RpcException.Code is an RpcErrorCode:

  • UnknownService / UnknownMethod — no service/method is registered for the id the client called with.
  • Decode — the request or response protobuf failed to decode.
  • Application — the service implementation itself failed: it threw, or an otherwise-uncaught exception was caught on its behalf by GodotSupport.DispatchBytes.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 117 8/8/2026
0.1.0 120 8/6/2026