mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 15:24:48 +01:00
feat(lua): expose hash fn
This commit is contained in:
parent
c58d1db58b
commit
8806941a13
1 changed files with 7 additions and 0 deletions
|
@ -269,6 +269,10 @@ fn get_logger(_: &Lua, (): ()) -> LuaResult<LuaLogger> {
|
|||
Ok(LuaLogger(sub))
|
||||
}
|
||||
|
||||
fn hash(_: &Lua, (txt,): (String,)) -> LuaResult<i64> {
|
||||
Ok(crate::hash(txt))
|
||||
}
|
||||
|
||||
// define module and exports
|
||||
#[mlua::lua_module]
|
||||
fn codemp_lua(lua: &Lua) -> LuaResult<LuaTable> {
|
||||
|
@ -279,6 +283,9 @@ fn codemp_lua(lua: &Lua) -> LuaResult<LuaTable> {
|
|||
exports.set("get_client", lua.create_function(get_client)?)?;
|
||||
exports.set("close_client", lua.create_function(close_client)?)?;
|
||||
|
||||
// utils
|
||||
exports.set("hash", lua.create_function(hash)?)?;
|
||||
|
||||
// runtime
|
||||
exports.set("runtime_drive_forever", lua.create_function(runtime_drive_forever)?)?;
|
||||
|
||||
|
|
Loading…
Reference in a new issue