inexorgame-obsolete / deprecated-cube-engine-inexor

UNMAINTAINED: Please have a look at the vulkan-renderer
https://inexor.org
zlib License
11 stars 1 forks source link

Inexor Lifecycle (Initialising Inexor Tree, RPC and parsing command line options) #354

Closed aschaeffer closed 7 years ago

aschaeffer commented 7 years ago

Lifecycle

Inexor Flex (NodeJS) starts a new instance of Inexor Core (C++). Command line options parsing and reading configuration files is done in Inexor Flex only. Inexor Core have to use the Inexor Tree instead. This prepares Inexor for multi-instance capabilities.

Startup of Inexor Flex

  1. The user starts Inexor Flex
  2. Inexor Flex checks if there is a running instance of Inexor Flex already
  3. Inexor Flex initializes the Inexor Tree with default values from the proto file
  4. Inexor Flex automatically detects media paths (currently done by batch files) and stores the paths into the Inexor Tree
  5. Inexor Flex loads TOML configuration file describing the list of instances and populates the Inexor Tree
    • This may start instances of Inexor Core (autostart = true)

Startup of Inexor Core

  1. Inexor Flex starts an instance of Inexor Core (see #362)
    • Pass the port / instance id as command line argument to Inexor Core
  2. First, Inexor Core initializes the RPC subsystem
    • Using the port / instance id
  3. Inexor Flex waits until the port available
  4. When the port is available, Inexor Flex connects to the RPC subsystem of Inexor Core
  5. Now the Inexor Tree will be synchronized
  6. After this Inexor Core is fully configured and can use the Inexor Tree for further initialization like opening the SDL window

Shutdown of Inexor Core

  1. Inexor Core synchronizes the Inexor Tree for the last time
  2. Inexor Core terminates the RPC connection(s)
  3. Inexor Core exits
  4. When the RPC connection has been terminated Inexor Flex saves the relevant information of the Inexor Tree into a TOML file and removes the Inexor Tree of the terminated instance of Inexor Core

Tasks

a-teammate commented 7 years ago

Category: Awesome.

a-teammate commented 7 years ago

The only command line argument for InexorCore would be the port to InexorFlex (since otherwise Core would be blocked from starting up if the port is somehow already taken by another process).

aschaeffer commented 7 years ago

Correct. And I would suggest that the instance ID and the port should be the same.

Fohlen commented 7 years ago

Shouldn't the node folder be removed from master as well? Adding that as a task.

aschaeffer commented 7 years ago

Already done? fa37ee2090104ab531e71627f17462771989a573

aschaeffer commented 7 years ago

Everything is done in flex/master, except the Core Initialization Routine (#368).

a-teammate commented 7 years ago

can be closed as core gets merged

EDIT: (we shouldnt close "almost finished" issues)