Static helper method in Superuser that constructs an IAdminModule for native engine settings and commands. It finds an authoritative runtime and returns a new Engine.NativeSettings.NativeBindingsModule with the provided setting and command descriptors, throwing if no eligible runtime is found.
namespace SboxSuperuser;
public static partial class Superuser
{
/// <summary>Creates the optional settings module for RegisterModulesAsync; call once per authoritative runtime from trusted game setup.</summary>
public static IAdminModule CreateNativeBindingsModule( IEnumerable<NativeSettingDescriptor> settings,
IEnumerable<NativeCommandBindingDescriptor> commands = null )
{
var runtime = FindAuthorityRuntime() ?? throw new InvalidOperationException( "An eligible authoritative runtime is required." );
return new Engine.NativeSettings.NativeBindingsModule( runtime, settings, commands );
}
}