Class
PluginConnectionService
NotCreatableServiceNotReplicated
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#
| CanHaveConnectionType | Checks if the current data model context can ever have connections of a given type.PluginSecurity security |
| GetPluginConnectionsOfType | Returns 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.
| Name | Type | Default | Description |
|---|---|---|---|
type | PluginConnectionTargetType | The 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.
| Name | Type | Default | Description |
|---|---|---|---|
type | PluginConnectionTargetType | The connection type to check. |
Returns
List<PluginConnection>— An array of the currently connectedPluginConnectionobjects with that target type.
Events 1#
| Connected | Fires 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.
| Name | Type | Default | Description |
|---|---|---|---|
conn | PluginConnection | The newly connected PluginConnection. |
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild