sm.message
Functions:
sm.message.send(messageKey, data?)
Server only
Sends a message to all script instances registered for the given key. Can only be called from server!
Parameters:
| Type | Name | Description |
|---|---|---|
| string | messageKey | The message key. |
| any | data? | Optional data to send with the message. |
sm.message.subscribe(messageKey, callbackName)
Server only
Subscribes the calling script instance to receive messages for a given key. Can only be called from server!
Parameters:
| Type | Name | Description |
|---|---|---|
| string | messageKey | The message key to subscribe to. |
| string | callbackName | The name of the callback function to invoke. |