Roblox UtilitiesDevlHub Roblox Documentation

Class

PluginConnectionService

NotCreatableServiceNotReplicated
Inherits
Instance › Object
Memory category
Instances

This service is used by plugins to communicate with other instances of themselves running in other data models.

This service is used by plugins to communicate with other instances of themselves running in other data models (e.g. a plugin in the Studio edit data model can communicate with the instance of that same plugin in the Studio playtest Server data model). Plugins can retrieve PluginConnection objects from this service, which provide an API for sending messages across the data model boundary. All access to this class is restricted to Plugin security. The command bar is not currently supported.

Methods 2#

CanHaveConnectionTypeChecks if the current data model context can ever have connections of a given type.PluginSecurity security
GetPluginConnectionsOfTypeReturns a list of currently connected PluginConnection objects with the given connection type.PluginSecurity security

CanHaveConnectionType(type: PluginConnectionTargetType): boolean#

PluginSecurity security

Checks if the current data model can potentially have connections of a given PluginConnectionTargetType. Note that it is possible for this function to return true even if no such connections currently exist.

NameTypeDefaultDescription
typePluginConnectionTargetTypeThe connection type to check.
Returns
  • boolean — Whether the current data model can potentially have connections of the given type.

GetPluginConnectionsOfType(type: PluginConnectionTargetType): List<PluginConnection>#

PluginSecurity security

Returns a list of currently connected PluginConnection objects with the given connection type. Each PluginConnection from this list will initially have their Connected property set to true and correspond to a connected data model related to the current data model according to their PluginConnectionTargetType. For example, an edit data model may have PluginConnectionTargetType.Test connections to communicate with its ongoing playtest data models, and each test data model will have an PluginConnectionTargetType.Edit connection back to its edit data model.

NameTypeDefaultDescription
typePluginConnectionTargetTypeThe connection type to check.
Returns
  • List<PluginConnection> — An array of the currently connected PluginConnection objects with that target type.

Events 1#

ConnectedFires just after a new PluginConnection successfully connects.PluginSecurity security

Connected(conn: PluginConnection)#

PluginSecurity security

Fires just after a new PluginConnection successfully connects. Plugins may listen for this signal to learn when a new data model that they can communicate with becomes available.

Note: On startup, it is possible some PluginConnections already exist. Plugins should query PluginConnectionService:GetPluginConnectionsOfType() for each type they are interested in after connecting to this function.

NameTypeDefaultDescription
connPluginConnectionThe newly connected PluginConnection.

Inherited members#

Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed