HolloFox_TS-RPCPlugin icon


This is a developer network tool to send messages over RPC

Last updated 2 months ago
Total downloads 4771
Total rating 0 
Categories Networked Tools
Dependency string HolloFox_TS-RPCPlugin-2.1.2
Dependants 2 other mods depend on this mod

This mod requires the following mods to function

bbepisTaleSpire-BepInExPack-5.4.10 icon

Unified BepInEx all-in-one modding pack - plugin framework, detour library

Preferred version: 5.4.10
brcoding-SetInjectionFlagPlugin-2.3.0 icon

Allows players to flag mods are installed

Preferred version: 2.3.0


RPC Plugin


This is a plugin for TaleSpire using BepInEx, it creates a consumer and service for sending data over RPC. This is designed to be light weight for small messages. If you want large messages then you should host the file externally and only message a pointer to it. This is to reduce the impact on the performance and server costs from sending large messages.


Currently you need to either follow the build guide down below or use the R2ModMan.


Reference this dependency plugin in the parent plugin and then use the following syntax to add a chat service:

RPCManager.AddHandler(serviceKey, handler)

Where the service key is a string that must appear at the beginning of the rpc message in order to trip the corresponding handler.

Where hander is a function that takes in two string, the message content and the sender, and a source which is a ChatSource enumeration indicating if the source if a GM message, player message or creature message. The handler returns a string for Interface compatibility.

An example of adding a inline handler for "/w" function would be:

RPCManager.AddHandler("/w", (chatMessage, sender, source)=> { Debug.Log(sender+" whispered "+chatMessage); });

An example of removing a inline handler for "/w" function would be:


Usage programatically

RPCManager.SendMessage(message, sender);

Where message is the content to be sent and should include the handling prefix.

Where sender is the NGuid of either a creature mini (CreatureId) or player (PlayerId).

For example, to use the above hander for "/doSomething" assuming it is a whisper message to the GM: RPCManager.SendMessage("/doSomething{\"I'm a\": \"json\"}", LocalPlayer.Id.Value)

Usage Consumer and Messenger framework

RPC Manager now supports a Consumer and messenger workflow allowing a singleton

    public class MyMessage : RpcMessage
        // Example Data
        internal int I { get; set; }

        public MyMessage()


        // Serialize to Binary
        public override byte[] Value()
            IEnumerable<byte> bytes = new List<byte>();

            bytes = bytes.Concat(BitConverter.GetBytes(I));

            return bytes.ToArray();

        // Construct from Binary
        public MyMessage(byte[] data)
            I = BitConverter.ToInt32(data, 0);

    public class MyConsumer : RpcConsumer<MyMessage>
        private static readonly MyConsumer instance = new MyConsumer();
        static MyConsumer() { } // Make sure it's truly lazy

        public static MyConsumer Instance { get { return instance; } }

        // My constructor (If I wanted something to happen)
        private MyConsumer(): base ()

        public override void Handle(MyMessage message)


Build the project using nuget.

Browse to the newly created bin/Debug or bin/Release folders and copy the RPCPlugin.dll to Steam\steamapps\common\TaleSpire\BepInEx\plugins


  • 2.1.2: Sample project now uploaded on gitrepo using message and consumer
  • 2.1.1: Message Id Optimization
  • 2.1.0: Added Binary message and Consumer workflow for messaging.
  • 2.0.1: Fix dependency in pipeline
  • 2.0.0: Nuget and re-starting the project
  • 1.0.0: Slight Optimization, Official Release
  • 0.9.5: Updated depended dll
  • 0.9.4: Hide Volume Support and Parallelization
  • 0.9.3: Refactor RPCManager to Static class
  • 0.9.2: Use SourceRoll.dll and implement static methods
  • 0.9.1: remove logging
  • 0.9.0: Alpha release


Shoutout to my Patreons on https://www.patreon.com/HolloFox recognising your mighty contribution to my caffeine addiciton:

Available versions

Please note that the install buttons only work if you have compatible client software installed, such as the Thunderstore Mod Manager. Otherwise use the zip download links instead.

Upload date Version number Downloads Download link  
2023-2-3 2.1.2 963 Version 2.1.2 Install
2023-2-3 2.1.1 50 Version 2.1.1 Install
2023-1-30 2.1.0 172 Version 2.1.0 Install
2022-11-28 2.0.1 756 Version 2.0.1 Install
2022-11-27 2.0.0 48 Version 2.0.0 Install
2022-2-16 1.0.1 2486 Version 1.0.1 Install
2022-2-13 1.0.0 54 Version 1.0.0 Install
2022-2-12 0.9.5 44 Version 0.9.5 Install
2022-2-12 0.9.4 41 Version 0.9.4 Install
2022-2-12 0.9.3 44 Version 0.9.3 Install
2022-2-12 0.9.2 34 Version 0.9.2 Install
2022-2-11 0.9.1 37 Version 0.9.1 Install
2022-2-11 0.9.0 42 Version 0.9.0 Install