Check out our latest project ✨ OpenChapter.io: free ebooks the way its meant to be 📖

Rem Send

An asset by Joy-less
The page banner background of a mountain and forest
Rem Send hero image

Quick Information

0 ratings
Rem Send icon image
Joy-less
Rem Send

A Remote Procedure Call framework for Godot C#.Features:- Call source-generated RPCs with static typing and optimal performance.- Request and return values from RPCs.- Send variant-incompatible values with MemoryPack.- Extra access enum (peer -> authority).- Fully compatible with async / Tasks.- Created for use in a real MMORPG.Example:```cs[Rem(RemAccess.Any)]public void SayWords(List<string> Words) { foreach (string Word in Words) { GD.Print(Word); }}// Send SayWords to authoritySendSayWords(1, ["cat", "dog"]);// Broadcast SayWords to all peersBroadcastSayWords(["cat", "dog"]);```The library is available on NuGet: https://www.nuget.org/packages/RemSend

Supported Engine Version
4.4
Version String
8.14
License Version
MIT
Support Level
community
Modified Date
2 months ago
Git URL
Issue URL

Rem Send

README NuGet

A Remote Procedure Call framework for Godot C# using source generators.

Features

  • Call source-generated RPCs with static typing and optimal performance.
  • Request and return values from RPCs.
  • Send variant-incompatible values with MemoryPack.
  • Extra access enum (peer -> authority).
  • Fully compatible with async / Tasks.
  • Created for use in a real MMORPG.

Setup

  1. Install RemSend through NuGet.
  2. Connect RemSend to your MultiplayerApi by using the following code:
RemSendService.Setup((SceneMultiplayer)Multiplayer, GetTree().Root);

Examples

Sending a method call to a remote peer:

[Rem(RemAccess.Any)]
public void SayWords(List<string> Words) {
    foreach (string Word in Words) {
        GD.Print(Word);
    }
}

// Send SayWords to authority
SendSayWords(1, ["cat", "dog"]);
// Broadcast SayWords to all peers
BroadcastSayWords(["cat", "dog"]);

Requesting a result from a peer:

[Rem(RemAccess.PeerToAuthority)]
public int GetNumber() {
    return 5;
}

// Send GetNumber to authority and await result for up to 10 seconds
int Number = await RequestGetNumber(1, TimeSpan.FromSeconds(10));

Getting the remote sender's peer ID:

[Rem(RemAccess.Any)]
public void RemoteHug([Sender] int SenderId) {
    if (SenderId == 1) {
        GD.Print("Thank you authority.");
    }
    else if (SenderId == Multiplayer.GetUniqueId()) {
        GD.Print("*depression*");
    }
    else {
        GD.Print("Thank you random peer.");
    }
}

// Send RemoteHug to authority
SendRemoteHug(1);

Notes

  • Since RemSend uses SceneMultiplayer.SendBytes and SceneMultiplayer.PeerPacket, using them with RemSend is not recommended. However, you can still use RPCs.
  • RemSend does not support GDScript or C++. It can only be used with C#. Other languages can use RPCs instead.

Special Thanks

A Remote Procedure Call framework for Godot C#.

Features:
- Call source-generated RPCs with static typing and optimal performance.
- Request and return values from RPCs.
- Send variant-incompatible values with MemoryPack.
- Extra access enum (peer -> authority).
- Fully compatible with async / Tasks.
- Created for use in a real MMORPG.

Example:
```cs
[Rem(RemAccess.Any)]
public void SayWords(List Words) {
foreach (string Word in Words) {
GD.Print(Word);
}
}

// Send SayWords to authority
SendSayWords(1, ["cat", "dog"]);
// Broadcast SayWords to all peers
BroadcastSayWords(["cat", "dog"]);
```

The library is available on NuGet: https://www.nuget.org/packages/RemSend

Reviews

0 ratings

Your Rating

Headline must be at least 3 characters but not more than 50
Review must be at least 5 characters but not more than 500
Please sign in to add a review

Quick Information

0 ratings
Rem Send icon image
Joy-less
Rem Send

A Remote Procedure Call framework for Godot C#.Features:- Call source-generated RPCs with static typing and optimal performance.- Request and return values from RPCs.- Send variant-incompatible values with MemoryPack.- Extra access enum (peer -> authority).- Fully compatible with async / Tasks.- Created for use in a real MMORPG.Example:```cs[Rem(RemAccess.Any)]public void SayWords(List<string> Words) { foreach (string Word in Words) { GD.Print(Word); }}// Send SayWords to authoritySendSayWords(1, ["cat", "dog"]);// Broadcast SayWords to all peersBroadcastSayWords(["cat", "dog"]);```The library is available on NuGet: https://www.nuget.org/packages/RemSend

Supported Engine Version
4.4
Version String
8.14
License Version
MIT
Support Level
community
Modified Date
2 months ago
Git URL
Issue URL

Open Source

Released under the AGPLv3 license

Plug and Play

Browse assets directly from Godot

Community Driven

Created by developers for developers