Pass listening port to lua when calling oct_init
This commit is contained in:
parent
59932d224f
commit
7cf075d1a6
3
main.c
3
main.c
|
@ -214,7 +214,8 @@ int initialize_everything(char* lua_file) {
|
||||||
OCT_LOG_INFO("Begin running oct_init()");
|
OCT_LOG_INFO("Begin running oct_init()");
|
||||||
lua_getglobal(L, "oct_init");
|
lua_getglobal(L, "oct_init");
|
||||||
lua_pushstring(L, lua_args);
|
lua_pushstring(L, lua_args);
|
||||||
if (lua_pcall(L, 1, 2, 0) != LUA_OK) {
|
lua_pushinteger(L, atoi(config.port));
|
||||||
|
if (lua_pcall(L, 2, 2, 0) != LUA_OK) {
|
||||||
OCT_LOG_ERROR("%s", luaL_checkstring(L, -1));
|
OCT_LOG_ERROR("%s", luaL_checkstring(L, -1));
|
||||||
deinitialize_everything();
|
deinitialize_everything();
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
require("oct_utils")
|
require("oct_utils")
|
||||||
require("termbox_defs")
|
require("termbox_defs")
|
||||||
|
|
||||||
function oct_init(args)
|
function oct_init(args, port)
|
||||||
OCT_LOG_ERROR("Starting oct_init")
|
OCT_LOG_ERROR("Starting oct_init")
|
||||||
|
OCT_LOG_ERROR("Port: " .. port)
|
||||||
OCT_LOG_ERROR("Received args: " .. args)
|
OCT_LOG_ERROR("Received args: " .. args)
|
||||||
return OCT_NOT_NEEDS_NETWORKING, OCT_NOT_NEEDS_TERMBOX
|
return OCT_NOT_NEEDS_NETWORKING, OCT_NOT_NEEDS_TERMBOX
|
||||||
end
|
end
|
Loading…
Reference in New Issue