Skip to main content

Module server

Module server 

Source
Expand description

Vtables for objects managed by the Open Multiplayer server.

The vtable indices and signatures were derived from the public specification of the Open Multiplayer SDK (https://github.com/openmultiplayer/open.mp-sdk). No SDK code was copied.

Unlike component.rs (where WE implement the vtable), here we define vtables for objects created by the SERVER so we can call methods on them from Rust.

§Indices per ABI

Itanium ABI — two destructor slots (D1 + D0) interleaved after the virtuals of each base class, in declaration order.

MSVC ABI — a single destructor (scalar deleting) at the end of the virtuals of the class that declared it (e.g. ~IExtensible at slot [4], after removeExtension).

The practical difference is that on MSVC the vtable is 1 slot smaller per destructor (no separate D0 slot), which shifts all subsequent methods.

Structs§

IEventDispatcherPawn
Opaque handle for the server’s IEventDispatcher<PawnEventHandler>*.
IPawnScript
Opaque handle for the server’s IPawnScript*.
PawnComponent
Typed wrapper for the Open Multiplayer server’s IPawnComponent.
ServerComponent
Opaque handle for the IComponent* returned by queryComponent.
ServerComponentList
Opaque handle for the server’s IComponentList*.
ServerPawnComponent
Opaque handle for the server’s IPawnComponent*.

Constants§

NUM_AMX_FUNCS
Number of AMX functions exported by IPawnComponent (NUM_AMX_FUNCS in the SDK).
PAWN_COMPONENT_UID
UID of the Open Multiplayer Pawn component (PawnComponent_UID in the SDK).

Functions§

add_pawn_event_handler
Registers a Pawn event handler in the dispatcher.
get_amx_from_script
Extracts the AMX* pointer from an IPawnScript*.
get_amx_functions
Gets the pointer to the AMX function table from the IPawnComponent.
get_pawn_event_dispatcher
Gets the Pawn event dispatcher from the IPawnComponent.
query_component
Queries a component by UID in the list provided by the server.
remove_pawn_event_handler
Removes a Pawn event handler from the dispatcher.

Type Aliases§

AmxFunctionTable
Table of 52 AMX function pointers (StaticArray<void*, NUM_AMX_FUNCS>).