#glua #garrysmod #lua #gmod

rglua

Toolkit for garrysmod development with the source sdk and luajit api

10 releases (3 stable)

Uses new Rust 2021

2.0.1 Jan 12, 2022
2.0.0-beta Dec 31, 2021
1.0.0 Dec 21, 2021
0.9.0 Dec 20, 2021
0.5.0 Nov 26, 2021

#66 in FFI

Download history 22/week @ 2021-11-23 11/week @ 2021-11-30 74/week @ 2021-12-07 34/week @ 2021-12-14 28/week @ 2021-12-21 27/week @ 2021-12-28 31/week @ 2022-01-04 26/week @ 2022-01-11

136 downloads per month

MIT and maybe GPL-3.0

93KB
1K SLoC

🌑 rglua cratesio Build Status License github/Vurv78

This is a crate that allows interop with the (g)luajit c api as well as the source sdk through libloading and vtable bindings. You can then use these for binary modules or manually injected code, like with Autorun-rs

More information on binary modules can be found on the garrysmod wiki: Creating Binary Modules and examples can be found here.

Usage

If you are targeting 32 bit make sure to install the toolchain and build to it:

rustup target add i686-pc-windows-msvc
cargo build --target=i686-pc-windows-msvc

Comparison

There are actually a decent amount of libraries out there for gmod development. Here's a comparison and why you could use this one.

Library rglua rust-glua-sys gmod-rs gmrs
Full Lua C Api Bindings ✔️
On Crates.io ✔️ ✔️
Proc Macros ✔️ ✔️ ✔️
Interfacing w/ Source SDK ✔️
Returning Result<> from functions ✔️ ✔️
Can be used on stable ✔️ ✔️ ✔️
Real world examples ✔️ 〰️ ✔️
Linux / OSX Support ✔️ ✔️ ✔️
Github Stars 😢 👍 👑 🤷‍♂️

You can help with that last one 😉

Acknowledgements

garrysmod_common

This is heavily based off of garrysmod_common, in how we export the lua_shared functions and trying to replicate everything from the Lua C Api.

Dependencies

~0.4–0.9MB
~20K SLoC

S]a