Crate rrplug

Source
Expand description

§rrplug

framework for working with R2Northstar’s plugin system.

this crate provides convenient abstractions with compile time checks while not limiting unsafe access to any parts of plugin sys or the titanfall 2 engine.

§rrplug template

plugins v4 removed some dependencies on external files so now templates are redundant but a template still exists

§cross compiling plugins

To compile a plugin from a host machine that’s not using windows, you need to install the required target.

rustup target add x86_64-pc-windows-gnu

Then create a cargo config to always compile your project for windows.

mkdir .cargo
echo "[build]\ntarget = \"x86_64-pc-windows-gnu\"" > .cargo/config.toml

Modules§

bindings
errors
Errors produced by rrplug that can be retured to the user
high
abstractions :)
interfaces
Contains logic for creating and managing interfaces
low
lowest access is at crate::bindings
macros
various macros provided/used by rrplug
mid
contains structs and functions with minimal abstraction
plugin
the plugin trait module
prelude
prelude for rrplug

Macros§

call_sq_function
calls any function defined on the sqvm
call_sq_object_function
calls any function defined on the sqvm from its SQObject
create_external_interface
creates a type definition for the external trait
entry
marco used to generate the entry for your plugin
impl_sqvm_name
macro to implement SQVMName
impl_vmethod
internal rrplug macro
impl_vmethods
internal rrplug macro
offset_functions
utility macro to get functions and globals from dlls with offsets
offset_struct
internal rrplug macro
sq_raise_errorDeprecated
sq_raise_error
sq_return_boolDeprecated
sq_return_bool
sq_return_floatDeprecated
sq_return_float
sq_return_intDeprecated
sq_return_int
sq_return_notnullDeprecated
sq_return_notnull
sq_return_nullDeprecated
sq_return_null
sq_return_stringDeprecated
sq_return_string
sq_return_vectorDeprecated
sq_return_vector
to_c_stringDeprecated
transforms a String into a null terminated string
to_sq_stringDeprecated
use crate::to_c_string

Attribute Macros§

as_interface
creates a valid source interface layout from the provided impl block
completion
macro that transforms a function into a that can be used for completion by the engine while also adding a few abstraction layers
concommand
proc marco for generating compatible concommand callbacks
convar
proc marco for generating compatible convar callbacks
sqfunction
proc marco for generating compatible functions with the sqvm.