Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 3c5310d

Browse files
authored
Update README.md
1 parent 4e5898c commit 3c5310d

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# rglua [![Release Shield](https://img.shields.io/github/v/release/Vurv78/rglua)](https://github.com/Vurv78/rglua/releases/latest) ![Linux Build Status](https://www.travis-ci.com/Vurv78/rglua.svg?branch=main) [![License](https://img.shields.io/github/license/Vurv78/rglua?color=red)](https://opensource.org/licenses/Apache-2.0) [![github/Vurv78](https://discordapp.com/api/guilds/824727565948157963/widget.png)](https://discord.gg/epJFC6cNsw)
22

3-
4-
This is a Rust library that contains bindings for tinkering with the lua c api in garrysmod through bindings using rust-dlopen.
3+
This is a crate that contains bindings for using the lua c api in garrysmod through bindings using rust-dlopen.
54
Can be used for either binary modules or just manual injections into gmod, like with [Autorun-rs](https://github.com/Vurv78/Autorun-rs)
65

7-
More information on binary modules: https://wiki.facepunch.com/gmod/Creating_Binary_Modules
6+
This works by finding a ``lua_shared.dll`` file relative to the currently running program, so you need to make sure your file is either in ``GarrysMod/bin/`` or ``GarrysMod/garrysmod/bin`` for srcds servers. The library will panic if the file is not found otherwise until it is eventually needed.
87

9-
An example module can be found below.
8+
More information on binary modules can be found on the garrysmod wiki: [Creating Binary Modules](https://wiki.facepunch.com/gmod/Creating_Binary_Modules) and an example can be found at the bottom of this file.
109

11-
## How to build
10+
## Usage
1211

13-
Add this to your Cargo.toml.
12+
Add this to your ``Cargo.toml`` file
1413
```toml
1514
[lib]
1615
crate-type = ["cdylib"] # This tells rust we want to create a .dll file that links to C code.
@@ -19,17 +18,18 @@ crate-type = ["cdylib"] # This tells rust we want to create a .dll file that lin
1918
rglua = { git = "https://github.com/Vurv78/rglua", branch = "main" }
2019
```
2120

21+
## Building
2222
Make sure you build to 32 bit if you want to use the module with srcds / on a local server.
2323
``cargo build --release --target=i686-pc-windows-msvc``
2424

2525
Also do this if you have never compiled to 32 bit, to get rustup to install 32 bit versions of everything you need
2626
``rustup target add i686-pc-windows-msvc``
2727

2828
## Notes
29-
The nature of this crate is super unsafe.
30-
Using rust sort of defeats the purpose because of the sheer amount of times you'll have to convert strings from and to C, and call lua c api functions.
29+
* I have never tested this outside of Windows and won't.
30+
If there are any issues on other platforms, I will gladly accept any PRs you may make but I won't be able to help you myself.
3131

32-
Also, I have never tested this outside of Windows and won't. If there are any issues on other platforms, I will gladly accept any PRs you may make but I won't be able to help you myself.
32+
* The nature of this crate is super unsafe and sort of defeats the purpose of rust's safety because of the interfacing you require to unsafe C code and the nature of linking to them.
3333

3434
## Example Module
3535
```rust

0 commit comments

Comments
 (0)