mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +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
|
|
@ -180,14 +180,34 @@ app.get_content_sources() -> table<string>
|
|||
|
||||
Returns a list of content sources (paths), in descending priority order.
|
||||
|
||||
``lua
|
||||
```lua
|
||||
app.set_content_sources(sources: table<string>)
|
||||
```
|
||||
|
||||
Sets a list of content sources (paths). Specified in descending priority order.
|
||||
|
||||
``lua
|
||||
```lua
|
||||
app.reset_content_sources()
|
||||
```
|
||||
|
||||
Resets content sources.
|
||||
|
||||
## Sub-instances
|
||||
|
||||
```lua
|
||||
-- Creates a headless engine instance with the current project and the specified application script.
|
||||
-- Returns the instance ID. The number of active sub-instances is currently limited to one.
|
||||
app.start_background_instance(
|
||||
-- script file
|
||||
app_script: string,
|
||||
-- log file
|
||||
output_file: string | nil
|
||||
) -> int
|
||||
|
||||
-- Checks if the engine sub-instance is alive.
|
||||
app.is_instance_alive(handle: int) -> boolean
|
||||
|
||||
-- Stops the engine sub-instance.
|
||||
-- Returns true if the instance was alive at the time of the call.
|
||||
app.terminate(handle: int) -> boolean
|
||||
```
|
||||
|
|
|
|||
|
|
@ -142,4 +142,24 @@ app.set_content_sources(sources: table<string>)
|
|||
|
||||
-- Сбрасывает список источников контента.
|
||||
app.reset_content_sources()
|
||||
```
|
||||
```
|
||||
|
||||
## Под-экземпляры
|
||||
|
||||
```lua
|
||||
-- Создаёт headless-экземпляр движка с текущим проектом и указанным сценарием.
|
||||
-- Возвращает id экземпляра. Число живых под-экземпляров, на данный момент, ограничено одним.
|
||||
app.start_background_instance(
|
||||
-- файл сценария
|
||||
app_script: string,
|
||||
-- файл лога
|
||||
output_file: string | nil
|
||||
) -> int
|
||||
|
||||
-- Проверяет, жив ли под-экземпляр движка.
|
||||
app.is_instance_alive(handle: int) -> boolean
|
||||
|
||||
-- Останавливает под-экземпляр движка.
|
||||
-- Возвращает true если экземпляр был жив в момент вызова.
|
||||
app.terminate_instance(handle: int) -> boolean
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue