Documentation

Cloud Code

What's new in Cloud Code 3.1

Cloud Code 3.1 lets your game receive the messages that a module sends to a scope, and lets modules publish custom events to Triggers.
Read time 2 minutesLast updated a day ago

Discover new features and performance improvements in the latest update to Cloud Code.
For a full list of changes and updates in this version, refer to the Cloud Code changelog.

Receive scope messages in your game

Your game can now receive the messages that a module sends to a scope with
SendScopeMessageAsync
. To subscribe, your game calls
SubscribeToScopeMessagesAsync
with the scope and the names of the module and the token function. Only players who can call the token function can subscribe, so the access rules of the token function control who receives the messages.
For more information, refer to Subscribe to scope messages.

Publish custom events to Triggers

A C# module function can publish custom events to the Triggers service with the
ITriggersEventClient
interface. A trigger on the event can then run a Cloud Code script, a module function, or a webhook, so the publishing function can move follow-up work to a separate call. From version 3.1.1 of the Cloud Code package, the local Cloud Code server checks and logs these events.
For more information, refer to Publish events to Triggers.

Keep local Cloud Code server logs and data in each project

The local Cloud Code server keeps log files in the
Logs/CloudCodeLocalServer
folder of each project, and deployed modules and local state in the
Library/CloudCodeLocalServer
folder. Each project has a separate set of deployed modules and local state, even when two projects are open at the same time. To open these folders, select the Cloud Code toolbar button, then select Show Logs Folder or Show Modules Folder.
For more information, refer to Find the local server's logs and data.