-
Notifications
You must be signed in to change notification settings - Fork 20
shared.server
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 shared.client module is used to read the data.
local server = require('shared.server')
❗ Dependency Required
To use this library, you must include
shared
in themanifest.xml
file for your package:<dependency>shared</dependency>
The server
table has the following entries:
- server.new Creates a new shared structure
- server.new_ptr Creates a new pointer for use in shared space
Creates a new structure based on the provided ftype. It is created in fixed memory and can be accessed by other instances.
function server.new(name : string = 'data', ftype : ftype) : struct
name string
The name of the associated shared object. Can be (and is usually) omitted if the sharing package only uses one shared object.
ftype ftype
The type description of the structure, defined via the struct library.
struct struct
Creates a new structure based on the provided ftype. It is created in fixed memory and can be accessed by other instances. Returns a pointer to the struct for potential manual sharing. This is a very rarely used function and is not required when using server.new.
function server.new_ptr(ftype : ftype) : cdata<ptr>
ftype ftype
The type description of the structure, defined via the struct library.
ptr cdata
A pointer to the struct created based on the provided ftype.
- 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