I’ve created headless game build with command below:
java -jar bob.jar clean resolve build --platform x86_64-macos --variant headless --settings game_server.settings
And run it with command:
./dmengine_headless
In game I have a script with method update below:
local sleepTime = 0.03 -- 30 ms
function update(self, dt)
local current_time = os.date("%Y-%m-%d %H:%M:%S")
log(current_time, "update", dt)
if sleepTime > 0 then
-- this limits CPU usage on VPS
--socket.select(nil, nil, tonumber(sleepTime))
os.execute("sleep " .. tonumber(sleepTime))
end
-- checkDataRecievedFromClientSocketAndSendResultBack(dt)
end
So, this update function running for some time and then just stops!
I’ve commented out heavy socket read/write method but it does not help;(
Can someone explain why?
I am using Defold version 1.9.1 because editor with version 1.9.2 just hanging on splash screen on Mac M1 Max;(
PS: Maybe instead of C# it’s better to add Java support?