mirror of
https://github.com/hexedtech/codemp.git
synced 2024-11-22 15:24:48 +01:00
fix: lib name is codemp_lua, override addr via env
use CODEMP_SERVER_ADDRESS
This commit is contained in:
parent
05a4c88967
commit
cd9a2d6247
1 changed files with 3 additions and 2 deletions
|
@ -19,8 +19,9 @@ struct GlobalState {
|
||||||
impl Default for GlobalState {
|
impl Default for GlobalState {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let rt = Runtime::new().expect("could not create tokio runtime");
|
let rt = Runtime::new().expect("could not create tokio runtime");
|
||||||
|
let addr = std::env::var("CODEMP_SERVER_ADDRESS").unwrap_or_else(|_|"http://codemp.alemi.dev:50053".to_string());
|
||||||
let client = rt.block_on(
|
let client = rt.block_on(
|
||||||
CodempClient::new("http://codemp.alemi.dev:50053")
|
CodempClient::new(&addr)
|
||||||
).expect("could not connect to codemp servers");
|
).expect("could not connect to codemp servers");
|
||||||
GlobalState { client: std::sync::RwLock::new(client), runtime: rt }
|
GlobalState { client: std::sync::RwLock::new(client), runtime: rt }
|
||||||
}
|
}
|
||||||
|
@ -248,7 +249,7 @@ fn setup_tracing(_: &Lua, (debug,): (Option<bool>,)) -> LuaResult<LuaLogger> {
|
||||||
|
|
||||||
// define module and exports
|
// define module and exports
|
||||||
#[mlua::lua_module]
|
#[mlua::lua_module]
|
||||||
fn libcodemp(lua: &Lua) -> LuaResult<LuaTable> {
|
fn codemp_lua(lua: &Lua) -> LuaResult<LuaTable> {
|
||||||
let exports = lua.create_table()?;
|
let exports = lua.create_table()?;
|
||||||
|
|
||||||
// core proto functions
|
// core proto functions
|
||||||
|
|
Loading…
Reference in a new issue