Skip to main content

samp_sdk/omp/
mod.rs

1//! Native bindings for the Open Multiplayer SDK.
2//!
3//! Independent pure-Rust implementation of the binary ABI of the Open Multiplayer
4//! server: vtables, layout of `IComponent`/`ICore`/`ITimer`, calling
5//! conventions, and subobject offsets. No dependency on the original C++ libs
6//! (`robin_hood`, `glm`, `nonstd`) — only the types sufficient to implement a
7//! component's lifecycle.
8//!
9//! Offsets and slots were confirmed via disasm of `Console.dll` / `Console.so`
10//! and `omp-server.exe`, not by guessing from the C++ headers.
11//!
12//! Supports the two i686 ABIs used by the server:
13//! - **Itanium** (Linux GCC) — calling convention `extern "C"`
14//! - **MSVC** (Windows) — calling convention `extern "thiscall"` for virtual
15//!   methods, `extern "C"` (cdecl) for variadic
16
17pub mod component;
18pub mod component_api;
19pub mod core;
20pub mod events;
21pub mod server;
22pub mod timers;
23pub mod types;
24pub mod vtable;
25
26pub use component::{
27    IComponentList, IComponentVTable, ICore, IEarlyConfig, ILogger, IUIDProviderVTable,
28    OmpComponent,
29};
30pub use component_api::{OmpComponentHandle, component_name, component_version};
31pub use core::{LogLevel, core_log_ln, core_log_ln_u8, core_print_ln, core_print_ln_u8};
32pub use events::{PawnEventHandler, PawnEventHandlerVTable};
33pub use server::{
34    AmxFunctionTable, IEventDispatcherPawn, IPawnScript, PAWN_COMPONENT_UID, PawnComponent,
35    ServerComponentList, ServerPawnComponent, add_pawn_event_handler, get_amx_from_script,
36    get_amx_functions, get_pawn_event_dispatcher, query_component, remove_pawn_event_handler,
37};
38pub use timers::{
39    ITimer, ITimersComponent, TIMERS_COMPONENT_UID, TimerHandlerVTable, TimerTimeOutHandler,
40    TimersComponent, create_repeating_timer, kill_timer, query_timers_component,
41};
42pub use types::{
43    Colour, ComponentType, SemanticVersion, StringView, UID, Vector2, Vector3, Vector4,
44};