mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 10:31:50 +00:00
Merge pull request #899 from MihailRis/app-new-instance
engine sub-instance spawn function
This commit is contained in:
commit
40f8fc620d
18 changed files with 386 additions and 52 deletions
|
|
@ -3,5 +3,6 @@ name = "default"
|
|||
base_packs = ["base"]
|
||||
permissions = [
|
||||
"network",
|
||||
"record-audio"
|
||||
"record-audio",
|
||||
"sub-instances",
|
||||
]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue