A library for simplifying working with foundries sockets. This module does not have any user facing features. You only need to install it if one of the modules you use lists it as a dependency.
This library makes it easy to execute functions in the clients of other connected users. Parameters can be passed to the remote functions as easy as they can be passed to regular functions and it's possible to retrieve the return value of the remote function via await
. The features of socketlib are:
- Execute a function as GM: socketlib allows you to execute a function as a gm user. If a GM client is connected, that client will execute that function. The original client can wait for the GM to finish the execution of the function and retrieve the return value of the function via
await
. If multiple GMs are connected, socketlib will make sure only one of the GMs will execute the function. - Execute a function as another user: socketlib allows you to execute a function in the client of another user. The original client can wait for the other user to finish execution of the function and retrieve the return value the function via
await
. - Execute a function for all users: socketlib will execute a function in the clients of all other connected users.
- Execute a function for all GMs: socketlib will execute a function in the clients of all connected GMs.
- Execute a function for a specified list of players: socketlib will execute a function in the clients of several players that can be identified by their id.
Documentation of the modules capabilities and example code is avaliable here.