TaleSpire.RPCPlugin 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package TaleSpire.RPCPlugin --version 1.0.0                
NuGet\Install-Package TaleSpire.RPCPlugin -Version 1.0.0                
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="TaleSpire.RPCPlugin" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TaleSpire.RPCPlugin --version 1.0.0                
#r "nuget: TaleSpire.RPCPlugin, 1.0.0"                
#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.
// Install TaleSpire.RPCPlugin as a Cake Addin
#addin nuget:?package=TaleSpire.RPCPlugin&version=1.0.0

// Install TaleSpire.RPCPlugin as a Cake Tool
#tool nuget:?package=TaleSpire.RPCPlugin&version=1.0.0                

RPC Plugin

.github/workflows/release.yml

This is a plugin for TaleSpire using BepInEx.

Install

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

Usage

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:

RPCManager.RemoveHandler("/w");

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)

Compiling

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

Changelog

  • 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

Shoutouts

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

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 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
2.1.2 300 2/3/2023
2.1.1 251 2/3/2023
1.0.0 274 11/27/2022