LordAshes-RollPostPlugin icon

RollPostPlugin

Posts rolls to a web server address in JSON format.

Last updated a month ago
Total downloads 78
Total rating 0 
Categories Assets Networked Integration
Dependency string LordAshes-RollPostPlugin-1.3.2
Dependants 0 other mods depend on this mod

README

Roll Post Plugin

This unofficial TaleSpire mod posts rolls to a web server using JSON encoding.

This plugin, like all others, is free but if you want to donate, use: http://LordAshes.ca/TalespireDonate/Donate.php

Change Log

1.3.2: Fixed bug with player name 
1.2.1: Removed trailing comma in the d20 JSON post
1.2.0: Added selected mini and selected mini id into d20 post
1.1.0: Added option for full roll result posting
1.0.0: Initial release

Install

Use R2ModMan or similar installer to install.

Configure the URL using R2ModMan Edit Config option for the plugin.

Each player needs a copy of the plugin to use it.

Usage

There are two mode: d20Only and not d20Only.

d20Only Mode

When a roll is made, if the die is a D20, the roll will be sent as a POST to the specified URL and the contents of the roll will be provided as the contents of the POST in JSON format. For example:

{
  "player": "LordAshes",
  "name": "initiative",
  "mini": "Human Warrior",
  "id": "3b6bf1b5-453b-4c1e-9dbc-a82258f86128",
  "formula": "1D20+5",
  "die": "4",
  "total": "9"
}

Not d20Only Mode

When a roll is made, regardless if it is a D20 roll or not, the full Talespire Roll Result object is sent to the URL via POST with the JSON serialized roll result as the content. Unlike the d20Only mode, this content supports multiple dice and even multiple roll totals. The content will look similar to:

{
  "RollId":100001,
  "GroupResults":
  [
    {
	  "Name":  "Inspiration",
	  "Dice":
	  [
	    {
		  "Resource": "numbered1D20",
		  "Results": [11],
		  "Modifier": 3,
		  "DiceOperator":0
		}
      ]
	}
  ]
}

The RollId can be ignored, it is used by Talespire internally. The Name may be empty if the roll was made in Talespire without associating the roll with a name. DiceOperator 0 is plus. DiceOperator 1 is minus.

Server Side Example

The plugin does not provide the web server portion. That is scope of others. However, below is a simple PHP script that captures the posted JSON content as a string:

<?PHP
  $json = file_get_contents('php://input');
?>

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  
2022-5-25 1.3.2 45 Version 1.3.2 Install
2022-5-23 1.2.1 11 Version 1.2.1 Install
2022-5-23 1.2.0 8 Version 1.2.0 Install
2022-5-22 1.1.0 7 Version 1.1.0 Install
2022-5-22 1.0.0 7 Version 1.0.0 Install