Merge pull request #899 from MihailRis/app-new-instance

engine sub-instance spawn function
This commit is contained in:
MihailRis 2026-08-02 19:07:49 +03:00 • committed by GitHub
commit 40f8fc620d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 386 additions and 52 deletions

View file

@ -3,5 +3,6 @@ name = "default"
base_packs = ["base"]
permissions = [
"network",
"record-audio"
"record-audio",
"sub-instances",
]

View file

@ -140,7 +140,20 @@ local __vc_named_coroutines = {}
local __vc_next_coroutine = 1
function __vc_start_coroutine(chunk)
local co = coroutine.create(chunk)
local co = coroutine.create(function()
local _, err = xpcall(chunk, function(msg)
local traceback = debug.get_traceback(0)
local s = string.format("%s:", msg)
for i=1,#traceback - 2 do
local frame = traceback[i]
s = s .. "\n\t"..tb_frame_tostring(frame)
end
return s
end)
if err then
error(err)
end
end)
local id = __vc_next_coroutine
__vc_next_coroutine = __vc_next_coroutine + 1
__vc_coroutines[id] = co

View file

@ -10,8 +10,9 @@ vc = {
is_client = function()
return not _vc_headless
end,
get_version = __vc_app.get_version,
get_setting = __vc_app.get_setting,
get_setting_str = __vc_app.get_setting_str,
str_setting = __vc_app.str_setting,
get_setting_info = __vc_app.get_setting_info,
}