HolloFox_TS-Photon_Universal_Plugin_PUP icon

Photon Universal Plugin PUP

Base plugin used to synchronize mods over photon network. Provides messaging between TaleSpire clients without a need of a private server for mods.

Last updated a year ago
Total downloads 2369
Total rating 1 
Categories Networked Tools
Dependency string HolloFox_TS-Photon_Universal_Plugin_PUP-1.0.3
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


Photon Util Plugin (PUP)

Provides messaging between TaleSpire clients without a need of a private server for mods.


The Photon Util Plugin is intended to be used as a dependency for other plugins. To use it as part of your own plugins, add a reference to the DLL into your Visual Studio project and then add the following to your plugin header:

    [BepInPlugin(Guid, "My Plugin That Uses The Photon Util Plugin", Version)]
    public class MyNetworkedPlugin : BaseUnityPlugin
        public const string Guid = "org.demo.plugins.mycooldemo";
        private const string Version = "";
        void Awake()
		// Run once on awake
        void Update()
		// Run every frame

This will give access to the PhotonUtilPlugin namespace at runtime and ensure that only one PhotonUtilPlugin instance handles all plugins that need it.

To be able to get or send messages, you register your mod. Typically this can be done in the Awake() function but specific situations may dictated otherwise. This can be done using:

    void Awake()

To create a message you can isntantiate a new Photon Message that you'll use to send your content.

	var message = new PhotonMessage	
        		PackageId = Guid,
                	Version = Version,
                	SerializedMessage = "your message here"

There's currently 2 ways to send a message. 1 is using your ledger. To add to your ledger you call the add message function after your mod has been added to the plugin.


This will be broadcasted for every other player to view. To view everyone's ledgers you call GetMessages

	var AllMessage = PhotonUtilPlugin.GetMessages(Guid);
	// OR
	var NewMessage = PhotonUtilPlugin.GetNewMessages(Guid);

This will return a Dictionary<PhotonPlayer, List<PhotonMessage>> allowing you to go through the history of messages per person within the room. If you're ledger is getting abit long you may call the clear function to clean it up.


This will clearup all messages that you deem to not persist.

The 2nd way is to Bind it to an instance, (This will usually be for a singleton you want to keep sync like a character sheet for a session)

	// Create and Update, 
	PhotonUtilPlugin.CreateInstance("My Instance",message);
	PhotonUtilPlugin.UpdateInstance("My Instance",message);
	// Delete
	PhotonUtilPlugin.DeleteInstance(Guid,"My Instance");

	// Read
	var result = ReadInstance(Guid,"My Instance", PhotonPlayer player);

Creating, updating and deleting is relatively easy as these objects are relatively straight forwards.

Reading involves obtaining a player first and this can be done by:

	var players = PhotonNetwork.playerList;

This will return all players in the current "room" you are in ready to read their stored values for your mod's session.

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  
2021-5-23 1.0.3 2199 Version 1.0.3 Install
2021-5-23 1.0.2 61 Version 1.0.2 Install
2021-5-23 1.0.1 52 Version 1.0.1 Install
2021-5-22 1.0.0 57 Version 1.0.0 Install