Registry of interfaces between scripts. An interface is simply a dictionary mapping names to functions. A script or mod can then register an interface with LuaRemote, after that any script can call the registered functions, provided it knows the interface name and the desired function name. An instance of LuaRemote is available through the global object named remote.
stringunknownfalseThe class name of this object. Available even when valid is false. For LuaStruct objects it may also be suffixed with a dotted path to a member of the struct.
Dict<string, Dict<string, true>>unknownfalseList of all registered interfaces. For each interface name, remote.interfaces[name] is a dictionary mapping the interface's registered functions to true.
LuaRemote.add_interface(name: string, functions: Dict<string, function()>)
remote.add_interface(name, functions)
takes_table: falsetable_optional: falseAdd a remote interface.
name: string — Name of the interface. If the name matches any existing interface, an error is thrown.functions: Dict<string, function()> — List of functions that are members of the new interface.LuaRemote.remove_interface(name: string) -> boolean
remote.remove_interface(name)
takes_table: falsetable_optional: falseRemoves an interface with the given name.
name: string — Name of the interface.boolean — Whether the interface was removed. false if the interface didn't exist.LuaRemote.call(interface: string, function: string) -> Any?
remote.call(interface, function)
takes_table: falsetable_optional: falseCall a function of an interface.
Providing an unknown interface or function name will result in a script error.
interface: string — Interface to look up function in.function: string — Function name that belongs to the interface.Any?