-
-
Notifications
You must be signed in to change notification settings - Fork 14
API Compatibility
All mods start with an ‘Undefined’ compatibility state and can declare their compatibility either through an Info.json entry or programmatically with an API call.
There are a handful of hard-coded states for some known mods, however, these can be overridden.
If a mod declares compatibility through more than one method, precedence is as follows:
- API declaration
-
Info.jsonentry - Hard-coded state
Undefined
Current hard-coded compatibility states:
- Booklet Organizer – Host
- Comms Radio API – Client
- Custom Cargo - All
- Discord Rich Presence – Client
- F spammer mod – Client
- Improved Job Overview - Client
- Language Helper – Client
- LightingOverhaul – Client
- Remote Dispatch – Client
- Runtime Unity Editor – Client
Mods not requiring API usage should add a MultiplayerCompatibility entry to their Info.json.
This entry and its value are case-sensitive. See Multiplayer Compatibility Enum for possible values and their meanings.
Example for a mod that does not work with Multiplayer:
{
"Id": "MyMod",
"Version": "1.0.0.0",
"DisplayName": "My Awesome Mod",
"EntryMethod": "MyMod.MyMod.Load",
"MultiplayerCompatibility": "Incompatible"
}Mods referencing the API should call IMultiplayerAPI.SetModCompatibility() and pass in the mod's ModEntry.Info.Id and compatibility state.
See Multiplayer Compatibility Enum for possible values and their meanings.
Example for a mod required on the host and all clients:
public static class MyMod
{
public static UnityModManager.ModEntry ModEntry;
public static bool Load(UnityModManager.ModEntry modEntry)
{
ModEntry = modEntry;
// Your mod initialisation here
// ...
if (MultiplayerAPI.IsMultiplayerLoaded)
{
MultiplayerAPI.Instance.SetModCompatibility(ModEntry.Info.Id, MultiplayerCompatibility.All);
}
return true;
}
}Getting Started
Guides
- The Basics
- Packet Naming Conventions
- Defining Packets
- Registering Packet Listeners
- Sending Packets