Discovery and capabilities
Two independent checks protect a PAPER feature:
- Interface version: discovery serves the interface at the exact major and at least the minor your headers were built for, with a table at least as large as yours.
- Granted capability: this owner may call the function.
Discovery
Resolve PAPERAPI_QueryInterfaceV1 (kQueryExportName) from the loaded PAPER.dll and call it with an interface ID, exact major, minimum minor and minimum table size. It runs on any thread; the returned descriptor and table stay valid for the process lifetime.
| Result | Meaning |
|---|---|
Ok | Descriptor returned; its table is at least the size you asked for. |
UnknownInterface | This PAPER does not know the interface ID. |
UnsupportedMajor | This PAPER does not serve that major. A mod built for the pre-2.0 API gets this. |
UnsupportedMinor | The installed PAPER is older than your headers. |
TableTooSmall | The installed table is smaller than your headers expect. |
InvalidArgument | Null output pointer, or a zero major or table size. |
InternalError | Discovery failed inside PAPER. |
After any version refusal, or a call to a pre-2.0 export, PAPER logs the calling DLL once in PAPER.log and the game keeps running. Request exactly the versions your headers declare and never probe with trial queries. When PAPER.dll is not loaded or refuses your request, turn your PAPER features off and keep running.
paper::api::Client does this for you: connect queries Provider and registers the owner, acquire queries any further interface and checks that it accepts this Provider version (requiredProviderMajor / requiredProviderMinor). There are no per-family table extents or feature bits: a negotiated table is complete.
Capability map
Capabilities are requested once, at registration, as a ConsumerCapability mask.
| Capability | Bit | Purpose |
|---|---|---|
RuntimeState | 0 | Runtime and configuration snapshots; PhysicalReload read. |
CapturedTransforms | 1 | Native animation node capture. |
NativeHandPose | 2 | Hand-in-weapon and 15 finger-local transforms. |
AnimationAuthority | 3 | Animation ownership arbitration; PhysicalReload acquire. |
FrameCallbacks | 4 | Event callback registration. |
NativePosePipeline | 10 | Resolved pose diagnostics and PresentationComplete events. |
Bits 5 to 9 and 11 to 14 belonged to the removed observation, motion and development capture calls; they are retired, never granted and never reused. All covers the six bits above, but request only the ones you use.
Registration returns the actual granted mask (Client::grantedCapabilities). Treat missing required bits as a failed integration, close the partial owner, and report which feature is unavailable. A call without its capability returns PermissionDenied, or false/0 for the getters that do not return Status.