module

socketlib

Endorsements
4
Installs
60.86%
Comments
2
Latest version1.0.12
Minimum Core0.7.9
Compatible Core9
File size0 B
Last updated2 months ago
Created1 year ago
Authors
Languages
Systems All systems
Project source Project URL
Report bugs Bug tracker URL
Read-me Readme URL
Changelog Changelog URL

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.

 

Subscribe
Notify of
2 Comments
Inline Feedbacks
View all comments
Calego (Elf Friend)
9 months ago

Having this resource to make working with sockets easier has been a big boon to module development. It’s also been a great resource for looking into how best to work with sockets in the Foundry ecosystem, even in situations where the dependency isn’t desired.

ghost
9 months ago

While not necessary for regular users in and of itself, this provides a very easy way for other developers to utilize sockets for messaging in their modules. Need to broadcast a message to all clients, implement a GM proxy, or send a message to a specific client? This module has got you covered.

2
0
Would love your thoughts, please comment.x
()
x