blankochan-AirframeAPI icon

AirframeAPI

Barebones modding api, and desync prevention system

Last updated 17 hours ago
Total downloads 7
Total rating 1 
Categories Mods Tools Libraries Misc
Dependency string blankochan-AirframeAPI-1.0.0
Dependants 2 other packages depend on this package

This mod requires the following mods to function

LavaGang-MelonLoader-0.7.3 icon
LavaGang-MelonLoader

The World's First Universal Mod Loader for Unity Games compatible with both Il2Cpp and Mono

Preferred version: 0.7.3

README

AirframeAPI - Funny title here

AirframeAPI has one primary job, which is to sync mod lists and do everything in its power to prevent desyncing vanilla players.

If you would like to support its development, consider supporting me on ko-fi.

Features

  • Simple Mod list sync
  • Vanilla desync prevention
  • Extensions for dealing with Il2Cpp arrays and lists.
  • Custom networking callbacks (Planned)
  • Various subscribable events

Developer must-knows

This section contains must know info every mod developer should know about, I strongly recommend reading it in full.

Using AirframeAPI

Referencing AirframeAPI is essentially the same process for referencing the base game dependencies. My preferred way of referencing other mods is something like this, in my csproj.

<ItemGroup>
  <Reference Include="$(ProjectDir)/.lib/*.dll" Private="false" />
</ItemGroup>

And then I just create a folder called .lib, and stuff any mods I need there (+any xml documentation they might have).

Registration

There are two primary ways to register to AirframeAPI, Assembly Attributes, and manually doing it.

Assembly Attributes

So the recommended way to handle registering to AirframeAPI is similar to how you register to MelonLoader.

AirframeAPI.Registration has an attribute called AirframeModTags, which takes in the Type of your MelonMod and then some ModTags which is a Flag enum, which means you can use | to chain tags together.

In practice, this looks something like this.

using MelonLoader;
using AirframeAPI.Registration;

[assembly: AirframeModTags(typeof(AirframeTestMod.Main), ModTags.IsRequiredToJoin | ModTags.CanJoinVanilla)]
[assembly: MelonInfo(typeof(AirframeTestMod.Main), AirframeTestMod.BuildInfo.Name, AirframeTestMod.BuildInfo.Verison, AirframeTestMod.BuildInfo.Author)]

You can also specify your preferred version checking schema

[assembly: AirframeModTags(typeof(AirframeTestMod.Main), ModTags.IsRequiredToJoin | ModTags.CanJoinVanilla, VersionPreference.Same)]

The manual method

This might be preferable if for whatever reason you wanted to make AirframeAPI an optional dependency, because your mod will fail to load if AirframeAPI isn't installed using the attribute method.

That will look something like this

public void RegisterToAirframeAPI()
{
  AirframeAPI.Registration.RegistrationAPI.Register(this, ModTags.IsRequiredToJoin | ModTags.CanJoinVanilla);
  /// you can also specify version preference like with attributes
}

public override void OnInitializeMelon()
{
  if (MelonMod.RegisteredMelons.Any(melon => melon.Info.Name is "AirframeAPI"))
    RegisterToAirframeAPI();
}

Available ModTags

You can find a list of all available ModTags here.

The fail-safe

The fail-safe entirely separates a modded game from vanilla players. This is achieved by connecting to a different photon lobby, which entirely seperates the gamelist between modded and vanilla clients.

There are a couple things that might trigger the fail safe, but the most common are Unregistered Mods/Melons, will trigger the fail safe because AirframeAPI has no way of knowing if a given mod will cause desyncs for vanilla clients.

Special Thanks

  • @fl.oof (on discord), for making the Icon.
  • The modding discord, for occasional feedback
AirframeAPI is in no way endorsed by or affiliated with Akupara Games and or VIDEOCULT