-
Notifications
You must be signed in to change notification settings - Fork 20
shared.client
This library facilitates sharing data between packages. Usually this refers to services and their respective libraries but can be just as well be used to communicate between different addons. The server module is used to create and host the data.
local client = require('shared.client')
❗ Dependency Required
To use this library, you must include
shared
in themanifest.xml
file for your package:<dependency>shared</dependency>
The client
table has the following entries:
- client.new Returns a shared structure
- client.configure Configures the ftype to be fully usable
Returns a new structure previously created in another addon or service.
function client.new(package_name : string, data_name : string) : struct
package_name string
The name of the package where the shared object was created in.
data_name string
The name of the associated shared object. Can be (and is usually) omitted if the sharing package only uses one shared object. Needs to match the
data_name
specified in the server library.
struct struct
Sets up a deserialized ftype. Adds metatables to structs and arrays and creates the necessary typedefs. This is a very rarely used function and is not required when using client.new.
It is never needed when defining a struct directly, only when it is serialized and deserialized, since that process loses some information.
function client.configure(ftype : ftype)
ftype ftype
The type description of the structure, defined via the struct library. In this case it is usually transmitted from the server to client vie the shared library or through events.
This function does not return any values.
- Background and Architecture
- Windower Data Locations
- Code Standards and Guidelines
- Addon Development
- Windower Commands
- Packet Tutorial
- burdometer
- config
- delay_me_not
- distance
- dress_up
- enternity
- fps
- ime
- logger
- party_time
- paste
- pouches
- send
- shortcuts
- speedometer
- target_info
- terminate
- timestamp
- window_title
- Game
- Windower
- General