p2p/src/lua.rs
Lucas Schwiderski eb67616eb6
All checks were successful
build Build for the target platform
lint/clippy Check for common mistakes and opportunities for code improvement
Rework plugin structure
Also implements logging through the common `log` macros.
2025-05-08 01:44:35 +02:00

16 lines
371 B
Rust

use crate::stingray_sdk::lua_State;
use crate::{LUA, global};
pub extern "C" fn do_something(l: *mut lua_State) -> i32 {
let lua = global!(LUA);
if let Some(name) = lua.tolstring(l, 1) {
lua.pushstring(
l,
format!("[do_something] Hello from Rust, {}", name.to_string_lossy()),
);
1
} else {
0
}
}