Hypercosm Protocol Docs

Interfaces

Interface Object

v1.0.0

The root interface, that all interfaces inherit from and all objects implement

Methods

list_interfaces() -> []string

Get all interfaces implemented by an object

The interfaces will be listed in the format {namespace}.{extension}.{interface_name}.{version}

release()

Remove the object from the object list

Future attempts to make calls on the object ID MUST fail.

The resources associated with the object may be released, but the object ID must not be reused, we have plenty of them

It is an error to remove the root singleton (id 0)

Interface Root

v0.1.0

Singleton with known id 0

This is the only object that is known at the start of connection and is used to discover other objects

Methods

list_extensions() -> []string

List the extensions implemented by the conected node

ping()

Check the conection status

get_object_by_id(id: uuid) -> object
get_object_by_name(name: string) -> object

Get the id of a singleton by the name of the interface

Extensions

Extension asset_delivery

v0.1.0

Delivers assets

Interfaces

Interface asset_delivery

Singleton for asset delivery

Events

load_assets(assets: []Asset)
unload_assets(assets: []uuid)

Methods

fetch_by_id(id: uuid) -> Asset
fetch_by_name(name: string) -> Asset
fetch_by_ids(ids: []uuid) -> []Asset
fetch_by_names(names: []string) -> []Asset
get_id(name: string) -> uuid

Types

Struct Asset

An asset: the type is given by TODO

  • id: uuid
  • name: string
  • data: bytes

Extension world

v0.1.0

Interfaces

Interface world

Events

add_entities(entities: []EntityInfo)
update_entities(entities: []EntityInfo)
remove_entities(entities: []Entity)

Interface Entity

Methods

interact()

Types

Struct EntityInfo

  • asset_id: uuid
  • entity: Entity
  • transformation: matrix4x4
  • attrs: EntityAttrs

Flags EntityAttrs

NameValue
None0b00
Interactable0b01
Collidable0b10

Extension execution_context

v0.1.0

Interfaces

Interface execution_context

Methods

load_wasm_module(asset_id: uuid, exports: [string]string) -> vu64
load_lua_script(asset_id: uuid) -> vu64
load_inline_lua_script(script: string) -> vu64
begin_execution(module_or_script: vu64, entry_point: string)
begin_inline_lua_execution(script: string)