Since I got this running now, I wanted to share on how to do it. u need https://github.com/siffiejoe/lua-moon/blob/master/examples/sofix.c compiled as shared Object with -DMOON_DLFIX_LIBNAME=/path/to/silent/qagame.mp.i386.so example: gcc -DMOON_DLFIX_LIBNAME='"/home/gs/wolfet/silent/qagame.mp.i386.so"' -m32 -Wall -Wextra -I.. -fpic -shared -Os -o sofix.so sofix.c Luasocket (precompiled for 32bit): https://ptpb.pw/gyb_.zip Copas: https://github.com/keplerproject/copas/tree/master/src copy/extract luasocket, sofix.so and copas to: silent/lualibs/ after that create your luamodule. example:
require('sofix') -- needs to be required before any other C based module
local copas = require('copas')
local asynchttp = require('copas.http').request
-- random callback
-- makes http request at every player connect (probably not what u wanna do)
function et_ClientConnect(clientNum, firstTime, isBot)
copas.addthread(function()
local body, c, h = asynchttp('http://example.org/')
if c ~= 200 then
et.G_LogPrint(("HTTP Error: %d"):format(c))
return
end
-- use body and headers here. eg:
et.G_LogPrint(body)
end)
end
-- "Using gameloop as event loop"
function et_RunFrame(levelTime)
if levelTime % 500 ~= 0 then
return
end
copas.step()
end
I am currently using a structure like that and haven't experienced any lags till now.