Skip to main content

Module component_api

Module component_api 

Source
Expand description

High-level API for Open Multiplayer server components.

The raw pointer returned by server::query_component is opaque — it only lets you check presence, with no way to interact with the component’s vtable. This module defines the OmpComponentHandle trait that specific types (PawnComponent, TimersComponent, etc.) implement to provide:

  • The component’s known UID (associated constant)
  • Safe construction from the raw pointer
  • Access to shared methods (componentName, componentVersion) via the generic utility functions in this module

Plugins implementing their own external component declare the trait with the UID generated by the SDK.

Traits§

OmpComponentHandle
Trait implemented by typed wrappers for Open Multiplayer components.

Functions§

component_name
Reads the component name by calling componentName() (slot [6] of the IComponent vtable).
component_version
Reads the component version by calling componentVersion() (slot [8] of the IComponent vtable).