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

Extend tree synchonization to lists and classes #454

Open aschaeffer opened 7 years ago

aschaeffer commented 7 years ago

Currently SharedVars are synchronized via the Inexor Tree. Next step is to synchronize lists/arrays and complex data structures like c++ objects. This would enables us to complete other tasks like the HUD which depends on these information.

Tree path format

Tasks Inexor Flex

Tasks Inexor Core

GRPC / Proto

Inexor Tree Structure for Shared Lists

Line numbers for pastebin: http://pastebin.com/QrDcTHa6

Newer version of the proto file:

List Entry Add Event

In order to create new list elements in NodeJS:

  1. Generate a new message
    • Get the message type from the list-Node (/players)
      • list_inexor_rendering_player_added
  2. Determine the array index in the message
    • Get the array index from the list_entry-Node (node_name = 0)
    • Mapping: intern_shared_list_id_number
  3. For each sub node of a list element check if a mapping exists and set the message value for the corresponding member variable
    • e.g. /players/0/kills
      • message_mapping == sharedclass_member__rendering_kills
  4. Send message

List Entry Modify Event

In order to change list elements in NodeJS:

  1. Generate a new message
    • Get the message type from the list-Node (/players)
      • list_inexor_rendering_player_modified
  2. Determine the array index in the message
    • Get the array index from the list_entry-Node (node_name = 0)
    • Mapping: intern_shared_list_id_number
  3. For each sub node of a list element check if a mapping exists and set the message value for the corresponding member variable
    • e.g. /players/0/kills
      • message_mapping == sharedclass_member__rendering_kills
    • Optimization: synchronize changed member variables only
  4. Send message

List Entry Remove Event

In order to remove list elements in NodeJS:

  1. Generate a new message
    • Get the message type from the list-Node (/players)
      • list_inexor_rendering_player_removed
  2. Determine the array index in the message
    • Get the array index from the list_entry-Node (node_name = 0)
    • Mapping: intern_shared_list_id_number
  3. Send message